Update screenshot and add screenshot of settings to README.md
This commit is contained in:
parent
08e2988776
commit
2eb289ead1
22
.qmake.stash
Normal file
22
.qmake.stash
Normal file
@ -0,0 +1,22 @@
|
||||
QMAKE_CXX.QT_COMPILER_STDCXX = 201703L
|
||||
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 14
|
||||
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 1
|
||||
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
|
||||
QMAKE_CXX.COMPILER_MACROS = \
|
||||
QT_COMPILER_STDCXX \
|
||||
QMAKE_GCC_MAJOR_VERSION \
|
||||
QMAKE_GCC_MINOR_VERSION \
|
||||
QMAKE_GCC_PATCH_VERSION
|
||||
QMAKE_CXX.INCDIRS = \
|
||||
/usr/include/c++/14 \
|
||||
/usr/include/c++/14/x86_64-mageia-linux \
|
||||
/usr/include/c++/14/backward \
|
||||
/usr/lib/gcc/x86_64-mageia-linux/14/include \
|
||||
/usr/local/include \
|
||||
/usr/include
|
||||
QMAKE_CXX.LIBDIRS = \
|
||||
/usr/lib/gcc/x86_64-mageia-linux/14 \
|
||||
/usr/lib64 \
|
||||
/lib64 \
|
||||
/usr/lib \
|
||||
/lib
|
486
Makefile.old
Normal file
486
Makefile.old
Normal file
@ -0,0 +1,486 @@
|
||||
#############################################################################
|
||||
# Makefile for building: ssdd
|
||||
# Generated by qmake (3.1) (Qt 6.7.1)
|
||||
# Project: ssdd-qt.pro
|
||||
# Template: app
|
||||
# Command: /usr/bin/qmake -o Makefile ssdd-qt.pro
|
||||
#############################################################################
|
||||
|
||||
MAKEFILE = Makefile
|
||||
|
||||
EQ = =
|
||||
|
||||
####### Compiler, tools and options
|
||||
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
DEFINES = -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
|
||||
CFLAGS = -pipe -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-strict-aliasing -DPIC -fPIC -Wall -Wextra -D_REENTRANT $(DEFINES)
|
||||
CXXFLAGS = -pipe -std=gnu++17 -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-strict-aliasing -DPIC -fPIC -Wall -Wextra -D_REENTRANT $(DEFINES)
|
||||
INCPATH = -I. -I/usr/include/qt6 -I/usr/include/qt6/QtWidgets -I/usr/include/qt6/QtGui -I/usr/include/qt6/QtCore -I. -I/usr/lib64/qt6/mkspecs/linux-g++
|
||||
QMAKE = /usr/bin/qmake
|
||||
DEL_FILE = rm -f
|
||||
CHK_DIR_EXISTS= test -d
|
||||
MKDIR = mkdir -p
|
||||
COPY = cp -f
|
||||
COPY_FILE = cp -f
|
||||
COPY_DIR = cp -f -R
|
||||
INSTALL_FILE = install -m 644 -p
|
||||
INSTALL_PROGRAM = install -m 755 -p
|
||||
INSTALL_DIR = cp -f -R
|
||||
QINSTALL = /usr/bin/qmake -install qinstall
|
||||
QINSTALL_PROGRAM = /usr/bin/qmake -install qinstall -exe
|
||||
DEL_FILE = rm -f
|
||||
SYMLINK = ln -f -s
|
||||
DEL_DIR = rmdir
|
||||
MOVE = mv -f
|
||||
TAR = tar -cf
|
||||
COMPRESS = gzip -9f
|
||||
DISTNAME = ssdd1.0.0
|
||||
DISTDIR = /home/stig/projects/ssdd/.tmp/ssdd1.0.0
|
||||
LINK = g++
|
||||
LFLAGS = -Wl,-O1 -Wl,-rpath-link,/usr/lib64
|
||||
LIBS = $(SUBLIBS) /usr/lib64/libQt6Widgets.so /usr/lib64/libQt6Gui.so /usr/lib64/libGLX.so /usr/lib64/libOpenGL.so /usr/lib64/libQt6Core.so -lpthread -lGLX -lOpenGL
|
||||
AR = ar cqs
|
||||
RANLIB =
|
||||
SED = sed
|
||||
STRIP = strip
|
||||
|
||||
####### Output directory
|
||||
|
||||
OBJECTS_DIR = ./
|
||||
|
||||
####### Files
|
||||
|
||||
SOURCES = ssdd-qt.cpp qrc_resources.cpp
|
||||
OBJECTS = ssdd-qt.o \
|
||||
qrc_resources.o
|
||||
DIST = /usr/lib64/qt6/mkspecs/features/spec_pre.prf \
|
||||
/usr/lib64/qt6/mkspecs/common/unix.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/linux.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/sanitize.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/gcc-base.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/gcc-base-unix.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/g++-base.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/g++-unix.conf \
|
||||
/usr/lib64/qt6/mkspecs/qconfig.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_concurrent.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_concurrent_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_core.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_core_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_dbus.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_dbus_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_devicediscovery_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_eglfs_kms_gbm_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_eglfsdeviceintegration_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_example_icons_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_fb_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_gui.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_gui_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_input_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_kms_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_network.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_network_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_opengl.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_opengl_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_openglwidgets.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_openglwidgets_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdf.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdf_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfquick.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfquick_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfwidgets.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfwidgets_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioning.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioning_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioningquick.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioningquick_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_printsupport.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_printsupport_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qml.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qml_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlbuiltins.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlbuiltins_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmldebug_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlintegration.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlintegration_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlmodels.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlmodels_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmltest.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmltest_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quick.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quick_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quickwidgets.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quickwidgets_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_sql.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_sql_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_testlib.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_testlib_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannel.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannel_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannelquick.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannelquick_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginecore.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginecore_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequick.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequick_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequickdelegatesqml.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequickdelegatesqml_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginewidgets.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginewidgets_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_widgets.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_widgets_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_xml.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_xml_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/features/qt_functions.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/qt_config.prf \
|
||||
/usr/lib64/qt6/mkspecs/linux-g++/qmake.conf \
|
||||
/usr/lib64/qt6/mkspecs/features/spec_post.prf \
|
||||
.qmake.stash \
|
||||
/usr/lib64/qt6/mkspecs/features/exclusive_builds.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/toolchain.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/default_pre.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/resolve_config.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/default_post.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/warn_on.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/permissions.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/qt.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/resources_functions.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/resources.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/moc.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/unix/opengl.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/uic.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/unix/thread.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/qmake_use.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/file_copies.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/testcase_targets.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/exceptions.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/yacc.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/lex.prf \
|
||||
ssdd-qt.pro ssdd-qt.cpp
|
||||
QMAKE_TARGET = ssdd
|
||||
DESTDIR =
|
||||
TARGET = ssdd
|
||||
|
||||
|
||||
first: all
|
||||
####### Build rules
|
||||
|
||||
ssdd: $(OBJECTS)
|
||||
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
|
||||
|
||||
Makefile: ssdd-qt.pro /usr/lib64/qt6/mkspecs/linux-g++/qmake.conf /usr/lib64/qt6/mkspecs/features/spec_pre.prf \
|
||||
/usr/lib64/qt6/mkspecs/common/unix.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/linux.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/sanitize.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/gcc-base.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/gcc-base-unix.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/g++-base.conf \
|
||||
/usr/lib64/qt6/mkspecs/common/g++-unix.conf \
|
||||
/usr/lib64/qt6/mkspecs/qconfig.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_concurrent.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_concurrent_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_core.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_core_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_dbus.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_dbus_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_devicediscovery_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_eglfs_kms_gbm_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_eglfsdeviceintegration_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_example_icons_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_fb_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_gui.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_gui_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_input_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_kms_support_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_network.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_network_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_opengl.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_opengl_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_openglwidgets.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_openglwidgets_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdf.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdf_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfquick.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfquick_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfwidgets.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfwidgets_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioning.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioning_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioningquick.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioningquick_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_printsupport.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_printsupport_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qml.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qml_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlbuiltins.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlbuiltins_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmldebug_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlintegration.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlintegration_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlmodels.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlmodels_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmltest.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmltest_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quick.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quick_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quickwidgets.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quickwidgets_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_sql.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_sql_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_testlib.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_testlib_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannel.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannel_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannelquick.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannelquick_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginecore.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginecore_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequick.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequick_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequickdelegatesqml.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequickdelegatesqml_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginewidgets.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginewidgets_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_widgets.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_widgets_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_xml.pri \
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_xml_private.pri \
|
||||
/usr/lib64/qt6/mkspecs/features/qt_functions.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/qt_config.prf \
|
||||
/usr/lib64/qt6/mkspecs/linux-g++/qmake.conf \
|
||||
/usr/lib64/qt6/mkspecs/features/spec_post.prf \
|
||||
.qmake.stash \
|
||||
/usr/lib64/qt6/mkspecs/features/exclusive_builds.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/toolchain.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/default_pre.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/resolve_config.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/default_post.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/warn_on.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/permissions.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/qt.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/resources_functions.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/resources.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/moc.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/unix/opengl.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/uic.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/unix/thread.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/qmake_use.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/file_copies.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/testcase_targets.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/exceptions.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/yacc.prf \
|
||||
/usr/lib64/qt6/mkspecs/features/lex.prf \
|
||||
ssdd-qt.pro \
|
||||
resources.qrc \
|
||||
/usr/lib64/libQt6Widgets.prl \
|
||||
/usr/lib64/libQt6Gui.prl \
|
||||
/usr/lib64/libQt6Core.prl
|
||||
$(QMAKE) -o Makefile ssdd-qt.pro
|
||||
/usr/lib64/qt6/mkspecs/features/spec_pre.prf:
|
||||
/usr/lib64/qt6/mkspecs/common/unix.conf:
|
||||
/usr/lib64/qt6/mkspecs/common/linux.conf:
|
||||
/usr/lib64/qt6/mkspecs/common/sanitize.conf:
|
||||
/usr/lib64/qt6/mkspecs/common/gcc-base.conf:
|
||||
/usr/lib64/qt6/mkspecs/common/gcc-base-unix.conf:
|
||||
/usr/lib64/qt6/mkspecs/common/g++-base.conf:
|
||||
/usr/lib64/qt6/mkspecs/common/g++-unix.conf:
|
||||
/usr/lib64/qt6/mkspecs/qconfig.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_concurrent.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_concurrent_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_core.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_core_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_dbus.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_dbus_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_devicediscovery_support_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_eglfs_kms_gbm_support_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_eglfsdeviceintegration_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_example_icons_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_fb_support_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_gui.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_gui_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_input_support_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_kms_support_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_network.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_network_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_opengl.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_opengl_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_openglwidgets.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_openglwidgets_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdf.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdf_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfquick.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfquick_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfwidgets.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_pdfwidgets_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioning.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioning_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioningquick.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_positioningquick_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_printsupport.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_printsupport_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qml.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qml_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlbuiltins.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlbuiltins_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmldebug_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlintegration.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlintegration_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlmodels.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmlmodels_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmltest.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_qmltest_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quick.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quick_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quickwidgets.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_quickwidgets_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_sql.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_sql_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_testlib.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_testlib_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannel.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannel_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannelquick.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webchannelquick_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginecore.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginecore_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequick.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequick_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequickdelegatesqml.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginequickdelegatesqml_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginewidgets.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_webenginewidgets_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_widgets.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_widgets_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_xml.pri:
|
||||
/usr/lib64/qt6/mkspecs/modules/qt_lib_xml_private.pri:
|
||||
/usr/lib64/qt6/mkspecs/features/qt_functions.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/qt_config.prf:
|
||||
/usr/lib64/qt6/mkspecs/linux-g++/qmake.conf:
|
||||
/usr/lib64/qt6/mkspecs/features/spec_post.prf:
|
||||
.qmake.stash:
|
||||
/usr/lib64/qt6/mkspecs/features/exclusive_builds.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/toolchain.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/default_pre.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/resolve_config.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/default_post.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/warn_on.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/permissions.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/qt.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/resources_functions.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/resources.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/moc.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/unix/opengl.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/uic.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/unix/thread.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/qmake_use.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/file_copies.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/testcase_targets.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/exceptions.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/yacc.prf:
|
||||
/usr/lib64/qt6/mkspecs/features/lex.prf:
|
||||
ssdd-qt.pro:
|
||||
resources.qrc:
|
||||
/usr/lib64/libQt6Widgets.prl:
|
||||
/usr/lib64/libQt6Gui.prl:
|
||||
/usr/lib64/libQt6Core.prl:
|
||||
qmake: FORCE
|
||||
@$(QMAKE) -o Makefile ssdd-qt.pro
|
||||
|
||||
qmake_all: FORCE
|
||||
|
||||
|
||||
all: Makefile ssdd
|
||||
|
||||
dist: distdir FORCE
|
||||
(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar) && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)
|
||||
|
||||
distdir: FORCE
|
||||
@test -d $(DISTDIR) || mkdir -p $(DISTDIR)
|
||||
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
|
||||
$(COPY_FILE) --parents resources.qrc $(DISTDIR)/
|
||||
$(COPY_FILE) --parents /usr/lib64/qt6/mkspecs/features/data/dummy.cpp $(DISTDIR)/
|
||||
$(COPY_FILE) --parents ssdd-qt.cpp $(DISTDIR)/
|
||||
|
||||
|
||||
clean: compiler_clean
|
||||
-$(DEL_FILE) $(OBJECTS)
|
||||
-$(DEL_FILE) *~ core *.core
|
||||
|
||||
|
||||
distclean: clean
|
||||
-$(DEL_FILE) $(TARGET)
|
||||
-$(DEL_FILE) .qmake.stash
|
||||
-$(DEL_FILE) Makefile
|
||||
|
||||
|
||||
####### Sub-libraries
|
||||
|
||||
mocclean: compiler_moc_header_clean compiler_moc_objc_header_clean compiler_moc_source_clean
|
||||
|
||||
mocables: compiler_moc_header_make_all compiler_moc_objc_header_make_all compiler_moc_source_make_all
|
||||
|
||||
check: first
|
||||
|
||||
benchmark: first
|
||||
|
||||
compiler_rcc_make_all: qrc_resources.cpp
|
||||
compiler_rcc_clean:
|
||||
-$(DEL_FILE) qrc_resources.cpp
|
||||
qrc_resources.cpp: resources.qrc \
|
||||
/usr/lib64/qt6/libexec/rcc \
|
||||
ssdd-icon.png
|
||||
/usr/lib64/qt6/libexec/rcc -name resources resources.qrc -o qrc_resources.cpp
|
||||
|
||||
compiler_moc_predefs_make_all: moc_predefs.h
|
||||
compiler_moc_predefs_clean:
|
||||
-$(DEL_FILE) moc_predefs.h
|
||||
moc_predefs.h: /usr/lib64/qt6/mkspecs/features/data/dummy.cpp
|
||||
g++ -pipe -std=gnu++17 -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-strict-aliasing -DPIC -fPIC -Wall -Wextra -dM -E -o moc_predefs.h /usr/lib64/qt6/mkspecs/features/data/dummy.cpp
|
||||
|
||||
compiler_moc_header_make_all:
|
||||
compiler_moc_header_clean:
|
||||
compiler_moc_objc_header_make_all:
|
||||
compiler_moc_objc_header_clean:
|
||||
compiler_moc_source_make_all: ssdd-qt.moc
|
||||
compiler_moc_source_clean:
|
||||
-$(DEL_FILE) ssdd-qt.moc
|
||||
ssdd-qt.moc: ssdd-qt.cpp \
|
||||
moc_predefs.h \
|
||||
/usr/lib64/qt6/libexec/moc
|
||||
/usr/lib64/qt6/libexec/moc $(DEFINES) --include /home/stig/projects/ssdd/moc_predefs.h -I/usr/lib64/qt6/mkspecs/linux-g++ -I/home/stig/projects/ssdd -I/usr/include/qt6 -I/usr/include/qt6/QtWidgets -I/usr/include/qt6/QtGui -I/usr/include/qt6/QtCore -I/usr/include/c++/14 -I/usr/include/c++/14/x86_64-mageia-linux -I/usr/include/c++/14/backward -I/usr/lib/gcc/x86_64-mageia-linux/14/include -I/usr/local/include -I/usr/include ssdd-qt.cpp -o ssdd-qt.moc
|
||||
|
||||
compiler_uic_make_all:
|
||||
compiler_uic_clean:
|
||||
compiler_yacc_decl_make_all:
|
||||
compiler_yacc_decl_clean:
|
||||
compiler_yacc_impl_make_all:
|
||||
compiler_yacc_impl_clean:
|
||||
compiler_lex_make_all:
|
||||
compiler_lex_clean:
|
||||
compiler_clean: compiler_rcc_clean compiler_moc_predefs_clean compiler_moc_source_clean
|
||||
|
||||
####### Compile
|
||||
|
||||
ssdd-qt.o: ssdd-qt.cpp ssdd-qt.moc
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o ssdd-qt.o ssdd-qt.cpp
|
||||
|
||||
qrc_resources.o: qrc_resources.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_resources.o qrc_resources.cpp
|
||||
|
||||
####### Install
|
||||
|
||||
install: FORCE
|
||||
|
||||
uninstall: FORCE
|
||||
|
||||
FORCE:
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -4,6 +4,8 @@ A simple Shutdown Dialog for Openbox written in C using GTK
|
||||
|
||||
![Project Screenshot](ssdd.png)
|
||||
|
||||
![Settings screenshot](ssdd-settings.png)
|
||||
|
||||
**Simple Shutdown Dialog (ssdd)** is a simple yet stylish shutdown dialog for Openbox, crafted in C using GTK.
|
||||
|
||||
## Why ssdd?
|
||||
|
6
resources.qrc
Normal file
6
resources.qrc
Normal file
@ -0,0 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file alias="icons/ssdd-icon.png">ssdd-icon.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
242
ssdd-gtk.c
Normal file
242
ssdd-gtk.c
Normal file
@ -0,0 +1,242 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib.h>
|
||||
#include "resources.h"
|
||||
|
||||
// Function declarations (prototypes)
|
||||
static void execute_command(const gchar *command);
|
||||
static void show_about_dialog(GtkWidget *widget);
|
||||
static void button_clicked(GtkWidget *widget, gpointer data);
|
||||
static gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data);
|
||||
static void show_confirmation_dialog(GtkWidget *widget, const gchar *label, const gchar *command);
|
||||
static void create_button(GtkWidget *grid, GtkApplication *app, const gchar *label_text, const gchar *icon_name, const gchar *command, int pos);
|
||||
|
||||
static void execute_command(const gchar *command) {
|
||||
GError *error = NULL;
|
||||
gboolean ret = g_spawn_command_line_async(command, &error);
|
||||
if (!ret) {
|
||||
GtkWidget *dialog;
|
||||
dialog = gtk_message_dialog_new(NULL,
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"Error executing command: %s\n%s",
|
||||
command,
|
||||
error->message);
|
||||
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
g_error_free(error);
|
||||
}
|
||||
}
|
||||
|
||||
static void show_about_dialog(GtkWidget *widget) {
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *content_area;
|
||||
GtkWidget *label;
|
||||
GtkWidget *image;
|
||||
GtkWidget *box;
|
||||
const gchar *about_text =
|
||||
"\n<b>About Simple ShutDown Dialog</b>\n\n"
|
||||
"<b>Version:</b> 1.3\n"
|
||||
"<b>Author:</b> kekePower\n"
|
||||
"<b>URL:</b> <a href=\"https://git.kekepower.com/kekePower/ssdd\">https://git.kekepower.com/kekePower/ssdd</a>\n"
|
||||
"<b>Description:</b> This is a simple Shutdown Dialog for Openbox.\n";
|
||||
|
||||
dialog = gtk_dialog_new_with_buttons("About Simple ShutDown Dialog",
|
||||
NULL,
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
"_Close",
|
||||
GTK_RESPONSE_CLOSE,
|
||||
NULL);
|
||||
content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
|
||||
box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
|
||||
gtk_container_add(GTK_CONTAINER(content_area), box);
|
||||
|
||||
image = gtk_image_new_from_resource("/org/gtk/ssdd/ssdd-icon.png");
|
||||
gtk_image_set_pixel_size(GTK_IMAGE(image), 250); // Assuming original size is 500x500
|
||||
gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0);
|
||||
|
||||
label = gtk_label_new(NULL);
|
||||
gtk_label_set_markup(GTK_LABEL(label), about_text);
|
||||
gtk_label_set_selectable(GTK_LABEL(label), TRUE);
|
||||
gtk_widget_set_halign(label, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign(label, GTK_ALIGN_START);
|
||||
gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 0);
|
||||
|
||||
gtk_widget_show_all(dialog);
|
||||
|
||||
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
|
||||
static void button_clicked(GtkWidget *widget, gpointer data) {
|
||||
const gchar *command = (const gchar *)data;
|
||||
const gchar *label = g_object_get_data(G_OBJECT(widget), "label");
|
||||
|
||||
if (g_strcmp0(command, "exit") == 0) {
|
||||
g_application_quit(G_APPLICATION(g_object_get_data(G_OBJECT(widget), "app")));
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_strcmp0(command, "about") == 0) {
|
||||
show_about_dialog(widget);
|
||||
} else {
|
||||
GtkWidget *window = gtk_widget_get_toplevel(widget);
|
||||
show_confirmation_dialog(window, label, command);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data) {
|
||||
if (event->keyval == GDK_KEY_Escape) {
|
||||
g_application_quit(G_APPLICATION(data));
|
||||
return TRUE; // Event handled
|
||||
}
|
||||
return FALSE; // Event not handled
|
||||
}
|
||||
|
||||
static void show_confirmation_dialog(GtkWidget *parent_window, const gchar *label, const gchar *command) {
|
||||
GtkWidget *dialog;
|
||||
gint response;
|
||||
|
||||
gchar *message = g_strdup_printf("Are you sure you want to %s?", label);
|
||||
|
||||
dialog = gtk_dialog_new();
|
||||
gtk_window_set_title(GTK_WINDOW(dialog), "Confirmation");
|
||||
|
||||
// Set the transient parent correctly
|
||||
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent_window));
|
||||
|
||||
gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
|
||||
gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
|
||||
|
||||
GtkWidget *content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
|
||||
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
|
||||
gtk_container_add(GTK_CONTAINER(content_area), box);
|
||||
|
||||
GtkWidget *image = gtk_image_new_from_icon_name("dialog-warning", GTK_ICON_SIZE_DIALOG);
|
||||
gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0);
|
||||
|
||||
GtkWidget *label_widget = gtk_label_new(message);
|
||||
gtk_box_pack_start(GTK_BOX(box), label_widget, TRUE, TRUE, 0);
|
||||
|
||||
gtk_dialog_add_buttons(GTK_DIALOG(dialog),
|
||||
"Yes", GTK_RESPONSE_YES,
|
||||
"No", GTK_RESPONSE_NO,
|
||||
NULL); // Add NULL to terminate the list of buttons
|
||||
|
||||
GtkWidget *button_box = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); // Get content area instead of action area
|
||||
gtk_box_set_spacing(GTK_BOX(button_box), 10); // Adjust spacing as needed
|
||||
gtk_widget_set_margin_top(button_box, 10);
|
||||
|
||||
gtk_widget_show_all(dialog); // Show the dialog and its children
|
||||
|
||||
response = gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
g_free(message);
|
||||
|
||||
if (response == GTK_RESPONSE_YES) {
|
||||
execute_command(command);
|
||||
}
|
||||
}
|
||||
|
||||
static void create_button(GtkWidget *grid, GtkApplication *app, const gchar *label_text, const gchar *icon_name, const gchar *command, int pos) {
|
||||
GtkWidget *button;
|
||||
GtkWidget *box;
|
||||
GtkWidget *image;
|
||||
GtkWidget *label;
|
||||
|
||||
button = gtk_button_new();
|
||||
box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
|
||||
gtk_container_add(GTK_CONTAINER(button), box);
|
||||
|
||||
image = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_BUTTON);
|
||||
gtk_box_pack_start(GTK_BOX(box), image, TRUE, TRUE, 0);
|
||||
|
||||
label = gtk_label_new(label_text);
|
||||
gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 0);
|
||||
|
||||
//Add margin to the button
|
||||
gtk_widget_set_margin_top(button, 10);
|
||||
|
||||
g_object_set_data(G_OBJECT(button), "app", app);
|
||||
g_object_set_data(G_OBJECT(button), "label", (gpointer) label_text);
|
||||
g_signal_connect(button, "clicked", G_CALLBACK(button_clicked), (gpointer) command);
|
||||
gtk_grid_attach(GTK_GRID(grid), button, pos % 4, pos / 4, 1, 1);
|
||||
}
|
||||
|
||||
static void activate(GtkApplication *app, gpointer user_data) {
|
||||
GtkWidget *window;
|
||||
GtkWidget *grid;
|
||||
const gchar *buttons[] = {
|
||||
"openbox --exit",
|
||||
"systemctl reboot",
|
||||
"systemctl poweroff",
|
||||
"dm-tool switch-to-greeter",
|
||||
"systemctl suspend",
|
||||
"systemctl hibernate",
|
||||
"about",
|
||||
"exit"
|
||||
};
|
||||
const gchar *icons[] = {
|
||||
"system-log-out",
|
||||
"view-refresh",
|
||||
"system-shutdown",
|
||||
"system-users",
|
||||
"media-playback-pause",
|
||||
"media-playback-stop",
|
||||
"help-about",
|
||||
"application-exit"
|
||||
};
|
||||
const gchar *labels[] = { // Define the labels array here
|
||||
"Logout",
|
||||
"Reboot",
|
||||
"Shutdown",
|
||||
"Switch User",
|
||||
"Suspend",
|
||||
"Hibernate",
|
||||
"About",
|
||||
"Exit"
|
||||
};
|
||||
|
||||
window = gtk_application_window_new(app);
|
||||
gtk_window_set_title(GTK_WINDOW(window), "Simple ShutDown Dialog");
|
||||
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
|
||||
|
||||
// Load the icon with error handling
|
||||
GError *error = NULL;
|
||||
GdkPixbuf *icon_pixbuf = gdk_pixbuf_new_from_resource("/org/gtk/ssdd/ssdd-icon.png", &error);
|
||||
if (icon_pixbuf) {
|
||||
gtk_window_set_icon(GTK_WINDOW(window), icon_pixbuf);
|
||||
g_object_unref(icon_pixbuf); // Free the pixbuf
|
||||
} else {
|
||||
g_warning("Failed to load icon: %s", error->message);
|
||||
g_error_free(error);
|
||||
}
|
||||
|
||||
g_signal_connect(window, "key-press-event", G_CALLBACK(on_key_press), app);
|
||||
|
||||
grid = gtk_grid_new();
|
||||
gtk_container_add(GTK_CONTAINER(window), grid);
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
create_button(grid, app, labels[i], icons[i], buttons[i], i);
|
||||
}
|
||||
|
||||
gtk_widget_show_all(window);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
// Register the resource
|
||||
g_resources_register(resources_get_resource());
|
||||
|
||||
app = gtk_application_new("org.gtk.ssdd", G_APPLICATION_DEFAULT_FLAGS);
|
||||
g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
|
||||
status = g_application_run(G_APPLICATION(app), argc, argv);
|
||||
g_object_unref(app);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
115
ssdd-qt.cpp
Normal file
115
ssdd-qt.cpp
Normal file
@ -0,0 +1,115 @@
|
||||
#include <QApplication>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
#include <QGridLayout>
|
||||
#include <QMessageBox>
|
||||
#include <QIcon>
|
||||
#include <QKeyEvent>
|
||||
#include <QLabel>
|
||||
#include <QDialog>
|
||||
#include <QProcess>
|
||||
|
||||
class SimpleShutDownDialog : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SimpleShutDownDialog() {
|
||||
setWindowTitle("Simple ShutDown Dialog");
|
||||
setWindowIcon(QIcon(":/icons/ssdd-icon.png"));
|
||||
setWindowFlags(Qt::Dialog);
|
||||
setWindowModality(Qt::ApplicationModal);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
QGridLayout *gridLayout = new QGridLayout;
|
||||
|
||||
const QStringList labels = {
|
||||
"Logout", "Reboot", "Shutdown", "Switch User",
|
||||
"Suspend", "Hibernate", "About", "Exit"
|
||||
};
|
||||
const QStringList icons = {
|
||||
"system-log-out", "view-refresh", "system-shutdown", "system-users",
|
||||
"media-playback-pause", "media-playback-stop", "help-about", "application-exit"
|
||||
};
|
||||
const QStringList commands = {
|
||||
"openbox --exit", "systemctl reboot", "systemctl poweroff", "dm-tool switch-to-greeter",
|
||||
"systemctl suspend", "systemctl hibernate", "about", "exit"
|
||||
};
|
||||
|
||||
for (int i = 0; i < labels.size(); ++i) {
|
||||
QPushButton *button = new QPushButton;
|
||||
QVBoxLayout *vbox = new QVBoxLayout;
|
||||
QLabel *iconLabel = new QLabel;
|
||||
iconLabel->setPixmap(QIcon::fromTheme(icons[i]).pixmap(48));
|
||||
QLabel *textLabel = new QLabel(labels[i]);
|
||||
vbox->addWidget(iconLabel, 0, Qt::AlignHCenter);
|
||||
vbox->addWidget(textLabel, 0, Qt::AlignHCenter);
|
||||
button->setLayout(vbox);
|
||||
|
||||
connect(button, &QPushButton::clicked, this, [this, commands, i]() {
|
||||
onButtonClicked(commands[i]);
|
||||
});
|
||||
|
||||
gridLayout->addWidget(button, i / 4, i % 4);
|
||||
}
|
||||
|
||||
mainLayout->addLayout(gridLayout);
|
||||
setLayout(mainLayout);
|
||||
}
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event) override {
|
||||
if (event->key() == Qt::Key_Escape) {
|
||||
QApplication::quit();
|
||||
} else {
|
||||
QWidget::keyPressEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
private slots:
|
||||
void onButtonClicked(const QString &command) {
|
||||
if (command == "about") {
|
||||
showAboutDialog();
|
||||
} else if (command == "exit") {
|
||||
QApplication::quit();
|
||||
} else {
|
||||
showConfirmationDialog(command);
|
||||
}
|
||||
}
|
||||
|
||||
void showAboutDialog() {
|
||||
QMessageBox aboutBox;
|
||||
aboutBox.setWindowTitle("About Simple ShutDown Dialog");
|
||||
aboutBox.setIconPixmap(QPixmap(":/icons/ssdd-icon.png").scaled(250, 250, Qt::KeepAspectRatio));
|
||||
aboutBox.setText(
|
||||
"<b>About Simple ShutDown Dialog</b><br><br>"
|
||||
"<b>Version:</b> 1.3<br>"
|
||||
"<b>Author:</b> kekePower<br>"
|
||||
"<b>URL:</b> <a href=\"https://git.kekepower.com/kekePower/ssdd\">https://git.kekepower.com/kekePower/ssdd</a><br>"
|
||||
"<b>Description:</b> This is a simple Shutdown Dialog for Openbox."
|
||||
);
|
||||
aboutBox.exec();
|
||||
}
|
||||
|
||||
void showConfirmationDialog(const QString &command) {
|
||||
QMessageBox confirmBox;
|
||||
confirmBox.setWindowTitle("Confirmation");
|
||||
confirmBox.setText(QString("Are you sure you want to %1?").arg(command));
|
||||
confirmBox.setIcon(QMessageBox::Warning);
|
||||
confirmBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
|
||||
if (confirmBox.exec() == QMessageBox::Yes) {
|
||||
QProcess::startDetached(command);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#include "ssdd-qt.moc"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QApplication app(argc, argv);
|
||||
|
||||
SimpleShutDownDialog dialog;
|
||||
dialog.show();
|
||||
|
||||
return app.exec();
|
||||
}
|
10
ssdd-qt.pro
Normal file
10
ssdd-qt.pro
Normal file
@ -0,0 +1,10 @@
|
||||
QT += core gui widgets
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
TARGET = ssdd
|
||||
|
||||
SOURCES += ssdd-qt.cpp
|
||||
|
||||
RESOURCES += resources.qrc
|
||||
|
BIN
ssdd-settings.png
Normal file
BIN
ssdd-settings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
Loading…
Reference in New Issue
Block a user