Add shortcut

This commit is contained in:
Ximi1970
2023-12-04 23:12:03 +01:00
parent ccb6411f32
commit a3f8fd10eb
40 changed files with 1442 additions and 699 deletions

View File

@@ -19,7 +19,7 @@ include( ../SysTray-X.pri )
QT += core gui
unix:!macx: {
contains(DEFINES,KDE_INTEGRATION) {
QT += dbus KNotifications
QT += dbus KNotifications x11extras
}
}
@@ -147,6 +147,9 @@ win32: {
SOURCES += \
main.cpp \
nativeeventfilter-x11.cpp \
nativeeventfilterbase.cpp \
shortcut.cpp \
systrayxlink.cpp \
systrayxicon.cpp \
systrayx.cpp \
@@ -169,6 +172,9 @@ SOURCES += \
HEADERS += \
debug.h \
nativeeventfilter-x11.h \
nativeeventfilterbase.h \
shortcut.h \
systrayxlink.h \
systrayxicon.h \
systrayx.h \

View File

@@ -433,21 +433,41 @@
</message>
<message>
<location filename="../preferences.ui" line="1138"/>
<source>Shortcuts</source>
<translation>Tastatürkürzel</translation>
</message>
<message>
<location filename="../preferences.ui" line="1157"/>
<source>Current show / hide shortcut:</source>
<translation>Aktuelle Tastenkombination zum Anzeigen / Verbergen</translation>
</message>
<message>
<location filename="../preferences.ui" line="1186"/>
<source>New show / hide shortcut:</source>
<translation>Neuer Tastenkombination zum Anzeigen / Verbergen</translation>
</message>
<message>
<location filename="../preferences.ui" line="1200"/>
<source>Clear</source>
<translation>Löschen</translation>
</message>
<message>
<location filename="../preferences.ui" line="1211"/>
<source>Debug</source>
<translation>Debug</translation>
</message>
<message>
<location filename="../preferences.ui" line="1144"/>
<location filename="../preferences.ui" line="1217"/>
<source>Display debug window</source>
<translation>Debug-Fenster anzeigen</translation>
</message>
<message>
<location filename="../preferences.ui" line="1205"/>
<location filename="../preferences.ui" line="1278"/>
<source>Save</source>
<translation>Speichern</translation>
</message>
<message>
<location filename="../preferences.ui" line="1198"/>
<location filename="../preferences.ui" line="1271"/>
<source>Cancel</source>
<translation>Annullieren</translation>
</message>
@@ -458,20 +478,20 @@
<translation>Hauptfenster minimieren</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Open Image</source>
<translation>Bild öffnen</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Image Files (*.png *.jpg *.bmp)</source>
<translation>Bilddateien (*.png *.jpg *.bmp)</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="763"/>
<location filename="../preferencesdialog.cpp" line="777"/>
<location filename="../preferencesdialog.cpp" line="781"/>
<location filename="../preferencesdialog.cpp" line="795"/>
<source>Select application</source>
<translation>Anwendung auswählen</translation>
</message>
@@ -479,27 +499,27 @@
<context>
<name>SysTrayX</name>
<message>
<location filename="../systrayx.cpp" line="246"/>
<location filename="../systrayx.cpp" line="225"/>
<source>&amp;Show/Hide</source>
<translation>&amp;Anzeigen/Verbergen</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="250"/>
<location filename="../systrayx.cpp" line="229"/>
<source>&amp;Preferences</source>
<translation>&amp;Einstellungen</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="254"/>
<location filename="../systrayx.cpp" line="233"/>
<source>&amp;About</source>
<translation>&amp;Über</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="258"/>
<location filename="../systrayx.cpp" line="237"/>
<source>&amp;Quit</source>
<translation>&amp;Beenden</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="692"/>
<location filename="../systrayx.cpp" line="671"/>
<source>Close</source>
<translation>Schließen</translation>
</message>

View File

@@ -422,12 +422,17 @@
<translation>Χρησιμοποιήστε το παράθυρο διαλόγου Προτιμήσεις Thunderbird για να επιλέξετε λογαριασμούς και φακέλους</translation>
</message>
<message>
<location filename="../preferences.ui" line="1138"/>
<location filename="../preferences.ui" line="1200"/>
<source>Clear</source>
<translation>Αφαιρώ</translation>
</message>
<message>
<location filename="../preferences.ui" line="1211"/>
<source>Debug</source>
<translation>Αποσφαλμάτωση</translation>
</message>
<message>
<location filename="../preferences.ui" line="1144"/>
<location filename="../preferences.ui" line="1217"/>
<source>Display debug window</source>
<translation>Προβολή παραθύρου αποσφαλμάτωσης</translation>
</message>
@@ -448,30 +453,45 @@
<translation>Εφαρμογή εκκίνησης</translation>
</message>
<message>
<location filename="../preferences.ui" line="1205"/>
<location filename="../preferences.ui" line="1138"/>
<source>Shortcuts</source>
<translation>Συντομεύσεις</translation>
</message>
<message>
<location filename="../preferences.ui" line="1157"/>
<source>Current show / hide shortcut:</source>
<translation>Τρέχουσα συντόμευση Εμφάνιση / Απόκρυψη</translation>
</message>
<message>
<location filename="../preferences.ui" line="1186"/>
<source>New show / hide shortcut:</source>
<translation>Νέα συντόμευση Εμφάνιση / Απόκρυψη</translation>
</message>
<message>
<location filename="../preferences.ui" line="1278"/>
<source>Save</source>
<translation>Αποθήκευση</translation>
</message>
<message>
<location filename="../preferences.ui" line="1198"/>
<location filename="../preferences.ui" line="1271"/>
<source>Cancel</source>
<translation>Άκυρο</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Open Image</source>
<translation>Άνοιγμα εικόνας</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Image Files (*.png *.jpg *.bmp)</source>
<translation>Αρχεία εικόνας (*.png *.jpg *.bmp)</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="763"/>
<location filename="../preferencesdialog.cpp" line="777"/>
<location filename="../preferencesdialog.cpp" line="781"/>
<location filename="../preferencesdialog.cpp" line="795"/>
<source>Select application</source>
<translation>επιλέξτε εφαρμογή</translation>
</message>
@@ -479,27 +499,27 @@
<context>
<name>SysTrayX</name>
<message>
<location filename="../systrayx.cpp" line="246"/>
<location filename="../systrayx.cpp" line="225"/>
<source>&amp;Show/Hide</source>
<translation>&amp;Εμφάνιση/Απόκρυψη</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="250"/>
<location filename="../systrayx.cpp" line="229"/>
<source>&amp;Preferences</source>
<translation>&amp;Προτιμήσεις</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="254"/>
<location filename="../systrayx.cpp" line="233"/>
<source>&amp;About</source>
<translation>&amp;Σχετικά</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="258"/>
<location filename="../systrayx.cpp" line="237"/>
<source>&amp;Quit</source>
<translation>&amp;Έξοδος</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="692"/>
<location filename="../systrayx.cpp" line="671"/>
<source>Close</source>
<translation>Κλείσιμο</translation>
</message>

View File

@@ -438,21 +438,53 @@
</message>
<message>
<location filename="../preferences.ui" line="1138"/>
<source>Shortcuts</source>
<translation>Shortcuts</translation>
</message>
<message>
<location filename="../preferences.ui" line="1157"/>
<source>Current show / hide shortcut:</source>
<translation>Current Show / Hide shortcut</translation>
</message>
<message>
<location filename="../preferences.ui" line="1186"/>
<source>New show / hide shortcut:</source>
<translation>New Show / Hide shortcut</translation>
</message>
<message>
<source>Shortcut</source>
<translation type="vanished">Shortcut</translation>
</message>
<message>
<source>Current shortcut:</source>
<translation type="vanished">Current shortcut</translation>
</message>
<message>
<source>New shortcut:</source>
<translation type="vanished">New shortcut</translation>
</message>
<message>
<location filename="../preferences.ui" line="1200"/>
<source>Clear</source>
<translation>Clear</translation>
</message>
<message>
<location filename="../preferences.ui" line="1211"/>
<source>Debug</source>
<translation>Debug</translation>
</message>
<message>
<location filename="../preferences.ui" line="1144"/>
<location filename="../preferences.ui" line="1217"/>
<source>Display debug window</source>
<translation>Display debug window</translation>
</message>
<message>
<location filename="../preferences.ui" line="1205"/>
<location filename="../preferences.ui" line="1278"/>
<source>Save</source>
<translation>Save</translation>
</message>
<message>
<location filename="../preferences.ui" line="1198"/>
<location filename="../preferences.ui" line="1271"/>
<source>Cancel</source>
<translation>Cancel</translation>
</message>
@@ -463,20 +495,20 @@
<translation>Minimize to tray</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Open Image</source>
<translation>Open Image</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Image Files (*.png *.jpg *.bmp)</source>
<translation>Image Files (*.png *.jpg *.bmp)</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="763"/>
<location filename="../preferencesdialog.cpp" line="777"/>
<location filename="../preferencesdialog.cpp" line="781"/>
<location filename="../preferencesdialog.cpp" line="795"/>
<source>Select application</source>
<translation>Select application</translation>
</message>
@@ -484,27 +516,27 @@
<context>
<name>SysTrayX</name>
<message>
<location filename="../systrayx.cpp" line="246"/>
<location filename="../systrayx.cpp" line="225"/>
<source>&amp;Show/Hide</source>
<translation>&amp;Show/Hide</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="250"/>
<location filename="../systrayx.cpp" line="229"/>
<source>&amp;Preferences</source>
<translation>&amp;Preferences</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="254"/>
<location filename="../systrayx.cpp" line="233"/>
<source>&amp;About</source>
<translation>&amp;About</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="258"/>
<location filename="../systrayx.cpp" line="237"/>
<source>&amp;Quit</source>
<translation>&amp;Quit</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="692"/>
<location filename="../systrayx.cpp" line="671"/>
<source>Close</source>
<translation>Close</translation>
</message>

View File

@@ -423,12 +423,17 @@
<translation>Usa la finestra di dialogo delle preferenze in Thunderbird per selezionare account e cartelle</translation>
</message>
<message>
<location filename="../preferences.ui" line="1138"/>
<location filename="../preferences.ui" line="1200"/>
<source>Clear</source>
<translation>Rimuovi</translation>
</message>
<message>
<location filename="../preferences.ui" line="1211"/>
<source>Debug</source>
<translation>Debug</translation>
</message>
<message>
<location filename="../preferences.ui" line="1144"/>
<location filename="../preferences.ui" line="1217"/>
<source>Display debug window</source>
<translation>Mostra finestra di debug</translation>
</message>
@@ -449,30 +454,45 @@
<translation>Applicazione di avvio</translation>
</message>
<message>
<location filename="../preferences.ui" line="1205"/>
<location filename="../preferences.ui" line="1138"/>
<source>Shortcuts</source>
<translation>Scorciatoie</translation>
</message>
<message>
<location filename="../preferences.ui" line="1157"/>
<source>Current show / hide shortcut:</source>
<translation>Scorciatoia corrente Mostra / Nascondi</translation>
</message>
<message>
<location filename="../preferences.ui" line="1186"/>
<source>New show / hide shortcut:</source>
<translation>Nuova scorciatoia Mostra / Nascondi</translation>
</message>
<message>
<location filename="../preferences.ui" line="1278"/>
<source>Save</source>
<translation>Salva</translation>
</message>
<message>
<location filename="../preferences.ui" line="1198"/>
<location filename="../preferences.ui" line="1271"/>
<source>Cancel</source>
<translation>Annulla</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Open Image</source>
<translation>Apri immagine</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Image Files (*.png *.jpg *.bmp)</source>
<translation>File immagine (*.png *.jpg *.bmp)</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="763"/>
<location filename="../preferencesdialog.cpp" line="777"/>
<location filename="../preferencesdialog.cpp" line="781"/>
<location filename="../preferencesdialog.cpp" line="795"/>
<source>Select application</source>
<translation>Selezionare l&apos;applicazione</translation>
</message>
@@ -480,27 +500,27 @@
<context>
<name>SysTrayX</name>
<message>
<location filename="../systrayx.cpp" line="246"/>
<location filename="../systrayx.cpp" line="225"/>
<source>&amp;Show/Hide</source>
<translation>&amp;Mostra/Nascondi</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="250"/>
<location filename="../systrayx.cpp" line="229"/>
<source>&amp;Preferences</source>
<translation>&amp;Preferenze</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="254"/>
<location filename="../systrayx.cpp" line="233"/>
<source>&amp;About</source>
<translation>&amp;Informazioni</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="258"/>
<location filename="../systrayx.cpp" line="237"/>
<source>&amp;Quit</source>
<translation>&amp;Esci</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="692"/>
<location filename="../systrayx.cpp" line="671"/>
<source>Close</source>
<translation>Chiudi</translation>
</message>

View File

@@ -437,21 +437,41 @@
</message>
<message>
<location filename="../preferences.ui" line="1138"/>
<source>Shortcuts</source>
<translation>Snelkoppelingen</translation>
</message>
<message>
<location filename="../preferences.ui" line="1157"/>
<source>Current show / hide shortcut:</source>
<translation>Huidige snelkoppeling Tonen / Verbergen</translation>
</message>
<message>
<location filename="../preferences.ui" line="1186"/>
<source>New show / hide shortcut:</source>
<translation>Nieuwe snelkoppeling Tonen / Verbergen</translation>
</message>
<message>
<location filename="../preferences.ui" line="1200"/>
<source>Clear</source>
<translation>Verwijderen</translation>
</message>
<message>
<location filename="../preferences.ui" line="1211"/>
<source>Debug</source>
<translation>Debug</translation>
</message>
<message>
<location filename="../preferences.ui" line="1144"/>
<location filename="../preferences.ui" line="1217"/>
<source>Display debug window</source>
<translation>Toon debug venster</translation>
</message>
<message>
<location filename="../preferences.ui" line="1205"/>
<location filename="../preferences.ui" line="1278"/>
<source>Save</source>
<translation>Bewaren</translation>
</message>
<message>
<location filename="../preferences.ui" line="1198"/>
<location filename="../preferences.ui" line="1271"/>
<source>Cancel</source>
<translation>Annnuleren</translation>
</message>
@@ -462,20 +482,20 @@
<translation>Minimaliseer naar systeemvak</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Open Image</source>
<translation>Open afbeelding</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Image Files (*.png *.jpg *.bmp)</source>
<translation>Afbeeldingsbestanden (*.png *.jpg *.bmp)</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="763"/>
<location filename="../preferencesdialog.cpp" line="777"/>
<location filename="../preferencesdialog.cpp" line="781"/>
<location filename="../preferencesdialog.cpp" line="795"/>
<source>Select application</source>
<translation>Selecteer programma</translation>
</message>
@@ -483,27 +503,27 @@
<context>
<name>SysTrayX</name>
<message>
<location filename="../systrayx.cpp" line="246"/>
<location filename="../systrayx.cpp" line="225"/>
<source>&amp;Show/Hide</source>
<translation>&amp;Tonen/Verbergen</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="250"/>
<location filename="../systrayx.cpp" line="229"/>
<source>&amp;Preferences</source>
<translation>&amp;Opties</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="254"/>
<location filename="../systrayx.cpp" line="233"/>
<source>&amp;About</source>
<translation>O&amp;ver</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="258"/>
<location filename="../systrayx.cpp" line="237"/>
<source>&amp;Quit</source>
<translation>&amp;Afsluiten</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="692"/>
<location filename="../systrayx.cpp" line="671"/>
<source>Close</source>
<translation>Sluiten</translation>
</message>

View File

@@ -437,21 +437,41 @@
</message>
<message>
<location filename="../preferences.ui" line="1138"/>
<source>Shortcuts</source>
<translation>Atalhos</translation>
</message>
<message>
<location filename="../preferences.ui" line="1157"/>
<source>Current show / hide shortcut:</source>
<translation>Atual Mostrar / Ocultar atalho</translation>
</message>
<message>
<location filename="../preferences.ui" line="1186"/>
<source>New show / hide shortcut:</source>
<translation>Novo atalho Mostrar / Ocultar</translation>
</message>
<message>
<location filename="../preferences.ui" line="1200"/>
<source>Clear</source>
<translation>Remover</translation>
</message>
<message>
<location filename="../preferences.ui" line="1211"/>
<source>Debug</source>
<translation>Depuração</translation>
</message>
<message>
<location filename="../preferences.ui" line="1144"/>
<location filename="../preferences.ui" line="1217"/>
<source>Display debug window</source>
<translation>Mostrar janela de depuração</translation>
</message>
<message>
<location filename="../preferences.ui" line="1205"/>
<location filename="../preferences.ui" line="1278"/>
<source>Save</source>
<translation>Salvar</translation>
</message>
<message>
<location filename="../preferences.ui" line="1198"/>
<location filename="../preferences.ui" line="1271"/>
<source>Cancel</source>
<translation>Cancelar</translation>
</message>
@@ -462,20 +482,20 @@
<translation>Minimizar para a tray</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Open Image</source>
<translation>Abrir imagem</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Image Files (*.png *.jpg *.bmp)</source>
<translation>Arquivo de imagem (*.png *.jpg *.bmp)</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="763"/>
<location filename="../preferencesdialog.cpp" line="777"/>
<location filename="../preferencesdialog.cpp" line="781"/>
<location filename="../preferencesdialog.cpp" line="795"/>
<source>Select application</source>
<translation>Selecione o aplicativo</translation>
</message>
@@ -483,27 +503,27 @@
<context>
<name>SysTrayX</name>
<message>
<location filename="../systrayx.cpp" line="246"/>
<location filename="../systrayx.cpp" line="225"/>
<source>&amp;Show/Hide</source>
<translation>&amp;Exibir/Ocultar</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="250"/>
<location filename="../systrayx.cpp" line="229"/>
<source>&amp;Preferences</source>
<translation>&amp;Preferências</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="254"/>
<location filename="../systrayx.cpp" line="233"/>
<source>&amp;About</source>
<translation>&amp;Sobre</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="258"/>
<location filename="../systrayx.cpp" line="237"/>
<source>&amp;Quit</source>
<translation>&amp;Sair</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="692"/>
<location filename="../systrayx.cpp" line="671"/>
<source>Close</source>
<translation>Fechar</translation>
</message>

View File

@@ -434,21 +434,41 @@
</message>
<message>
<location filename="../preferences.ui" line="1138"/>
<source>Shortcuts</source>
<translation>Сочетания</translation>
</message>
<message>
<location filename="../preferences.ui" line="1157"/>
<source>Current show / hide shortcut:</source>
<translation>Текущий ярлык Показать / Скрыть</translation>
</message>
<message>
<location filename="../preferences.ui" line="1186"/>
<source>New show / hide shortcut:</source>
<translation>Новый ярлык Показать / Скрыть</translation>
</message>
<message>
<location filename="../preferences.ui" line="1200"/>
<source>Clear</source>
<translation>Удалять</translation>
</message>
<message>
<location filename="../preferences.ui" line="1211"/>
<source>Debug</source>
<translation>Отладка</translation>
</message>
<message>
<location filename="../preferences.ui" line="1144"/>
<location filename="../preferences.ui" line="1217"/>
<source>Display debug window</source>
<translation>Показывать окно отладки</translation>
</message>
<message>
<location filename="../preferences.ui" line="1205"/>
<location filename="../preferences.ui" line="1278"/>
<source>Save</source>
<translation>Сохранить</translation>
</message>
<message>
<location filename="../preferences.ui" line="1198"/>
<location filename="../preferences.ui" line="1271"/>
<source>Cancel</source>
<translation>Отменить</translation>
</message>
@@ -459,20 +479,20 @@
<translation>Свернуть в трей</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Open Image</source>
<translation>Открыть изображение</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="684"/>
<location filename="../preferencesdialog.cpp" line="708"/>
<location filename="../preferencesdialog.cpp" line="702"/>
<location filename="../preferencesdialog.cpp" line="726"/>
<source>Image Files (*.png *.jpg *.bmp)</source>
<translation>Файлы изображений (*.png *.jpg *.bmp)</translation>
</message>
<message>
<location filename="../preferencesdialog.cpp" line="763"/>
<location filename="../preferencesdialog.cpp" line="777"/>
<location filename="../preferencesdialog.cpp" line="781"/>
<location filename="../preferencesdialog.cpp" line="795"/>
<source>Select application</source>
<translation>выберите приложение</translation>
</message>
@@ -480,27 +500,27 @@
<context>
<name>SysTrayX</name>
<message>
<location filename="../systrayx.cpp" line="246"/>
<location filename="../systrayx.cpp" line="225"/>
<source>&amp;Show/Hide</source>
<translation>&amp;Показать/Скрыть</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="250"/>
<location filename="../systrayx.cpp" line="229"/>
<source>&amp;Preferences</source>
<translation>&amp;Настройки</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="254"/>
<location filename="../systrayx.cpp" line="233"/>
<source>&amp;About</source>
<translation>&amp;О приложении</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="258"/>
<location filename="../systrayx.cpp" line="237"/>
<source>&amp;Quit</source>
<translation>&amp;Выход</translation>
</message>
<message>
<location filename="../systrayx.cpp" line="692"/>
<location filename="../systrayx.cpp" line="671"/>
<source>Close</source>
<translation>Закрыть</translation>
</message>

View File

@@ -0,0 +1,168 @@
#include "nativeeventfilter-x11.h"
/*
* System includes
*/
/*
* Qt includes
*/
#include <QX11Info>
#include <QKeySequence>
/*
* Define the statics
*/
const QVector< int > NativeEventFilterX11::m_special_modifiers = { 0, Mod2Mask, LockMask, ( Mod2Mask | LockMask ) };
const int NativeEventFilterX11::m_valid_mods_mask = ShiftMask | ControlMask | Mod1Mask | Mod4Mask;
/*
* Catch the key press
*/
bool NativeEventFilterX11::nativeEventFilter( const QByteArray& eventType, void* message, long* result )
{
Q_UNUSED( eventType )
Q_UNUSED( result )
xcb_generic_event_t* generic_event = static_cast< xcb_generic_event_t* >( message );
if( generic_event->response_type == XCB_KEY_PRESS )
{
xcb_key_press_event_t key_press_event = *static_cast< xcb_key_press_event_t* >( message );
if( m_key_code_x11 == key_press_event.detail &&
m_key_modifiers_x11 == key_press_event.state & NativeEventFilterX11::m_valid_mods_mask )
{
activated();
}
}
return false;
}
/*
* Connect the shortcut key
*/
bool NativeEventFilterX11::connectShortcut( QKeySequence key_seq )
{
Qt::Key key_code = Qt::Key( key_seq[ 0 ] & static_cast< int >( ~Qt::KeyboardModifierMask ) );
Qt::KeyboardModifiers key_modifiers = Qt::KeyboardModifiers( key_seq[ 0 ] & static_cast<int>( Qt::KeyboardModifierMask ) );
return connectShortcut( key_code, key_modifiers );
}
/*
* Connect the shortcut key
*/
bool NativeEventFilterX11::connectShortcut( Qt::Key key_code, Qt::KeyboardModifiers key_modifiers )
{
/*
* Convert the Qt key code to a X11 key code
*/
QString key_string;
switch( key_code )
{
case Qt::Key_MediaLast :
case Qt::Key_MediaPrevious :
key_string = "XF86AudioPrev";
break;
case Qt::Key_MediaNext :
key_string = "XF86AudioNext";
break;
case Qt::Key_MediaPause :
case Qt::Key_MediaPlay :
case Qt::Key_MediaTogglePlayPause :
key_string = "XF86AudioPlay";
break;
case Qt::Key_MediaRecord :
key_string = "XF86AudioRecord";
break;
case Qt::Key_MediaStop :
key_string = "XF86AudioStop";
break;
default :
key_string = QKeySequence( key_code ).toString();
}
KeySym key_sym = XStringToKeysym( key_string.toLocal8Bit().constData() );
if( key_sym == NoSymbol )
{
if( key_code <= 0xffff )
{
// Bad conversion, use only the key
key_sym = key_code;
}
else
{
// Cannot decode the key
return false;
}
}
/*
* Convert the Qt key modifiers to X11 key modifiers
*/
m_key_modifiers_x11 = 0;
if( key_modifiers & Qt::ShiftModifier )
{
m_key_modifiers_x11 |= ShiftMask;
}
if( key_modifiers & Qt::ControlModifier )
{
m_key_modifiers_x11 |= ControlMask;
}
if( key_modifiers & Qt::AltModifier )
{
m_key_modifiers_x11 |= Mod1Mask;
}
if( key_modifiers & Qt::MetaModifier )
{
m_key_modifiers_x11 |= Mod4Mask;
}
/*
* Get the X11 display
*/
Display *display = QX11Info::display();
/*
* Get the final key code
*/
m_key_code_x11 = XKeysymToKeycode( display, key_sym );
/*
* Grab the key
*/
for( int special_mod : NativeEventFilterX11::m_special_modifiers )
{
XGrabKey( display, m_key_code_x11, m_key_modifiers_x11 | special_mod, XDefaultRootWindow( display ), True, GrabModeAsync, GrabModeAsync );
}
XSync( display, False );
return true;
}
/*
* Disconnect the shortcut key
*/
bool NativeEventFilterX11::disconnectShortcut()
{
Display* display = QX11Info::display();
/*
* Ungrab the key
*/
for( int special_mod : NativeEventFilterX11::m_special_modifiers )
{
XUngrabKey( display, m_key_code_x11, m_key_modifiers_x11 | special_mod, XDefaultRootWindow( display ) );
}
XSync( display, False );
return true;
}

View File

@@ -0,0 +1,90 @@
#ifndef NATIVEEVENTFILTERX11_H
#define NATIVEEVENTFILTERX11_H
/*
* Local includes
*/
#include "nativeeventfilterbase.h"
/*
* System includes
*/
#include <X11/Xlib.h>
/*
* Qt includes
*/
/**
* @brief The NativeEventFilterX11 class
*/
class NativeEventFilterX11 : public NativeEventFilterBase
{
public:
/**
* @brief nativeEventFilter. Set the native event filter to catch the key press.
*
* @param eventType Event type to handle.
* @param message Message to handle.
* @param result Result to handle.
*
* @return Result
*/
bool nativeEventFilter( const QByteArray& eventType, void* message, long* result ) override;
protected:
/**
* @brief connectShortcut. Connect the shortcut to the system.
*
* @param key_seq Key sequence to connect.
*
* @return Succeeded?
*/
bool connectShortcut( QKeySequence key_seq );
/**
* @brief connectShortcut. Connect the shortcut to the system.
*
* @param key_code Qt key code to connect.
* @param key_modifiers Qt key modifiers to connect.
*
* @return Succeeded?
*/
bool connectShortcut( Qt::Key key_code, Qt::KeyboardModifiers key_modifiers );
/**
* @brief disconnectShortcut. Disconnect the shortcut.
*
* @return Succeeded?
*/
bool disconnectShortcut();
private:
/**
* @brief m_key_modifiers_x11. Storage for the X11 key modifiers.
*/
int m_key_modifiers_x11;
/**
* @brief m_key_code_x11. Storage for the X11 key code.
*/
KeyCode m_key_code_x11;
/**
* @brief m_special_modifiers. Storage for the special modifiers.
*/
static const QVector< int > m_special_modifiers;
/**
* @brief m_valid_mods_mask. Storage for the valid modifiers mask.
*/
static const int m_valid_mods_mask;
};
SINGLETON( NativeEventFilterX11 )
#endif // NATIVEEVENTFILTERX11_H

View File

@@ -0,0 +1,74 @@
#include "nativeeventfilterbase.h"
/*
* Local includes
*/
#include "shortcut.h"
/*
* System includes
*/
/*
* Qt includes
*/
#include <QCoreApplication>
#include <QAbstractEventDispatcher>
/*
* Constructor
*/
NativeEventFilterBase::NativeEventFilterBase()
{
/*
* Install the new filter
*/
qApp->eventDispatcher()->installNativeEventFilter( this );
}
/*
* Destructor
*/
NativeEventFilterBase::~NativeEventFilterBase()
{
if( qApp && qApp->eventDispatcher() )
{
/*
* Remove the filter
*/
qApp->eventDispatcher()->removeNativeEventFilter( this );
}
}
/*
* Send the activate signal
*/
void NativeEventFilterBase::activated()
{
emit m_shortcut->activated();
}
/*
* Set the shortcut key
*/
bool NativeEventFilterBase::setShortcut( Shortcut* shortcut )
{
m_shortcut = shortcut;
return connectShortcut( m_shortcut->getKeyCode(), m_shortcut->getKeyModifiers() );
}
/*
* Unset the shortcut key
*/
bool NativeEventFilterBase::unsetShortcut()
{
m_shortcut = nullptr;
return disconnectShortcut();
}

View File

@@ -0,0 +1,97 @@
#ifndef NATIVEEVENTFILTERBASE_H
#define NATIVEEVENTFILTERBASE_H
/*
* Local includes
*/
/*
* System includes
*/
/*
* Qt includes
*/
#include <QObject>
#include <QAbstractNativeEventFilter>
#include <QGlobalStatic>
/*
* Predefines
*/
class Shortcut;
/**
* @brief The NativeEventFilterBase class
*/
class NativeEventFilterBase : public QObject, public QAbstractNativeEventFilter
{
Q_OBJECT
public:
/**
* @brief NativeEventFilterBase. Constructor, destructor.
*/
NativeEventFilterBase();
~NativeEventFilterBase();
/**
* @brief instance. Pointer to the instance.
*
* @return Pointer to the instance.
*/
static NativeEventFilterBase* instance();
/**
* @brief setShortcut. Set a shortcut.
*
* @param shortcut Shortcut to set.
*/
bool setShortcut( Shortcut* shortcut );
/**
* @brief unsetShortcut. Unset a shortcut.
*/
bool unsetShortcut();
protected:
/**
* @brief connectShortcut. Connect the shortcut to the system.
*
* @param key_code The key code to connect.
* @param key_modifiers The modifiers to use.
*
* @return Succeeded?
*/
virtual bool connectShortcut( Qt::Key key_code, Qt::KeyboardModifiers key_modifiers ) = 0;
/**
* @brief disconnectShortcut. Disconnect the shortcut.
*
* @return Succeeded?
*/
virtual bool disconnectShortcut() = 0;
/**
* @brief activated. Shortcut has been activated.
*/
void activated();
private:
/**
* @brief m_shortcut. Shortcut storage.
*/
Shortcut* m_shortcut;
};
#define SINGLETON( ClassName ) Q_GLOBAL_STATIC( ClassName, nativeEventFilterBase ) \
NativeEventFilterBase* NativeEventFilterBase::instance()\
{\
return nativeEventFilterBase;\
}
#endif // NATIVEEVENTFILTERBASE_H

View File

@@ -44,10 +44,8 @@ Preferences::Preferences( QObject *parent ) : QObject( parent )
/*
* Initialize
*/
m_app_pref_changed = false;
m_minimize_type = PREF_MINIMIZE_METHOD_1;
m_close_type = PREF_MINIMIZE_MAIN_CLOSE_CHILDREN_WINDOWS;
m_close_type = PREF_MINIMIZE_MAIN_TRAY_CLOSE_CHILDREN_WINDOWS;
m_minimize_icon_type = PREF_MINIMIZE_TRAY_ICON;
m_startup_type = PREF_START_DEFAULT;
@@ -70,6 +68,7 @@ Preferences::Preferences( QObject *parent ) : QObject( parent )
m_number_size = 10;
m_count_type = PREF_COUNT_UNREAD;
m_startup_delay = 5;
m_api_count_method = false;
m_number_alignment = 4;
m_number_margins = QMargins();
m_new_indicator_type = PREF_NEW_INDICATOR_SHADE;
@@ -91,27 +90,8 @@ Preferences::Preferences( QObject *parent ) : QObject( parent )
m_start_app_args = "";
m_close_app = "";
m_close_app_args = "";
}
/*
* Get the icon mime.
*/
bool Preferences::getAppPrefChanged() const
{
return m_app_pref_changed;
}
/*
* Control the sending of preferences changes to the add-on
*/
void Preferences::setAppPrefChanged( bool state )
{
if( m_app_pref_changed != state )
{
m_app_pref_changed = state;
}
m_show_hide_shortcut = QKeySequence();
}
@@ -941,6 +921,32 @@ void Preferences::setApiCountMethod( bool state )
}
/*
* Get the show / hide shortcut key sequence.
*/
QKeySequence Preferences::getShowHideShortcut() const
{
return m_show_hide_shortcut;
}
/*
* Set the show / hide shortcut key sequence.
*/
void Preferences::setShowHideShortcut( QKeySequence key_seq )
{
if( m_show_hide_shortcut != key_seq )
{
m_show_hide_shortcut = key_seq;
/*
* Tell the world the new preference
*/
emit signalShowHideShortcutChange();
}
}
/*
* Get the debug state.
*/

View File

@@ -13,6 +13,8 @@
#include <QStringList>
#include <QByteArray>
#include <QMargins>
#include <QKeySequence>
/**
* @brief The Preferences class. Class to hold the preferences.
@@ -125,20 +127,6 @@ class Preferences : public QObject
*/
Preferences( QObject *parent = nullptr );
/**
* @brief getAppPrefChanged. Control for sending changes to the add-on.
*
* @return The state
*/
bool getAppPrefChanged() const;
/**
* @brief setAppPrefChanged. Control for sending changes to the add-on.
*
* @param state The state
*/
void setAppPrefChanged( bool state );
/**
* @brief setPlatformOs. Set the platform OS.
*
@@ -587,6 +575,16 @@ class Preferences : public QObject
*/
void setApiCountMethod( bool state );
/**
* @brief getShowHideShortcut. Get the show / hide shortcut key sequence.
*/
QKeySequence getShowHideShortcut() const;
/**
* @brief setShowHideShortcut. Set the show / hide shortcut key sequence.
*/
void setShowHideShortcut( QKeySequence key_seq );
/**
* @brief getDebug. Get the debug windows state.
*
@@ -769,16 +767,16 @@ class Preferences : public QObject
void signalCloseAppArgsChange();
/**
* @brief signalApiCountMethodChange
* @brief signalApiCountMethodChange. Signal the api count method change.
*/
void signalApiCountMethodChange();
private:
/**
* @brief m_app_pref_changed. Control for sending changes to the add-on.
* @brief signalShowHideShortcutChange. Signal the show / hide shortcut key sequence change.
*/
bool m_app_pref_changed;
void signalShowHideShortcutChange();
private:
/**
* @brief m_platform_xx. Platform description.
@@ -964,6 +962,11 @@ class Preferences : public QObject
*/
bool m_api_count_method;
/**
* @brief m_show_hide_shortcut. The show / hide shortcut key sequence.
*/
QKeySequence m_show_hide_shortcut;
/**
* @brief m_debug. Display debug window.
*/

View File

@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>556</width>
<width>608</width>
<height>468</height>
</rect>
</property>
@@ -27,7 +27,7 @@
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabWindows">
<attribute name="title">
@@ -1133,6 +1133,79 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Shortcuts</string>
</attribute>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>11</x>
<y>10</y>
<width>571</width>
<height>58</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_16">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_18">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>Current show / hide shortcut:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="currentShowHideShortcut"/>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>New show / hide shortcut:</string>
</property>
</widget>
</item>
<item>
<widget class="QKeySequenceEdit" name="showHideKeySequenceEdit">
<property name="keySequence">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearShowHideShortcutPushButton">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="tabDebug">
<attribute name="title">
<string>Debug</string>
@@ -1217,13 +1290,13 @@
</resources>
<connections/>
<buttongroups>
<buttongroup name="closeTypeGroup"/>
<buttongroup name="iconTypeGroup"/>
<buttongroup name="minimizeIconTypeGroup"/>
<buttongroup name="minimizeTypeGroup"/>
<buttongroup name="startupTypeGroup"/>
<buttongroup name="defaultIconTypeGroup"/>
<buttongroup name="newIndicatorTypeGroup"/>
<buttongroup name="countTypeGroup"/>
<buttongroup name="minimizeTypeGroup"/>
<buttongroup name="defaultIconTypeGroup"/>
<buttongroup name="startupTypeGroup"/>
<buttongroup name="closeTypeGroup"/>
<buttongroup name="minimizeIconTypeGroup"/>
</buttongroups>
</ui>

View File

@@ -137,6 +137,9 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi
connect( m_ui->startBrowseButton, &QPushButton::clicked, this, &PreferencesDialog::slotStartAppSelect );
connect( m_ui->closeBrowseButton, &QPushButton::clicked, this, &PreferencesDialog::slotCloseAppSelect );
connect( m_ui->showHideKeySequenceEdit, &QKeySequenceEdit::editingFinished, this, &PreferencesDialog::slotTruncateShowHideShortcut );
connect( m_ui->clearShowHideShortcutPushButton, &QPushButton::clicked, this, &PreferencesDialog::slotClearShowHideShortcut );
/*
* Set number color
*/
@@ -180,6 +183,11 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi
setCloseApp( m_pref->getCloseApp() );
setCloseAppArgs( m_pref->getCloseAppArgs() );
/*
* Set the show / hide shortcut
*/
setShowHideShortcut( m_pref->getShowHideShortcut() );
/*
* Dialog on top
*/
@@ -540,6 +548,17 @@ void PreferencesDialog::setApiCountMethod( bool state )
}
/*
* Set the show / hide shortcut
*/
void PreferencesDialog::setShowHideShortcut( QKeySequence key_seq )
{
m_ui->currentShowHideShortcut->setText( key_seq.toString() );
m_ui->showHideKeySequenceEdit->setKeySequence( key_seq );
}
/*
* Handle show dialog signal
*/
@@ -565,11 +584,6 @@ void PreferencesDialog::slotShowDialog()
*/
void PreferencesDialog::slotAccept()
{
/*
* Settings changed by app
*/
m_pref->setAppPrefChanged( true );
/*
* Get all the selected values and store them in the preferences
*/
@@ -604,20 +618,22 @@ void PreferencesDialog::slotAccept()
QString startApp = m_ui->startAppLineEdit->text();
m_pref->setStartApp( startApp );
QString startAppArgs= m_ui->startAppArgsLineEdit->text();
QString startAppArgs = m_ui->startAppArgsLineEdit->text();
m_pref->setStartAppArgs( startAppArgs );
QString closeApp = m_ui->closeAppLineEdit->text();
m_pref->setCloseApp( closeApp );
QString closeAppArgs= m_ui->closeAppArgsLineEdit->text();
QString closeAppArgs = m_ui->closeAppArgsLineEdit->text();
m_pref->setCloseAppArgs( closeAppArgs );
m_pref->setNumberColor( m_number_color );
m_pref->setShowHideShortcut( m_ui->showHideKeySequenceEdit->keySequence() );
m_pref->setDebug( m_ui->debugWindowCheckBox->isChecked() );
/*
* Settings changed by app
*/
m_pref->setAppPrefChanged( false );
emit signalPreferencesChanged();
/*
* Close it
@@ -672,6 +688,8 @@ void PreferencesDialog::slotReject()
setCloseApp( m_pref->getCloseApp() );
setCloseAppArgs( m_pref->getCloseAppArgs() );
setShowHideShortcut( m_pref->getShowHideShortcut() );
setDebug( m_pref->getDebug());
}
@@ -957,6 +975,15 @@ void PreferencesDialog::slotStartupDelayChange()
}
/*
* Handle the API count method change signal
*/
void PreferencesDialog::slotApiCountMethodChange()
{
setApiCountMethod( m_pref->getApiCountMethod() );
}
/*
* Handle the number alignment change
*/
@@ -1030,9 +1057,43 @@ void PreferencesDialog::slotCloseAppArgsChange()
/*
* Handle the API count method change signal
* Handle the show / hide shortcut change signal
*/
void PreferencesDialog::slotApiCountMethodChange()
void PreferencesDialog::slotShowHideShortcutChange()
{
setApiCountMethod( m_pref->getApiCountMethod() );
setShowHideShortcut( m_pref->getShowHideShortcut() );
}
/*
* Handle the edit show / hide shortcut key field
*/
void PreferencesDialog::slotTruncateShowHideShortcut()
{
QKeySequence key_seq = m_ui->showHideKeySequenceEdit->keySequence();
/*
* Workaround for a Qt5 bug in QKeySequenceEdit object, Meta/Win key is not handled correctly.
*/
int value = 0;
if( key_seq[ 0 ] == 16777299 && key_seq.count() > 1 )
{
value = key_seq[ 1 ];
}
else if( !(key_seq[ 0 ] == 16777299 && key_seq.count() == 1) )
{
value = key_seq[ 0 ];
}
QKeySequence shortcut( value );
m_ui->showHideKeySequenceEdit->setKeySequence( shortcut );
}
/*
* Handle the clear show / hide shortcut push button
*/
void PreferencesDialog::slotClearShowHideShortcut()
{
m_ui->showHideKeySequenceEdit->setKeySequence( QKeySequence() );
}

View File

@@ -265,6 +265,13 @@ class PreferencesDialog : public QDialog
*/
void setApiCountMethod( bool state );
/**
* @brief setShowHideShortcut. Set the show / hide shortcut.
*
* @param key_seq The shortcut key sequence.
*/
void setShowHideShortcut( QKeySequence key_seq );
signals:
/**
@@ -279,6 +286,11 @@ class PreferencesDialog : public QDialog
*/
void signalUpdateSysTrayIcon();
/**
* @brief signalPreferencesChanged. The preferences have been changed.
*/
void signalPreferencesChanged();
public slots:
/**
@@ -356,6 +368,11 @@ class PreferencesDialog : public QDialog
*/
void slotStartupDelayChange();
/**
* @brief slotApiCountMethodChange. Slot for handling the API count methid change.
*/
void slotApiCountMethodChange();
/**
* @brief slotShowNumberChange. Slot for handling show number state change.
*/
@@ -417,9 +434,9 @@ class PreferencesDialog : public QDialog
void slotCloseAppArgsChange();
/**
* @brief slotApiCountMethodChange. Slot for handling the API count methid change.
* @brief slotShowHideShortcutChange. Slot for handling a show / hide shortcut change.
*/
void slotApiCountMethodChange();
void slotShowHideShortcutChange();
private slots:
@@ -463,6 +480,16 @@ class PreferencesDialog : public QDialog
*/
void slotCloseAppSelect();
/**
* @brief slotTruncateShowHideShortcut. Handle the edit show / hide shortcut key field.
*/
void slotTruncateShowHideShortcut();
/**
* @brief slotClearShowHideShortcut. Handle the clear show / hide shortcut button.
*/
void slotClearShowHideShortcut();
private:
/**

View File

@@ -0,0 +1,86 @@
#include "shortcut.h"
/*
* Local includes
*/
#include "nativeeventfilterbase.h"
/*
* Constructor
*/
Shortcut::Shortcut( QObject *parent )
: QObject( parent )
{
}
/*
* Constructor with arguments
*/
Shortcut::Shortcut( QKeySequence key_seq, QObject *parent ) :
Shortcut( parent )
{
setShortcut( key_seq );
}
/*
* Constructor with arguments
*/
Shortcut::Shortcut( Qt::Key key_code, Qt::KeyboardModifiers key_modifiers, QObject *parent ) :
Shortcut( parent )
{
setShortcut( key_code, key_modifiers );
}
/*
* Destructor
*/
Shortcut::~Shortcut()
{
NativeEventFilterBase::instance()->unsetShortcut();
}
/*
* Set the shortcut
*/
bool Shortcut::setShortcut( QKeySequence key_seq )
{
Qt::Key key_code = Qt::Key( key_seq[ 0 ] & ~Qt::KeyboardModifierMask );
Qt::KeyboardModifiers key_modifiers = Qt::KeyboardModifiers( key_seq[ 0 ] & Qt::KeyboardModifierMask);
return setShortcut( key_code, key_modifiers );
}
/*
* Set the shortcut
*/
bool Shortcut::setShortcut( Qt::Key key_code, Qt::KeyboardModifiers key_modifiers )
{
m_key_code = key_code;
m_key_modifiers = key_modifiers;
return NativeEventFilterBase::instance()->setShortcut( this );
}
/*
* Get the stored Qt key code
*/
Qt::Key Shortcut::getKeyCode()
{
return m_key_code;
}
/*
* Get the stored Qt key modifiers
*/
Qt::KeyboardModifiers Shortcut::getKeyModifiers()
{
return m_key_modifiers;
}

View File

@@ -0,0 +1,112 @@
#ifndef SHORTCUT_H
#define SHORTCUT_H
/*
* Local includes
*/
#include "nativeeventfilterbase.h"
/*
* Qt includes
*/
#include <QObject>
#include <QKeySequence>
/**
* @brief The Shortcut class
*/
class Shortcut : public QObject
{
Q_OBJECT
private:
/**
* @brief NativeEventFilterBase. Singleton friend class.
*/
friend class NativeEventFilterBase;
public:
/**
* @brief Shortcut. Constructor, destructor.
*
* @param parent Parent object.
*/
explicit Shortcut( QObject* parent = nullptr );
~Shortcut() override;
/**
* @brief Shortcut Constructor with arguments.
*
* @param key_seq The Qt key sequence for the shortcut.
* @param parent The parent object.
*/
explicit Shortcut( QKeySequence key_seq, QObject* parent = nullptr );
/**
* @brief Shortcut. Constructor with arguments.
*
* @param keyCode The Qt key code for the shortcut.
* @param modifiers The Qt key modifiers for the shortcut.
* @param parent The parent object.
*/
explicit Shortcut( Qt::Key keyCode, Qt::KeyboardModifiers modifiers, QObject* parent = nullptr );
/**
* @brief getKeyCode. Get the stored key code.
*
* @return The key code.
*/
Qt::Key getKeyCode();
/**
* @brief getKeyModifiers. Get the stored key modifiers.
*
* @return The key modifiers.
*/
Qt::KeyboardModifiers getKeyModifiers();
private:
/**
* @brief setShortcut. Set the shortcut.
*
* @param key_seq The Qt keysequence to use.
*
* @return Succeeded?
*/
bool setShortcut( QKeySequence key_seq );
/**
* @brief setShortcut. Set the shortcut.
*
* @param key_code The Qt key code to use.
* @param key_modifiers The Qt key modifiers to use.
*
* @return Succeeded?
*/
bool setShortcut( Qt::Key key_code, Qt::KeyboardModifiers key_modifiers );
signals:
/**
* @brief activated. Signal send when activated.
*/
void activated();
private:
/**
* @brief m_key_code. Storage for the key code.
*/
Qt::Key m_key_code;
/**
* @brief m_key_modifiers. Storage for the key modifiers.
*/
Qt::KeyboardModifiers m_key_modifiers;
};
#endif // SHORTCUT_H

View File

@@ -9,6 +9,7 @@
#include "systrayxicon.h"
#include "systrayxstatusnotifier.h"
#include "windowctrl.h"
#include "shortcut.h"
/*
* Qt includes
@@ -43,6 +44,8 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
m_new_mail = 0;
m_locale = QString();
m_show_hide_shortcut = nullptr;
/*
* Setup preferences storage
*/
@@ -105,8 +108,6 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
#endif
connect( this, &SysTrayX::signalConsole, m_debug, &DebugWidget::slotConsole );
/*
* Connect preferences signals
*/
@@ -128,6 +129,7 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
connect( m_preferences, &Preferences::signalShowNumberChange, m_pref_dialog, &PreferencesDialog::slotShowNumberChange );
connect( m_preferences, &Preferences::signalShowNewIndicatorChange, m_pref_dialog, &PreferencesDialog::slotShowNewIndicatorChange );
connect( m_preferences, &Preferences::signalStartupDelayChange, m_pref_dialog, &PreferencesDialog::slotStartupDelayChange );
connect( m_preferences, &Preferences::signalApiCountMethodChange, m_pref_dialog, &PreferencesDialog::slotApiCountMethodChange );
connect( m_preferences, &Preferences::signalCountTypeChange, m_pref_dialog, &PreferencesDialog::slotCountTypeChange );
connect( m_preferences, &Preferences::signalNumberColorChange, m_pref_dialog, &PreferencesDialog::slotNumberColorChange );
connect( m_preferences, &Preferences::signalNumberSizeChange, m_pref_dialog, &PreferencesDialog::slotNumberSizeChange );
@@ -139,37 +141,13 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
connect( m_preferences, &Preferences::signalStartAppArgsChange, m_pref_dialog, &PreferencesDialog::slotStartAppArgsChange );
connect( m_preferences, &Preferences::signalCloseAppChange, m_pref_dialog, &PreferencesDialog::slotCloseAppChange );
connect( m_preferences, &Preferences::signalCloseAppArgsChange, m_pref_dialog, &PreferencesDialog::slotCloseAppArgsChange );
connect( m_preferences, &Preferences::signalApiCountMethodChange, m_pref_dialog, &PreferencesDialog::slotApiCountMethodChange );
connect( m_preferences, &Preferences::signalShowHideShortcutChange, m_pref_dialog, &PreferencesDialog::slotShowHideShortcutChange );
connect( m_preferences, &Preferences::signalDebugChange, m_pref_dialog, &PreferencesDialog::slotDebugChange );
connect( m_preferences, &Preferences::signalDefaultIconTypeChange, m_link, &SysTrayXLink::slotDefaultIconTypeChange );
connect( m_preferences, &Preferences::signalDefaultIconDataChange, m_link, &SysTrayXLink::slotDefaultIconDataChange );
connect( m_preferences, &Preferences::signalHideDefaultIconChange, m_link, &SysTrayXLink::slotHideDefaultIconChange );
connect( m_preferences, &Preferences::signalIconTypeChange, m_link, &SysTrayXLink::slotIconTypeChange );
connect( m_preferences, &Preferences::signalIconDataChange, m_link, &SysTrayXLink::slotIconDataChange );
connect( m_preferences, &Preferences::signalMinimizeTypeChange, m_link, &SysTrayXLink::slotMinimizeTypeChange );
connect( m_preferences, &Preferences::signalMinimizeIconTypeChange, m_link, &SysTrayXLink::slotMinimizeIconTypeChange );
connect( m_preferences, &Preferences::signalStartupTypeChange, m_link, &SysTrayXLink::slotStartupTypeChange );
connect( m_preferences, &Preferences::signalRestoreWindowPositionsChange, m_link, &SysTrayXLink::slotRestoreWindowPositionsChange );
connect( m_preferences, &Preferences::signalCloseTypeChange, m_link, &SysTrayXLink::slotCloseTypeChange );
connect( m_preferences, &Preferences::signalInvertIconChange, m_link, &SysTrayXLink::slotInvertIconChange );
connect( m_preferences, &Preferences::signalShowNumberChange, m_link, &SysTrayXLink::slotShowNumberChange );
connect( m_preferences, &Preferences::signalShowNewIndicatorChange, m_link, &SysTrayXLink::slotShowNewIndicatorChange );
connect( m_preferences, &Preferences::signalStartupDelayChange, m_link, &SysTrayXLink::slotStartupDelayChange );
connect( m_preferences, &Preferences::signalCountTypeChange, m_link, &SysTrayXLink::slotCountTypeChange );
connect( m_preferences, &Preferences::signalNumberColorChange, m_link, &SysTrayXLink::slotNumberColorChange );
connect( m_preferences, &Preferences::signalNumberSizeChange, m_link, &SysTrayXLink::slotNumberSizeChange );
connect( m_preferences, &Preferences::signalNumberAlignmentChange, m_link, &SysTrayXLink::slotNumberAlignmentChange );
connect( m_preferences, &Preferences::signalNumberMarginsChange, m_link, &SysTrayXLink::slotNumberMarginsChange );
connect( m_preferences, &Preferences::signalNewIndicatorTypeChange, m_link, &SysTrayXLink::slotNewIndicatorTypeChange );
connect( m_preferences, &Preferences::signalNewShadeColorChange, m_link, &SysTrayXLink::slotNewShadeColorChange );
connect( m_preferences, &Preferences::signalStartAppChange, m_link, &SysTrayXLink::slotStartAppChange );
connect( m_preferences, &Preferences::signalStartAppArgsChange, m_link, &SysTrayXLink::slotStartAppArgsChange );
connect( m_preferences, &Preferences::signalCloseAppChange, m_link, &SysTrayXLink::slotCloseAppChange );
connect( m_preferences, &Preferences::signalCloseAppArgsChange, m_link, &SysTrayXLink::slotCloseAppArgsChange );
connect( m_preferences, &Preferences::signalApiCountMethodChange, m_link, &SysTrayXLink::slotApiCountMethodChange );
connect( m_preferences, &Preferences::signalDebugChange, m_link, &SysTrayXLink::slotDebugChange );
connect( m_pref_dialog, &PreferencesDialog::signalPreferencesChanged, m_link, &SysTrayXLink::slotPreferencesChanged );
connect( m_preferences, &Preferences::signalHideDefaultIconChange, this, &SysTrayX::slotSelectIconObjectPref );
connect( m_preferences, &Preferences::signalShowHideShortcutChange, this, &SysTrayX::slotShowHideShortcutChange );
connect( m_preferences, &Preferences::signalDebugChange, m_debug, &DebugWidget::slotDebugChange );
@@ -209,6 +187,7 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
/*
m_preferences->setBrowserVersion( "115.1.0" );
// m_preferences->setBrowserVersion( "102.2.3" );
slotLoadLanguage( "en-US" );
//slotLoadLanguage( "it" );
//slotLoadLanguage( "nl" );
@@ -217,11 +196,11 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
slotSelectIconObject( true );
slotMailCount( 10, 1 );
*/
// m_preferences->setStartApp( "/home/maxime/test.sh" );
// m_preferences->setStartAppArgs( "/home/maxime/startup.txt StartupString" );
// slotStartApp();
*/
}
@@ -793,3 +772,16 @@ void SysTrayX::slotCloseApp()
}
}
void SysTrayX::slotShowHideShortcutChange()
{
if( m_show_hide_shortcut != nullptr )
{
disconnect( m_show_hide_shortcut, &Shortcut::activated, m_win_ctrl, &WindowCtrl::slotShowHide );
delete m_show_hide_shortcut;
m_show_hide_shortcut = nullptr;
}
m_show_hide_shortcut = new Shortcut( m_preferences->getShowHideShortcut(), this );
connect( m_show_hide_shortcut, &Shortcut::activated, m_win_ctrl, &WindowCtrl::slotShowHide );
}

View File

@@ -28,6 +28,9 @@ class WindowCtrl;
class SysTrayXStatusNotifier;
class Shortcut;
/**
* @brief The SysTrayX class
*/
@@ -185,6 +188,11 @@ class SysTrayX : public QObject
*/
void slotVersion( QString version );
/**
* @brief slotShowHideShortcutChange. Handle a show / hide shortcut change.
*/
void slotShowHideShortcutChange();
private:
/**
@@ -254,6 +262,11 @@ class SysTrayX : public QObject
* @brief m_locale. Storage for the current locale.
*/
QString m_locale;
/**
* @brief m_show_hide_shortcut. Storage for the show / hide shortcut.
*/
Shortcut* m_show_hide_shortcut;
};
#endif // SYSTRAYX_H

View File

@@ -796,6 +796,16 @@ void SysTrayXLink::DecodePreferences( const QJsonObject& pref )
m_pref->setStartupDelay( startup_delay );
}
if( pref.contains( "apiCountMethod" ) && pref[ "apiCountMethod" ].isString() )
{
bool api_count_method = pref[ "apiCountMethod" ].toString() == "true";
/*
* Store the new API cont method state
*/
m_pref->setApiCountMethod( api_count_method );
}
if( pref.contains( "minimizeType" ) && pref[ "minimizeType" ].isString() )
{
Preferences::MinimizeType minimize_type = static_cast< Preferences::MinimizeType >( pref[ "minimizeType" ].toString().toInt() );
@@ -896,14 +906,14 @@ void SysTrayXLink::DecodePreferences( const QJsonObject& pref )
m_pref->setCloseAppArgs( args );
}
if( pref.contains( "apiCountMethod" ) && pref[ "apiCountMethod" ].isString() )
if( pref.contains( "showHideShortcut" ) && pref[ "showHideShortcut" ].isString() )
{
bool api_count_method = pref[ "apiCountMethod" ].toString() == "true";
QString shortcut = pref[ "showHideShortcut" ].toString();
/*
* Store the new API cont method state
* Store the new shortcut
*/
m_pref->setApiCountMethod( api_count_method );
m_pref->setShowHideShortcut( QKeySequence::fromString( shortcut ) );
}
if( pref.contains( "debug" ) && pref[ "debug" ].isString() )
@@ -957,44 +967,46 @@ void SysTrayXLink::EncodePreferences( const Preferences& pref )
* Setup the preferences JSON
*/
QJsonObject prefObject;
prefObject.insert("debug", QJsonValue::fromVariant( QString( pref.getDebug() ? "true" : "false" ) ) );
prefObject.insert("minimizeType", QJsonValue::fromVariant( QString::number( pref.getMinimizeType() ) ) );
prefObject.insert("minimizeIconType", QJsonValue::fromVariant( QString::number( pref.getMinimizeIconType() ) ) );
prefObject.insert("startupType", QJsonValue::fromVariant( QString::number( pref.getStartupType() ) ) );
prefObject.insert("restorePositions", QJsonValue::fromVariant( QString( pref.getRestoreWindowPositions() ? "true" : "false" ) ) );
prefObject.insert("closeType", QJsonValue::fromVariant( QString::number( pref.getCloseType() ) ) );
prefObject.insert("defaultIconType", QJsonValue::fromVariant( QString::number( pref.getDefaultIconType() ) ) );
prefObject.insert("defaultIconMime", QJsonValue::fromVariant( pref.getDefaultIconMime() ) );
prefObject.insert("defaultIcon", QJsonValue::fromVariant( QString( pref.getDefaultIconData().toBase64() ) ) );
prefObject.insert("hideDefaultIcon", QJsonValue::fromVariant( QString( pref.getHideDefaultIcon() ? "true" : "false" ) ) );
prefObject.insert("iconType", QJsonValue::fromVariant( QString::number( pref.getIconType() ) ) );
prefObject.insert("iconMime", QJsonValue::fromVariant( pref.getIconMime() ) );
prefObject.insert("icon", QJsonValue::fromVariant( QString( pref.getIconData().toBase64() ) ) );
prefObject.insert("invertIcon", QJsonValue::fromVariant( QString( pref.getInvertIcon() ? "true" : "false" ) ) );
prefObject.insert("showNumber", QJsonValue::fromVariant( QString( pref.getShowNumber() ? "true" : "false" ) ) );
prefObject.insert("showNewIndicator", QJsonValue::fromVariant( QString( pref.getShowNewIndicator() ? "true" : "false" ) ) );
prefObject.insert("numberColor", QJsonValue::fromVariant( QString( pref.getNumberColor() ) ) );
prefObject.insert("numberSize", QJsonValue::fromVariant( QString::number( pref.getNumberSize() ) ) );
prefObject.insert("numberAlignment", QJsonValue::fromVariant( QString::number( pref.getNumberAlignment() ) ) );
prefObject.insert( "debug", QJsonValue::fromVariant( QString( pref.getDebug() ? "true" : "false" ) ) );
prefObject.insert( "minimizeType", QJsonValue::fromVariant( QString::number( pref.getMinimizeType() ) ) );
prefObject.insert( "minimizeIconType", QJsonValue::fromVariant( QString::number( pref.getMinimizeIconType() ) ) );
prefObject.insert( "startupType", QJsonValue::fromVariant( QString::number( pref.getStartupType() ) ) );
prefObject.insert( "restorePositions", QJsonValue::fromVariant( QString( pref.getRestoreWindowPositions() ? "true" : "false" ) ) );
prefObject.insert( "closeType", QJsonValue::fromVariant( QString::number( pref.getCloseType() ) ) );
prefObject.insert( "defaultIconType", QJsonValue::fromVariant( QString::number( pref.getDefaultIconType() ) ) );
prefObject.insert( "defaultIconMime", QJsonValue::fromVariant( pref.getDefaultIconMime() ) );
prefObject.insert( "defaultIcon", QJsonValue::fromVariant( QString( pref.getDefaultIconData().toBase64() ) ) );
prefObject.insert( "hideDefaultIcon", QJsonValue::fromVariant( QString( pref.getHideDefaultIcon() ? "true" : "false" ) ) );
prefObject.insert( "iconType", QJsonValue::fromVariant( QString::number( pref.getIconType() ) ) );
prefObject.insert( "iconMime", QJsonValue::fromVariant( pref.getIconMime() ) );
prefObject.insert( "icon", QJsonValue::fromVariant( QString( pref.getIconData().toBase64() ) ) );
prefObject.insert( "invertIcon", QJsonValue::fromVariant( QString( pref.getInvertIcon() ? "true" : "false" ) ) );
prefObject.insert( "showNumber", QJsonValue::fromVariant( QString( pref.getShowNumber() ? "true" : "false" ) ) );
prefObject.insert( "showNewIndicator", QJsonValue::fromVariant( QString( pref.getShowNewIndicator() ? "true" : "false" ) ) );
prefObject.insert( "numberColor", QJsonValue::fromVariant( QString( pref.getNumberColor() ) ) );
prefObject.insert( "numberSize", QJsonValue::fromVariant( QString::number( pref.getNumberSize() ) ) );
prefObject.insert( "numberAlignment", QJsonValue::fromVariant( QString::number( pref.getNumberAlignment() ) ) );
QJsonObject marginsObject;
marginsObject.insert("left", QJsonValue::fromVariant( QString::number( pref.getNumberMargins().left() ) ) );
marginsObject.insert("top", QJsonValue::fromVariant( QString::number( pref.getNumberMargins().top() ) ) );
marginsObject.insert("right", QJsonValue::fromVariant( QString::number( pref.getNumberMargins().right() ) ) );
marginsObject.insert("bottom", QJsonValue::fromVariant( QString::number( pref.getNumberMargins().bottom() ) ) );
marginsObject.insert( "left", QJsonValue::fromVariant( QString::number( pref.getNumberMargins().left() ) ) );
marginsObject.insert( "top", QJsonValue::fromVariant( QString::number( pref.getNumberMargins().top() ) ) );
marginsObject.insert( "right", QJsonValue::fromVariant( QString::number( pref.getNumberMargins().right() ) ) );
marginsObject.insert( "bottom", QJsonValue::fromVariant( QString::number( pref.getNumberMargins().bottom() ) ) );
prefObject.insert("numberMargins", marginsObject );
prefObject.insert("countType", QJsonValue::fromVariant( QString::number( pref.getCountType() ) ) );
prefObject.insert("startupDelay", QJsonValue::fromVariant( QString::number( pref.getStartupDelay() ) ) );
prefObject.insert("apiCountMethod", QJsonValue::fromVariant( QString( pref.getApiCountMethod() ? "true" : "false" ) ) );
prefObject.insert( "numberMargins", marginsObject );
prefObject.insert( "countType", QJsonValue::fromVariant( QString::number( pref.getCountType() ) ) );
prefObject.insert( "startupDelay", QJsonValue::fromVariant( QString::number( pref.getStartupDelay() ) ) );
prefObject.insert( "apiCountMethod", QJsonValue::fromVariant( QString( pref.getApiCountMethod() ? "true" : "false" ) ) );
prefObject.insert("startApp", QJsonValue::fromVariant( pref.getStartApp() ) );
prefObject.insert("startAppArgs", QJsonValue::fromVariant( pref.getStartAppArgs() ) );
prefObject.insert("closeApp", QJsonValue::fromVariant( pref.getCloseApp() ) );
prefObject.insert("closeAppArgs", QJsonValue::fromVariant( pref.getCloseAppArgs() ) );
prefObject.insert( "startApp", QJsonValue::fromVariant( pref.getStartApp() ) );
prefObject.insert( "startAppArgs", QJsonValue::fromVariant( pref.getStartAppArgs() ) );
prefObject.insert( "closeApp", QJsonValue::fromVariant( pref.getCloseApp() ) );
prefObject.insert( "closeAppArgs", QJsonValue::fromVariant( pref.getCloseAppArgs() ) );
prefObject.insert( "showHideShortcut", QJsonValue::fromVariant( pref.getShowHideShortcut().toString() ) );
QJsonObject preferencesObject;
preferencesObject.insert("preferences", prefObject );
preferencesObject.insert( "preferences", prefObject );
/*
* Store the new document
@@ -1029,328 +1041,14 @@ void SysTrayXLink::slotLinkRead( QByteArray message )
*/
void SysTrayXLink::slotPositions( QList< QPoint > positions )
{
sendPositions( positions );
sendPositions( positions );
}
/*
* Handle a restore window positions state change signal
* Handle a preferences changed signal
*/
void SysTrayXLink::slotRestoreWindowPositionsChange()
void SysTrayXLink::slotPreferencesChanged()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle the minimize type change signal
*/
void SysTrayXLink::slotMinimizeTypeChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle the minimize icon type change signal
*/
void SysTrayXLink::slotMinimizeIconTypeChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a startup type change signal
*/
void SysTrayXLink::slotStartupTypeChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a close type change signal
*/
void SysTrayXLink::slotCloseTypeChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle the default icon type change signal
*/
void SysTrayXLink::slotDefaultIconTypeChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle the default icon data change signal
*/
void SysTrayXLink::slotDefaultIconDataChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle the hide default icon change signal
*/
void SysTrayXLink::slotHideDefaultIconChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle the icon type change signal
*/
void SysTrayXLink::slotIconTypeChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle the icon data change signal
*/
void SysTrayXLink::slotIconDataChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a invert icon change signal
*/
void SysTrayXLink::slotInvertIconChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a show number state change signal
*/
void SysTrayXLink::slotShowNumberChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a show new indicator state change signal
*/
void SysTrayXLink::slotShowNewIndicatorChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle the count type change signal
*/
void SysTrayXLink::slotCountTypeChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a startup delay change signal
*/
void SysTrayXLink::slotStartupDelayChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a number color change signal
*/
void SysTrayXLink::slotNumberColorChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a number size change signal
*/
void SysTrayXLink::slotNumberSizeChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a number alignment change signal
*/
void SysTrayXLink::slotNumberAlignmentChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a number margins change signal
*/
void SysTrayXLink::slotNumberMarginsChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle the new indicator type change signal
*/
void SysTrayXLink::slotNewIndicatorTypeChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle the new shade color change signal
*/
void SysTrayXLink::slotNewShadeColorChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a start application change signal
*/
void SysTrayXLink::slotStartAppChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a start application arguments change signal
*/
void SysTrayXLink::slotStartAppArgsChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a close application change signal
*/
void SysTrayXLink::slotCloseAppChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a close application arguments change signal
*/
void SysTrayXLink::slotCloseAppArgsChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a API count method change signal
*/
void SysTrayXLink::slotApiCountMethodChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
}
/*
* Handle a debug state change signal
*/
void SysTrayXLink::slotDebugChange()
{
if( m_pref->getAppPrefChanged() )
{
sendPreferences();
}
sendPreferences();
}

View File

@@ -268,145 +268,15 @@ class SysTrayXLink : public QObject
public slots:
/**
* @brief slotDebugChange. Handle a change in debug state.
*/
void slotDebugChange();
/**
* @brief slotPositions. Slot for handling a window positions change.
*/
void slotPositions( QList< QPoint > positions );
/**
* @brief slotRestoreWindowPositionsChange. Handle a change in restore window positions state.
* @brief slotPreferencesChanged
*/
void slotRestoreWindowPositionsChange();
/**
* @brief slotMinimizeTypeChange. Slot for handling minimize type change signals.
*/
void slotMinimizeTypeChange();
/**
* @brief slotMinimizeIconTypeChange. Slot for handling minimize icon type change signals.
*/
void slotMinimizeIconTypeChange();
/**
* @brief slotStartupTypeChange. Handle a change in startup type.
*/
void slotStartupTypeChange();
/**
* @brief slotCloseTypeChange. Slot for handling close type change signals.
*/
void slotCloseTypeChange();
/**
* @brief slotDefaultIconTypeChange. Slot for handling default icon type change signals.
*/
void slotDefaultIconTypeChange();
/**
* @brief slotDefaultIconDataChange. Slot for handling default icon data change signals.
*/
void slotDefaultIconDataChange();
/**
* @brief slotHideDefaultIconChange. Slot for handling hide default icon change signals.
*/
void slotHideDefaultIconChange();
/**
* @brief slotIconTypeChange. Slot for handling icon type change signals.
*/
void slotIconTypeChange();
/**
* @brief slotIconDataChange. Slot for handling icon data change signals.
*/
void slotIconDataChange();
/**
* @brief slotInvertIconChange. Slot for handling invert icon change signals.
*/
void slotInvertIconChange();
/**
* @brief slotShowNumberChange. Handle a change in show number state.
*/
void slotShowNumberChange();
/**
* @brief slotShowNewIndicatorChange. Handle a change in show new indicator state.
*/
void slotShowNewIndicatorChange();
/**
* @brief slotCountTypeChange. Slot for handling count type change signals.
*/
void slotCountTypeChange();
/**
* @brief slotStartupDelayChange. Handle a change in startup delay.
*/
void slotStartupDelayChange();
/**
* @brief slotNumberColorChange. Handle a change in number color.
*/
void slotNumberColorChange();
/**
* @brief slotNumberSizeChange. Handle a change in number size.
*/
void slotNumberSizeChange();
/**
* @brief slotNumberAlignmentChange. Handle a change in number alignment.
*/
void slotNumberAlignmentChange();
/**
* @brief slotNumberMarginsChange. Handle a change in number margins.
*/
void slotNumberMarginsChange();
/**
* @brief slotNewIndicatorTypeChange. Slot for handling new indicator type change signals.
*/
void slotNewIndicatorTypeChange();
/**
* @brief slotNewShadeColorChange. Handle a change in new shade color.
*/
void slotNewShadeColorChange();
/**
* @brief slotStartAppChange. Slot for handling start application change signals.
*/
void slotStartAppChange();
/**
* @brief slotStartAppArgsChange. Slot for handling start application arguments change signals.
*/
void slotStartAppArgsChange();
/**
* @brief slotCloseAppChange. Slot for handling close application change signals.
*/
void slotCloseAppChange();
/**
* @brief slotCloseAppArgsChange. Slot for handling close application arguments change signals.
*/
void slotCloseAppArgsChange();
/**
* @brief slotApiCountMethodChange. Slot for handling the API count method change signals.
*/
void slotApiCountMethodChange();
void slotPreferencesChanged();
private slots:

View File

@@ -49,6 +49,11 @@
"description": "Tab for Mail options"
},
"tab_shortcuts": {
"message": "Tastatürkürzel",
"description": "Tab for Shortcuts options"
},
"tab_debug": {
"message": "Debug",
"description": "Tab for Debug options"
@@ -394,6 +399,21 @@
"description": "Title for Accounts options"
},
"shortcuts": {
"message": "Tastatürkürzel",
"description": "Title for Shortcuts options"
},
"shortcuts_showhide_shortcut": {
"message": "Tastenkombination Einblenden / Ausblenden: ",
"description": "Label for the show / hide shortcut edit box"
},
"shortcuts_clear_button": {
"message": "Löschen",
"description": "Clear"
},
"debug": {
"message": "Debug",
"description": "Title for Debug options"

View File

@@ -49,6 +49,11 @@
"description": "Tab for Mail options"
},
"tab_shortcuts": {
"message": "Συντομεύσεις",
"description": "Tab for Shortcuts options"
},
"tab_debug": {
"message": "Αποσφαλμάτωση",
"description": "Tab for Debug options"
@@ -394,6 +399,21 @@
"description": "Title for Accounts options"
},
"shortcuts": {
"message": "Συντομεύσεις",
"description": "Title for Shortcuts options"
},
"shortcuts_showhide_shortcut": {
"message": "Συντόμευση Εμφάνιση / Απόκρυψη: ",
"description": "Label for the show / hide shortcut edit box"
},
"shortcuts_clear_button": {
"message": "Αφαιρώ",
"description": "Clear"
},
"debug": {
"message": "Αποσφαλμάτωση",
"description": "Title for Debug options"

View File

@@ -49,6 +49,11 @@
"description": "Tab for Mail options"
},
"tab_shortcuts": {
"message": "Shortcuts",
"description": "Tab for Shortcuts options"
},
"tab_debug": {
"message": "Debug",
"description": "Tab for Debug options"
@@ -394,6 +399,21 @@
"description": "Title for Accounts options"
},
"shortcuts": {
"message": "Shortcuts",
"description": "Title for Shortcuts options"
},
"shortcuts_showhide_shortcut": {
"message": "Shortcut Show / Hide: ",
"description": "Label for the show / hide shortcut edit box"
},
"shortcuts_clear_button": {
"message": "Clear",
"description": "Clear"
},
"debug": {
"message": "Debug",
"description": "Title for Debug options"

View File

@@ -49,6 +49,11 @@
"description": "Tab for Mail options"
},
"tab_shortcuts": {
"message": "Scorciatoie",
"description": "Tab for Shortcuts options"
},
"tab_debug": {
"message": "Debug",
"description": "Tab for Debug options"
@@ -394,6 +399,21 @@
"description": "Title for Accounts options"
},
"shortcuts": {
"message": "Scorciatoie",
"description": "Title for Shortcuts options"
},
"shortcuts_showhide_shortcut": {
"message": "Scorciatoia Mostra / Nascondi: ",
"description": "Label for the show / hide shortcut edit box"
},
"shortcuts_clear_button": {
"message": "Rimuovi",
"description": "Clear"
},
"debug": {
"message": "Debug",
"description": "Title for Debug options"

View File

@@ -49,6 +49,11 @@
"description": "Tab for Mail options"
},
"tab_shortcuts": {
"message": "Snelkoppelingen",
"description": "Tab for Shortcuts options"
},
"tab_debug": {
"message": "Debug",
"description": "Tab for Debug options"
@@ -394,6 +399,21 @@
"description": "Title for Accounts options"
},
"shortcuts": {
"message": "Snelkoppelingen",
"description": "Title for Shortcuts options"
},
"shortcuts_showhide_shortcut": {
"message": "Snelkoppeling Tonen / Verbergen: ",
"description": "Label for the show / hide shortcut edit box"
},
"shortcuts_clear_button": {
"message": "Verwijderen",
"description": "Clear"
},
"debug": {
"message": "Debug",
"description": "Title for Debug options"

View File

@@ -49,6 +49,11 @@
"description": "Tab for Mail options"
},
"tab_shortcuts": {
"message": "Atalhos",
"description": "Tab for Shortcuts options"
},
"tab_debug": {
"message": "Depuração",
"description": "Tab for Debug options"
@@ -394,6 +399,21 @@
"description": "Title for Accounts options"
},
"shortcuts": {
"message": "Atalhos",
"description": "Title for Shortcuts options"
},
"shortcuts_showhide_shortcut": {
"message": "Atalho Mostrar / Ocultar: ",
"description": "Label for the show / hide shortcut edit box"
},
"shortcuts_clear_button": {
"message": "Remover",
"description": "Clear"
},
"debug": {
"message": "Depuração",
"description": "Title for Debug options"

View File

@@ -49,6 +49,11 @@
"description": "Tab for Mail options"
},
"tab_shortcuts": {
"message": "Сочетания",
"description": "Tab for Shortcuts options"
},
"tab_debug": {
"message": "Отладка",
"description": "Tab for Debug options"
@@ -394,6 +399,21 @@
"description": "Title for Accounts options"
},
"shortcuts": {
"message": "Сочетания",
"description": "Title for Shortcuts options"
},
"shortcuts_showhide_shortcut": {
"message": "Ярлык Показать / Скрыть: ",
"description": "Label for the show / hide shortcut edit box"
},
"shortcuts_clear_button": {
"message": "Удалять",
"description": "Clear"
},
"debug": {
"message": "Отладка",
"description": "Title for Debug options"

View File

@@ -632,6 +632,7 @@ SysTrayX.Messaging = {
"startAppArgs",
"closeApp",
"closeAppArgs",
"showHideShortcut",
])
.then(
SysTrayX.Messaging.sendPreferencesStorage,
@@ -674,6 +675,7 @@ SysTrayX.Messaging = {
const startAppArgs = result.startAppArgs || "";
const closeApp = result.closeApp || "";
const closeAppArgs = result.closeAppArgs || "";
const showHideShortcut = result.showHideShortcut || "";
// Send it to the app
SysTrayX.Link.postSysTrayXMessage({
@@ -707,6 +709,7 @@ SysTrayX.Messaging = {
startAppArgs,
closeApp,
closeAppArgs,
showHideShortcut,
},
});
},
@@ -965,6 +968,13 @@ SysTrayX.Link = {
});
}
const showHideShortcut = response["preferences"].showHideShortcut;
if (showHideShortcut !== undefined) {
await storage().set({
showHideShortcut: showHideShortcut,
});
}
const debug = response["preferences"].debug;
if (debug) {
await storage().set({
@@ -1023,7 +1033,7 @@ SysTrayX.Window = {
async function start() {
// Setup the link first
SysTrayX.Link.init();
// Force close a window using a toolbar button
browser.browserAction.disable();

View File

@@ -32,6 +32,7 @@
<button class="tablinks" id="Count">__MSG_tab_count__</button>
<button class="tablinks" id="Apps">__MSG_tab_apps__</button>
<button class="tablinks" id="Mail">__MSG_tab_mail__</button>
<button class="tablinks" id="Shortcuts">__MSG_tab_shortcuts__</button>
<button class="tablinks" id="Debug">__MSG_tab_debug__</button>
</div>
@@ -668,6 +669,30 @@
<script src="js/options_mailform.js"></script>
</div>
<div id="ShortcutsContent" class="tabcontent">
<form name="shortcutsform">
<h3>__MSG_shortcuts__</h3>
<div id="showhideshortcutinput">
<div>
<label for="showHideShortcutInput" id="showHideShortcutInputLabel">
__MSG_shortcuts_showhide_shortcut__
</label>
<input
type="text"
name="showhideshortcut"
id="showHideShortcutInput"
value=""
/>
<button type="button" name="showhideshortcutsbutton">__MSG_shortcuts_clear_button__</button>
</div>
</div>
</form>
<script src="js/options_shortcutsform.js"></script>
</div>
<div id="DebugContent" class="tabcontent">
<form name="debugform">
<h3>__MSG_debug__</h3>

View File

@@ -322,6 +322,17 @@ SysTrayX.SaveOptions = {
closeAppArgs: closeAppArgs,
});
//
// Save shortcuts
//
const showHideShortcutInput = document.getElementById("showHideShortcutInput");
const showHideShortcut = showHideShortcutInput.value;
// Store show / hide shortcut
await storage().set({
showHideShortcut: showHideShortcut,
});
// Mark add-on preferences changed
await storage().set({
addonprefchanged: true,
@@ -584,26 +595,36 @@ SysTrayX.RestoreOptions = {
SysTrayX.RestoreOptions.onStartAppError
);
await storage()
.get("startAppArgs")
.then(
SysTrayX.RestoreOptions.setStartAppArgs,
SysTrayX.RestoreOptions.onStartAppArgsError
);
await storage()
.get("startAppArgs")
.then(
SysTrayX.RestoreOptions.setStartAppArgs,
SysTrayX.RestoreOptions.onStartAppArgsError
);
await storage()
.get("closeApp")
.then(
SysTrayX.RestoreOptions.setCloseApp,
SysTrayX.RestoreOptions.onCloseAppError
);
await storage()
.get("closeApp")
.then(
SysTrayX.RestoreOptions.setCloseApp,
SysTrayX.RestoreOptions.onCloseAppError
);
await storage()
.get("closeAppArgs")
await storage()
.get("closeAppArgs")
.then(
SysTrayX.RestoreOptions.setCloseAppArgs,
SysTrayX.RestoreOptions.onCloseAppArgsError
);
//
// Restore show / hide shortcut
//
await storage()
.get("showHideShortcut")
.then(
SysTrayX.RestoreOptions.setCloseAppArgs,
SysTrayX.RestoreOptions.onCloseAppArgsError
);
SysTrayX.RestoreOptions.setShowHideShortcut,
SysTrayX.RestoreOptions.onShowHideShortcutError
);
},
//
@@ -1118,6 +1139,20 @@ SysTrayX.RestoreOptions = {
console.log(`CloseAppArgs Error: ${error}`);
},
//
// Restore show / hide shortcut
//
setShowHideShortcut: function (result) {
const showHideShortcut = result.showHideShortcut || "";
const showHideShortcutInput = document.getElementById("showHideShortcutInput");
showHideShortcutInput.value = showHideShortcut;
},
onShowHideShortcutError: function (error) {
console.log(`ShowHideShortcut Error: ${error}`);
},
//
// Restore filters callbacks
//
@@ -1367,6 +1402,11 @@ SysTrayX.StorageChanged = {
closeAppArgs: changes[item].newValue,
});
}
if (item === "showHideShortcut") {
SysTrayX.RestoreOptions.setShowHideShortcut({
showHideShortcut: changes[item].newValue,
});
}
if (item === "filters") {
SysTrayX.RestoreOptions.setFilters({