From 34deeaf154310ee7078c3318cbf20c44603b16ba Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Tue, 22 May 2018 21:45:38 -0500 Subject: [PATCH] Remove pristine-tar files. --- AUTHORS | 13 - CHANGELOG | 559 ------ CMakeLists.txt | 65 - LICENSE | 458 ----- README.md | 77 - liblxqt-config-cursor/CMakeLists.txt | 98 - liblxqt-config-cursor/cfgfile.cpp | 122 -- liblxqt-config-cursor/cfgfile.h | 20 - liblxqt-config-cursor/crtheme.cpp | 276 --- liblxqt-config-cursor/crtheme.h | 119 -- liblxqt-config-cursor/itemdelegate.cpp | 141 -- liblxqt-config-cursor/itemdelegate.h | 48 - liblxqt-config-cursor/main.cpp | 44 - liblxqt-config-cursor/main.h | 19 - liblxqt-config-cursor/man/lxqt-config-mouse.1 | 39 - liblxqt-config-cursor/previewwidget.cpp | 221 --- liblxqt-config-cursor/previewwidget.h | 60 - liblxqt-config-cursor/selectwnd.cpp | 233 --- liblxqt-config-cursor/selectwnd.h | 65 - liblxqt-config-cursor/selectwnd.ui | 114 -- liblxqt-config-cursor/thememodel.cpp | 328 ---- liblxqt-config-cursor/thememodel.h | 116 -- liblxqt-config-cursor/warninglabel.cpp | 43 - liblxqt-config-cursor/warninglabel.h | 47 - liblxqt-config-cursor/warninglabel.ui | 64 - liblxqt-config-cursor/xcr/xcrimg.cpp | 262 --- liblxqt-config-cursor/xcr/xcrimg.h | 116 -- liblxqt-config-cursor/xcr/xcrtheme.cpp | 742 -------- liblxqt-config-cursor/xcr/xcrtheme.h | 97 - liblxqt-config-cursor/xcr/xcrthemefx.cpp | 400 ----- liblxqt-config-cursor/xcr/xcrthemefx.h | 40 - liblxqt-config-cursor/xcr/xcrthemexp.cpp | 352 ---- liblxqt-config-cursor/xcr/xcrthemexp.h | 31 - liblxqt-config-cursor/xcr/xcrxcur.cpp | 248 --- liblxqt-config-cursor/xcr/xcrxcur.h | 40 - lxqt-config-appearance.png | Bin 29640 -> 0 bytes lxqt-config-appearance/CMakeLists.txt | 101 -- lxqt-config-appearance/fontconfigfile.cpp | 236 --- lxqt-config-appearance/fontconfigfile.h | 86 - lxqt-config-appearance/fontsconfig.cpp | 196 -- lxqt-config-appearance/fontsconfig.h | 70 - lxqt-config-appearance/fontsconfig.ui | 261 --- lxqt-config-appearance/iconthemeconfig.cpp | 155 -- lxqt-config-appearance/iconthemeconfig.h | 58 - lxqt-config-appearance/iconthemeconfig.ui | 98 - lxqt-config-appearance/iconthemeinfo.cpp | 80 - lxqt-config-appearance/iconthemeinfo.h | 65 - .../lxqt-config-appearance.desktop.in | 11 - lxqt-config-appearance/lxqtthemeconfig.cpp | 152 -- lxqt-config-appearance/lxqtthemeconfig.h | 59 - lxqt-config-appearance/lxqtthemeconfig.ui | 65 - lxqt-config-appearance/main.cpp | 88 - .../man/lxqt-config-appearance.1 | 50 - lxqt-config-appearance/styleconfig.cpp | 142 -- lxqt-config-appearance/styleconfig.h | 63 - lxqt-config-appearance/styleconfig.ui | 98 - .../lxqt-config-appearance_ar.desktop | 4 - .../lxqt-config-appearance_ca.desktop | 4 - .../lxqt-config-appearance_cs.desktop | 4 - .../lxqt-config-appearance_cs_CZ.desktop | 4 - .../lxqt-config-appearance_da.desktop | 4 - .../lxqt-config-appearance_de.desktop | 3 - .../lxqt-config-appearance_el.desktop | 4 - .../lxqt-config-appearance_eo.desktop | 4 - .../lxqt-config-appearance_es.desktop | 4 - .../lxqt-config-appearance_es_VE.desktop | 4 - .../lxqt-config-appearance_eu.desktop | 4 - .../lxqt-config-appearance_fi.desktop | 4 - .../lxqt-config-appearance_fr.desktop | 4 - .../lxqt-config-appearance_hu.desktop | 4 - .../lxqt-config-appearance_ia.desktop | 1 - .../lxqt-config-appearance_id_ID.desktop | 1 - .../lxqt-config-appearance_it.desktop | 4 - .../lxqt-config-appearance_ja.desktop | 4 - .../lxqt-config-appearance_ko.desktop | 1 - .../lxqt-config-appearance_lt.desktop | 4 - .../lxqt-config-appearance_nl.desktop | 4 - .../lxqt-config-appearance_pl_PL.desktop | 4 - .../lxqt-config-appearance_pt.desktop | 4 - .../lxqt-config-appearance_pt_BR.desktop | 4 - .../lxqt-config-appearance_ro_RO.desktop | 4 - .../lxqt-config-appearance_ru.desktop | 4 - .../lxqt-config-appearance_sk.desktop | 4 - .../lxqt-config-appearance_sl.desktop | 4 - .../lxqt-config-appearance_sr.desktop | 4 - ...xqt-config-appearance_sr@ijekavian.desktop | 3 - ...onfig-appearance_sr@ijekavianlatin.desktop | 3 - .../lxqt-config-appearance_sr@latin.desktop | 4 - .../lxqt-config-appearance_th_TH.desktop | 4 - .../lxqt-config-appearance_tr.desktop | 4 - .../lxqt-config-appearance_uk.desktop | 4 - ...xqt-config-appearance_zh_CN.GB2312.desktop | 1 - .../lxqt-config-appearance_zh_CN.desktop | 4 - .../lxqt-config-appearance_zh_TW.desktop | 4 - lxqt-config-brightness/CMakeLists.txt | 84 - lxqt-config-brightness/README.md | 4 - lxqt-config-brightness/brightnesssettings.cpp | 101 -- lxqt-config-brightness/brightnesssettings.h | 53 - lxqt-config-brightness/brightnesssettings.ui | 89 - .../icons/brightnesssettings.svg | 141 -- lxqt-config-brightness/main.cpp | 95 - lxqt-config-brightness/monitorinfo.cpp | 76 - lxqt-config-brightness/monitorinfo.h | 58 - lxqt-config-brightness/outputwidget.cpp | 68 - lxqt-config-brightness/outputwidget.h | 45 - lxqt-config-brightness/outputwidget.ui | 84 - .../lxqt-config-brightness.desktop.in | 12 - .../lxqt-config-brightness_ar.desktop | 2 - .../lxqt-config-brightness_ca.desktop | 2 - .../lxqt-config-brightness_da.desktop | 4 - .../lxqt-config-brightness_es.desktop | 4 - .../lxqt-config-brightness_fr.desktop | 3 - .../lxqt-config-brightness_it.desktop | 2 - .../lxqt-config-brightness_lt.desktop | 4 - .../lxqt-config-brightness_pl.desktop | 3 - .../lxqt-config-brightness_ru.desktop | 4 - lxqt-config-brightness/xrandrbrightness.cpp | 411 ----- lxqt-config-brightness/xrandrbrightness.h | 56 - lxqt-config-file-associations/CMakeLists.txt | 87 - .../applicationchooser.cpp | 194 -- .../applicationchooser.h | 61 - .../applicationchooser.ui | 207 --- .../lxqt-config-file-associations.desktop.in | 11 - lxqt-config-file-associations/main.cpp | 65 - .../mimetypedata.cpp | 52 - lxqt-config-file-associations/mimetypedata.h | 54 - .../mimetypeitemmodel.cpp | 200 --- .../mimetypeitemmodel.h | 51 - .../mimetypeviewer.cpp | 269 --- .../mimetypeviewer.h | 69 - .../mimetypeviewer.ui | 275 --- .../lxqt-config-file-associations_ar.desktop | 4 - .../lxqt-config-file-associations_ca.desktop | 4 - .../lxqt-config-file-associations_da.desktop | 4 - .../lxqt-config-file-associations_de.desktop | 4 - .../lxqt-config-file-associations_el.desktop | 4 - .../lxqt-config-file-associations_fr.desktop | 3 - .../lxqt-config-file-associations_hu.desktop | 4 - .../lxqt-config-file-associations_it.desktop | 4 - .../lxqt-config-file-associations_ja.desktop | 4 - .../lxqt-config-file-associations_lt.desktop | 4 - ...xqt-config-file-associations_pl_PL.desktop | 4 - .../lxqt-config-file-associations_pt.desktop | 4 - .../lxqt-config-file-associations_ru.desktop | 4 - lxqt-config-input/CMakeLists.txt | 92 - lxqt-config-input/data/input-keyboard.png | Bin 5998 -> 0 bytes lxqt-config-input/data/input-mouse.png | Bin 10725 -> 0 bytes lxqt-config-input/keyboardconfig.cpp | 150 -- lxqt-config-input/keyboardconfig.h | 67 - lxqt-config-input/keyboardconfig.ui | 208 --- lxqt-config-input/keyboardlayoutconfig.cpp | 321 ---- lxqt-config-input/keyboardlayoutconfig.h | 74 - lxqt-config-input/keyboardlayoutconfig.ui | 152 -- lxqt-config-input/keyboardlayoutinfo.h | 52 - lxqt-config-input/lxqt-config-input.cpp | 70 - .../lxqt-config-input.desktop.in | 11 - lxqt-config-input/lxqt-config-input.h | 15 - lxqt-config-input/mouseconfig.cpp | 214 --- lxqt-config-input/mouseconfig.h | 69 - lxqt-config-input/mouseconfig.ui | 208 --- .../selectkeyboardlayoutdialog.cpp | 76 - .../selectkeyboardlayoutdialog.h | 45 - .../selectkeyboardlayoutdialog.ui | 88 - .../translations/lxqt-config-input_ar.desktop | 4 - .../translations/lxqt-config-input_ca.desktop | 4 - .../translations/lxqt-config-input_da.desktop | 4 - .../translations/lxqt-config-input_de.desktop | 4 - .../translations/lxqt-config-input_el.desktop | 4 - .../translations/lxqt-config-input_fr.desktop | 3 - .../translations/lxqt-config-input_hu.desktop | 4 - .../translations/lxqt-config-input_it.desktop | 6 - .../translations/lxqt-config-input_ja.desktop | 5 - .../translations/lxqt-config-input_lt.desktop | 4 - .../translations/lxqt-config-input_pl.desktop | 4 - .../translations/lxqt-config-input_pt.desktop | 4 - .../translations/lxqt-config-input_ru.desktop | 4 - lxqt-config-locale/CMakeLists.txt | 68 - lxqt-config-locale/localeconfig.cpp | 452 ----- lxqt-config-locale/localeconfig.h | 79 - lxqt-config-locale/localeconfig.ui | 385 ---- .../lxqt-config-locale.desktop.in | 11 - lxqt-config-locale/main.cpp | 64 - .../lxqt-config-locale_ar.desktop | 3 - .../lxqt-config-locale_ca.desktop | 3 - .../lxqt-config-locale_da.desktop | 4 - .../lxqt-config-locale_de.desktop | 3 - .../lxqt-config-locale_fr.desktop | 3 - .../lxqt-config-locale_it.desktop | 2 - .../lxqt-config-locale_lt.desktop | 3 - .../lxqt-config-locale_pl.desktop | 3 - .../lxqt-config-locale_ru.desktop | 4 - lxqt-config-monitor/CMakeLists.txt | 92 - lxqt-config-monitor/LICENSE | 339 ---- lxqt-config-monitor/README.md | 4 - lxqt-config-monitor/fakeTest.sh | 6 - lxqt-config-monitor/fastmenu.cpp | 203 --- lxqt-config-monitor/fastmenu.h | 55 - lxqt-config-monitor/fastmenu.ui | 80 - lxqt-config-monitor/icons/monitor.svg | 205 --- lxqt-config-monitor/loadsettings.cpp | 112 -- lxqt-config-monitor/loadsettings.h | 48 - lxqt-config-monitor/main.cpp | 83 - lxqt-config-monitor/managesavedsettings.cpp | 196 -- lxqt-config-monitor/managesavedsettings.h | 59 - lxqt-config-monitor/managesavedsettings.ui | 74 - lxqt-config-monitor/monitor.cpp | 133 -- lxqt-config-monitor/monitor.h | 74 - lxqt-config-monitor/monitorpicture.cpp | 418 ----- lxqt-config-monitor/monitorpicture.h | 96 - lxqt-config-monitor/monitorpicture.ui | 38 - lxqt-config-monitor/monitorsettingsdialog.cpp | 246 --- lxqt-config-monitor/monitorsettingsdialog.h | 60 - lxqt-config-monitor/monitorsettingsdialog.ui | 136 -- lxqt-config-monitor/monitorwidget.cpp | 282 --- lxqt-config-monitor/monitorwidget.h | 76 - lxqt-config-monitor/monitorwidget.ui | 210 --- lxqt-config-monitor/resources/configure.in | 4 - .../resources/lxqt-config-monitor.desktop.in | 11 - .../resources/magnetic_attraction.html | 42 - lxqt-config-monitor/savesettings.cpp | 117 -- lxqt-config-monitor/settingsdialog.cpp | 34 - lxqt-config-monitor/settingsdialog.h | 43 - lxqt-config-monitor/timeoutdialog.cpp | 65 - lxqt-config-monitor/timeoutdialog.h | 47 - lxqt-config-monitor/timeoutdialog.ui | 107 -- .../lxqt-config-monitor_ar.desktop | 3 - .../lxqt-config-monitor_ca.desktop | 4 - .../lxqt-config-monitor_da.desktop | 4 - .../lxqt-config-monitor_de.desktop | 3 - .../lxqt-config-monitor_el.desktop | 4 - .../lxqt-config-monitor_fr.desktop | 3 - .../lxqt-config-monitor_hu.desktop | 3 - .../lxqt-config-monitor_it.desktop | 4 - .../lxqt-config-monitor_ja.desktop | 4 - .../lxqt-config-monitor_lt.desktop | 4 - .../lxqt-config-monitor_pl_PL.desktop | 3 - .../lxqt-config-monitor_pt.desktop | 3 - .../lxqt-config-monitor_ru.desktop | 4 - .../lxqt-config-monitor_zh_TW.desktop | 4 - lxqt-config.png | Bin 32184 -> 0 bytes man/lxqt-config.1 | 59 - src/CMakeLists.txt | 81 - src/lxqt-config.desktop.in | 11 - src/lxqt-config.menu | 71 - src/main.cpp | 66 - src/mainwindow.cpp | 329 ---- src/mainwindow.h | 74 - src/mainwindow.ui | 89 - src/qcategorizedview/CMakeLists.txt | 10 - .../qcategorizedsortfilterproxymodel.cpp | 320 ---- .../qcategorizedsortfilterproxymodel.h | 177 -- .../qcategorizedsortfilterproxymodel_p.h | 49 - src/qcategorizedview/qcategorizedview.cpp | 1581 ----------------- src/qcategorizedview/qcategorizedview.h | 363 ---- src/qcategorizedview/qcategorizedview_p.h | 160 -- src/qcategorizedview/qcategorydrawer.cpp | 285 --- src/qcategorizedview/qcategorydrawer.h | 234 --- src/translations/lxqt-config_ar.desktop | 4 - src/translations/lxqt-config_ca.desktop | 4 - src/translations/lxqt-config_cs.desktop | 4 - src/translations/lxqt-config_cs_CZ.desktop | 4 - src/translations/lxqt-config_da.desktop | 4 - src/translations/lxqt-config_de.desktop | 3 - src/translations/lxqt-config_el.desktop | 5 - src/translations/lxqt-config_eo.desktop | 4 - src/translations/lxqt-config_es.desktop | 4 - src/translations/lxqt-config_es_VE.desktop | 4 - src/translations/lxqt-config_eu.desktop | 4 - src/translations/lxqt-config_fi.desktop | 4 - src/translations/lxqt-config_fr.desktop | 4 - src/translations/lxqt-config_hu.desktop | 4 - src/translations/lxqt-config_id_ID.desktop | 4 - src/translations/lxqt-config_it.desktop | 4 - src/translations/lxqt-config_ja.desktop | 4 - src/translations/lxqt-config_lt.desktop | 4 - src/translations/lxqt-config_nl.desktop | 4 - src/translations/lxqt-config_pl.desktop | 4 - src/translations/lxqt-config_pl_PL.desktop | 4 - src/translations/lxqt-config_pt.desktop | 4 - src/translations/lxqt-config_pt_BR.desktop | 4 - src/translations/lxqt-config_ro_RO.desktop | 4 - src/translations/lxqt-config_ru.desktop | 4 - src/translations/lxqt-config_sk.desktop | 4 - src/translations/lxqt-config_sl.desktop | 4 - src/translations/lxqt-config_sr.desktop | 4 - .../lxqt-config_sr@ijekavian.desktop | 3 - .../lxqt-config_sr@ijekavianlatin.desktop | 3 - src/translations/lxqt-config_sr@latin.desktop | 4 - src/translations/lxqt-config_th_TH.desktop | 4 - src/translations/lxqt-config_tr.desktop | 4 - src/translations/lxqt-config_uk.desktop | 4 - src/translations/lxqt-config_zh_CN.desktop | 4 - src/translations/lxqt-config_zh_TW.desktop | 4 - 293 files changed, 22038 deletions(-) delete mode 100644 AUTHORS delete mode 100644 CHANGELOG delete mode 100644 CMakeLists.txt delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 liblxqt-config-cursor/CMakeLists.txt delete mode 100644 liblxqt-config-cursor/cfgfile.cpp delete mode 100644 liblxqt-config-cursor/cfgfile.h delete mode 100644 liblxqt-config-cursor/crtheme.cpp delete mode 100644 liblxqt-config-cursor/crtheme.h delete mode 100644 liblxqt-config-cursor/itemdelegate.cpp delete mode 100644 liblxqt-config-cursor/itemdelegate.h delete mode 100644 liblxqt-config-cursor/main.cpp delete mode 100644 liblxqt-config-cursor/main.h delete mode 100644 liblxqt-config-cursor/man/lxqt-config-mouse.1 delete mode 100644 liblxqt-config-cursor/previewwidget.cpp delete mode 100644 liblxqt-config-cursor/previewwidget.h delete mode 100644 liblxqt-config-cursor/selectwnd.cpp delete mode 100644 liblxqt-config-cursor/selectwnd.h delete mode 100644 liblxqt-config-cursor/selectwnd.ui delete mode 100644 liblxqt-config-cursor/thememodel.cpp delete mode 100644 liblxqt-config-cursor/thememodel.h delete mode 100644 liblxqt-config-cursor/warninglabel.cpp delete mode 100644 liblxqt-config-cursor/warninglabel.h delete mode 100644 liblxqt-config-cursor/warninglabel.ui delete mode 100644 liblxqt-config-cursor/xcr/xcrimg.cpp delete mode 100644 liblxqt-config-cursor/xcr/xcrimg.h delete mode 100644 liblxqt-config-cursor/xcr/xcrtheme.cpp delete mode 100644 liblxqt-config-cursor/xcr/xcrtheme.h delete mode 100644 liblxqt-config-cursor/xcr/xcrthemefx.cpp delete mode 100644 liblxqt-config-cursor/xcr/xcrthemefx.h delete mode 100644 liblxqt-config-cursor/xcr/xcrthemexp.cpp delete mode 100644 liblxqt-config-cursor/xcr/xcrthemexp.h delete mode 100644 liblxqt-config-cursor/xcr/xcrxcur.cpp delete mode 100644 liblxqt-config-cursor/xcr/xcrxcur.h delete mode 100644 lxqt-config-appearance.png delete mode 100644 lxqt-config-appearance/CMakeLists.txt delete mode 100644 lxqt-config-appearance/fontconfigfile.cpp delete mode 100644 lxqt-config-appearance/fontconfigfile.h delete mode 100644 lxqt-config-appearance/fontsconfig.cpp delete mode 100644 lxqt-config-appearance/fontsconfig.h delete mode 100644 lxqt-config-appearance/fontsconfig.ui delete mode 100644 lxqt-config-appearance/iconthemeconfig.cpp delete mode 100644 lxqt-config-appearance/iconthemeconfig.h delete mode 100644 lxqt-config-appearance/iconthemeconfig.ui delete mode 100644 lxqt-config-appearance/iconthemeinfo.cpp delete mode 100644 lxqt-config-appearance/iconthemeinfo.h delete mode 100644 lxqt-config-appearance/lxqt-config-appearance.desktop.in delete mode 100644 lxqt-config-appearance/lxqtthemeconfig.cpp delete mode 100644 lxqt-config-appearance/lxqtthemeconfig.h delete mode 100644 lxqt-config-appearance/lxqtthemeconfig.ui delete mode 100644 lxqt-config-appearance/main.cpp delete mode 100644 lxqt-config-appearance/man/lxqt-config-appearance.1 delete mode 100644 lxqt-config-appearance/styleconfig.cpp delete mode 100644 lxqt-config-appearance/styleconfig.h delete mode 100644 lxqt-config-appearance/styleconfig.ui delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_ar.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_ca.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_cs.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_cs_CZ.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_da.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_de.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_el.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_eo.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_es.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_es_VE.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_eu.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_fi.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_fr.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_hu.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_ia.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_id_ID.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_it.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_ja.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_ko.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_lt.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_nl.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_pl_PL.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_pt.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_pt_BR.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_ro_RO.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_ru.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_sk.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_sl.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_sr.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_sr@ijekavian.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_sr@ijekavianlatin.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_sr@latin.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_th_TH.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_tr.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_uk.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_zh_CN.GB2312.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_zh_CN.desktop delete mode 100644 lxqt-config-appearance/translations/lxqt-config-appearance_zh_TW.desktop delete mode 100644 lxqt-config-brightness/CMakeLists.txt delete mode 100644 lxqt-config-brightness/README.md delete mode 100644 lxqt-config-brightness/brightnesssettings.cpp delete mode 100644 lxqt-config-brightness/brightnesssettings.h delete mode 100644 lxqt-config-brightness/brightnesssettings.ui delete mode 100644 lxqt-config-brightness/icons/brightnesssettings.svg delete mode 100644 lxqt-config-brightness/main.cpp delete mode 100644 lxqt-config-brightness/monitorinfo.cpp delete mode 100644 lxqt-config-brightness/monitorinfo.h delete mode 100644 lxqt-config-brightness/outputwidget.cpp delete mode 100644 lxqt-config-brightness/outputwidget.h delete mode 100644 lxqt-config-brightness/outputwidget.ui delete mode 100644 lxqt-config-brightness/resources/lxqt-config-brightness.desktop.in delete mode 100644 lxqt-config-brightness/translations/lxqt-config-brightness_ar.desktop delete mode 100644 lxqt-config-brightness/translations/lxqt-config-brightness_ca.desktop delete mode 100644 lxqt-config-brightness/translations/lxqt-config-brightness_da.desktop delete mode 100644 lxqt-config-brightness/translations/lxqt-config-brightness_es.desktop delete mode 100644 lxqt-config-brightness/translations/lxqt-config-brightness_fr.desktop delete mode 100644 lxqt-config-brightness/translations/lxqt-config-brightness_it.desktop delete mode 100644 lxqt-config-brightness/translations/lxqt-config-brightness_lt.desktop delete mode 100644 lxqt-config-brightness/translations/lxqt-config-brightness_pl.desktop delete mode 100644 lxqt-config-brightness/translations/lxqt-config-brightness_ru.desktop delete mode 100644 lxqt-config-brightness/xrandrbrightness.cpp delete mode 100644 lxqt-config-brightness/xrandrbrightness.h delete mode 100644 lxqt-config-file-associations/CMakeLists.txt delete mode 100644 lxqt-config-file-associations/applicationchooser.cpp delete mode 100644 lxqt-config-file-associations/applicationchooser.h delete mode 100644 lxqt-config-file-associations/applicationchooser.ui delete mode 100644 lxqt-config-file-associations/lxqt-config-file-associations.desktop.in delete mode 100644 lxqt-config-file-associations/main.cpp delete mode 100644 lxqt-config-file-associations/mimetypedata.cpp delete mode 100644 lxqt-config-file-associations/mimetypedata.h delete mode 100644 lxqt-config-file-associations/mimetypeitemmodel.cpp delete mode 100644 lxqt-config-file-associations/mimetypeitemmodel.h delete mode 100644 lxqt-config-file-associations/mimetypeviewer.cpp delete mode 100644 lxqt-config-file-associations/mimetypeviewer.h delete mode 100644 lxqt-config-file-associations/mimetypeviewer.ui delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_ar.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_ca.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_da.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_de.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_el.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_fr.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_hu.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_it.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_ja.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_lt.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_pl_PL.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_pt.desktop delete mode 100644 lxqt-config-file-associations/translations/lxqt-config-file-associations_ru.desktop delete mode 100644 lxqt-config-input/CMakeLists.txt delete mode 100644 lxqt-config-input/data/input-keyboard.png delete mode 100644 lxqt-config-input/data/input-mouse.png delete mode 100644 lxqt-config-input/keyboardconfig.cpp delete mode 100644 lxqt-config-input/keyboardconfig.h delete mode 100644 lxqt-config-input/keyboardconfig.ui delete mode 100644 lxqt-config-input/keyboardlayoutconfig.cpp delete mode 100644 lxqt-config-input/keyboardlayoutconfig.h delete mode 100644 lxqt-config-input/keyboardlayoutconfig.ui delete mode 100644 lxqt-config-input/keyboardlayoutinfo.h delete mode 100644 lxqt-config-input/lxqt-config-input.cpp delete mode 100644 lxqt-config-input/lxqt-config-input.desktop.in delete mode 100644 lxqt-config-input/lxqt-config-input.h delete mode 100644 lxqt-config-input/mouseconfig.cpp delete mode 100644 lxqt-config-input/mouseconfig.h delete mode 100644 lxqt-config-input/mouseconfig.ui delete mode 100644 lxqt-config-input/selectkeyboardlayoutdialog.cpp delete mode 100644 lxqt-config-input/selectkeyboardlayoutdialog.h delete mode 100644 lxqt-config-input/selectkeyboardlayoutdialog.ui delete mode 100644 lxqt-config-input/translations/lxqt-config-input_ar.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_ca.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_da.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_de.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_el.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_fr.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_hu.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_it.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_ja.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_lt.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_pl.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_pt.desktop delete mode 100644 lxqt-config-input/translations/lxqt-config-input_ru.desktop delete mode 100644 lxqt-config-locale/CMakeLists.txt delete mode 100644 lxqt-config-locale/localeconfig.cpp delete mode 100644 lxqt-config-locale/localeconfig.h delete mode 100644 lxqt-config-locale/localeconfig.ui delete mode 100644 lxqt-config-locale/lxqt-config-locale.desktop.in delete mode 100644 lxqt-config-locale/main.cpp delete mode 100644 lxqt-config-locale/translations/lxqt-config-locale_ar.desktop delete mode 100644 lxqt-config-locale/translations/lxqt-config-locale_ca.desktop delete mode 100644 lxqt-config-locale/translations/lxqt-config-locale_da.desktop delete mode 100644 lxqt-config-locale/translations/lxqt-config-locale_de.desktop delete mode 100644 lxqt-config-locale/translations/lxqt-config-locale_fr.desktop delete mode 100644 lxqt-config-locale/translations/lxqt-config-locale_it.desktop delete mode 100644 lxqt-config-locale/translations/lxqt-config-locale_lt.desktop delete mode 100644 lxqt-config-locale/translations/lxqt-config-locale_pl.desktop delete mode 100644 lxqt-config-locale/translations/lxqt-config-locale_ru.desktop delete mode 100644 lxqt-config-monitor/CMakeLists.txt delete mode 100644 lxqt-config-monitor/LICENSE delete mode 100644 lxqt-config-monitor/README.md delete mode 100644 lxqt-config-monitor/fakeTest.sh delete mode 100644 lxqt-config-monitor/fastmenu.cpp delete mode 100644 lxqt-config-monitor/fastmenu.h delete mode 100644 lxqt-config-monitor/fastmenu.ui delete mode 100644 lxqt-config-monitor/icons/monitor.svg delete mode 100644 lxqt-config-monitor/loadsettings.cpp delete mode 100644 lxqt-config-monitor/loadsettings.h delete mode 100644 lxqt-config-monitor/main.cpp delete mode 100644 lxqt-config-monitor/managesavedsettings.cpp delete mode 100644 lxqt-config-monitor/managesavedsettings.h delete mode 100644 lxqt-config-monitor/managesavedsettings.ui delete mode 100644 lxqt-config-monitor/monitor.cpp delete mode 100644 lxqt-config-monitor/monitor.h delete mode 100644 lxqt-config-monitor/monitorpicture.cpp delete mode 100644 lxqt-config-monitor/monitorpicture.h delete mode 100644 lxqt-config-monitor/monitorpicture.ui delete mode 100644 lxqt-config-monitor/monitorsettingsdialog.cpp delete mode 100644 lxqt-config-monitor/monitorsettingsdialog.h delete mode 100644 lxqt-config-monitor/monitorsettingsdialog.ui delete mode 100644 lxqt-config-monitor/monitorwidget.cpp delete mode 100644 lxqt-config-monitor/monitorwidget.h delete mode 100644 lxqt-config-monitor/monitorwidget.ui delete mode 100644 lxqt-config-monitor/resources/configure.in delete mode 100644 lxqt-config-monitor/resources/lxqt-config-monitor.desktop.in delete mode 100644 lxqt-config-monitor/resources/magnetic_attraction.html delete mode 100644 lxqt-config-monitor/savesettings.cpp delete mode 100644 lxqt-config-monitor/settingsdialog.cpp delete mode 100644 lxqt-config-monitor/settingsdialog.h delete mode 100644 lxqt-config-monitor/timeoutdialog.cpp delete mode 100644 lxqt-config-monitor/timeoutdialog.h delete mode 100644 lxqt-config-monitor/timeoutdialog.ui delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_ar.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_ca.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_da.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_de.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_el.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_fr.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_hu.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_it.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_ja.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_lt.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_pl_PL.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_pt.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_ru.desktop delete mode 100644 lxqt-config-monitor/translations/lxqt-config-monitor_zh_TW.desktop delete mode 100644 lxqt-config.png delete mode 100644 man/lxqt-config.1 delete mode 100644 src/CMakeLists.txt delete mode 100644 src/lxqt-config.desktop.in delete mode 100644 src/lxqt-config.menu delete mode 100644 src/main.cpp delete mode 100644 src/mainwindow.cpp delete mode 100644 src/mainwindow.h delete mode 100644 src/mainwindow.ui delete mode 100644 src/qcategorizedview/CMakeLists.txt delete mode 100644 src/qcategorizedview/qcategorizedsortfilterproxymodel.cpp delete mode 100644 src/qcategorizedview/qcategorizedsortfilterproxymodel.h delete mode 100644 src/qcategorizedview/qcategorizedsortfilterproxymodel_p.h delete mode 100644 src/qcategorizedview/qcategorizedview.cpp delete mode 100644 src/qcategorizedview/qcategorizedview.h delete mode 100644 src/qcategorizedview/qcategorizedview_p.h delete mode 100644 src/qcategorizedview/qcategorydrawer.cpp delete mode 100644 src/qcategorizedview/qcategorydrawer.h delete mode 100644 src/translations/lxqt-config_ar.desktop delete mode 100644 src/translations/lxqt-config_ca.desktop delete mode 100644 src/translations/lxqt-config_cs.desktop delete mode 100644 src/translations/lxqt-config_cs_CZ.desktop delete mode 100644 src/translations/lxqt-config_da.desktop delete mode 100644 src/translations/lxqt-config_de.desktop delete mode 100644 src/translations/lxqt-config_el.desktop delete mode 100644 src/translations/lxqt-config_eo.desktop delete mode 100644 src/translations/lxqt-config_es.desktop delete mode 100644 src/translations/lxqt-config_es_VE.desktop delete mode 100644 src/translations/lxqt-config_eu.desktop delete mode 100644 src/translations/lxqt-config_fi.desktop delete mode 100644 src/translations/lxqt-config_fr.desktop delete mode 100644 src/translations/lxqt-config_hu.desktop delete mode 100644 src/translations/lxqt-config_id_ID.desktop delete mode 100644 src/translations/lxqt-config_it.desktop delete mode 100644 src/translations/lxqt-config_ja.desktop delete mode 100644 src/translations/lxqt-config_lt.desktop delete mode 100644 src/translations/lxqt-config_nl.desktop delete mode 100644 src/translations/lxqt-config_pl.desktop delete mode 100644 src/translations/lxqt-config_pl_PL.desktop delete mode 100644 src/translations/lxqt-config_pt.desktop delete mode 100644 src/translations/lxqt-config_pt_BR.desktop delete mode 100644 src/translations/lxqt-config_ro_RO.desktop delete mode 100644 src/translations/lxqt-config_ru.desktop delete mode 100644 src/translations/lxqt-config_sk.desktop delete mode 100644 src/translations/lxqt-config_sl.desktop delete mode 100644 src/translations/lxqt-config_sr.desktop delete mode 100644 src/translations/lxqt-config_sr@ijekavian.desktop delete mode 100644 src/translations/lxqt-config_sr@ijekavianlatin.desktop delete mode 100644 src/translations/lxqt-config_sr@latin.desktop delete mode 100644 src/translations/lxqt-config_th_TH.desktop delete mode 100644 src/translations/lxqt-config_tr.desktop delete mode 100644 src/translations/lxqt-config_uk.desktop delete mode 100644 src/translations/lxqt-config_zh_CN.desktop delete mode 100644 src/translations/lxqt-config_zh_TW.desktop diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 2ecec14..0000000 --- a/AUTHORS +++ /dev/null @@ -1,13 +0,0 @@ -Upstream Authors: - LXQt team: http://lxqt.org - Razor team: http://razor-qt.org - -Copyright: - Copyright (c) 2010-2012 Razor team - Copyright (c) 2012-2017 LXQt team - -License: GPL-2 and LGPL-2.1+ -The full text of the licenses can be found in the 'LICENSE' file. - -The lxqt-config-cursor component is based on the "qt-xcurtheme" project -and is licensed under GPL 2, GPL 3, LGPL-2, LGPL-2.1 and WTFPL 2. diff --git a/CHANGELOG b/CHANGELOG deleted file mode 100644 index ebf9b09..0000000 --- a/CHANGELOG +++ /dev/null @@ -1,559 +0,0 @@ - -lxqt-config-0.12.0 / 2017-10-21 -=============================== - - * Set patch version - * Use $XDG_CONFIG_HOME/mimeapps.list for mime data instead of $XDG_DATA_HOME/applications/mimeapps.list (#129) - * Don't export github templates - * Update monitorsettingsdialog.ui - * lxqt-config-locale: corrected/reworded Save Changed Settings dialog - * Add/update *lt.desktop files - * lxq-config-monitor: set Qt::AA_UseHighDpiPixmaps to true - * lxqt-config-locale: set Qt::AA_UseHighDpiPixmaps to true - * lxqt-config-input: set Qt::AA_UseHighDpiPixmaps to true - * lxqt-config-file-ass.: set Qt::AA_UseHighDpiPixmaps to true - * lxqt-config-brightness: set Qt::AA_UseHighDpiPixmaps to true - * lxqt-config-appearance: set Qt::AA_UseHighDpiPixmaps to true - * liblxqt-config-cursor: set Qt::AA_UseHighDpiPixmaps to true - * Added QCommandLineParser and basic cli interface to lxqt-config-monitor - * Added QCommandLineParser and basic cli interface to lxqt-config-locale - * Added QCommandLineParser and basic cli interface to lxqt-config-input - * Added QCommandLineParser and basic cli interface to lxqt-config-file-associations - * Added version info to lxqt-config-brightness cli - * Added QCommandLineParser and basic cli interface to lxqt-config-appearance - * Added QCommandLineParser and basic cli interface to lxqt-config - * Added LXQT_CONFIG_PATCH_VERSION - * Fixed typo in appearance_pl_PL.desktop (#124) - * i18n: added some *.desktop for Polish language - * Fixes (#121) - * appearance: Fix typo from @aca544479 - * lxqt-config-file-associations: Sets the initial focus (#120) - * appearance: Add icon FollowColorScheme configuration (#119) - * Show non-primary screens in UI. (#116) - * Removes unneeded include_directories() entry - * Fixes a FTBFS with CMake v3.8 - * Use const iterators - * Update AUTHORS - -0.11.1 / 2017-01-01 -=================== - - * Release 0.11.1: Update changelog - * lxqt-config-monitor: remove unnecessary wait before settings load (#114) - * Fix self icontheme update (#113) - * liblxqt-config-cursor: Don't check for null pointer before deleting it - * liblxqt-config-cursor: Explicitly ignore function return value - * Updated and added *_da.desktop files and removed da_DK - * Use FindXCB CMake module - * Activate items on releasing Enter instead of pressing it. (#78) - * Update and rename lxqt-config_fr_FR.desktop to lxqt-config_fr.desktop - * Fix faulty link in README.md - * if not set, set the build type to Release - * Desktop entry files: Update French translation - * lxqt-config: Avoid multiple spawn on auto-repeat - * Fix loading of translations for brightness - * Create lxqt-config-brightness_it.desktop - * Remove cpack (#104) - * lxqt-config-brightness: Add GenericName and Comment to desktop entry - -0.11.0 / 2016-09-24 -=================== - - * Release 0.11.0: Add changelog - * appearance: Avoid blocking when setting wallpaper - * appearance: Do (not) change wallpaper with theme - * all: Remove XdgIcon & XdgIconLoader usage - * brightness: Add change confirmation dialog - * brightness: Correct indentation - * Update README.md - * Replaces deprecated QStyleOptionViewItemVx - * Add Catalan translations - * Add and Update Arabic Translations for Desktop Files - * lxqt-config-monitor: Correct loadsettings.cpp - * lxqt-config-monitor: Use QGuiApplication - * I18n: Fix Plural String (#94) - * fixed crash when selecting "extended view" while second monitor is off (#91) - * build: Add optional build for subcomponents - * lxqt-config-appearance: Fix a null pointer dereference (#93) - * Add README.md - * lxqt-config-brightness: Remove compiler warning - * lxqt-config-brightness: Add libxcb dependency - * lxqt-config-brightness: Use *_LDFLAGS in target_link_libraries - * lxqt-config-appearance: Use fewer XdgIcon* stuff (#92) - * lxqt-config-appearance: Use the new XdgIconLoader library (#90) - * build: Use external translations (#89) - * ts-files removal (#88) - * Use const references with the foreach iterator - * translations: russian translation update (#85) - * font config: make it possible to write custom fontconfig files (#83) - * view: Use icon/decoration size based on styling - * Set grid size according to font and icon sizes. - * lxqt-config-brightness: Use arrow keys to change settings. - * Desktop file translation to Spanish added. - * lxqt-config-brigness: Set brightness value by command line. - * Removed not needed LICENSE - * lxqt-config-brightness: Increase or decrease brightness using command line. - * Create lxqt-config-locale_it.desktop - * Rename from lxqt-config-brightness-settings to lxqt-config-brightness. - * lxqt-config-brightness-settings: Some files changes their licenses from GPL to LGPL. - * lxqt-config-brightness-settings lxqt translations module added. - * lxqt-config-brightness-settings added. - * fix typo skiping -> skipping - * build: Fix FTBFS by reverting the @a7220cb - * Bum year in AUTHORS - * lxqt-config-brightness-settings has been added. It can change brightness and gamma. It's a X11 tool because libKScreen can not change brightness or gamma yet. - * lxqt-config: Load/store window size on begin/end - * categorizedview: Use correct signature - * lxqt-config: Remove homemade "activation logic" - * Settings are saved in QSettings format instead JSON format. - * Set position widget used bad scale. The real widget size is not set until the widget is shown. - * Remove blue square in GUI position - * Fast options added. - * GUI only lets one primary output. - * Icons aren't installed. - * Check KScreen reply is OK. Changes in interface. - * liblxqt is used to write autostart entry. - * Don't track IDE settings - * KScreen is slow loading screen modes at starting. Wait for modes ready. - * KScreen sometimes changes id of modes. If mode exists and it is OK, settings will be applied. - * Save settings dialog added. - * Initial support for different paths of xkb base.lst in different OSes. - * A couple of bug fixes Check if the memory was allocated after malloc() and realloc() calls Fix typo - * Update german translation - * Fix warning on translation - * Replace slang with a more traditional wording - * build: Use CMAKE_INSTALL_FULL_LIBDIR for RPATH - * Fixes an FTBFS on lxqt-config-locale_ru.desktop - * Update Russian translations - * apearance: Support "System" theme preview - * Italian translation update - * lxqt-config: Add CTRL+Q shortcut for closing - *_hu.ts files updated, *hu_HU.ts files deleted - * Mkdir $XDG_CONFIG_HOME/autostart or ~/.config/autostart, if not exists. - * lxqt-config-appearance: Choose the icon with the matching size - -0.10.0 / 2015-11-02 -=================== - - * Update translations - * Fix license file - * Set saved settings at session start. - * lxqt-config-monitor: Correctly link to liblxqt - * lxqt-config-monitor: GUI for positioning - * lxqt-config-monito: Handle the clone combobox - * lxqt-config-monitor: Fix activation of second screen - * lxqt-config-monitor: Screen rotation - * lxqt-config-monitor: Tabs to spaces - * lxqt-config-monitor: Remove duplicate modes from list - * lxqt-config-monitor: Sort output modes - * lxqt-config-monitor: clean-up, old code removed - * lxqt-config-monitor: fix for reverting to previous configuration - * lxqt-config-monitor: refactoring and improvements - * lxqt-config-monitor: Use a separate combobox for clones - * lxqt-config-monitor: Actually update the config on setting screen position - * lxqt-config-monitor: Display EDID information in an additional tab - * lxqt-config-monitor: Attempt at an even simpler UI (#502) - * lxqt-config-monitor: Replace xrandr by KScreen - * lxqt-config-monitor: Remove backlight/brightness support - * Make the lxqt-config-locale chosen settings work - * Fix a few typos in file “info-for-developers.txt” - * Removed some compile warnings - * OnlyShowIn=LXQt; - * Add an option to automatically turn on numlock after login (implemented in lxqt-session). - * Initial support for locale config, based on formats KCMS. - * Rename LxQt to LXQt everywhere - * Update Greek (el) translation Remove country variant from language code - * lxqt-config: add correct rpath into lxqt-config-input & lxqt-config-appearance to find liblxqt-config-cursor.so installed into private directory - * Drop country-specific Italian translations - * Updated and created italian .desktop files - * Fix mouse settings persistency - * fixes lxde/lxqt #785 AUTHORS changed, list the used licenses LXQt license header added - * Description: Install private .so file into proper directory. Author: Andrew Lee (李健秋) - * Add copyright headers - * Handles CMake policy CMP0063 - * Uses LXQtCompilerSettings CMake module - * Fix cursor settings location - * Updates translations sources - * CMake: Adds Runtime and Devel install COMPONENTs - * Coding style changes - * Removes unneeded include_directories() entries - * Use CMAKE_AUTORCC - * Get rid of qt5_wrap_cpp() MOC variables - * Use CMAKE_AUTOUIC - * Drops LIB_SUFFIX, use GNUInstallDirs - * fix build with qt 5.5 - * Makes it compile in superbuild mode - * Updated german translation. - * Updates the build system to the Targets infrastructure - * polish regarding lxqt-config.desktop - * Remove trailing whitespaces - * Fix naming and links - * Include X-LXQt category in lxqt-config menu - * ApplyDialog renamed to SaveSettings. - * Rename and delete saved settings added. - * Bug always unify monitors fixed. - * lxqt-config-appearance: minimum configurable font size -> 4px - * Fix function name - * Update lxqt-config-input_it.ts - * Hungarian translations update, lxqt-config-monitor.desktop.in fixed - * Testing changes in the buttonbar of LxQt::ConfigDialog. - * Update Russian translation - * lxqt-configure-appearance: Reload icons from the user selected theme - * The last xrandr backend commit. Save settings added. Framebuffer screen size fixed. - * First save settings implementation. - * Update lxqt-config-cursor_it_IT.ts - * Framebuffer size is calculated on xrand backend. - * Update to keep up with our QIconLoader - * Added reset values. - * Remove testing parameters - * Apply page added - * Updated to LxQt::ConfigDialog. - * Added SVG icon for monitor in monitor position. - * Polish translation update - * Reorganizing the code. Support for long names in resolution modes . - * Reorganizing the code. Support for long names in resolution modes. - * Reorganizing the code. Support for long names in resolution modes. - * New modes name bug fixed. - * lxqt-config-appearance/icontheme: String performance enhancements - * Handles previews for inherited icon themes - * file-associations:Return from the busy cursor only after the Ui stuff ended - * Remove an unneeded dependency on KWindowSystem - -0.9.0 / 2015-01-31 -================== - - * Delay loading of application icons in the app-chooser dialog for faster loading. - * Make the user aware of still ongoing work (Application Chooser) - * Bad English fixed - * Capitalize themes' names - * Create lxqt-config-monitor_it_IT.ts - * Update lxqt-config-appearance_it.desktop - * Added german translation for file association dialogue - * Added german translation for input device settings. - * Create lxqt-config-file-associations_it.ts - * Update lxqt-config-appearance_it.ts - * Update lxqt-config-appearance_it_IT.ts - * Added german translation for monitor settings. - * Update Japanese translation - * Fix PT desktop file names and paths. - * Portuguese language update - * Updates translations sources - * Documenting the code: Magnetic attraction without javascript. - * Magnetic attraction procedure has been documented. - * Added confirm dialog before saving. - * Added backlight control and position control button. - * Update lxqt-config-cursor_ja.ts - * - Unify naming for a unique lxqt. No more suffixes - * Write to mimeapps.list rather than defaults.list - * If directory ~/.config/autostart/ doesn't exists, it is created. Save doesn't close window. - * Use the new LxQt::SingleApplication - * Add windows icon - * CMakeLists code reformatting - * CMakeLists maintenance - * Renames .ts files that used _template in their name - * Moves and renames translations files around - * Uses the new translations cmake modules - * - Add option autohint - Fix compatibility with KDE fonts settings - * Activate System Settings items with enter key. Fixes lxde/lxde-qt#355 - * Update Russian translation - * Drop Qt4 support in code - * Clean up CMakeLists.txt and drop Qt 4 support - -0.8.0 / 2014-10-10 -================== - - * Adapts to translations infrastructure - * Option to set single-click as default and sigle-click handling in system settings' main window - * Qt4 and Qt5 compiling fixed - * Compiling in Qt4 fixed. - * Fix #273 - File fonts.conf is created as folder if doesn't exist. - * Make initial panel receive focus - * Adapt to use QtMimeTypes/XdgMimeType - * Restore translations. - * Use our custom TimeoutDialog to replace QProgressDialog and provide a "cancel" button and show better text in the progress bar. - * Little fix for the broken stacked widget. - * Replace the scrolled UI with a left list and a right stacked widget to provide usability. - * Don't use Qt QObject properties in mode changes. Use MonitorWidget class properties instead. - * Fixed: Some ugly code has been changed. - * Fixed: Error reading monitor name. - * Fixed: Restore position of monitor when user cancels settings. - * Fixed: If no relative monitor is selected, then position is disabled. - * Fixed: Disable position options when output is unified at start. Fixed: No cicles in relative positions at start. - * Fixed: Timeout dialog is now modal. - * Fixed: If monitor is turned off, brightness is set to 0. Fixed: Quick options close window on click. - * Read vendor from EDID. - * Fixed: Gamma error when monitor is turned off. - * Gamma control implemented. - * Added brightness control. Some bugs fixed reading xrandr properties. - * Little adjustment to the UI. Delete unused methods. - * Refactor the code, make things more OOP-style. * Slight adjustment to the UI. - * Add code to determine the position of monitors and their relationship on startup. - * Add a new parser for the output of "xrandr --verbose" to get more detailed monitor info, including gamma. - * Add initial translation support and an incomplete zh_TW locale to lxqt-config-monitor. - * Integrate the Makefile of lxqt-config-monitor to build it as part of lxqt-config. - * Move lxqt-config-monitor into a subdirectory. - * Use QWindow::windowHandle()->winId() to replace QWidget::winId() due to a bug of Qt5. - * Added: Save settings in autostart desktop file. - * Added timeout dialog. When settings are applied, a timeout dialog is shown. If user doesn't press "Yes" button, settings are restored. - * Monitor position can be changed. Outputs can be diferent. Position of outputs can be chosen. If system has got two monitors, wizard will be shown to config them. - * Modules for xrandr and GUI. Now new backends can be added. - * Split xrandr settings from UI. - * Readme updated. - * Remove all Glib dependencies. - * Initial commit - * Fix bug #242: lxqt-config-input: Mouse acceleration & sensitivity settings are not saved. - * Fix missing libxcb linking so building with llvm/clang now works. - * Fixes layout on the Fonts Config Ui - * Avoid putting system programs in "LXQt settings" category since they belong to "System settings". - * Add to lxqt-config.menu to avoid duplicated items in "Other Settings" section. This fixed lxde-qt bug #186. - * Rename lxqt-config-cursor to liblxqt-config-cursor since it's a library. - * Show cursors by using raw xcb calls since Qt5 does not support creating QCursor based on native cursor handle. - * Write Qt settings to lxqt.conf instead of the deprecated Trolltech.conf in Qt5. - * Make the code compile with both Qt4 and Qt5. - * Fix keyboard layout settings reading and writting - * Cleanup header style - * Use new LXQt header files. - * Use preferred header style. - * Make sure all enums are handled in switch - * Fix a null dereference - * Remove unnecessary use of alloca, which is not portable. - -0.7.0 / 2014-05-07 -================== - - * Mention lxqt-config-cursor in AUTHORS - * Include some optional components in LXQt settings. - * Remove duplicate COPYING file - * Update COPYING - * Update categories to match proper ones in .desktop files - * String changes LxQt -> LXQt and LXDE-Qt -> LXQt without refactoring classes, namespaces and so on - * removal of old templates in translations - -0.6.99 / 2014-05-01 -=================== - - * Update manpages - * Update AUTHORS - * Add CPack rules for creating tarball - * config-input: Fix a typo - * Preserve the config values in lxqt-session config file. * Support setting key used to switch layouts. - * Add keys used to switch layout to the combox box. - * Add very primitive support for settings keyboard layout via setxkbmap. - * Add a basic skeleton for keyboard layout settings. - * lxqt-config-file-associations: Wording in main window - * Assorted improvements to .desktop files - * Man page improvements - * Correctly save the cursor theme name to lxqt session config file. - * Correctly write current cursor theme name to ~/.icons/default/index.theme. Deprecate the use of XCURSOR_THEME environment variable. - * Support changing double click interval, whell scroll lines, and cursor flash time for Qt programs. Little adjustment of UI. - * Fix incorrect linking to liblxqt-config-cursor. - * Add missing desktop entry file for lxqt-config-input. Some cleanup. - * Rename lxqt-config-mouse to lxqt-config-cursor to reflect what it does. Remove unnecessary desktop entry files and do some makefile cleanup. - * Try to integrate lxqt-config-appearance with lxqt-config-mouse so we can select cursor themes in lxqt-config-appearance, too. - * Total redesign of lxqt-config-input using LxQt::ConfigDialog and integrate lxqt-config-mouse. - * Fix lxqt-config-appearance: write config files on widget destruction properly - * Fix dpi settings and add a timeout to 1.5 sec delay to writing fontconfig file. - * Read/write ~/.config/fontconfig/fonts.conf file for settings antialias, hinting, and dpi. - * Write a fontconfig config file to ~/.config/fonts.conf at the same time. - * Fix bugs in font configurations - * Try to add very basic font configurations - * Add support for toolbar button styles and single click activation for item views - * Add support for Qt style selection to lxqt-config-appearance. - * Removed CMAKE_SOURCE_DIR usage from CMakeLists.txt files - * Fix XDG_MENU_PREFIX and use correct config.menu file. - * Support changing the wallpaper of pcmanfm-qt. - * Fix renaming bugs, replacing lxqt-qt with lxde-qt - * Finish the crazy razor=>lxqt renaming tasks. - * Fix wrong config name. - * Project name added to cmake file - * Fix wrong Exec lines in desktop entry files. - * Fix broken build and rename binaries to lxqt-config-*. - * Add COPYING file for razor-config-mouse since it's GPL'd rather than using LGPL. - * Add COPYING and AUTHORS - * Make razor-config-fileassociations compile with qt 4.6 - * Corrected include line in mimetypeviewer.cpp - * X-RAZOR changed to Razor in desktop files - * Make config-file-associations dialogs appear faster - * config-file-associations: removed placeholder text from search field - * config-file-associations: add search icon to search lineedit - * Removed heading from mimetypeviewer in config-file-associations - * razor-config-file-associations: Set focus correctly when opening applicationchooser - * razor-config-file-associations: remove connect to nonexisting ok-slot - * razor-config-file-associations: clean up qDebug lines - * config-file-associations, clear mimeinfo frames in mimetypeviewer, when no mimetype chosen - * Sorting of applications in config-file-associations - * config-file-associations adapt detection of applications to xdg-mime behavior - * razor-config: load model content after the window appears on screen (we need to provide some user feedback immediately) - * config-file-associations, mimetypeviewer: change tab-order and initial focus - * Added search functionality to config-file-associations, MimetypeViewer - * config-file-associations, mimetypeviewer: Replaced QTreeWidget with QTreeView and new class MimetypeItemModel as model - * config-file-associations: minor changes to mimetypeviewer looks - * config-file-associations: Changed application listwidget back to treewidget, and dropped \handles\ listwidget - * Improved (hopefuly) layout and look of config-fileassociations, application chooser - * config-file-associations: changed treewidget to listwidget in applicationchooser - * razor-config-file-associations, improved layout for mimetype-viewer - * Added application razor-config-file-associations - * fixed appearance icons display + huge filesystem access optimization in this area - * Update fixes for qcategorizedview - * Make config center icon labels not wrap as much - * fixed #488 Display a message if no cursor theme is found - * Fix various build falures - * Add translation support for qtconfig entry - * preliminary manpages primary for razorqt and usefully in venenux - * Suppressed warning "variable «currSize» set but not used" in the razorqt-config/src/qcategorizedview/qcategorizedview.cpp:496:29 - * Suppressed warning "variable «currSize» set but not used" in the razorqt-config/src/qcategorizedview/qcategorizedview.cpp:496:29 - * Translations updated - * Translations updated - * Translations - * Delete bad en_GB translations - * Install translations into correct places - * Update translations - * Enable translations for some components that were missing them - * Minor fixes - * Translations updated - * Removed line num from TS files. - * razor-config: wrap text - * Make it possible to build modules separately - * Translations - * Deleted old translation methods. - * New translation infrastructure - * Translation for razor-config-appearance - * Fix for Issue #290 Fails to build on BSD - * Updated ts.src files - * removed useles window title - * fixed #336: remove the "razor" prefix from razor-config dialog - * config app for notifications - * Remove RazorNotification classes (no license/copyright) - * add module names to includes and tidy up the coding style - * Update razorqt-config/razor-config-mouse/thememodel.h - * Update razorqt-config/razor-config-mouse/selectwnd.h - * Update razorqt-config/razor-config-mouse/previewwidget.h - * Update razorqt-config/razor-config-mouse/itemdelegate.h - * Update razorqt-config/razor-config-mouse/crtheme.h - * fix coding style errors - * fix coding style errors - * fix coding style errors - * fix coding style errors - * fix coding style errors - * fix coding style errors - * fix coding style errors - * fix coding style errors - * Ts.src files updated. - * add module name to include - * add module names to includes - * add module names to includes and fix style errors - * fix coding style errors - * add module names to includes - * add module names to includes - * add module names to includes - * add module names to includes - * Language name zh_CN.GB2312 braked cmake process. - * Translations updated - * Environments should be "Razor", not "RAZOR" Thanks Alec Moskvin - * Renames razor-config-notificationd window title - * Small fixes in the razor-config-appearance Thanks PICCORO Lenz McKAY. still need some fixeds: iconthemeconfig.h:38: error: expected class-name before ‘{’ token and also the moc ui_mainwindow.h must be renamed too in iconthemeconfig.h - * Fix header - * Small fixes in the razor-config-appearance - * razor-config GUI improvement - * razor-config based on XDG Desktop Menu Specification 2 - * fixed #261 Fix missing icons in razor config center - * default arguments for notification client lib - * quick compilation fix - * razor-config based on XDG Desktop Menu Specification - * Composition on by default - * GUI for change razor theme. - * Fixing cmake error - * fixed wrongly set license for new files. It's LGPL2+ - * much better razor-config layout for icons - * config center: align icons into grid; do not show self; OnlyShowIn check - * reworked config stuff. No more special config registering. All 'Settings' desktop files are displayed in razor-config (grouped) - * Typos in code. Thanks Aaron Lewis. * In razor-runner , providers item: title() was typed as tile() * For RazorSettings class , settingsChanged() was typed as settigsChanged() - * Minor modifications and code cleanup - * Minor ui modifications. Moving default icon to notificationd instead of widget notification - * Setting min & max position according to QDesktopWidget - * Changing notification ui. Adding default notitifaction icon. Embedding icons in notification - * Properly install config Correct desktop file - * Proper default values - * Proper id number assigned to notifications Properly remove notification by quint32 id - * Proper configuration - * Rename file to match class name - * Remove custom settings, use razor ones - * Adding razor-config-notificationd - * tweaks for qtconfig installation - * qtconfig for razor-config - * Transifex desktop: sr_BA.ts should be a local - * Transifex desktop: local translations - * Transifex desktop: cmake files - * Transifex desktop: Translations pulled - * Transifex desktop: Reomove translations from desktop.in - * Transifex desktop: desktop->desktop.in - * Update Tradidtional Chinese Translations - * Add Traditional Chinese Translations - * Translations update - * Added support for the online translation service. www.transifex.net - * RazorApplication class implemented; all modules ported to this class - * fixed #76: razor-config should respect mouse behaviour - * Serbian translation files - * Serbian translations (2 variants) - * Greek translation by iosifidis - * Added danish translations - * Russian translation - * fix #169: italian translation - * Add function to use alternative icons - * Relicense - * Convert Appearance dialog to use RazorConfigDialog - * Fix gmail.ru -> gmail.com - * Czech translations (cs_CZ) Desktop files - * fixed #138: system settings icons - * SVK translation finalized - * Initial german [de] translation - * Close Issue #120 - * License audit - * Add Chinese(simplified) translation files. - * License audit - * HU translation by Kristóf Kiszel - * Initial spanish translation - * Add Slovak (sk) translation - * Removes one empty line from .desktop file - * Adds newline to the end of .desktop files - * Czech translations (cs_CZ) - * Fix a few typos - * XdgDesktopFile is implicitly shared - * huge refactoring of the libraries build organization - * config mouse: close button as in the other tools - * Razor-config-appearance: incorrect translation path - * config: better item layouting in razor-config - * config appearance: make icons fully visible - * Razor-config: Fixes for razor-config-appearance - * Razor-config: New razor-config-appearance - * Razor-config: New razor-config-appearance - * display icon theme fixes - * forgotten debugs - * config icons: show progress when it searches for themes - * icon theme config - initial revision - * Razor-config-mouse: Added check for zlib in CMakeLists.txt - * moc warnings cleanup - * GPL->LGPL where I'm the author - * config: remove toolbars - * Polish translation part X - * Fix: Desktop Menu Specification category must be X-RAZOR. - * Russian translations - * unify razor-config look - * Added razor-application.menu - * razor-config can open items by Enter key too - * fixed desktop files - * fix donfig desktp files install for rpm - * razor-config-mousetheme -> razor-config-mouse rename - * do not use direct lib name for X11 stuff - * issue #37 - Config-mousetheme show not all themes, my KDE show 6 themes but razor only 1. (mHidden attribute fixed) - * homepage updated + auto replacement script - * adding missing libraries to fedora build - * show only in RAZOR; close/undo changes actions - * small refactoring in mouse config - * fixed #35: razor-config-mousetheme saves are not persistent - * final fix for build error #34 - * potential fix for #34 - * mouse theme configurator - * fix for #33: razorqt doesn't build - * config tools are registered in config center; desktop file for CC - * initial revision of "config tool". Very simple but functional. diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 8828c3c..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) - -project(lxqt-config) -set(LXQT_CONFIG_PROJECT "${PROJECT_NAME}") - -option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF) -option(WITH_INPUT "Build the 'lxqt-config-input'" ON) -option(WITH_FILE_ASSOCIATIONS "Build the 'lxqt-config-file-associations'" ON) -option(WITH_APPEARANCE "Build the 'lxqt-config-appearance'" ON) -option(WITH_MONITOR "Build the 'lxqt-config-monitor'" ON) -option(WITH_BRIGHTNESS "Build the 'lxqt-config-brightness'" ON) -option(WITH_LOCALE "Build the 'lxqt-config-locale'" ON) - -include(GNUInstallDirs) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTORCC ON) - -find_package(Qt5Widgets REQUIRED) -find_package(Qt5DBus REQUIRED) -find_package(Qt5Xml REQUIRED) -find_package(Qt5Concurrent REQUIRED) -find_package(Qt5X11Extras REQUIRED) -find_package(Qt5LinguistTools REQUIRED) -find_package(lxqt REQUIRED) - -include(LXQtCompilerSettings NO_POLICY_SCOPE) - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) -endif() - -# Patch Version -set(LXQT_CONFIG_PATCH_VERSION 0) - -set(LXQT_CONFIG_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_CONFIG_PATCH_VERSION}) -add_definitions("-DLXQT_CONFIG_VERSION=\"${LXQT_CONFIG_VERSION}\"") - -include(LXQtTranslate) - -add_subdirectory(src) -if (WITH_INPUT OR WITH_APPEARANCE) - add_subdirectory(liblxqt-config-cursor) -endif() -if (WITH_INPUT) - add_subdirectory(lxqt-config-input) -endif() -if (WITH_FILE_ASSOCIATIONS) - add_subdirectory(lxqt-config-file-associations) -endif() -if (WITH_APPEARANCE) - add_subdirectory(lxqt-config-appearance) -endif() -if (WITH_MONITOR) - add_subdirectory(lxqt-config-monitor) -endif() -if (WITH_BRIGHTNESS) - add_subdirectory(lxqt-config-brightness) -endif() -if (WITH_LOCALE) - add_subdirectory(lxqt-config-locale) -endif() diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 20fb9c7..0000000 --- a/LICENSE +++ /dev/null @@ -1,458 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md deleted file mode 100644 index 61bcde8..0000000 --- a/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# lxqt-config - -## Overview - -This repository is providing several tools involved in the configuration of both LXQt and the underlying operating system. - -On the one hand it is featuring several GUI tools to configure topics like general appearance, pointer devices or screen resolutions. -On the other hand there's a GUI "Configuration Center" which summarizes all those configuration tools as well as counterparts of other LXQt components or third-party applications. - -### Configuration GUI tools - -#### LXQt Appearance Configuration - -Appearance of LXQt, that is topics like icon and LXQt theme or fonts. - -![LXQt Appearance Configuration (lxqt-config-appearance)](lxqt-config-appearance.png) - -Binary `lxqt-config-appearance`. - -#### Brightness - -Brightness settings of output devices. - -Technically colors are adjusted to simulate varying brightness if the system LXQt is running on doesn't allow for adjusting the brightness itself. - -Binary `lxqt-config-brightness`. - -#### File Associations - -Assigns MIME types to applications used to handle them. Not too user-friendly so far, see e. g. discussion in https://github.com/lxde/lxqt/issues/433. - -Binary `lxqt-config-file-associations`. - -#### Keyboard and Mouse - -Configures hardware of pointer devices. Settings like repeat delay and interval of keyboards or acceleration of pointer devices. - -Binary `lxqt-config-input`. - -#### Locale - -Locale used within LXQt sessions. Basically this GUI sets the well-known environment variables like `LANG` or `LC_*`. The settings apply to the session as a whole, that is to applications running within LXQt sessions but not belonging to LXQt, too. - -Binary `lxqt-config-locale`. - -#### Monitor Settings - -Adjusts screen resolutions, positioning of screens and the likes. - -Binary `lxqt-config-monitor`. - -### Configuration Center - -The "Configuration Center" (binary `lxqt-config`) is summarizing and providing various configuration GUIs. - -![Configuration Center (lxqt-config)](lxqt-config.png) - -First of all these are the ones belonging to repository lxqt-config described [above](https://github.com/lxde/lxqt-config#configuration-gui-tools). Next, it is hosting counterparts of several other LXQt components like "Desktop Notifications" of [lxqt-notificationd](https://github.com/lxde/lxqt-notificationd), "Shortcut Keys" of [lxqt-globalkeyshortcuts](https://github.com/lxde/lxqt-globalkeyshortcuts) or the tools provided by [lxqt-admin](https://github.com/lxde/lxqt-admin). Third-party applications can include their configuration tools in "Configuration Center", too. This applies e. g. to "Connman UI Setup" of [cmst](https://github.com/andrew-bibb/cmst) or "SDDM Configuration" of [sddm-config-editor](https://github.com/hagabaka/sddm-config-editor). - -## Installation - -### Compiling source code - -Runtime dependencies are Xcursor, qtsvg, KScreen and [liblxqt](https://github.com/lxde/liblxqt). -Additional build dependencies are CMake and optionally Git to pull latest VCS checkouts. The localization files were outsourced to repository [lxqt-l10n](https://github.com/lxde/lxqt-l10n) so the corresponding dependencies are needed, too. Please refer to this repository's `README.md` for further information. - -Code configuration is handled by CMake. CMake variable `CMAKE_INSTALL_PREFIX` has to be set to `/usr` on most operating systems, depending on the way library paths are dealt with on 64bit systems variables like `CMAKE_INSTALL_LIBDIR` may have to be set as well. - -To build run `make`, to install `make install` which accepts variable `DESTDIR` as usual. - -### Binary packages - -The library is provided by all major Linux distributions like Arch Linux, Debian (as of Debian stretch only), Fedora and openSUSE. Just use your package manager to search for string `lxqt-config`. - -## Usage - -Both the various configuration tools and the Configuration Center can be launched from the panel's main menu - Preferences - LXQt settings. Obviously the former can be launched from the latter, too. diff --git a/liblxqt-config-cursor/CMakeLists.txt b/liblxqt-config-cursor/CMakeLists.txt deleted file mode 100644 index 42e7f0d..0000000 --- a/liblxqt-config-cursor/CMakeLists.txt +++ /dev/null @@ -1,98 +0,0 @@ -project(lxqt-config-cursor) -find_package(X11 REQUIRED) - -find_package(XCB REQUIRED xcb) -include_directories(${XCB_INCLUDE_DIRS}) -link_libraries(${XCB_LIBRARIES}) - -include_directories ( - ${X11_INCLUDE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/xcr -) - -set(lxqt-config-cursor_HDRS - thememodel.h - previewwidget.h - itemdelegate.h - selectwnd.h - warninglabel.h -) - -set(lxqt-config-cursor_SRCS - crtheme.cpp - selectwnd.cpp - xcr/xcrimg.cpp - xcr/xcrxcur.cpp - xcr/xcrthemefx.cpp - xcr/xcrtheme.cpp - xcr/xcrthemexp.cpp - cfgfile.cpp - previewwidget.cpp - itemdelegate.cpp - thememodel.cpp - warninglabel.cpp -) - -set(lxqt-config-cursor_UIS - selectwnd.ui - warninglabel.ui -) - -find_package(ZLIB REQUIRED) - -# Translations ********************************** -lxqt_translate_ts(QM_FILES - UPDATE_TRANSLATIONS - ${UPDATE_TRANSLATIONS} - SOURCES - ${lxqt-config-cursor_HDRS} - ${lxqt-config-cursor_SRCS} - ${lxqt-config-cursor_UIS} - INSTALL_DIR - "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}" - PULL_TRANSLATIONS - ${PULL_TRANSLATIONS} - CLEAN_TRANSLATIONS - ${CLEAN_TRANSLATIONS} - TRANSLATIONS_REPO - ${TRANSLATIONS_REPO} - TRANSLATIONS_REFSPEC - ${TRANSLATIONS_REFSPEC} - REPO_SUBDIR - "lxqt-config/liblxqt-config-cursor" -) - -lxqt_app_translation_loader(lxqt-config-cursor_QM_LOADER ${PROJECT_NAME}) - -#************************************************ - -add_library(lxqt-config-cursor - SHARED - ${lxqt-config-cursor_SRCS} - ${DESKTOP_FILES} - ${QM_FILES} - ${lxqt-config-cursor_QM_LOADER} -) - -target_link_libraries(lxqt-config-cursor - Qt5::X11Extras - Qt5::DBus - Qt5::Xml - ${X11_X11_LIB} - ${X11_Xcursor_LIB} - lxqt - ${ZLIB_LIBRARY} - ${X11_Xfixes_LIB} -) -# not needed probably ${X11_Xfixes_LIB}) - -install(TARGETS - lxqt-config-cursor - DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LXQT_CONFIG_PROJECT}" - COMPONENT Runtime -) -install(FILES - ${DESKTOP_FILES} - DESTINATION "${CMAKE_INSTALL_DATAROOTDOR}/applications" - COMPONENT Runtime -) diff --git a/liblxqt-config-cursor/cfgfile.cpp b/liblxqt-config-cursor/cfgfile.cpp deleted file mode 100644 index 6d790a1..0000000 --- a/liblxqt-config-cursor/cfgfile.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#include "cfgfile.h" - -#include -#include -#include -#include - -QMultiMap loadCfgFile(const QString &fname, bool forceLoCase) -{ - QMultiMap res; - QFile fl(fname); - if (fl.open(QIODevice::ReadOnly)) - { - QTextStream stream; - stream.setDevice(&fl); - stream.setCodec("UTF-8"); - QString curPath = "/"; - while (1) - { - QString s = stream.readLine(); - if (s.isNull()) break; - s = s.trimmed(); - if (s.isEmpty() || s[0] == '#' || s[0] == ';') continue; - if (s[0] == '[') - { - // new path - int len = s.length()-1; - if (s[len] == ']') len--; - s = s.mid(1, len).simplified(); - s += '/'; - curPath = s; - continue; - } - int eqp = s.indexOf('='); - if (eqp < 0) continue; // invalid entry - QString name = s.left(eqp).simplified(); - QString value = s.mid(eqp+1).simplified(); - if (name.isEmpty()) continue; // invalid entry - name.prepend(curPath); - if (forceLoCase) name = name.toLower(); - res.insert(name, value); - } - fl.close(); - } - return res; -} - -void fixXDefaults(const QString &themeName) -{ - QStringList lst; - { - QFile fl(QDir::home().path()+"/.Xdefaults"); - if (fl.open(QIODevice::ReadOnly)) - { - QTextStream stream; - stream.setDevice(&fl); - while (1) - { - QString s = stream.readLine(); - if (s.isNull()) - break; - // if the line does not contain Xcursor?theme, save it to a list - if (!(s.startsWith(QLatin1String("Xcursor")) && s.midRef(8).startsWith(QLatin1String("theme")))) - lst << s; - } - fl.close(); - } - } - while (lst.size() > 0) - { - QString s(lst[lst.size()-1]); - if (!s.trimmed().isEmpty()) break; - lst.removeAt(lst.size()-1); - } - { - //QByteArray ba(themeName.toUtf8()); - QFile fl(QDir::home().path()+"/.Xdefaults"); - if (fl.open(QIODevice::WriteOnly)) - { - QTextStream stream; - stream.setDevice(&fl); - foreach (const QString &s, lst) - { - stream << s << "\n"; - } - stream << "\nXcursor.theme: " << themeName << "\n"; - fl.close(); - } - } -} - -const QString findDefaultTheme() -{ - QString res = "default"; - QFile fl(QDir::home().path()+"/.Xdefaults"); - if (fl.open(QIODevice::ReadOnly)) - { - QTextStream stream; - stream.setDevice(&fl); - while (1) - { - QString s = stream.readLine(); - if (s.isNull()) break; - if (!s.startsWith("Xcursor.theme:")) continue; - s.remove(0, 14); - s = s.trimmed(); - if (s.isEmpty()) s = "default"; - res = s; - } - fl.close(); - } - return res; -} diff --git a/liblxqt-config-cursor/cfgfile.h b/liblxqt-config-cursor/cfgfile.h deleted file mode 100644 index a6d7528..0000000 --- a/liblxqt-config-cursor/cfgfile.h +++ /dev/null @@ -1,20 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#ifndef CFGFILE_H -#define CFGFILE_H - -#include -#include - -QMultiMap loadCfgFile(const QString &fname, bool forceLoCase=false); -void fixXDefaults(const QString &themeName); -const QString findDefaultTheme(); - -#endif diff --git a/liblxqt-config-cursor/crtheme.cpp b/liblxqt-config-cursor/crtheme.cpp deleted file mode 100644 index 1b6d565..0000000 --- a/liblxqt-config-cursor/crtheme.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/* Copyright © 2006-2007 Fredrik Höglund - * (c)GPL2 (c)GPL3 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License version 2 or at your option version 3 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/* - * additional code: Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - */ -#include - -#include "crtheme.h" - -#include -#include - -#include "cfgfile.h" - -#include -#include -#include - -// Static variable holding alternative names for some cursors -static QHash alternatives; - -/////////////////////////////////////////////////////////////////////////////// -XCursorThemeData::XCursorThemeData(const QDir &aDir) -{ - mHidden = false; - // parse configs, etc - mPath = aDir.path(); - setName(aDir.dirName()); - if (aDir.exists("index.theme")) parseIndexFile(); - if (mDescription.isEmpty()) mDescription = "no description"; - if (mTitle.isEmpty()) mTitle = mName; -} - -void XCursorThemeData::parseIndexFile() -{ - QMultiMap cfg = loadCfgFile(mPath+"/index.theme", true); - if (cfg.contains("icon theme/name")) mTitle = cfg.values("icon theme/name").at(0).trimmed(); - if (cfg.contains("icon theme/comment")) mDescription = cfg.values("icon theme/comment").at(0).trimmed(); - if (cfg.contains("icon theme/example")) mSample = cfg.values("icon theme/example").at(0).trimmed(); - if (cfg.contains("icon theme/hidden")) - { - QString hiddenValue = cfg.values("icon theme/hidden").at(0).toLower(); - mHidden = hiddenValue=="false" ? false : true; - } - if (cfg.contains("icon theme/inherits")) - { - QStringList i = cfg.values("icon theme/inherits"), res; - for (int f = i.size()-1; f >= 0; f--) res << i.at(f).trimmed(); - } - if (mDescription.startsWith("- Converted by")) mDescription.remove(0, 2); -} - -QString XCursorThemeData::findAlternative(const QString &name) const -{ - if (alternatives.isEmpty()) - { - alternatives.reserve(18); - - // Qt uses non-standard names for some core cursors. - // If Xcursor fails to load the cursor, Qt creates it with the correct name using the - // core protcol instead (which in turn calls Xcursor). We emulate that process here. - // Note that there's a core cursor called cross, but it's not the one Qt expects. - alternatives.insert("cross", "crosshair"); - alternatives.insert("up_arrow", "center_ptr"); - alternatives.insert("wait", "watch"); - alternatives.insert("ibeam", "xterm"); - alternatives.insert("size_all", "fleur"); - alternatives.insert("pointing_hand", "hand2"); - - // Precomputed MD5 hashes for the hardcoded bitmap cursors in Qt and KDE. - // Note that the MD5 hash for left_ptr_watch is for the KDE version of that cursor. - alternatives.insert("size_ver", "00008160000006810000408080010102"); - alternatives.insert("size_hor", "028006030e0e7ebffc7f7070c0600140"); - alternatives.insert("size_bdiag", "c7088f0f3e6c8088236ef8e1e3e70000"); - alternatives.insert("size_fdiag", "fcf1c3c7cd4491d801f1e1c78f100000"); - alternatives.insert("whats_this", "d9ce0ab605698f320427677b458ad60b"); - alternatives.insert("split_h", "14fef782d02440884392942c11205230"); - alternatives.insert("split_v", "2870a09082c103050810ffdffffe0204"); - alternatives.insert("forbidden", "03b6e0fcb3499374a867c041f52298f0"); - alternatives.insert("left_ptr_watch", "3ecb610c1bf2410f44200f48c40d3599"); - alternatives.insert("hand2", "e29285e634086352946a0e7090d73106"); - alternatives.insert("openhand", "9141b49c8149039304290b508d208c40"); - alternatives.insert("closedhand", "05e88622050804100c20044008402080"); - } - - return alternatives.value(name, QString()); -} - -QPixmap XCursorThemeData::icon() const -{ - if (mIcon.isNull()) mIcon = createIcon(); - return mIcon; -} - -QImage XCursorThemeData::autoCropImage(const QImage &image) const -{ - // Compute an autocrop rectangle for the image - QRect r(image.rect().bottomRight(), image.rect().topLeft()); - const quint32 *pixels = reinterpret_cast(image.bits()); - for (int y = 0; y < image.height(); ++y) - { - for (int x = 0; x < image.width(); ++x) - { - if (*(pixels++)) - { - if (x < r.left()) r.setLeft(x); - if (x > r.right()) r.setRight(x); - if (y < r.top()) r.setTop(y); - if (y > r.bottom()) r.setBottom(y); - } - } - } - // Normalize the rectangle - return image.copy(r.normalized()); -} - -static int nominalCursorSize(int iconSize) -{ - for (int i = 512; i > 8; i /= 2) - { - if (i < iconSize) return i; - if ((i*0.75) < iconSize) return int(i*0.75); - } - return 8; -} - -QPixmap XCursorThemeData::createIcon() const -{ - int iconSize = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize); - int cursorSize = nominalCursorSize(iconSize); - QSize size = QSize(iconSize, iconSize); - - QPixmap pixmap; - QImage image = loadImage(sample(), cursorSize); - if (image.isNull() && sample() != "left_ptr") image = loadImage("left_ptr", cursorSize); - if (!image.isNull()) - { - // Scale the image if it's larger than the preferred icon size - if (image.width() > size.width() || image.height() > size.height()) - { - image = image.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); - pixmap = QPixmap::fromImage(image); - } - } - return pixmap; -} - -XcursorImage *XCursorThemeData::xcLoadImage(const QString &image, int size) const -{ - QByteArray cursorName = QFile::encodeName(image); - QByteArray themeName = QFile::encodeName(name()); - return XcursorLibraryLoadImage(cursorName, themeName, size); -} - -XcursorImages *XCursorThemeData::xcLoadImages(const QString &image, int size) const -{ - QByteArray cursorName = QFile::encodeName(image); - QByteArray themeName = QFile::encodeName(name()); - return XcursorLibraryLoadImages(cursorName, themeName, size); -} - -unsigned long XCursorThemeData::loadCursorHandle(const QString &name, int size) const -{ - if (size == -1) size = XcursorGetDefaultSize(QX11Info::display()); - // Load the cursor images - XcursorImages *images = xcLoadImages(name, size); - if (!images) images = xcLoadImages(findAlternative(name), size); - // Fall back to a legacy cursor - //if (!images) return LegacyTheme::loadCursor(name); - if (!images) return 0; - // Create the cursor - unsigned long handle = (unsigned long)XcursorImagesLoadCursor(QX11Info::display(), images); - XcursorImagesDestroy(images); - //setCursorName(cursor, name); - return handle; -} - -QImage XCursorThemeData::loadImage(const QString &name, int size) const -{ - if (size == -1) size = XcursorGetDefaultSize(QX11Info::display()); - // Load the image - XcursorImage *xcimage = xcLoadImage(name, size); - if (!xcimage) xcimage = xcLoadImage(findAlternative(name), size); - // Fall back to a legacy cursor - //if (!xcimage) return LegacyTheme::loadImage(name); - if (!xcimage) return QImage(); - // Convert the XcursorImage to a QImage, and auto-crop it - QImage image((uchar *)xcimage->pixels, xcimage->width, xcimage->height, QImage::Format_ARGB32_Premultiplied); - image = autoCropImage(image); - XcursorImageDestroy(xcimage); - return image; -} - -bool XCursorThemeData::isWritable() const -{ - QFileInfo fi(path()); - return fi.isWritable(); -} - -/////////////////////////////////////////////////////////////////////////////// -bool haveXfixes() -{ - bool result = false; - int event_base, error_base; - if (XFixesQueryExtension(QX11Info::display(), &event_base, &error_base)) - { - int major, minor; - XFixesQueryVersion(QX11Info::display(), &major, &minor); - result = (major >= 2); - } - return result; -} - -bool applyTheme(const XCursorThemeData &theme) -{ - // Require the Xcursor version that shipped with X11R6.9 or greater, since - // in previous versions the Xfixes code wasn't enabled due to a bug in the - // build system (freedesktop bug #975). - if (!haveXfixes()) return false; - - QByteArray themeName = QFile::encodeName(theme.name()); - - // Set up the proper launch environment for newly started apps - //k8:!!!:KToolInvocation::klauncher()->setLaunchEnv("XCURSOR_THEME", themeName); - - // Update the Xcursor X resources - //k8:!!!:runRdb(0); - - // Reload the standard cursors - QStringList names; - // Qt cursors - names << "left_ptr" << "up_arrow" << "cross" << "wait" - << "left_ptr_watch" << "ibeam" << "size_ver" << "size_hor" - << "size_bdiag" << "size_fdiag" << "size_all" << "split_v" - << "split_h" << "pointing_hand" << "openhand" - << "closedhand" << "forbidden" << "whats_this"; - // X core cursors - names << "X_cursor" << "right_ptr" << "hand1" - << "hand2" << "watch" << "xterm" - << "crosshair" << "left_ptr_watch" << "center_ptr" - << "sb_h_double_arrow" << "sb_v_double_arrow" << "fleur" - << "top_left_corner" << "top_side" << "top_right_corner" - << "right_side" << "bottom_right_corner" << "bottom_side" - << "bottom_left_corner" << "left_side" << "question_arrow" - << "pirate"; - - //QX11Info x11Info; - foreach (const QString &name, names) - { - Cursor cursor = (Cursor)theme.loadCursorHandle(name); - XFixesChangeCursorByName(QX11Info::display(), cursor, QFile::encodeName(name)); - // FIXME: do we need to free the cursor? - } - return true; -} - -QString getCurrentTheme() -{ - return XcursorGetTheme(QX11Info::display()); -} diff --git a/liblxqt-config-cursor/crtheme.h b/liblxqt-config-cursor/crtheme.h deleted file mode 100644 index 83cd541..0000000 --- a/liblxqt-config-cursor/crtheme.h +++ /dev/null @@ -1,119 +0,0 @@ -/* Copyright © 2006-2007 Fredrik Höglund - * (c)GPL2 (c)GPL3 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License version 2 or at your option version 3 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/* - * additional code: Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - */ -#ifndef CRTHEME_H -#define CRTHEME_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// X11 is SHIT! -struct _XcursorImage; -struct _XcursorImages; - -typedef _XcursorImage XcursorImage; -typedef _XcursorImages XcursorImages; - - -/////////////////////////////////////////////////////////////////////////////// -class XCursorThemeData -{ -public: - enum ItemDataRole { - // Note: use printf "0x%08X\n" $(($RANDOM*$RANDOM)) - // to define additional roles. - DisplayDetailRole = 0x24A3DAF8 - }; - - XCursorThemeData(const QDir &aDir); - - const QString &name() const { return mName; } - const QString &title() const { return mTitle; } - const QString &description() const { return mDescription; } - const QString &sample() const { return mSample; } - const QString &path() const { return mPath; } - bool isHidden() const { return mHidden; } - QPixmap icon() const; - const QStringList &inherits() const { return mInherits; } - - inline void setName(const QString &name) - { - mName = name; - mHash = qHash(name); - } - - bool isWritable() const; - - /// Hash value for the internal name - uint hash() const { return mHash; } - - /// Loads the cursor @p name, with the nominal size @p size. - /// If the theme doesn't have the cursor @p name, it should return - /// the default cursor from the active theme instead. - unsigned long loadCursorHandle(const QString &name, int size=-1) const; - - /// Loads the cursor image @p name, with the nominal size @p size. - /// The image should be autocropped to the smallest possible size. - /// If the theme doesn't have the cursor @p name, it should return a null image. - QImage loadImage(const QString &name, int size=-1) const; - - XcursorImage *xcLoadImage(const QString &image, int size=-1) const; - XcursorImages *xcLoadImages(const QString &image, int size=-1) const; - - QString findAlternative(const QString &name) const; - -protected: - void parseIndexFile(); - - /// Creates the icon returned by @ref icon(). - QPixmap createIcon() const; - - /// Convenience function for cropping an image. - QImage autoCropImage(const QImage &image) const; - -protected: - QString mName; - QString mTitle; - QString mDescription; - QString mPath; - QString mSample; - mutable QPixmap mIcon; - bool mHidden; - uint mHash; - QStringList mInherits; -}; - -bool haveXfixes(); -bool applyTheme(const XCursorThemeData &theme); - -QString getCurrentTheme(); - -#endif diff --git a/liblxqt-config-cursor/itemdelegate.cpp b/liblxqt-config-cursor/itemdelegate.cpp deleted file mode 100644 index 9f9df14..0000000 --- a/liblxqt-config-cursor/itemdelegate.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* Copyright © 2006-2007 Fredrik Höglund - * (c)GPL2 (c)GPL3 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License version 2 or at your option version 3 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/* - * additional code: Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - */ -#include "itemdelegate.h" -#include "crtheme.h" - -#include -#include -#include - - -namespace { - const int decorationMargin = 8; -} - - -/////////////////////////////////////////////////////////////////////////////// -ItemDelegate::ItemDelegate(QObject *parent) : QAbstractItemDelegate(parent) -{ -} - - -ItemDelegate::~ItemDelegate() -{ -} - -QString ItemDelegate::firstLine(const QModelIndex &index) const -{ - if (index.isValid()) return index.model()->data(index, Qt::DisplayRole).toString(); - return QString(); -} - -QString ItemDelegate::secondLine(const QModelIndex &index) const -{ - if (index.isValid()) return index.model()->data(index, XCursorThemeData::DisplayDetailRole).toString(); - return QString(); -} - -QPixmap ItemDelegate::decoration(const QModelIndex &index) const -{ - if (index.isValid()) return qvariant_cast(index.model()->data(index, Qt::DecorationRole)); - return QPixmap(); -} - -QSize ItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const -{ - if (!index.isValid()) return QSize(); - - QFont normalfont = option.font; - QFont boldfont = normalfont; - boldfont.setBold(true); - // Extract the items we want to measure - QString firstRow = firstLine(index); - QString secondRow = secondLine(index); - // Compute the height - QFontMetrics fm1(boldfont); - QFontMetrics fm2(normalfont); - int height = fm1.lineSpacing() + fm2.lineSpacing(); - height = qMax(height, option.decorationSize.height()); - // Compute the text width - int width = fm1.width(firstRow); - width = qMax(width, fm2.width(secondRow)); - // Add decoration width + margin - width += option.decorationSize.width()+decorationMargin; - return QSize(width, height+16); -} - -QPalette::ColorRole ItemDelegate::foregroundRole(const QStyleOptionViewItem &option, const QModelIndex &index) const -{ - Q_UNUSED(index) - if (option.state & QStyle::State_Selected) return QPalette::HighlightedText; - return QPalette::Text; -} - -void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const -{ - if (!index.isValid()) return; - painter->save(); - - QFont normalfont = option.font; - QFont boldfont = normalfont; - boldfont.setBold(true); - - QString firstRow = firstLine(index); - QString secondRow = secondLine(index); - QPixmap pixmap = decoration(index); - - QColor textcol = option.palette.color(foregroundRole(option, index)); - - // Draw the background - QStyleOptionViewItem opt = option; - QStyle *style = opt.widget ? opt.widget->style() : QApplication::style(); - style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, opt.widget); - - // Draw the icon - int x = option.rect.left()+(option.decorationSize.width()-pixmap.width()+decorationMargin)/2; - int y = option.rect.top()+(option.rect.height()-pixmap.height())/2; - QRect pixmapRect = QStyle::visualRect(option.direction, option.rect, QRect(x, y, pixmap.width(), pixmap.height())); - painter->drawPixmap(pixmapRect.x(), pixmapRect.y(), pixmap); - - // Draw the text - QFontMetrics fm1(boldfont); - QFontMetrics fm2(normalfont); - - int textAreaHeight = fm1.lineSpacing()+fm2.lineSpacing(); - - x = option.rect.left()+option.decorationSize.width()+decorationMargin; - int y1 = option.rect.top()+(option.rect.height()-textAreaHeight)/2; - int y2 = y1+fm1.lineSpacing(); - QRect firstRowRect = QStyle::visualRect(option.direction, option.rect, QRect(x, y1, fm1.width(firstRow), fm1.lineSpacing())); - QRect secondRowRect = QStyle::visualRect(option.direction, option.rect, QRect(x, y2, fm2.width(secondRow), fm2.lineSpacing())); - painter->setPen(textcol); - - // First line - painter->setFont(boldfont); - painter->drawText(firstRowRect, Qt::AlignCenter, firstRow); - - // Second line - painter->setFont(normalfont); - painter->drawText(secondRowRect, Qt::AlignCenter, secondRow); - - painter->restore(); -} diff --git a/liblxqt-config-cursor/itemdelegate.h b/liblxqt-config-cursor/itemdelegate.h deleted file mode 100644 index ff14467..0000000 --- a/liblxqt-config-cursor/itemdelegate.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright © 2006-2007 Fredrik Höglund - * (c)GPL2 (c)GPL3 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License version 2 or at your option version 3 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/* - * additional code: Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - */ -#ifndef ITEMDELEGATE_H -#define ITEMDELEGATE_H - -#include - -class QPainter; - - -class ItemDelegate : public QAbstractItemDelegate -{ - Q_OBJECT - -public: - ItemDelegate(QObject *parent = 0); - ~ItemDelegate(); - - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; - void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; - -private: - QString firstLine(const QModelIndex &index) const; - QString secondLine(const QModelIndex &index) const; - QPixmap decoration(const QModelIndex &index) const; - QPalette::ColorRole foregroundRole(const QStyleOptionViewItem &option, const QModelIndex &index) const; -}; - -#endif diff --git a/liblxqt-config-cursor/main.cpp b/liblxqt-config-cursor/main.cpp deleted file mode 100644 index 2a5cb92..0000000 --- a/liblxqt-config-cursor/main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -//#include -#include - -#include -#include -#include "main.h" -#include "lxqttranslate.h" - -#include -#include -#include -#include -#include -#include -#include - - -/////////////////////////////////////////////////////////////////////////////// -int main (int argc, char *argv[]) -{ - //QTextCodec::setCodecForCStrings(QTextCodec::codecForName("koi8-r")); - //QTextCodec::setCodecForLocale(QTextCodec::codecForName("koi8-r")); - - LXQt::Application app(argc, argv); - app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); - - TRANSLATE_APP; - - //qDebug() << findDefaultTheme() << getCurrentTheme(); - - SelectWnd *sw = new SelectWnd; - sw->show(); - sw->setCurrent(); - return app.exec(); -} diff --git a/liblxqt-config-cursor/main.h b/liblxqt-config-cursor/main.h deleted file mode 100644 index 09b9673..0000000 --- a/liblxqt-config-cursor/main.h +++ /dev/null @@ -1,19 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#ifndef MAIN_H -#define MAIN_H - - -#include "cfgfile.h" -#include "crtheme.h" -#include "selectwnd.h" - - -#endif diff --git a/liblxqt-config-cursor/man/lxqt-config-mouse.1 b/liblxqt-config-cursor/man/lxqt-config-mouse.1 deleted file mode 100644 index b69b08e..0000000 --- a/liblxqt-config-cursor/man/lxqt-config-mouse.1 +++ /dev/null @@ -1,39 +0,0 @@ -.TH lxqt-config-cursor "1" "September 2012" "LXQt\ 0.7.0" "LXQt\ Cursor settings" -.SH NAME -lxqt-config-cursor \- Application of \fBLXQt\fR: the faster and lighter Qt Desktop Environment -.SH SYNOPSIS -.B lxqt-config-cursor -.br -.SH DESCRIPTION -This is a simple GUI cursor theme configuration (at the moment) for the LXQt desktop environment. -Also can manage theme installation for it (locally for/per user only). -.P -\fBLXQt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt -technologies, ships several core desktop components, all of which are optional: -.P - * Panel - * Desktop - * Application launcher - * Settings center \fI(related to this)\fR - * Session handler - * Polkit handler - * SSH password access - * Display manager handler -.P -These components perform similar actions to those available in other desktop -environments, and their name is self-descriptive. They are usually not launched -by hand but automatically, when choosing a \fBLXQt\-qt\fR session in the Display -Manager. -.P -.SH "REPORTING BUGS" -Report bugs to https://github.com/lxde/lxqt/issues -.SH "SEE ALSO" -\fBLXQt\fR has been tailored for users who value simplicity, speed, and -an intuitive interface, also intended for less powerful machines. See also: -.\" any module must refers to session app, for more info on start it -.P -\fBlxqt-config(1)\fR LXQt application for performing settings on many applications -.P -.SH AUTHOR -This manual page was created by \fBPICCORO Lenz McKAY\fR \fI\fR -for \fBLXQt\fR project and VENENUX GNU/Linux but can be used by others. diff --git a/liblxqt-config-cursor/previewwidget.cpp b/liblxqt-config-cursor/previewwidget.cpp deleted file mode 100644 index 7fe319e..0000000 --- a/liblxqt-config-cursor/previewwidget.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* Copyright © 2003-2007 Fredrik Höglund - * (c)GPL2 (c)GPL3 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/* - * additional code: Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - */ -#include - -#include -#include - -#include "previewwidget.h" - -#include "crtheme.h" - -#include -#include - -#include -#include - -namespace { - // Preview cursors - const char *const cursorNames[] = { - "left_ptr", - "left_ptr_watch", - "wait", - "pointing_hand", - "whats_this", - "ibeam", - "size_all", - "size_fdiag", - "cross", - "split_h", - "size_ver", - "size_hor", - "size_bdiag", - "split_v", - }; - - const int numCursors = 9; // The number of cursors from the above list to be previewed - const int previewSize = 24; // The nominal cursor size to be used in the preview widget - const int cursorSpacing = 20; // Spacing between preview cursors - const int widgetMinWidth = 10; // The minimum width of the preview widget - const int widgetMinHeight = 48; // The minimum height of the preview widget -} - - -/////////////////////////////////////////////////////////////////////////////// -class PreviewCursor -{ - public: - PreviewCursor (const XCursorThemeData &theme, const QString &name); - ~PreviewCursor () {} - - const QPixmap &pixmap () const { return mPixmap; } - int width () const { return mPixmap.width(); } - int height () const { return mPixmap.height(); } - inline QRect rect () const; - void setPosition (const QPoint &p) { mPos = p; } - void setPosition (int x, int y) { mPos = QPoint(x, y); } - QPoint position () const { return mPos; } - operator const xcb_cursor_t& () const { return mCursorHandle; } - operator const QPixmap& () const { return pixmap(); } - - private: - QPixmap mPixmap; - xcb_cursor_t mCursorHandle; - QPoint mPos; -}; - - -/////////////////////////////////////////////////////////////////////////////// -PreviewCursor::PreviewCursor(const XCursorThemeData &theme, const QString &name) -{ - // Create the preview pixmap - QImage image = theme.loadImage(name, previewSize); - if (image.isNull()) return; - int maxSize = previewSize*2; - if (image.height() > maxSize || image.width() > maxSize) - image = image.scaled(maxSize, maxSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); - mPixmap = QPixmap::fromImage(image); - // load the cursor - mCursorHandle = theme.loadCursorHandle(name, previewSize); -} - -QRect PreviewCursor::rect() const -{ - return QRect(mPos, mPixmap.size()).adjusted(-(cursorSpacing/2), -(cursorSpacing/2), cursorSpacing/2, cursorSpacing/2); -} - - -/////////////////////////////////////////////////////////////////////////////// -PreviewWidget::PreviewWidget(QWidget *parent) : QWidget(parent) -{ - setMouseTracking(true); - mCurrent = NULL; -} - -PreviewWidget::~PreviewWidget() -{ - qDeleteAll(mList); - mList.clear(); -} - - -// Since Qt5, wrapping a Cursor handle with QCursor is no longer supported. -// So we have to do it ourselves. I really hate Qt 5! -void PreviewWidget::setCursorHandle(xcb_cursor_t cursorHandle) -{ - WId wid = nativeParentWidget()->windowHandle()->winId(); - xcb_change_window_attributes(QX11Info::connection(), wid, XCB_CW_CURSOR, &cursorHandle); - xcb_flush(QX11Info::connection()); -} - - -QSize PreviewWidget::sizeHint() const -{ - int totalWidth = 0, maxHeight = 0; - foreach (const PreviewCursor *c, mList) - { - totalWidth += c->width(); - maxHeight = qMax(c->height(), maxHeight); - } - totalWidth += (mList.count()-1)*cursorSpacing; - maxHeight = qMax(maxHeight, widgetMinHeight); - return QSize(qMax(totalWidth, widgetMinWidth), qMax(height(), maxHeight)); -} - -void PreviewWidget::layoutItems() -{ - if (!mList.isEmpty()) - { - QSize size = sizeHint(); - int cursorWidth = size.width()/mList.count(); - int nextX = (width()-size.width())/2; - foreach (PreviewCursor *c, mList) - { - c->setPosition(nextX+(cursorWidth-c->width())/2, (height()-c->height())/2); - nextX += cursorWidth; - } - } - mNeedLayout = false; -} - -void PreviewWidget::setTheme(const XCursorThemeData &theme) -{ - qDeleteAll(mList); - mList.clear(); - for (int i = 0; i < numCursors; ++i) mList << new PreviewCursor(theme, cursorNames[i]); - mNeedLayout = true; - updateGeometry(); - mCurrent = NULL; - update(); -} - - -void PreviewWidget::clearTheme() -{ - qDeleteAll(mList); - mList.clear(); - mCurrent = NULL; - update(); -} - -void PreviewWidget::paintEvent(QPaintEvent *) -{ - QPainter p(this); - if (mNeedLayout) layoutItems(); - foreach (const PreviewCursor *c, mList) - { - if (c->pixmap().isNull()) continue; - p.drawPixmap(c->position(), *c); - } -} - -void PreviewWidget::mouseMoveEvent(QMouseEvent *e) -{ - if (mNeedLayout) layoutItems(); - foreach (const PreviewCursor *c, mList) - { - if (c->rect().contains(e->pos())) - { - if (c != mCurrent) - { - // NOTE: we have to set the Qt cursor value to something other than Qt::ArrowCursor - // Otherwise, though we set the xcursor handle to the underlying window, Qt still - // thinks that the current cursor is Qt::ArrowCursor and will not restore the cursor - // later when we call setCursor(Qt::ArrowCursor). So, we set it to BlankCursor to - // cheat Qt so it knows that the current cursor is not Qt::ArrowCursor. - // This is a dirty hack, but without this, Qt cannot restore Qt::ArrowCursor later. - setCursor(Qt::BlankCursor); - setCursorHandle(*c); - mCurrent = c; - } - return; - } - } - setCursor(Qt::ArrowCursor); - mCurrent = NULL; -} - - -void PreviewWidget::resizeEvent(QResizeEvent *) -{ - if (!mList.isEmpty()) mNeedLayout = true; -} diff --git a/liblxqt-config-cursor/previewwidget.h b/liblxqt-config-cursor/previewwidget.h deleted file mode 100644 index 3d035ea..0000000 --- a/liblxqt-config-cursor/previewwidget.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright © 2003-2007 Fredrik Höglund - * (c)GPL2 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/* - * additional code: Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - */ -#ifndef PREVIEWWIDGET_H -#define PREVIEWWIDGET_H - -#include - -#include -#include - -class XCursorThemeData; -class PreviewCursor; - -class PreviewWidget : public QWidget -{ - Q_OBJECT - -public: - PreviewWidget (QWidget *parent=0); - ~PreviewWidget (); - - void setTheme (const XCursorThemeData &theme); - void clearTheme (); - - QSize sizeHint () const; - - void setCursorHandle(xcb_cursor_t cursorHandle); - -protected: - void paintEvent (QPaintEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void resizeEvent (QResizeEvent *e); - -private: - void layoutItems (); - - QList mList; - const PreviewCursor *mCurrent; - bool mNeedLayout; -}; - -#endif diff --git a/liblxqt-config-cursor/selectwnd.cpp b/liblxqt-config-cursor/selectwnd.cpp deleted file mode 100644 index 8a1fa18..0000000 --- a/liblxqt-config-cursor/selectwnd.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ - -// 2014-04-10 modified by Hong Jen Yee (PCMan) for integration with lxqt-config-input - -#include - -#include "selectwnd.h" -#include "ui_selectwnd.h" - -#include -#include -#include -#include -#include -#include - -#include "cfgfile.h" -#include "crtheme.h" -#include "thememodel.h" -#include "itemdelegate.h" - -#include "xcrimg.h" -#include "xcrxcur.h" -#include "xcrtheme.h" - -#include -#include -#include -#include - -#define HOME_ICON_DIR QDir::homePath() + "/.icons" - -SelectWnd::SelectWnd(LXQt::Settings* settings, QWidget *parent) - : QWidget(parent), - mSettings(settings), - ui(new Ui::SelectWnd) -{ - ui->setupUi(this); - ui->warningLabel->hide(); - - mModel = new XCursorThemeModel(this); - - int size = style()->pixelMetric(QStyle::PM_LargeIconSize); - ui->lbThemes->setModel(mModel); - ui->lbThemes->setItemDelegate(new ItemDelegate(this)); - ui->lbThemes->setIconSize(QSize(size, size)); - ui->lbThemes->setSelectionMode(QAbstractItemView::SingleSelection); - - // Make sure we find out about selection changes - connect(ui->lbThemes->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), - SLOT(currentChanged(const QModelIndex &, const QModelIndex &))); - // display/hide warning label - connect(mModel, SIGNAL(modelReset()), - this, SLOT(handleWarning())); - connect(mModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)), - this, SLOT(handleWarning())); - connect(mModel, SIGNAL(rowsRemoved(const QModelIndex&, int, int)), - this, SLOT(handleWarning())); - - connect(ui->warningLabel, SIGNAL(showDirInfo()), - this, SLOT(showDirInfo())); - - // Disable the install button if we can't install new themes to ~/.icons, - // or Xcursor isn't set up to look for cursor themes there - ui->btInstall->setEnabled(mModel->searchPaths().contains(HOME_ICON_DIR) && iconsIsWritable()); - // TODO/FIXME: btInstall functionality - ui->btInstall->hide(); - ui->btRemove->hide(); - - //QTimer::singleShot(0, this, SLOT(setCurrent())); - - handleWarning(); -} - - -SelectWnd::~SelectWnd() -{ - delete ui; -} - -void SelectWnd::setCurrent() -{ - ui->lbThemes->selectionModel()->clear(); - - QString ct = getCurrentTheme(); - mAppliedIndex = mModel->defaultIndex(); - - if (!ct.isEmpty()) mAppliedIndex = mModel->findIndex(ct); - else mAppliedIndex = mModel->defaultIndex(); - - if (mAppliedIndex.isValid()) - { - const XCursorThemeData *theme = mModel->theme(mAppliedIndex); - // Select the current theme - selectRow(mAppliedIndex); - ui->lbThemes->scrollTo(mAppliedIndex, QListView::PositionAtCenter); - // Update the preview widget as well - if (theme) ui->preview->setTheme(*theme);// else ui->preview->clearTheme(); - } -} - -bool SelectWnd::iconsIsWritable() const -{ - const QFileInfo icons = QFileInfo(HOME_ICON_DIR); - const QFileInfo home = QFileInfo(QDir::homePath()); - return ((icons.exists() && icons.isDir() && icons.isWritable()) || (!icons.exists() && home.isWritable())); -} - -/* -void SelectWnd::keyPressEvent(QKeyEvent *e) -{ - if (e->key() == Qt::Key_Escape) close(); -} -*/ - -void SelectWnd::selectRow(int row) const -{ - // Create a selection that stretches across all columns - QModelIndex from = mModel->index(row, 0); - QModelIndex to = mModel->index(row, mModel->columnCount()-1); - QItemSelection selection(from, to); - ui->lbThemes->selectionModel()->select(selection, QItemSelectionModel::Select); - ui->lbThemes->selectionModel()->setCurrentIndex(mAppliedIndex, QItemSelectionModel::NoUpdate); -} - -void SelectWnd::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) -{ - Q_UNUSED(previous) - if (current.isValid()) { - const XCursorThemeData *theme = mModel->theme(current); - if (theme) { - ui->preview->setTheme(*theme); - ui->btRemove->setEnabled(theme->isWritable()); - } else { - ui->preview->clearTheme(); - } - - // directly apply the current settings - applyCurrent(); - } else { - ui->preview->clearTheme(); - } - //emit changed(mAppliedIndex != current); -} - -void SelectWnd::on_btInstall_clicked() -{ - qDebug() << "'install' clicked"; -} - -void SelectWnd::applyCurrent() -{ - //qDebug() << "'set' clicked"; - const XCursorThemeData *theme = mModel->theme(ui->lbThemes->currentIndex()); - if (!theme) return; - applyTheme(*theme); - fixXDefaults(theme->name()); - - // call xrdb to merge the new settings in ~/.Xdefaults - // FIXME: need to check if we're running in X? - QProcess xrdb; - xrdb.start("xrdb -merge " + QDir::home().path() + "/.Xdefaults"); - xrdb.waitForFinished(); - - // old razor-qt and lxqt versions use $XCURSOR_THEME environment variable - // for this, but it's less flexible and more problematic. Let's deprecate its use. - mSettings->beginGroup("Environment"); - mSettings->remove("XCURSOR_THEME"); // ensure that we're not using XCURSOR_THEME - mSettings->endGroup(); - // save to Mouse/cursor_theme instead - mSettings->beginGroup("Mouse"); - mSettings->setValue("cursor_theme", theme->name()); - mSettings->endGroup(); - - // The XCURSOR_THEME environment varialbe does not work sometimes. - // Besides, XDefaults values are not used by Qt. - // So, let's write the new theme name to ~/.icons/default/index.theme. - // This is the most reliable way. - // QSettings will encode the group name "Icon Theme" to "Icon%20Theme" and there is no way to turn it off. - // So let's not use it here. :-( - QString dirPath = HOME_ICON_DIR + "/default"; - QDir().mkpath(dirPath); // ensure the existence of the ~/.icons/default dir - QFile indexTheme(dirPath + "/index.theme"); - if(indexTheme.open(QIODevice::WriteOnly|QIODevice::Truncate)) - { - QTextStream(&indexTheme) << - "# Written by lxqt-config-appearance\n" << - "[Icon Theme]\n" << - "Name=Default\n" << - "Comment=Default cursor theme\n" << - "Inherits=" << theme->name() << "\n"; - indexTheme.close(); - } -} - -void SelectWnd::on_btRemove_clicked() -{ - qDebug() << "'remove' clicked"; - const XCursorThemeData *theme = mModel->theme(ui->lbThemes->currentIndex()); - if (!theme) return; - QString ct = getCurrentTheme(); - if (ct == theme->name()) - { - QMessageBox::warning(this, tr("XCurTheme error"), - tr("You can't remove active theme!"), QMessageBox::Ok, QMessageBox::Ok); - return; - } - QDir d(theme->path()); - ui->preview->clearTheme(); - mModel->removeTheme(ui->lbThemes->currentIndex()); - removeXCursorTheme(d); -} - -void SelectWnd::handleWarning() -{ - bool empty = mModel->rowCount(); - ui->warningLabel->setVisible(!empty); - ui->preview->setVisible(empty); - ui->infoLabel->setVisible(empty); -} - -void SelectWnd::showDirInfo() -{ - QToolTip::showText(mapToGlobal(ui->warningLabel->buttonPos()), mModel->searchPaths().join("\n")); -} diff --git a/liblxqt-config-cursor/selectwnd.h b/liblxqt-config-cursor/selectwnd.h deleted file mode 100644 index 200cfa0..0000000 --- a/liblxqt-config-cursor/selectwnd.h +++ /dev/null @@ -1,65 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ - -// 2014-04-10 modified by Hong Jen Yee (PCMan) for integration with lxqt-config-input - -#ifndef SELECTWND_H -#define SELECTWND_H - -#include -#include -#include -#include - -namespace LXQt { - class Settings; -} - -namespace Ui { -class SelectWnd; -} - -class XCursorThemeModel; - -class LXQT_API SelectWnd : public QWidget -{ - Q_OBJECT - -public: - SelectWnd (LXQt::Settings* settings, QWidget *parent=0); - ~SelectWnd (); - -public slots: - void setCurrent (); - -protected: - // void keyPressEvent (QKeyEvent *e); - -private: - bool iconsIsWritable () const; - void selectRow (int) const; - void selectRow (const QModelIndex &index) const { selectRow(index.row()); } - void applyCurrent (); - -private slots: - void currentChanged (const QModelIndex ¤t, const QModelIndex &previous); - void on_btInstall_clicked (); - void on_btRemove_clicked (); - void handleWarning(); - void showDirInfo(); - -private: - XCursorThemeModel *mModel; - QPersistentModelIndex mAppliedIndex; - LXQt::Settings* mSettings; - Ui::SelectWnd *ui; -}; - -#endif diff --git a/liblxqt-config-cursor/selectwnd.ui b/liblxqt-config-cursor/selectwnd.ui deleted file mode 100644 index f6cd6b9..0000000 --- a/liblxqt-config-cursor/selectwnd.ui +++ /dev/null @@ -1,114 +0,0 @@ - - - SelectWnd - - - - 0 - 0 - 384 - 353 - - - - LXQt Mouse Theme Configuration - - - - - - Select the cursor theme you want to use (hover preview to test cursor). <b>LXQt session needs restart after this change</b>: - - - true - - - - - - - - - - - 0 - 0 - - - - - 0 - 48 - - - - - - - - QAbstractItemView::NoEditTriggers - - - false - - - true - - - QAbstractItemView::ScrollPerPixel - - - - - - - Qt::Horizontal - - - - 174 - 20 - - - - - - - - false - - - &Install New Theme... - - - - - - - &Remove Theme - - - - - - - - PreviewWidget - QWidget -
previewwidget.h
-
- - WarningLabel - QWidget -
warninglabel.h
- 1 -
-
- - lbThemes - btInstall - btRemove - - - -
diff --git a/liblxqt-config-cursor/thememodel.cpp b/liblxqt-config-cursor/thememodel.cpp deleted file mode 100644 index 66d87ba..0000000 --- a/liblxqt-config-cursor/thememodel.cpp +++ /dev/null @@ -1,328 +0,0 @@ -/* Copyright © 2005-2007 Fredrik Höglund - * (c)GPL2 (c)GPL3 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License version 2 or at your option version 3 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/* - * additional code: Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - */ -#include - -#include "thememodel.h" - -#include - -#include "crtheme.h" -#include "cfgfile.h" - -#include -#include - - -//#define DUMP_FOUND_THEMES - - -/////////////////////////////////////////////////////////////////////////////// -XCursorThemeModel::XCursorThemeModel (QObject *parent) : QAbstractTableModel(parent) -{ - insertThemes(); -} - - -XCursorThemeModel::~XCursorThemeModel() -{ - qDeleteAll(mList); - mList.clear(); -} - - -QVariant XCursorThemeModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - // Only provide text for the headers - if (role != Qt::DisplayRole) return QVariant(); - // Horizontal header labels - if (orientation == Qt::Horizontal) - { - switch (section) - { - case NameColumn: return tr("Name"); - case DescColumn: return tr("Description"); - default: return QVariant(); - } - } - // Numbered vertical header lables - return QString(section); -} - -QVariant XCursorThemeModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid() || index.row() < 0 || index.row() >= mList.count()) return QVariant(); - const XCursorThemeData *theme = mList.at(index.row()); - // Text label - if (role == Qt::DisplayRole) - { - switch (index.column()) - { - case NameColumn: return theme->title(); - case DescColumn: return theme->description(); - default: return QVariant(); - } - } - // Description for the first name column - if (role == XCursorThemeData::DisplayDetailRole && index.column() == NameColumn) return theme->description(); - // Icon for the name column - if (role == Qt::DecorationRole && index.column() == NameColumn) return theme->icon(); - // - return QVariant(); -} - -void XCursorThemeModel::sort(int column, Qt::SortOrder order) -{ - Q_UNUSED(column); - Q_UNUSED(order); - // Sorting of the model isn't implemented, as the KCM currently uses - // a sorting proxy model. -} - -const XCursorThemeData *XCursorThemeModel::theme(const QModelIndex &index) -{ - if (!index.isValid()) return NULL; - if (index.row() < 0 || index.row() >= mList.count()) return NULL; - return mList.at(index.row()); -} - -QModelIndex XCursorThemeModel::findIndex(const QString &name) -{ - uint hash = qHash(name); - for (int i = 0; i < mList.count(); ++i) - { - const XCursorThemeData *theme = mList.at(i); - if (theme->hash() == hash) return index(i, 0); - } - return QModelIndex(); -} - -QModelIndex XCursorThemeModel::defaultIndex() -{ - return findIndex(mDefaultName); -} - -const QStringList XCursorThemeModel::searchPaths() -{ - if (!mBaseDirs.isEmpty()) return mBaseDirs; - // Get the search path from Xcursor - QString path = XcursorLibraryPath(); - // Separate the paths - mBaseDirs = path.split(':', QString::SkipEmptyParts); - // Remove duplicates - QMutableStringListIterator i(mBaseDirs); - while (i.hasNext()) - { - const QString path = i.next(); - QMutableStringListIterator j(i); - while (j.hasNext()) if (j.next() == path) j.remove(); - } - // Expand all occurrences of ~/ to the home dir - mBaseDirs.replaceInStrings(QRegExp("^~\\/"), QDir::home().path() + '/'); - return mBaseDirs; -} - -bool XCursorThemeModel::hasTheme(const QString &name) const -{ - const uint hash = qHash(name); - foreach (const XCursorThemeData *theme, mList) if (theme->hash() == hash) return true; - return false; -} - -bool XCursorThemeModel::isCursorTheme(const QString &theme, const int depth) -{ - // Prevent infinite recursion - if (depth > 10) return false; - // Search each icon theme directory for 'theme' - foreach (const QString &baseDir, searchPaths()) - { - QDir dir(baseDir); - if (!dir.exists() || !dir.cd(theme)) continue; - // If there's a cursors subdir, we'll assume this is a cursor theme - if (dir.exists("cursors")) return true; - // If the theme doesn't have an index.theme file, it can't inherit any themes - if (!dir.exists("index.theme")) continue; - // Open the index.theme file, so we can get the list of inherited themes - QMultiMap cfg = loadCfgFile(dir.path()+"/index.theme", true); - QStringList inherits = cfg.values("icon theme/inherits"); - // Recurse through the list of inherited themes, to check if one of them is a cursor theme - // note that items are reversed - for (int f = inherits.size()-1; f >= 0; --f) - { - QString inh = inherits.at(f); - // Avoid possible DoS - if (inh == theme) continue; - if (isCursorTheme(inh, depth+1)) return true; - } - } - return false; -} - -bool XCursorThemeModel::handleDefault(const QDir &themeDir) -{ - QFileInfo info(themeDir.path()); - // If "default" is a symlink - if (info.isSymLink()) - { - QFileInfo target(info.symLinkTarget()); - if (target.exists() && (target.isDir() || target.isSymLink())) mDefaultName = target.fileName(); - return true; - } - // If there's no cursors subdir, or if it's empty - if (!themeDir.exists("cursors") || - QDir(themeDir.path() + "/cursors").entryList(QDir::Files | - QDir::NoDotAndDotDot).isEmpty()) - { - if (themeDir.exists("index.theme")) - { - XCursorThemeData theme(themeDir); - if (!theme.inherits().isEmpty()) mDefaultName = theme.inherits().at(0); - } - return true; - } - mDefaultName = QLatin1String("default"); - return false; -} - -//#define DUMP_FOUND_THEMES -void XCursorThemeModel::processThemeDir(const QDir &themeDir) -{ -#ifdef DUMP_FOUND_THEMES - qDebug() << "looking at:" << themeDir.path(); -#endif - bool haveCursors = themeDir.exists("cursors"); - // Special case handling of "default", since it's usually either a - // symlink to another theme, or an empty theme that inherits another theme - if (mDefaultName.isNull() && themeDir.dirName() == "default") - { - if (handleDefault(themeDir)) return; - } - // If the directory doesn't have a cursors subdir and lacks an - // index.theme file it can't be a cursor theme. - if (!themeDir.exists("index.theme") && !haveCursors) - { - //qDebug() << "IS NOT THEME" << themeDir; - return; - } - // Create a cursor theme object for the theme dir - XCursorThemeData *theme = new XCursorThemeData(themeDir); - // Skip this theme if it's hidden -#ifdef DUMP_FOUND_THEMES - qDebug() << - " theme name:" << theme->name() << - "\n theme title:" << theme->title() << - "\n theme desc:" << theme->description() << - "\n theme sample:" << theme->sample() << - "\n theme inherits:" << theme->inherits(); -#endif - if (theme->isHidden()) - { - //qDebug() << "HIDDEN THEME" << theme->name() << themeDir; - delete theme; - return; - } - // If there's no cursors subdirectory we'll do a recursive scan - // to check if the theme inherits a theme with one - if (!haveCursors) - { - bool foundCursorTheme = false; - foreach (const QString &name, theme->inherits()) - { - if ((foundCursorTheme = isCursorTheme(name))) break; - } - if (!foundCursorTheme) - { - delete theme; - return; - } - } - // Append the theme to the list - mList.append(theme); -} - -void XCursorThemeModel::insertThemes() -{ - // Scan each base dir for Xcursor themes and add them to the list - foreach (const QString &baseDir, searchPaths()) - { - QDir dir(baseDir); - //qDebug() << "TOPLEVEL" << baseDir; - if (!dir.exists()) continue; - //qDebug() << " continue passed"; - // Process each subdir in the directory - foreach (const QString &name, dir.entryList(QDir::AllDirs | - QDir::NoDotAndDotDot | QDir::Readable | QDir::Executable)) - { - //qDebug() << " SUBDIR" << name; - // Don't process the theme if a theme with the same name already exists - // in the list. Xcursor will pick the first one it finds in that case, - // and since we use the same search order, the one Xcursor picks should - // be the one already in the list - if (hasTheme(name)) - { - qDebug() << "duplicate theme:" << dir.path()+name; - } - if (!dir.cd(name)) - { - qDebug() << "can't cd:" << dir.path()+name; - continue; - } - processThemeDir(dir); - dir.cdUp(); // Return to the base dir - } - } - // The theme Xcursor will end up using if no theme is configured - //if (mDefaultName.isNull() || !hasTheme(mDefaultName)) mDefaultName = legacy->name(); -} - -bool XCursorThemeModel::addTheme(const QDir &dir) -{ - XCursorThemeData *theme = new XCursorThemeData(dir); - // Don't add the theme to the list if it's hidden - if (theme->isHidden()) - { - delete theme; - return false; - } - // If an item with the same name already exists in the list, - // we'll remove it before inserting the new one. - for (int i = 0; i < mList.count(); ++i) - { - if (mList.at(i)->hash() == theme->hash()) - { - removeTheme(index(i, 0)); - break; - } - } - // Append the theme to the list - beginInsertRows(QModelIndex(), rowCount(), rowCount()); - mList.append(theme); - endInsertRows(); - return true; -} - -void XCursorThemeModel::removeTheme(const QModelIndex &index) -{ - if (!index.isValid()) return; - beginRemoveRows(QModelIndex(), index.row(), index.row()); - delete mList.takeAt(index.row()); - endRemoveRows(); -} diff --git a/liblxqt-config-cursor/thememodel.h b/liblxqt-config-cursor/thememodel.h deleted file mode 100644 index 771c5a2..0000000 --- a/liblxqt-config-cursor/thememodel.h +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright © 2005-2007 Fredrik Höglund - * (c)GPL2 (c)GPL3 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License version 2 or at your option version 3 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/* - * additional code: Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - */ -#ifndef THEMEMODEL_H -#define THEMEMODEL_H - -#include -#include - -class QDir; -class XCursorThemeData; - - -// The two TableView/TreeView columns provided by the model -enum Columns { NameColumn = 0, DescColumn }; - - -/** - * The XCursorThemeModel class provides a model for all locally installed - * Xcursor themes, and the KDE/Qt legacy bitmap theme. - * - * This class automatically scans the locations in the file system from - * which Xcursor loads cursors, and creates an internal list of all - * available cursor themes. - * - * The model provides this theme list to item views in the form of a list - * of rows with two columns; the first column has the theme's descriptive - * name and its sample cursor as its icon, and the second column contains - * the theme's description. - * - * Additional Xcursor themes can be added to a model after it's been - * created, by calling addTheme(), which takes QDir as a parameter, - * with the themes location. The intention is for this function to be - * called when a new Xcursor theme has been installed, after the model - * was instantiated. - * - * The KDE legacy theme is a read-only entry, with the descriptive name - * "KDE Classic", and the internal name "#kde_legacy#". - * - * Calling defaultIndex() will return the index of the theme Xcursor - * will use if the user hasn't explicitly configured a cursor theme. - */ -class XCursorThemeModel : public QAbstractTableModel -{ - Q_OBJECT - -public: - XCursorThemeModel (QObject *parent = 0); - ~XCursorThemeModel (); - - inline int columnCount (const QModelIndex &parent = QModelIndex()) const; - inline int rowCount (const QModelIndex &parent = QModelIndex()) const; - QVariant headerData (int section, Qt::Orientation orientation, int role) const; - QVariant data (const QModelIndex &index, int role) const; - void sort (int column, Qt::SortOrder order = Qt::AscendingOrder); - - /// Returns the CursorTheme at @p index. - const XCursorThemeData *theme (const QModelIndex &index); - - /// Returns the index for the CursorTheme with the internal name @p name, - /// or an invalid index if no matching theme can be found. - QModelIndex findIndex (const QString &name); - - /// Returns the index for the default theme. - QModelIndex defaultIndex (); - - /// Adds the theme in @p dir, and returns @a true if successful or @a false otherwise. - bool addTheme (const QDir &dir); - void removeTheme (const QModelIndex &index); - - /// Returns the list of base dirs Xcursor looks for themes in. - const QStringList searchPaths (); - -private: - bool handleDefault (const QDir &dir); - void processThemeDir (const QDir &dir); - void insertThemes (); - bool hasTheme (const QString &theme) const; - bool isCursorTheme (const QString &theme, const int depth = 0); - -private: - QListmList; - QStringList mBaseDirs; - QString mDefaultName; -}; - -int XCursorThemeModel::rowCount (const QModelIndex &) const -{ - return mList.count(); -} - - -int XCursorThemeModel::columnCount (const QModelIndex &) const -{ - return 2; -} - -#endif diff --git a/liblxqt-config-cursor/warninglabel.cpp b/liblxqt-config-cursor/warninglabel.cpp deleted file mode 100644 index ea37b7e..0000000 --- a/liblxqt-config-cursor/warninglabel.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2010-2012 Razor team - * Authors: - * Petr Vanek - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include - -#include "warninglabel.h" - - - -WarningLabel::WarningLabel(QWidget *parent) - : QWidget(parent) -{ - setupUi(this); - - iconLabel->setPixmap(XdgIcon::fromTheme("dialog-warning").pixmap(64, 64)); - - connect(showDirButton, SIGNAL(pressed()), - this, SIGNAL(showDirInfo())); -} diff --git a/liblxqt-config-cursor/warninglabel.h b/liblxqt-config-cursor/warninglabel.h deleted file mode 100644 index 30805c9..0000000 --- a/liblxqt-config-cursor/warninglabel.h +++ /dev/null @@ -1,47 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2010-2012 Razor team - * Authors: - * Petr Vanek - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef WARNINGLABEL_H -#define WARNINGLABEL_H - -#include "ui_warninglabel.h" - - -class WarningLabel : public QWidget, public Ui::WarningLabel -{ - Q_OBJECT - -public: - WarningLabel (QWidget *parent=0); - - QPoint buttonPos() { return showDirButton->pos(); } - -signals: - void showDirInfo(); -}; - -#endif diff --git a/liblxqt-config-cursor/warninglabel.ui b/liblxqt-config-cursor/warninglabel.ui deleted file mode 100644 index b58b367..0000000 --- a/liblxqt-config-cursor/warninglabel.ui +++ /dev/null @@ -1,64 +0,0 @@ - - - WarningLabel - - - - 0 - 0 - 334 - 72 - - - - Form - - - - - - - - - 0 - 0 - - - - - 64 - 64 - - - - - - - - - 0 - 0 - - - - LXQt could not find any cursor theme. The default X11 cursor theme will be used instead. LXQt looked in the following directories: - - - true - - - - - - - Show... - - - - - - - - - - diff --git a/liblxqt-config-cursor/xcr/xcrimg.cpp b/liblxqt-config-cursor/xcr/xcrimg.cpp deleted file mode 100644 index 4d2ad28..0000000 --- a/liblxqt-config-cursor/xcr/xcrimg.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#include - -#include "xcrimg.h" - -#include -#include -#include -#include -#include -#include - -#include - - -#include -#include -#include - - -inline static quint8 alphaPreMul (quint8 clr, quint8 alpha) { - quint32 c32 = clr, a32 = alpha; - c32 = c32*a32/255; - if (c32 > a32) c32 = a32; - return c32&0xff; -} - - -static int nominalCursorSize (int iconSize) { - for (int i = 512; i > 8; i /= 2) { - if (i < iconSize) return i; - if (int(i*0.75) < iconSize) return int(i*0.75); - } - return 8; -} - - -static void baPutDW (QByteArray &ba, quint32 v) { - ba.append('\0'); ba.append('\0'); - ba.append('\0'); ba.append('\0'); - uchar *d = (uchar *)ba.data(); - d += ba.size()-4; - for (int f = 4; f > 0; f--, d++) { - *d = (v&0xff); - v >>= 8; - } -} - - -void XCursorImage::convertARGB2PreMul (QImage &img) { - switch (img.format()) { - case QImage::Format_ARGB32_Premultiplied: return; - case QImage::Format_ARGB32: break; - default: (void) img.convertToFormat(QImage::Format_ARGB32/*_Premultiplied*/); - } - (void) img.convertToFormat(QImage::Format_ARGB32_Premultiplied); // this shouldn't convert anything - // so convert it! - for (int y = img.height()-1; y >= 0; y--) { - quint8 *line = (quint8 *)img.scanLine(y); - for (int x = 0; x < img.width(); x++, line += 4) { - // convert to 'premultiplied' - line[0] = alphaPreMul(line[0], line[3]); - line[1] = alphaPreMul(line[1], line[3]); - line[2] = alphaPreMul(line[2], line[3]); - } - } -} - - -/////////////////////////////////////////////////////////////////////////////// -XCursorImage::XCursorImage (const QString &aName, const QImage &aImg, int aXHot, int aYHot, quint32 aDelay, quint32 aCSize) : - mIsValid(true), mName(aName), mImage(0), mDelay(aDelay), mXHot(aXHot), mYHot(aYHot), mCSize(aCSize) -{ - mImage = new QImage(aImg.copy()); - convertARGB2PreMul(*mImage); -} - - -XCursorImage::XCursorImage (const QString &aName) : - mIsValid(false), mName(aName), mImage(0), mDelay(50), mXHot(0), mYHot(0) -{ -} - - -XCursorImage::~XCursorImage () { - delete mImage; // or memory will leak! -} - - -QPixmap XCursorImage::icon () const { - if (mIcon.isNull()) mIcon = createIcon(); - return mIcon; -} - - -QCursor XCursorImage::cursor () const { - return QCursor(icon(), mXHot, mYHot); -} - - -QImage XCursorImage::image (int size) const { - if (size == -1) size = XcursorGetDefaultSize(QX11Info::display()); - if (!mImage) return QImage(); - return mImage->copy(); -} - - -QPixmap XCursorImage::createIcon () const { - QPixmap pixmap; - int iconSize = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize); - int cursorSize = nominalCursorSize(iconSize); - QSize size = QSize(iconSize, iconSize); - QImage img = image(cursorSize); - if (!img.isNull()) { - // Scale the image if it's larger than the preferred icon size - if (img.width() > size.width() || img.height() > size.height()) - img = img.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); - pixmap = QPixmap::fromImage(img); - } - return pixmap; -} - - -quint32 XCursorImage::xcurSize () const { - if (!mImage || !mIsValid) return 0; - quint32 res = 9*4; // header - res += mImage->width()*mImage->height()*4; - return res; -} - - -void XCursorImage::genXCursorImg (QByteArray &res) const { - if (!mImage || !mIsValid) return; - baPutDW(res, 36); // header size - baPutDW(res, 0xfffd0002); // chunk type - baPutDW(res, mCSize); // subtype - baPutDW(res, 1); // version - baPutDW(res, (quint32)mImage->width()); - baPutDW(res, (quint32)mImage->height()); - baPutDW(res, (quint32)mXHot); - baPutDW(res, (quint32)mYHot); - baPutDW(res, (quint32)mDelay); - // now put the pixels - QImage i = mImage->copy(); - (void) i.convertToFormat(QImage::Format_ARGB32_Premultiplied); - //i.convertToFormat(QImage::Format_ARGB32); - for (int y = 0; y < i.height(); y++) { - const uchar *sl = i.scanLine(y); - const quint32 *d = (const quint32 *)sl; - for (int x = 0; x < i.width(); x++, d++) baPutDW(res, *d); - } -} - - -/////////////////////////////////////////////////////////////////////////////// -XCursorImages::XCursorImages (const QString &aName, const QString &aPath) : - mName(aName), mPath(aPath), mTitle(""), mAuthor(""), mLicense(""), - mEMail(""), mSite(""), mDescr(""), mIM("") -{ -} - - -XCursorImages::~XCursorImages () { - qDeleteAll(mList); - mList.clear(); -} - - -QByteArray XCursorImages::genXCursor () const { - QByteArray res; - // build 'credits' block - QByteArray crdBA[7]; - { - QStringList crb; - crb << mAuthor << mLicense << mDescr << mTitle << mEMail << mSite << mIM; - for (int f = 0; f < crb.size(); f++) { - QString s(crb[f]); - if (s.isEmpty()) crdBA[f].clear(); else crdBA[f] = s.toUtf8(); - } - } - // - res.append("Xcur"); // signature - baPutDW(res, 16); // header size - baPutDW(res, 65536); // version number - // TOC - quint32 cnt = 0; - foreach (const XCursorImage *i, mList) if (i->xcurSize() > 0) cnt++; - // 'credits' - for (int f = 0; f < 7; f++) if (!crdBA[f].isEmpty()) cnt++; - // - baPutDW(res, cnt); // # of chunks - if (!cnt) return res; - quint32 dataOfs = cnt*(3*4)+16; - // add 'credits' chunks - for (int f = 0; f < 7; f++) { - if (crdBA[f].isEmpty()) continue; - baPutDW(res, 0xfffd0001); // entry type - baPutDW(res, f+1); // subtype - baPutDW(res, dataOfs); // offset - dataOfs += crdBA[f].size()+20; - } - // add image chunks - foreach (const XCursorImage *i, mList) { - quint32 isz = i->xcurSize(); - if (!isz) continue; - baPutDW(res, 0xfffd0002); // entry type - baPutDW(res, i->csize()); // subtype - baPutDW(res, dataOfs); // offset - dataOfs += isz; - } - // credits - for (int f = 0; f < 7; f++) { - if (crdBA[f].isEmpty()) continue; - baPutDW(res, 20); // header size - baPutDW(res, 0xfffd0001); // entry type - baPutDW(res, f+1); // subtype - baPutDW(res, 1); // version - baPutDW(res, crdBA[f].size()); // length - res.append(crdBA[f]); - } - // images - foreach (const XCursorImage *i, mList) { - quint32 isz = i->xcurSize(); - if (!isz) continue; - i->genXCursorImg(res); - } - return res; -} - - -QImage XCursorImages::buildImage () const { - int width = 0, height = 0, cnt = 0; - foreach (const XCursorImage *i, mList) { - if (i->xcurSize() > 0) { - QImage img = i->image(); - width = qMax(width, img.width()); - height = qMax(height, img.height()); - ++cnt; - } - } - //qDebug() << cnt << "images; size" << width << "by" << height; - - QImage res(width*cnt, height, QImage::Format_ARGB32); - QPainter p(&res); - int x = 0; - foreach (const XCursorImage *i, mList) { - if (i->xcurSize() > 0) { - QImage img = i->image(); - p.drawImage(QPoint(x, 0), img); - x += img.width(); - } - } - return res; -} diff --git a/liblxqt-config-cursor/xcr/xcrimg.h b/liblxqt-config-cursor/xcr/xcrimg.h deleted file mode 100644 index efcfdbe..0000000 --- a/liblxqt-config-cursor/xcr/xcrimg.h +++ /dev/null @@ -1,116 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#ifndef XCRIMG_H -#define XCRIMG_H - -#include -#include -#include - - -class XCursorImage { -public: - XCursorImage (const QString &aName, const QImage &aImg, int aXHot=0, int aYHot=0, quint32 aDelay=50, quint32 aCSize=1); - XCursorImage (const QString &aName); - virtual ~XCursorImage (); - - inline bool isValid () const { return mIsValid; } - inline const QString &name () const { return mName; } - inline quint32 delay () const { return mDelay; } - inline int xhot () const { return mXHot; } - inline int yhot () const { return mYHot; } - inline quint32 csize () const { return mCSize; } - - inline void setXHot (int v) { mXHot = v; } - inline void setYHot (int v) { mYHot = v; } - inline void setDelay (quint32 v) { mDelay = v; } - inline void setName (const QString &n) { mName = n; } - inline void setCSize (quint32 v) { mCSize = v; } - - virtual QPixmap icon () const; - virtual QCursor cursor () const; - virtual QImage image (int size=-1) const; - - quint32 xcurSize () const; // size in bytes - - virtual void genXCursorImg (QByteArray &res) const; // generate Xcursor image - - static void convertARGB2PreMul (QImage &img); - -protected: - virtual QPixmap createIcon () const; - -protected: - bool mIsValid; - QString mName; - QImage *mImage; - quint32 mDelay; // milliseconds - int mXHot; - int mYHot; - quint32 mCSize; - mutable QPixmap mIcon; -}; - - -class XCursorImages { -public: - XCursorImages (const QString &aName, const QString &aPath=""); - virtual ~XCursorImages (); - - inline const QString &name () const { return mName; } - inline const QString &path () const { return mPath; } - inline const QString &title () const { return mTitle; } - inline const QString &author () const { return mAuthor; } - inline const QString &license () const { return mLicense; } - inline const QString &mail () const { return mEMail; } - inline const QString &site () const { return mSite; } - inline const QString &descr () const { return mDescr; } - inline const QString &im () const { return mIM; } - inline const QString &script () const { return mScript; } - - inline void setName (const QString &v) { mName = v; } - inline void setPath (const QString &v) { mPath = v; } - inline void setTitle (const QString &v) { mTitle = v; } - inline void setAuthor (const QString &v) { mAuthor = v; } - inline void setLicense (const QString &v) { mLicense = v; } - inline void setMail (const QString &v) { mEMail = v; } - inline void setSite (const QString &v) { mSite = v; } - inline void setDescr (const QString &v) { mDescr = v; } - inline void setIM (const QString &v) { mIM = v; } - inline void setScript (const QString &v) { mScript = v; } - - inline const QList &list () const { return mList; } - inline XCursorImage *item (int idx) { return mList.at(idx); } - inline const XCursorImage *at (int idx) const { return mList.at(idx); } - inline int count () const { return mList.size(); } - inline int size () const { return mList.size(); } - - inline void append (XCursorImage *img) { mList << img; } - - QByteArray genXCursor () const; // generate Xcursor file - - QImage buildImage () const; - -protected: - QString mName; - QString mPath; - QString mTitle; - QString mAuthor; - QString mLicense; - QString mEMail; - QString mSite; - QString mDescr; - QString mIM; - QString mScript; // just for writing it back - QList mList; -}; - - -#endif diff --git a/liblxqt-config-cursor/xcr/xcrtheme.cpp b/liblxqt-config-cursor/xcr/xcrtheme.cpp deleted file mode 100644 index 454371d..0000000 --- a/liblxqt-config-cursor/xcr/xcrtheme.cpp +++ /dev/null @@ -1,742 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#include -//#include - -#include "xcrtheme.h" - -#include - -#include -#include - -#include "xcrimg.h" -#include "xcrxcur.h" - -/* - 0 standard arrow - 1 help arrow (the one with '?') - 2 working arrow - 3 busy cursor - 4 precision select - 5 text select - 6 handwriting - 7 unavailable -8 north (vert) resize -9 south resize - 10 west (vert-means horiz???) resize -11 east resize - 12 north-west resize -13 south-east resize - 14 north-east resize -15 south-west resize - 16 move - 17 alternate select - 18 hand -19 button -*/ - - -static const char *nameTransTbl[] = { - // curFX idx, curXP name, [...altnames], finalname, 0 - // end with 0 - "", // standard arrow (it's \x00) - "Arrow", - "left_ptr", "X_cursor", "right_ptr", "top_left_arrow", "move", - "4498f0e0c1937ffe01fd06f973665830", - 0, - // - "\x04", // precision select - "Cross", - "tcross", "cross", "crosshair", "cross_reverse", - "draped_box", - 0, - // - "\x12", // hand - "Hand", - "hand", "hand1", "hand2", "9d800788f1b08800ae810202380a0822", - "e29285e634086352946a0e7090d73106", - 0, - // - "\x05", // text select - "IBeam", - "xterm", - 0, - // - "\x11", // alternate select - "UpArrow", - "center_ptr", - 0, - // - "\x0c", - "SizeNWSE", // north-west resize - "bottom_right_corner", "top_left_corner", "bd_double_arrow", "lr_angle", - "c7088f0f3e6c8088236ef8e1e3e70000", - 0, - // - "\x0e", // north-east resize - "SizeNESW", - "bottom_left_corner", "top_right_corner", "fd_double_arrow", "ll_angle", - "fcf1c3c7cd4491d801f1e1c78f100000", - 0, - // - "\x0a", // west resize - "SizeWE", - "sb_h_double_arrow", "left_side", "right_side", "h_double_arrow", "028006030e0e7ebffc7f7070c0600140", - "14fef782d02440884392942c11205230", - 0, - // - "\x08", // north resize - "SizeNS", - "double_arrow", "bottom_side", "top_side", "v_double_arrow", "sb_v_double_arrow", "00008160000006810000408080010102", - "2870a09082c103050810ffdffffe0204", - 0, - // - "\x01", // help arrow - "Help", - "question_arrow", - "d9ce0ab605698f320427677b458ad60b", - 0, - // - "\x06", // handwriting - "Handwriting", - "pencil", - 0, - // - "\x02", // working arrow - "AppStarting", - "left_ptr_watch", "08e8e1c95fe2fc01f976f1e063a24ccd", - "3ecb610c1bf2410f44200f48c40d3599", - 0, - // - "\x10", // move (???) - "SizeAll", - "fleur", - 0, - // - "\x03", // busy cursor - "Wait", - "watch", - 0, - // - "\x07", // unavailable - "NO", - "crossed_circle", - "03b6e0fcb3499374a867c041f52298f0", - 0, - 0 -}; - - -/* -static QString convertFXIndexToXPName (qint32 idx) { - int f = 0; - do { - if (nameTransTbl[f][0] == idx) return QString(nameTransTbl[f+1]); - f += 2; - while (nameTransTbl[f]) ++f; - ++f; - } while (nameTransTbl[f]); - return QString(); -} -*/ - - -static void removeFilesAndDirs (QDir &dir) { - //qDebug() << "dir:" << dir.path(); - // files - QFileInfoList lst = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden); - foreach (const QFileInfo &fi, lst) { - //qDebug() << "removing" << fi.fileName() << fi.absoluteFilePath(); - dir.remove(fi.fileName()); - } - // dirs - lst = dir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::Hidden); - foreach (const QFileInfo &fi, lst) { - dir.cd(fi.fileName()); - removeFilesAndDirs(dir); - dir.cd(".."); - //qDebug() << "removing dir" << fi.fileName(); - dir.rmdir(fi.fileName()); - } -} - - -static void removeFiles (QDir &dir) { - // - QFileInfoList lst = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden); - foreach (const QFileInfo &fi, lst) { - qDebug() << "removing" << fi.fileName() << fi.absoluteFilePath(); - QFile fl(fi.absoluteFilePath()); - fl.remove(); - } - // -} - - -static void removeCursorFiles (QDir &dir) { - QString pt = dir.path(); - if (!pt.isEmpty() && pt != "/") pt += "/"; - const char **nlst = nameTransTbl; - while (*nlst) { - nlst += 2; // skip non-files - while (*nlst) { - QString n(*nlst); - QFile fl(pt+n); - qDebug() << "removing" << fl.fileName(); - fl.remove(); - nlst++; - } - nlst++; - } -} - - -/////////////////////////////////////////////////////////////////////////////// -const char **XCursorTheme::findCursorByFXId (int id) { - if (id < 0 || id > 19) return 0; // invalid id - const char **nlst = nameTransTbl; - while (*nlst) { - int lid = (**nlst)&0xff; - nlst += 2; // skip unnecessary - if (lid == id) return nlst; - while (nlst[-1]) nlst++ ; // skip - } - return 0; // none found -} - - -/* - * type: - * 0: by CursorXP name - * 1: by Xcursor name - * return: - * pointer to Xcursor name list - */ -const char **XCursorTheme::findCursorRecord (const QString &cname, int type) { - QByteArray ba(cname.toUtf8()); - const char *name = ba.constData(); - const char **nlst = nameTransTbl; - while (*nlst) { - nlst += 2; // skip unnecessary - if (!type) { - // by CursorXP name - if (!strcmp(name, nlst[-1])) return nlst; - } else { - // by Xcursor name - // find name - const char **nx = nlst; - while (*nx && strcmp(*nx, name)) nx++; - if (*nx) return nlst; // we got it! - } - while (nlst[-1]) nlst++ ; // skip - } - return 0; // none found -} - - -QString XCursorTheme::findCursorFile (const QDir &dir, const char *name) { - QString d(dir.path()); - if (d != "/") d += "/"; - d += "cursors/"; - const char **nlst = nameTransTbl; - while (*nlst) { - nlst += 2; // skip unnecessary - // find name - const char **nx = nlst; - while (*nx && strcmp(*nx, name)) nx++; - if (*nx) { - // we got it! - //qDebug() << "found" << *nx << "(" << *nlst << ")"; - nx = nlst; - while (*nx) { - QString s(*nx); - //qDebug() << "checking" << s; - QFileInfo fl(d+s); - if (fl.exists() && fl.isReadable()) { - //qDebug() << " ok" << s; - return s; - } - nx++; - } - } - while (nlst[-1]) nlst++ ; // skip - } - return QString(); // none found -} - - -/////////////////////////////////////////////////////////////////////////////// -XCursorTheme::XCursorTheme () : - mName(""), mPath(""), mTitle(""), mAuthor(""), mLicense(""), - mEMail(""), mSite(""), mDescr(""), mIM(""), mSample("left_ptr") -{ -} - - -XCursorTheme::XCursorTheme (const QDir &aDir, const QString &aName) : - mName(aName), mPath(aDir.path()), mTitle(""), mAuthor(""), mLicense(""), - mEMail(""), mSite(""), mDescr(""), mIM(""), mSample("left_ptr") -{ - parseXCursorTheme(aDir); -} - - -XCursorTheme::~XCursorTheme () { - qDeleteAll(mList); - mList.clear(); -} - - -bool XCursorTheme::writeToDir (const QDir &destDir) { - bool res = true; - QDir dir (destDir); - dir.mkdir("cursors"); - if (!dir.exists("cursors")) return false; - dir.cd("cursors"); - removeCursorFiles(dir); - // - foreach (const XCursorImages *ci, mList) { - const char **nlst = findCursorRecord(ci->name()); - if (!nlst) continue; // unknown cursor, skip it - qDebug() << "writing" << *nlst; - { - QByteArray ba(ci->genXCursor()); - QFile fo(dir.path()+"/"+ci->name()); - if (fo.open(QIODevice::WriteOnly)) { - fo.write(ba); - fo.close(); - } else { - res = false; - break; - } - } - // make symlinks - const char *orig = *nlst; - nlst++; - while (*nlst) { - qDebug() << "symlinking to" << orig << "as" << *nlst; - QByteArray newName(QFile::encodeName(dir.path()+"/"+(*nlst))); - qDebug() << "old" << orig << "new" << newName.constData(); - if (symlink(orig, newName.constData())) { - res = false; - break; - } - nlst++; - } - if (!res) break; - nlst++; - } - if (res) res = writeIndexTheme(destDir); - if (!res) removeCursorFiles(dir); - return res; -} - - -void XCursorTheme::parseThemeIndex (const QDir &dir) { - QString ifn = dir.path(); - if (!ifn.isEmpty() && ifn != "/") ifn += "/"; - ifn += "index.theme"; - qDebug() << "reading theme index:" << ifn; - QFile fl(ifn); - // - QString cmt; - mInherits.clear(); - // read config file, drop out 'icon theme' section (IT'S BAD!) - if (fl.open(QIODevice::ReadOnly)) { - QTextStream stream; - stream.setDevice(&fl); - stream.setCodec("UTF-8"); - bool inIconTheme = false; - QString curPath; - while (1) { - QString s = stream.readLine(); - if (s.isNull()) break; - QString orig(s); - s = s.trimmed(); - if (s.isEmpty() || s[0] == '#' || s[0] == ';') continue; - if (s[0] == '[') { - // new path - int len = s.length()-1; - if (s[len] == ']') len--; - s = s.mid(1, len).simplified(); - curPath = s.toLower(); - inIconTheme = (curPath == "icon theme"); - continue; - } - if (!inIconTheme) continue; - int eqp = s.indexOf('='); - if (eqp < 0) continue; // invalid entry - QString name = s.left(eqp).simplified().toLower(); - QString value = s.mid(eqp+1).simplified(); - qDebug() << name << value; - if (name == "name" && !value.isEmpty()) mTitle = value; - else if (name == "comment" && !value.isEmpty()) cmt = value; - else if (name == "author" && !value.isEmpty()) mAuthor = value; - else if (name == "url" && !value.isEmpty()) mSite = value; - else if (name == "description" && !value.isEmpty()) mDescr = value; - else if (name == "example" && !value.isEmpty()) mSample = value; - else if (name == "inherits" && !value.isEmpty()) mInherits << value; - } - fl.close(); - } - if (mDescr.isEmpty() && !cmt.isEmpty()) mDescr = cmt; - if (mSample.isEmpty()) mSample = "left_ptr"; - mInherits.removeDuplicates(); -} - - -void XCursorTheme::dumpInfo () { -/* - qDebug() << - "INFO:" << - "\n name:" << mName << - "\n path:" << mPath << - "\n title:" << mTitle << - "\n author:" << mAuthor << - "\n license:" << mLicense << - "\n mail:" << mEMail << - "\n site:" << mSite << - "\n dscr:" << mDescr << - "\n im:" << mIM << - "\n sample:" << mSample << - "\n inherits:" << mInherits - ; -*/ -} - - -void XCursorTheme::parseXCursorTheme (const QDir &dir) { - parseThemeIndex(dir); - dumpInfo(); - const char **nlst = nameTransTbl; - QDir dr(dir); dr.cd("cursors"); - while (*nlst) { - //qDebug() << "CurFX: (" << nlst[1] << ")"; - nlst += 2; // skip unnecessary - //qDebug() << "searching" << *nlst; - QString fn = findCursorFile(dir, *nlst); - if (fn.isEmpty()) continue; // no such file - //qDebug() << " Xcrusor: (" << nlst[0] << ")"; - while (nlst[-1]) nlst++ ; // skip - //qDebug() << " skiped: (" << nlst[1] << ")"; - qDebug() << "loading" << fn; - XCursorImages *ci = new XCursorImagesXCur(dr, fn); - if (ci->count()) { - qDebug() << " OK:" << fn << "name:" << ci->name(); - if (mTitle.isEmpty() && !ci->title().isEmpty()) mTitle = ci->title(); - if (mAuthor.isEmpty() && !ci->author().isEmpty()) mAuthor = ci->author(); - if (mLicense.isEmpty() && !ci->license().isEmpty()) mLicense = ci->license(); - if (mEMail.isEmpty() && !ci->mail().isEmpty()) mEMail = ci->mail(); - if (mSite.isEmpty() && !ci->site().isEmpty()) mSite = ci->site(); - if (mDescr.isEmpty() && !ci->descr().isEmpty()) mDescr = ci->descr(); - if (mIM.isEmpty() && !ci->im().isEmpty()) mIM = ci->im(); - mList << ci; - dumpInfo(); - } else { - qWarning() << "can't load" << fn << nlst[-2]; - delete ci; - } - } - dumpInfo(); - fixInfoFields(); - dumpInfo(); -} - - -void XCursorTheme::fixInfoFields () { - foreach (XCursorImages *ci, mList) { - if (!mTitle.isEmpty() && ci->title().isEmpty()) ci->setTitle(title()); - if (!mAuthor.isEmpty() && ci->author().isEmpty()) ci->setAuthor(author()); - if (!mLicense.isEmpty() && ci->license().isEmpty()) ci->setLicense(license()); - if (!mEMail.isEmpty() && ci->mail().isEmpty()) ci->setMail(mail()); - if (!mSite.isEmpty() && ci->site().isEmpty()) ci->setSite(site()); - if (!mDescr.isEmpty() && ci->descr().isEmpty()) ci->setDescr(descr()); - if (!mIM.isEmpty() && ci->im().isEmpty()) ci->setIM(im()); - } -} - - -bool XCursorTheme::writeIndexTheme (const QDir &destDir) { - QString ifn = destDir.path(); - if (!ifn.isEmpty() && ifn != "/") ifn += "/"; - ifn += "index.theme"; - qDebug() << "writing theme index:" << ifn; - QFile fl(ifn); - // - QStringList cfg, inhs, iconOther; - QString name, cmt, author, url, dscr, sample; - inhs.append(mInherits); - // read config file, drop out 'icon theme' section (IT'S BAD!) - if (fl.open(QIODevice::ReadOnly)) { - QTextStream stream; - stream.setDevice(&fl); - stream.setCodec("UTF-8"); - QString curPath; - while (1) { - QString s = stream.readLine(); - if (s.isNull()) break; - QString orig(s); - s = s.trimmed(); - if (s.isEmpty() || s[0] == '#' || s[0] == ';') { - if (curPath != "icon theme") cfg << orig; - continue; - } - if (s[0] == '[') { - // new path - int len = s.length()-1; - if (s[len] == ']') len--; - s = s.mid(1, len).simplified(); - curPath = s.toLower(); - if (curPath != "icon theme") cfg << orig; - continue; - } - if (curPath != "icon theme") cfg << orig; - else { - int eqp = s.indexOf('='); - if (eqp < 0) { - // invalid entry - iconOther << orig; - continue; - } - QString name = s.left(eqp).simplified(); - QString value = s.mid(eqp+1).simplified(); - if (name.isEmpty()) { - // invalid entry - iconOther << orig; - continue; - } - QString nn(name.toLower()); - if (nn == "name") name = value; - else if (nn == "comment") cmt = value; - else if (nn == "author") author = value; - else if (nn == "url") url = value; - else if (nn == "description") dscr = value; - else if (nn == "example") sample = value; - else if (nn == "inherits") { if (!value.isEmpty()) inhs << value; } - else iconOther << orig; -/* -Name=Fire Dragon -Comment=Fire Dragon Cursor Theme -- part of the 'Four Dragons' suite; (c) Sleeping Dragon, http://sleeping-dragon.deviantart.com/art/Fire-Dragon-30419542 -Author=Sleeping Dragon -Url=http://sleeping-dragon.deviantart.com/art/Fire-Dragon-30419542 -Description=Fire Dragon Cursor Theme -- part of the 'Four Dragons' suite -Example=left_ptr -Inherits=core -*/ - } - } - fl.close(); - } - // theme file parsed; rewrite it! - if (cfg.size() > 0 && !cfg.at(cfg.size()-1).isEmpty()) cfg << ""; - if (!fl.open(QIODevice::WriteOnly)) return false; - if (name.isEmpty()) name = mTitle; - if (author.isEmpty()) author = mAuthor; - if (url.isEmpty()) url = mSite; - if (dscr.isEmpty()) dscr = mDescr; - if (cmt.isEmpty()) cmt = dscr; - /*if (sample.isEmpty())*/ sample = "left_ptr"; - if (inhs.size() == 0) inhs << "core"; - inhs.removeDuplicates(); - dumpInfo(); -/* - qDebug() << - "***INFO:" << - "\n name:" << name << - "\n cmt:" << cmt << - "\n author:" << author << - "\n site:" << url << - "\n dscr:" << dscr << - "\n sample:" << mSample << - "\n inherits:" << inhs - ; -*/ - { - QTextStream stream; - stream.setDevice(&fl); - stream.setCodec("UTF-8"); - foreach (const QString &s, cfg) stream << s << "\n"; - stream << "[Icon Theme]\n"; - stream << "Name=" << name << "\n"; - stream << "Comment=" << cmt << "\n"; - stream << "Author=" << author << "\n"; - stream << "Url=" << url << "\n"; - stream << "Description=" << dscr << "\n"; - stream << "Example=" << mSample << "\n"; - foreach (const QString &s, inhs) stream << "Inherits=" << s << "\n"; - } - fl.close(); - return true; -} - - -/////////////////////////////////////////////////////////////////////////////// -static bool removeXCTheme (const QDir &thDir) { - if (thDir.exists("cursors")) { - QDir d(thDir); - d.cd("cursors"); - //removeCursorFiles(d); - removeFiles(d); - } - thDir.rmdir("cursors"); - // check if there are some other files - QFileInfoList lst = thDir.entryInfoList(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden); - bool cantKill = false; - foreach (const QFileInfo &fi, lst) { - QString s(fi.fileName()); - if (s != "icon-theme.cache" && s != "index.theme") { - cantKill = true; - break; - } - } - // can kill this? - if (!cantKill) { - QDir d(thDir); - d.remove("icon-theme.cache"); - d.remove("index.theme"); - } - return true; -} - - -bool removeXCursorTheme (const QDir &thDir, const QString &name) { - qDebug() << "to kill:" << thDir.path() << name; - QDir d(thDir); - if (!d.exists(name)) return false; - qDebug() << "removing" << d.path() << name; - d.cd(name); - removeXCTheme(d); - d.cd(".."); - d.rmdir(name); - return true; -} - - -bool removeXCursorTheme (const QString &name) { - QDir d(QDir::homePath()); - return removeXCursorTheme(d, name); -} - - -bool removeXCursorTheme (const QDir &thDir) { - QString name(thDir.path()); - while (!name.isEmpty() && name.endsWith('/')) name.chop(1); - int i = name.lastIndexOf('/'); - if (i < 1) return false; - name = name.mid(i+1); - QDir d(thDir); - d.cd(".."); - return removeXCursorTheme(d, name); -} - - -/////////////////////////////////////////////////////////////////////////////// -/* - * returns temporary dir or empty string - */ -static bool tarDir (const QString &destFName, const QDir &pth, const QString &dir) { - QStringList args; - - QFile fl(destFName); - fl.remove(); - - args << "-c"; // create archive... - args << "-z"; // and gzip it - QString ps(pth.path()); - if (!ps.isEmpty() && ps != ".") { - args << "-C"; // dir to go - args << ps; - } - args << "-f"; // to file - args << destFName; - QString s(dir); - if (!s.endsWith('/')) s += '/'; - args << s; - - QProcess pr; - pr.setStandardInputFile("/dev/null"); - pr.setStandardOutputFile("/dev/null"); - pr.setStandardErrorFile("/dev/null"); - - pr.start("tar", args); - - if (pr.waitForStarted()) { - if (pr.waitForFinished()) return true; - } - - // cleanup - fl.remove(); - return false; -} -//tar -c -C /home/ketmar/k8prj/xcurtheme/src -f z.tar xcr/ - - -bool packXCursorTheme (const QString &destFName, const QDir &thDir, const QString &thName, bool removeTheme) { - if (destFName.isEmpty() || thName.isEmpty()) return false; - QDir d(thDir); - if (!d.cd(thName)) return false; - - bool res = tarDir(destFName, thDir, thName); - if (res && removeTheme) { - removeFilesAndDirs(d); - d.cd(".."); - d.rmdir(thName); - } - return res; -} - - -bool XCursorTheme::writeXPTheme (const QDir &destDir) { - QString ifn = destDir.path(); - if (!ifn.isEmpty() && ifn != "/") ifn += '/'; - - QFile fl(ifn+"Scheme.ini"); - if (fl.open(QIODevice::WriteOnly)) { - QTextStream stream; - stream.setDevice(&fl); - stream.setCodec("UTF-8"); - stream << "[General]\r\n"; - stream << "Version=130\r\n"; - qDebug() << "writing images..."; - foreach (XCursorImages *ci, mList) { - const char **nlst = findCursorRecord(ci->name()); - if (!nlst) continue; // unknown cursor, skip it - qDebug() << "image:" << *(nlst-1); - QImage img(ci->buildImage()); - if (!img.save(ifn+(*(nlst-1))+".png")) return false; - stream << "["+QString(*(nlst-1))+"]\r\n"; - stream << "StdCursor=0\r\n"; - stream << "Frames=" << ci->count() << "\r\n"; - stream << "Hot spot x=" << ci->at(0)->xhot() << "\r\n"; - stream << "Hot spot y=" << ci->at(0)->yhot() << "\r\n"; - stream << "Interval=" << (ci->at(0)->delay() == 2147483647 ? 100 : ci->at(0)->delay()) << "\r\n"; - // x2, y2? wtf? - if (ci->count() > 1) { - stream << "Frames=" << ci->count() << "\r\n"; - stream << "Animation style=0\r\n"; - } else { - stream << "Frames=1\r\n"; - stream << "Animation style=0\r\n"; - } - } - stream << "[[Description]\r\n"; - if (!mName.isEmpty()) stream << mName << "\r\n"; - if (!mTitle.isEmpty()) stream << mTitle << "\r\n"; - if (!mAuthor.isEmpty()) stream << mAuthor << "\r\n"; - if (!mLicense.isEmpty()) stream << mLicense << "\r\n"; - if (!mEMail.isEmpty()) stream << mEMail << "\r\n"; - if (!mSite.isEmpty()) stream << mSite << "\r\n"; - if (!mDescr.isEmpty()) stream << mDescr << "\r\n"; - if (!mIM.isEmpty()) stream << mIM << "\r\n"; - } - fl.close(); - return true; -} diff --git a/liblxqt-config-cursor/xcr/xcrtheme.h b/liblxqt-config-cursor/xcr/xcrtheme.h deleted file mode 100644 index e8dca8c..0000000 --- a/liblxqt-config-cursor/xcr/xcrtheme.h +++ /dev/null @@ -1,97 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#ifndef XCRTHEME_H -#define XCRTHEME_H - -#include -#include -#include - -#include "xcrimg.h" - - -class XCursorTheme { -public: - XCursorTheme (const QDir &aDir, const QString &aName); - XCursorTheme (); - virtual ~XCursorTheme (); - - inline const QString &name () const { return mName; } - inline const QString &path () const { return mPath; } - inline const QString &title () const { return mTitle; } - inline const QString &author () const { return mAuthor; } - inline const QString &license () const { return mLicense; } - inline const QString &mail () const { return mEMail; } - inline const QString &site () const { return mSite; } - inline const QString &descr () const { return mDescr; } - inline const QString &im () const { return mIM; } - inline const QString &sample () const { return mSample; } - inline const QStringList &inherits () const { return mInherits; } - - inline void setName (const QString &v) { mName = v; } - inline void setPath (const QString &v) { mPath = v; } - inline void setTitle (const QString &v) { mTitle = v; } - inline void setAuthor (const QString &v) { mAuthor = v; } - inline void setLicense (const QString &v) { mLicense = v; } - inline void setMail (const QString &v) { mEMail = v; } - inline void setSite (const QString &v) { mSite = v; } - inline void setDescr (const QString &v) { mDescr = v; } - inline void setIM (const QString &v) { mIM = v; } - inline void setSample (const QString &v) { mSample = v; } - inline void setInherits (const QStringList &v) { mInherits.clear(); mInherits.append(v); } - - inline const QList &list () const { return mList; } - inline const XCursorImages *at (int idx) const { return mList.at(idx); } - inline int count () const { return mList.size(); } - inline int size () const { return mList.size(); } - - inline void append (XCursorImages *img) { mList << img; } - - bool writeToDir (const QDir &destDir); - - void fixInfoFields (); - - bool writeXPTheme (const QDir &destDir); - -protected: - static const char **findCursorByFXId (int id); - static QString findCursorFile (const QDir &dir, const char *name); - static const char **findCursorRecord (const QString &cname, int type=1); - - bool writeIndexTheme (const QDir &destDir); - void parseXCursorTheme (const QDir &dir); - void parseThemeIndex (const QDir &dir); - - void dumpInfo (); - -protected: - QString mName; - QString mPath; - QString mTitle; - QString mAuthor; - QString mLicense; - QString mEMail; - QString mSite; - QString mDescr; - QString mIM; - QString mSample; - QStringList mInherits; - QList mList; -}; - - -bool removeXCursorTheme (const QDir &thDir, const QString &name); -bool removeXCursorTheme (const QString &name); -bool removeXCursorTheme (const QDir &thDir); - -bool packXCursorTheme (const QString &destFName, const QDir &thDir, const QString &thName, bool removeTheme=false); - - -#endif diff --git a/liblxqt-config-cursor/xcr/xcrthemefx.cpp b/liblxqt-config-cursor/xcr/xcrthemefx.cpp deleted file mode 100644 index 4ffcc49..0000000 --- a/liblxqt-config-cursor/xcr/xcrthemefx.cpp +++ /dev/null @@ -1,400 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#include -//#include - -#include "xcrthemefx.h" - -#include -#include - -#include -#include -#include - -#include "xcrimg.h" -#include "xcrxcur.h" -#include "xcrtheme.h" - - -static const char *curShapeName[] = { - "standard arrow", - "help arrow (the one with '?')", - "working arrow", - "busy cursor", - "precision select", - "text select", - "handwriting", - "unavailable", - "north (vert) resize", - "south resize", - "west (vert-means horiz?) resize", - "east resize", - "north-west resize", - "south-east resize", - "north-east resize", - "south-west resize", - "move", - "alternate select", - "hand", - "button" -}; - - -bool XCursorThemeFX::str2num (const QString &s, quint32 &res) { - quint64 n = 0; - if (s.isEmpty()) return false; - for (int f = 0; f < s.length(); f++) { - QChar ch = s.at(f); - if (!ch.isDigit()) return false; - n = n*10+ch.unicode()-'0'; - } - //if (n >= (quint64)0x100000000LL) n = 0xffffffffLL; - if (n >= (quint64)0x80000000LL) n = 0x7fffffffLL; - res = n; - return true; -} - - -QList XCursorThemeFX::parseScript (const QString &script, quint32 maxFrame) { - QList res; - QString scp = script; scp.replace("\r", "\n"); - QStringList scpL = scp.split('\n', QString::SkipEmptyParts); - foreach (QString s, scpL) { - s = s.simplified(); - //qDebug() << s; - QStringList fld = s.split(',', QString::SkipEmptyParts); //BUG!BUG!BUG! - if (fld.size() != 2) { - qDebug() << "script error:" << s; - qWarning() << "script error:" << s; - continue; - } - // frame[s] - int hyph = fld[0].indexOf('-'); - tAnimSeq a; - if (hyph == -1) { - // just a number - if (!str2num(fld[0], a.from)) { - qDebug() << "script error (frame):" << s; - qWarning() << "script error (frame):" << s; - continue; - } - a.from = qMax(qMin(maxFrame, a.from), (quint32)1)-1; - a.to = a.from; - } else { - // a..b - if (!str2num(fld[0].left(hyph), a.from)) { - qDebug() << "script error (frame from):" << s; - qWarning() << "script error (frame from):" << s; - continue; - } - a.from = qMax(qMin(maxFrame, a.from), (quint32)1)-1; - if (!str2num(fld[0].mid(hyph+1), a.to)) { - qDebug() << "script error (frame to):" << s; - qWarning() << "script error (frame to):" << s; - continue; - } - a.to = qMax(qMin(maxFrame, a.to), (quint32)1)-1; - } - // delay - if (!str2num(fld[1], a.delay)) { - qDebug() << "script error (delay):" << s; - qWarning() << "script error (delay):" << s; - continue; - } - if (a.delay < 10) a.delay = 10; - qDebug() << "from" << a.from << "to" << a.to << "delay" << a.delay; - res << a; - } - return res; -} - - -/////////////////////////////////////////////////////////////////////////////// -static QByteArray zlibInflate (const void *buf, int bufSz, int destSz) { - QByteArray res; - z_stream stream; - int err; - - res.resize(destSz+1); - stream.next_in = (Bytef *)buf; - stream.avail_in = bufSz; - stream.zalloc = (alloc_func)0; - stream.zfree = (free_func)0; - stream.next_out = (Bytef *)res.data(); - stream.avail_out = destSz; - - err = inflateInit(&stream); - if (err != Z_OK) return QByteArray(); - err = inflate(&stream, Z_SYNC_FLUSH); - fprintf(stderr, "inflate result: %i\n", err); - switch (err) { - case Z_STREAM_END: - err = inflateEnd(&stream); - fprintf(stderr, "Z_STREAM_END: inflate result: %i\n", err); - if (err != Z_OK) return QByteArray(); - break; - case Z_OK: - err = inflateEnd(&stream); - fprintf(stderr, "Z_OK: inflate result: %i\n", err); - if (err != Z_OK) return QByteArray(); - break; - default: return QByteArray(); - } - return res; -} - - -static quint32 baGetDW (QByteArray &ba, int &pos) { - const uchar *d = (const uchar *)ba.constData(); - d += pos+3; - pos += 4; - quint32 res = 0; - for (int f = 4; f > 0; f--, d--) { - res <<= 8; - res |= *d; - } - return res; -} - - -/////////////////////////////////////////////////////////////////////////////// -XCursorThemeFX::XCursorThemeFX (const QString &aFileName) : XCursorTheme() { - if (!parseCursorFXTheme(aFileName)) { - qDeleteAll(mList); - mList.clear(); - } -} - - -bool XCursorThemeFX::parseCursorFXTheme (const QString &aFileName) { - qDebug() << "loading" << aFileName; - QFile fl(aFileName); - if (!fl.open(QIODevice::ReadOnly)) return false; // shit! - QByteArray ba(fl.readAll()); - fl.close(); - if (ba.size() < 0xb8) return false; // shit! - int pos = 0; - if (baGetDW(ba, pos) != 1) return false; // invalid version - quint32 mainHdrSize = baGetDW(ba, pos); - if (mainHdrSize < 0xb8) return false; // invalid header size - quint32 unDataSize = baGetDW(ba, pos); - if (unDataSize < 0x4c) return false; // no cursors anyway - struct { - quint32 ofs; - quint32 len; - } infoFields[6]; - pos = 0x84; - for (int f = 0; f < 6; f++) { - infoFields[f].ofs = baGetDW(ba, pos); - infoFields[f].len = baGetDW(ba, pos); - } - pos = 0xb4; - quint32 ihdrSize = baGetDW(ba, pos); - // now read data - pos = mainHdrSize; - qDebug() << "reading data from" << pos; - QByteArray unp(zlibInflate(ba.constData()+pos, ba.size()-pos, unDataSize)); - if (unp.isEmpty()) { - qDebug() << "CursorFX: can't depack data"; - qWarning() << "CursorFX: can't depack data"; - return false; - } - // process info section - for (int f = 0; f < 6; f++) { - int len = infoFields[f].len; - if (!len) continue; - pos = infoFields[f].ofs; - if ((quint32)pos >= ihdrSize || (quint32)pos+len >= ihdrSize) continue; // skip invalid one - QByteArray sBA(unp.mid(pos, len)); - sBA.append('\0'); sBA.append('\0'); - QString s = QString::fromUtf16((const ushort *)sBA.constData()).simplified(); - switch (f) { - case 0: setTitle(s); break; - case 1: setAuthor(s); break; - //case 2: setVersion(s); break; - case 3: setSite(s); break; - case 4: setMail(s); break; - case 5: setDescr(s); break; - default: ; - } - } - // process resources - QSet shapesSeen; - pos = ihdrSize; - qDebug() << "resources started at hex" << QString::number(pos, 16); - while (pos <= unp.size()-12) { - quint32 ipos = pos; // will be fixed later - quint32 rtype = baGetDW(unp, pos); - quint32 basicHdrSize = baGetDW(unp, pos); - quint32 itemSize = baGetDW(unp, pos); - qDebug() << "pos hex:" << QString::number(pos, 16) << "rtype:" << rtype << "bhdrsz hex:" << QString::number(basicHdrSize, 16) << "itemsz hex:" << QString::number(itemSize, 16); - if (itemSize < 12) { - // invalid data - qDebug() << "CursorFX: invalid data chunk size"; - qWarning() << "CursorFX: invalid data chunk size"; - return false; - } - pos = ipos+itemSize; // skip it - if (rtype != 2) continue; // not cursor resource - if (itemSize < 0x4c) { - qDebug() << "CursorFX: invalid cursor chunk size:" << itemSize; - qWarning() << "CursorFX: invalid cursor chunk size:" << itemSize; - return false; - } - // cursor - int cps = ipos+3*4; - rtype = baGetDW(unp, cps); - if (rtype != 2) { - qDebug() << "CursorFX: invalid cursor chunk type:" << rtype; - qWarning() << "CursorFX: invalid cursor chunk type:" << rtype; - return false; - } - quint32 curShape = baGetDW(unp, cps); - quint32 curType = baGetDW(unp, cps); - if (curShape > 19) { - qDebug() << "CursorFX: unknown cursor shape:" << curShape; - qWarning() << "CursorFX: unknown cursor shape:" << curShape; - return false; - } - if (curType != 1) { - qDebug() << "skipping 'press' cursor; shape no" << curShape << "named" << curShapeName[curShape]; - continue; - // we need only 'normal' cursors - } - qDebug() << "cursor shape:" << curShape; - const char **nlst = findCursorByFXId((int)curShape); - if (!nlst) { - // unknown cursor type, skip it - qDebug() << "CursorFX: skipping cursor shape:" << curShapeName[curShape]; - qWarning() << "CursorFX: skipping cursor shape:" << curShapeName[curShape]; - continue; - } - if (shapesSeen.contains(curShape&0xff)) { - // unknown cursor type, skip it - qDebug() << "CursorFX: skipping duplicate cursor shape:" << curShapeName[curShape]; - qWarning() << "CursorFX: skipping duplicate cursor shape:" << curShapeName[curShape]; - continue; - } - shapesSeen << (curShape&0xff); - qDebug() << "importing cursor" << *nlst; - quint32 unk0 = baGetDW(unp, cps); // unknown field - quint32 frameCnt = baGetDW(unp, cps); - if (frameCnt < 1) frameCnt = 1; // just in case - quint32 imgWdt = baGetDW(unp, cps); - quint32 imgHgt = baGetDW(unp, cps); - quint32 imgDelay = baGetDW(unp, cps); - quint32 aniFlags = baGetDW(unp, cps); - quint32 unk1 = baGetDW(unp, cps); // unknown field - quint32 imgXHot = baGetDW(unp, cps); - quint32 imgYHot = baGetDW(unp, cps); - quint32 realHdrSize = baGetDW(unp, cps); - quint32 imgDataSize = baGetDW(unp, cps); - quint32 addonOfs = baGetDW(unp, cps); - quint32 addonLen = baGetDW(unp, cps); - if (imgDelay < 10) imgDelay = 10; - if (imgDelay >= (quint32)0x80000000LL) imgDelay = 0x7fffffffLL; - qDebug() << - "cursor data:" << - "\n frames:" << frameCnt << - "\n width:" << imgWdt << - "\n height:" << imgHgt << - "\n delay:" << imgDelay << - "\n flags:" << QString::number(aniFlags, 2) << - "\n xhot:" << imgXHot << - "\n yhot:" << imgYHot << - "\n unk0:" << unk0 << - "\n unk1:" << unk1 << - "\n rhdata:" << QString::number(realHdrSize, 16) << - "\n dataOfs:" << QString::number(ipos+realHdrSize, 16) << - "\n cdataOfs:" << QString::number(ipos+basicHdrSize+addonLen, 16) - ; - // now check if we have enought data - if (ipos+realHdrSize+imgDataSize > (quint32)pos) { - qDebug() << "CursorFX: cursor data too big"; - qWarning() << "CursorFX: cursor data too big"; - return false; - } - // addon is the script; parse it later - QList aseq; - QString script; - if (addonLen) { - // script - if (addonOfs < 0x4c || addonOfs > realHdrSize) { - qDebug() << "CursorFX: invalid addon data offset"; - qWarning() << "CursorFX: invalid addon data offset"; - return false; - } - QByteArray bs(unp.mid(ipos+addonOfs, addonLen)); - bs.append('\0'); bs.append('\0'); - script = QString::fromUtf16((const ushort *)bs.constData()); - qDebug() << "script:\n" << script; - // create animseq - aseq = parseScript(script, frameCnt); - } else { - // create 'standard' animseq - tAnimSeq a; - a.from = 0; a.to = frameCnt-1; a.delay = imgDelay; - aseq << a; - // and back if 'alternate' flag set - if (aniFlags&0x01) { - a.from = frameCnt-1; a.to = 0; - aseq << a; - } - } - if (imgWdt*imgHgt*4 != imgDataSize) { - qDebug() << "data size:" << imgDataSize << "but should be" << imgWdt*imgHgt*4; - continue; - } - // decode image - QImage img((const uchar *)unp.constData()+ipos+realHdrSize, imgWdt, imgHgt, QImage::Format_ARGB32); - img = img.mirrored(false, true); - // - XCursorImages *cim = new XCursorImages(*nlst); - cim->setScript(script); - //!!! - //!!!img.save(QString("_png/%1.png").arg(cim->name())); - //!!! - quint32 frameWdt = img.width()/frameCnt; - qDebug() << "frameWdt:" << frameWdt << "left:" << img.width()%(frameWdt*frameCnt); - // now build animation sequence - int fCnt = 0; - foreach (const tAnimSeq &a, aseq) { - bool back = a.from > a.to; // going backwards - quint32 fNo = a.from; - for (;; fCnt++) { - //k8:qDebug() << " frame:" << fNo << "delay:" << a.delay; - // copy frame - QImage frame(img.copy(fNo*frameWdt, 0, frameWdt, img.height())); - //frame.save(QString("_png/%1_%2.png").arg(cim->name()).arg(QString::number(f))); - XCursorImage *i = new XCursorImage(QString("%1%2").arg(cim->name()).arg(QString::number(fCnt)), - frame, imgXHot, imgYHot, a.delay, 1 - ); - cim->append(i); - // - if (fNo == a.to) break; - if (back) fNo--; else fNo++; - } - } - // append if not empty - if (cim->count()) { - // now check if it is looped and cancel looping if necessary - if ((aniFlags & 0x02) == 0) { - // not looped - qDebug() << " anti-loop fix"; - XCursorImage *i = cim->item(cim->count()-1); - i->setDelay(0x7fffffffL); - //i->setCSize(2); // ??? - } - mList << cim; - } - } - return true; -} diff --git a/liblxqt-config-cursor/xcr/xcrthemefx.h b/liblxqt-config-cursor/xcr/xcrthemefx.h deleted file mode 100644 index c474ccd..0000000 --- a/liblxqt-config-cursor/xcr/xcrthemefx.h +++ /dev/null @@ -1,40 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#ifndef XCRTHEMEFX_H -#define XCRTHEMEFX_H - -#include -#include -#include - -#include "xcrimg.h" -#include "xcrtheme.h" - - -class XCursorThemeFX : public XCursorTheme { -public: - XCursorThemeFX (const QString &aFileName); - -public: - class tAnimSeq { - public: - quint32 from, to; - quint32 delay; - }; - - static QList parseScript (const QString &script, quint32 maxFrame); - static bool str2num (const QString &s, quint32 &res); - -protected: - bool parseCursorFXTheme (const QString &aFileName); -}; - - -#endif diff --git a/liblxqt-config-cursor/xcr/xcrthemexp.cpp b/liblxqt-config-cursor/xcr/xcrthemexp.cpp deleted file mode 100644 index 9aec632..0000000 --- a/liblxqt-config-cursor/xcr/xcrthemexp.cpp +++ /dev/null @@ -1,352 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#include -//#include - -#include "xcrthemexp.h" - -#include -#include - -#include -#include -#include - -#include "xcrimg.h" -#include "xcrxcur.h" -#include "xcrtheme.h" -#include "xcrthemefx.h" - - -static const char *curShapeName[] = { - "Arrow", - "Cross", - "Hand", - "IBeam", - "UpArrow", - "SizeNWSE", - "SizeNESW", - "SizeWE", - "SizeNS", - "Help", - "Handwriting", - "AppStarting", - "SizeAll", - "Wait", - "NO", - 0 -}; - - -static const char *findCurShapeName (const QString &s) { - QByteArray ba(s.toUtf8()); - const char *name = ba.constData(); - const char **nlst = curShapeName; - while (*nlst) { - if (!strcasecmp(name, *nlst)) return *nlst; - nlst++; - } - return 0; -} - - -static QString findFile (const QDir &dir, const QString &name, bool fullName=false) { - QFileInfoList lst = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden); - foreach (const QFileInfo &fi, lst) { - if (!name.compare(fi.fileName(), Qt::CaseInsensitive)) { - if (fullName) return fi.absoluteFilePath(); - return fi.fileName(); - } - } - return QString(); -} - - -class CursorInfo { -public: - CursorInfo () { clear(); curSection.clear(); } - - void clear () { - frameCnt = 1; delay = 50; xhot = yhot = 0; - script.clear(); - wasFrameCnt = wasXHot = wasYHot = wasDelay = wasScript = wasAStyle = wasStdCur = false; - isStdCursor = false; - isLooped = true; is2way = false; - } - -public: - quint32 frameCnt, delay, xhot, yhot; - QString script; - bool wasFrameCnt, wasXHot, wasYHot, wasDelay, wasScript, wasAStyle, wasStdCur; - bool isStdCursor; - bool isLooped, is2way; - QString curSection; - QString nextSection; -}; - - -/* true: EOF */ -static bool readNextSection (QTextStream &stream, CursorInfo &info) { - info.clear(); - if (info.nextSection.isEmpty()) { - // find next section - //qDebug() << "searching section..."; - for (;;) { - QString s; - info.curSection.clear(); - info.nextSection.clear(); - for (;;) { - s = stream.readLine(); - if (s.isNull()) return true; - s = s.trimmed(); - //qDebug() << "*" << s; - if (s.isEmpty() || s[0] == '#' || s[0] == ';') continue; - if (s[0] == '[') break; - } - int len = s.length()-1; - if (s[len] == ']') len--; - s = s.mid(1, len); - const char *csn = findCurShapeName(s); - if (!csn) continue; - // section found - info.curSection = csn; - break; - } - } else { - info.curSection = info.nextSection; - info.nextSection.clear(); - } - // section found; read it - for (;;) { - QString s = stream.readLine(); - if (s.isNull()) return true; - s = s.trimmed(); - //qDebug() << "+" << s; - if (s.isEmpty() || s[0] == '#' || s[0] == ';') continue; - if (s[0] == '[') { - int len = s.length()-1; - if (s[len] == ']') len--; - s = s.mid(1, len); - const char *csn = findCurShapeName(s); - if (csn) info.nextSection = csn; else info.nextSection.clear(); - break; - } - QStringList nv(s.split('=')); - if (nv.size() != 2) continue; // invalid - QString name = nv[0].simplified().toLower(); - quint32 num = 0; - bool numOk = XCursorThemeFX::str2num(nv[1].trimmed(), num); - if (!numOk) num = 0; - if (name == "frames") { - info.frameCnt = qMax(num, (quint32)1); - info.wasFrameCnt = true; - } else if (name == "interval") { - info.delay = qMax(qMin(num, (quint32)0x7fffffffL), (quint32)10); - info.wasDelay = true; - } else if (name == "animation style") { - info.isLooped = true; - info.is2way = (num != 0); - info.wasAStyle = true; - } else if (name == "hot spot x") { - info.xhot = num; - info.wasXHot = true; - } else if (name == "hot spot y") { - info.yhot = num; - info.wasYHot = true; - } else if (name == "framescript") { - // 1 or 0 - } else if (name == "stdcursor") { - info.isStdCursor = (num!=0); - info.wasStdCur = true; - } else if (name == "hot spot x2" || name == "hot spot y2") { - } else if (name == "stdcursor" || name == "hot spot x2" || name == "hot spot y2") { - // nothing - } else { - qDebug() << "unknown param:" << name << nv[1]; - qWarning() << "unknown param:" << name << nv[1]; - } - } - return false; -} - - -static void removeFilesAndDirs (QDir &dir) { - //qDebug() << "dir:" << dir.path(); - // files - QFileInfoList lst = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden); - foreach (const QFileInfo &fi, lst) { - //qDebug() << "removing" << fi.fileName() << fi.absoluteFilePath(); - dir.remove(fi.fileName()); - } - // dirs - lst = dir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::Hidden); - foreach (const QFileInfo &fi, lst) { - dir.cd(fi.fileName()); - removeFilesAndDirs(dir); - dir.cd(".."); - //qDebug() << "removing dir" << fi.fileName(); - dir.rmdir(fi.fileName()); - } -} - - -/* - * returns temporary dir or empty string - */ -static QString unzipFile (const QString &zipFile) { - QStringList args; - - char tmpDirName[18]; - strcpy(tmpDirName, "/tmp/unzXXXXXX"); - char *td = mkdtemp(tmpDirName); - if (!td) return QString(); - - QDir dir(td); - - args << "-b"; // all files are binary - args << "-D"; // skip timestamps - args << "-n"; // never overwrite (just in case) - args << "-qq"; // be very quiet - args << zipFile; - args << "-d" << dir.absolutePath(); // dest dir - - QProcess pr; - pr.setStandardInputFile("/dev/null"); - pr.setStandardOutputFile("/dev/null"); - pr.setStandardErrorFile("/dev/null"); - - pr.start("unzip", args); - - if (pr.waitForStarted()) { - if (pr.waitForFinished()) return QLatin1String(td); - } - - // cleanup - removeFilesAndDirs(dir); - dir.cd(".."); - QString s = QLatin1String(strchr(td+1, '/')+1); - //qDebug() << s; - dir.rmdir(s); - - return QString(); -} - - -/////////////////////////////////////////////////////////////////////////////// -XCursorThemeXP::XCursorThemeXP (const QString &aFileName) : XCursorTheme() { - QFileInfo fi(aFileName); - if (fi.exists() && fi.isReadable()) { - QString dst = unzipFile(aFileName); - if (!dst.isEmpty()) { - QDir d(dst); - if (!parseCursorXPTheme(d)) { - qDeleteAll(mList); - mList.clear(); - } - qDebug() << "doing cleanup..."; - dst.remove(0, dst.indexOf('/', 1)+1); - removeFilesAndDirs(d); - d.cd(".."); - qDebug() << dst; - d.rmdir(dst); - } - } -} - - -bool XCursorThemeXP::parseCursorXPTheme (const QDir &thDir) { - qDebug() << "loading" << thDir.path(); - QString ifn = findFile(thDir, "scheme.ini", true); - if (ifn.isEmpty()) return false; - qDebug() << "reading scheme:" << ifn; - // - QFile fl(ifn); - if (!fl.open(QIODevice::ReadOnly)) return false; // no scheme --> no fun! - QTextStream stream; - stream.setDevice(&fl); - stream.setCodec("UTF-8"); - CursorInfo info; - QSet sectionsSeen; - bool eof = false; - do { - eof = readNextSection(stream, info); - if (info.curSection.isEmpty()) break; -/* - qDebug() << "section:" << info.curSection << - "\n stdcr was:" << info.wasStdCur << "value:" << info.isStdCursor << - "\n frame was:" << info.wasFrameCnt << "value:" << info.frameCnt << - "\n delay was:" << info.wasDelay << "value:" << info.delay << - "\n xhot was:" << info.wasXHot << "value:" << info.xhot << - "\n yhot was:" << info.wasYHot << "value:" << info.yhot << - "\n style was:" << info.wasAStyle << "loop:" << info.isLooped << "2way:" << info.is2way << - "\n scrpt was:" << info.wasScript << "value:" << info.script << - "\n next section:" << info.nextSection - ; -*/ - const char ** nlst = XCursorTheme::findCursorRecord(info.curSection, 0); - QString imgFile = findFile(thDir, info.curSection+".png", true); - if (!sectionsSeen.contains(info.curSection) && nlst && !imgFile.isEmpty()) { - qDebug() << "section" << info.curSection << "file:" << imgFile; - sectionsSeen << info.curSection; - //TODO: script - QList aseq; - { - // create 'standard' animseq - XCursorThemeFX::tAnimSeq a; - a.from = 0; a.to = info.frameCnt-1; a.delay = info.delay; - aseq << a; - // and back if 'alternate' flag set - if (info.is2way) { - a.from = info.frameCnt-1; a.to = 0; - aseq << a; - } - } - // load image - QImage img(imgFile); - if (!img.isNull()) { - XCursorImages *cim = new XCursorImages(*nlst); - quint32 frameWdt = img.width()/info.frameCnt; - qDebug() << "frameWdt:" << frameWdt << "left:" << img.width()%(frameWdt*info.frameCnt); - // now build animation sequence - int fCnt = 0; - foreach (const XCursorThemeFX::tAnimSeq &a, aseq) { - bool back = a.from > a.to; // going backwards - quint32 fNo = a.from; - for (;; fCnt++) { - //k8:qDebug() << " frame:" << fNo << "delay:" << a.delay; - // copy frame - QImage frame(img.copy(fNo*frameWdt, 0, frameWdt, img.height())); - //frame.save(QString("_png/%1_%2.png").arg(cim->name()).arg(QString::number(f))); - XCursorImage *i = new XCursorImage(QString("%1%2").arg(cim->name()).arg(QString::number(fCnt)), - frame, info.xhot, info.yhot, a.delay, 1 - ); - cim->append(i); - // - if (fNo == a.to) break; - if (back) fNo--; else fNo++; - } - } - // append if not empty - if (cim->count()) { - // now check if it is looped and cancel looping if necessary - if (!info.isLooped) { - // not looped - qDebug() << " anti-loop fix"; - XCursorImage *i = cim->item(cim->count()-1); - i->setDelay(0x7fffffffL); - //i->setCSize(2); // ??? - } - mList << cim; - } - } - } - } while (!eof); - return true; -} diff --git a/liblxqt-config-cursor/xcr/xcrthemexp.h b/liblxqt-config-cursor/xcr/xcrthemexp.h deleted file mode 100644 index fb97be3..0000000 --- a/liblxqt-config-cursor/xcr/xcrthemexp.h +++ /dev/null @@ -1,31 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#ifndef XCRTHEMEXP_H -#define XCRTHEMEXP_H - -#include -#include -#include - -#include "xcrimg.h" -#include "xcrtheme.h" -#include "xcrthemefx.h" - - -class XCursorThemeXP : public XCursorTheme { -public: - XCursorThemeXP (const QString &aFileName); - -protected: - bool parseCursorXPTheme (const QDir &thDir); -}; - - -#endif diff --git a/liblxqt-config-cursor/xcr/xcrxcur.cpp b/liblxqt-config-cursor/xcr/xcrxcur.cpp deleted file mode 100644 index 219b978..0000000 --- a/liblxqt-config-cursor/xcr/xcrxcur.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#include -//#include - -#include "xcrxcur.h" - -#include -#include -#include -#include -#include - -#include - - -#include -#include -#include - - -/* -static QImage autoCropImage (const QImage &image) { - // Compute an autocrop rectangle for the image - QRect r(image.rect().bottomRight(), image.rect().topLeft()); - const quint32 *pixels = reinterpret_cast(image.bits()); - for (int y = 0; y < image.height(); y++) { - for (int x = 0; x < image.width(); x++) { - if (*(pixels++)) { - if (x < r.left()) r.setLeft(x); - if (x > r.right()) r.setRight(x); - if (y < r.top()) r.setTop(y); - if (y > r.bottom()) r.setBottom(y); - } - } - } - // Normalize the rectangle - return image.copy(r.normalized()); -} -*/ - - -inline static quint32 getDW (const void *data) { - const quint8 *d = (const quint8 *)data; - d += 3; - quint32 res = 0; - for (int f = 4; f > 0; f--, d--) { - res <<= 8; - res |= *d; - } - return res; -} - - -static quint32 baGetDW (QByteArray &ba, int &pos) { - const uchar *d = (const uchar *)ba.constData(); - d += pos+3; - pos += 4; - quint32 res = 0; - for (int f = 4; f > 0; f--, d--) { - res <<= 8; - res |= *d; - } - return res; -} - - -/////////////////////////////////////////////////////////////////////////////// -XCursorImageXCur::XCursorImageXCur (const QString &aName, const void *aImgData) : XCursorImage(aName) { - parseImgData(aImgData); -} - - -XCursorImageXCur::~XCursorImageXCur () { -} - - -void XCursorImageXCur::parseImgData (const void *aImgData) { - mIsValid = false; - delete mImage; // It's fine to delete a null pointer - mImage = 0; - const quint32 *data = (const quint32 *)aImgData; - if (getDW(data) != 36) return; // header size - if (getDW(data+1) != 0xfffd0002L) return; // magic - //if (getDW(data+2) != 1) return; // image subtype - if (getDW(data+3) != 1) return; // version - mCSize = getDW(data+2); - data += 4; - quint32 wdt = getDW(data++); // width - quint32 hgt = getDW(data++); // height - if (wdt > 0x7fff) return; - if (hgt > 0x7fff) return; -/* - quint32 xhot = getDW(data++); - quint32 yhot = getDW(data++); - assert(xhot <= wdt); - assert(yhot <= hgt); -*/ - mXHot = *((const qint32 *)data); data++; - mYHot = *((const qint32 *)data); data++; - mDelay = getDW(data++); // milliseconds - // got to pixels (ARGB) - QImage img((const uchar *)data, wdt, hgt, QImage::Format_ARGB32_Premultiplied); - mImage = new QImage(img.copy()); - mIsValid = true; -} - - -/////////////////////////////////////////////////////////////////////////////// -XCursorImagesXCur::XCursorImagesXCur (const QDir &aDir, const QString &aName) : XCursorImages(aName, aDir.path()) { - parseCursorFile(aDir.path()+"/"+aName); -} - - -XCursorImagesXCur::XCursorImagesXCur (const QString &aFileName) : XCursorImages("", "") { - QString name(aFileName); - if (name.isEmpty() || name.endsWith('/')) return; - int i = name.lastIndexOf('/'); - QString dir; - if (i < 0) dir = "./"; else dir = name.left(i); - name = name.mid(i+1); - setName(name); setPath(dir); - parseCursorFile(aFileName); -} - - -bool XCursorImagesXCur::parseCursorFile (const QString &fname) { - //qDebug() << fname; - qDeleteAll(mList); - mList.clear(); - QFile fl(fname); - if (!fl.open(QIODevice::ReadOnly)) return false; // shit! - QByteArray ba(fl.readAll()); - fl.close(); - if (ba.size() < 4*4) return false; // shit! - if (ba[0] != 'X' || ba[1] != 'c' || ba[2] != 'u' || ba[3] != 'r') return false; // shit! - //FIXME: add more checks! - int pos = 4; - quint32 hdrSize = baGetDW(ba, pos); - if (hdrSize < 16) return false; // invalid header size - quint32 version = baGetDW(ba, pos); - if (version != 65536) return false; // invalid version - quint32 ntoc = baGetDW(ba, pos); - if (!ntoc) return true; // nothing to parse - if (ntoc >= 65536) return false; // idiot or what? - quint32 tocEndOfs = hdrSize+(ntoc*(3*4)); - if (tocEndOfs > (quint32)ba.size()) return false; // out of data - pos = hdrSize; - // parse TOC - int cnt = -1; - bool wasTitle = false, wasAuthor = false, wasLic = false; - bool wasMail = false, wasSite = false, wasDescr = false, wasIM = false; - while (ntoc-- > 0) { - cnt++; - quint32 type = baGetDW(ba, pos); - pos += 4; // skip the shit - quint32 dataOfs = baGetDW(ba, pos); - if (type == 0xfffd0001) { - // text - if (dataOfs < tocEndOfs || dataOfs > (quint32)ba.size()-20) continue; // invalid text - // parse text - int ipos = dataOfs; - if (baGetDW(ba, ipos) != 20) continue; // invalid header size - if (baGetDW(ba, ipos) != 0xfffd0001) continue; // invalid type - quint32 subT = baGetDW(ba, ipos); - if (baGetDW(ba, ipos) != 1) continue; // invalid version - quint32 len = baGetDW(ba, ipos); - // check for data presence - if (ipos+len > (quint32)ba.size()) continue; // out of data - QByteArray stBA(ba.mid(ipos, len)); - QString s(QString::fromUtf8(stBA)); - switch (subT) { - case 1: // copyright (author) - if (!wasAuthor) { - wasAuthor = true; - mAuthor = s; - } - break; - case 2: // license - if (!wasLic) { - wasLic = true; - mLicense = s; - } - break; - case 3: // other (description) - if (!wasDescr) { - wasDescr = true; - mDescr = s; - } - break; - // my extensions - case 4: // title - if (!wasTitle) { - wasTitle = true; - mTitle = s; - } - break; - case 5: // e-mail - if (!wasMail) { - wasMail = true; - mEMail = s; - } - break; - case 6: // site - if (!wasSite) { - wasSite = true; - mSite = s; - } - break; - case 7: // IM - if (!wasIM) { - wasIM = true; - mIM = s; - } - break; - } - continue; - } - if (type != 0xfffd0002) continue; // not an image, skip this one - // image - // check - if (dataOfs < tocEndOfs || dataOfs > (quint32)ba.size()-36) continue; // invalid image - // parse image - int ipos = dataOfs; - if (baGetDW(ba, ipos) != 36) continue; // invalid image (header size) - if (baGetDW(ba, ipos) != 0xfffd0002) continue; // invalid type - ipos += 4; // skip the shit - if (baGetDW(ba, ipos) != 1) continue; // invalid image (version) - quint32 wdt = baGetDW(ba, ipos); - quint32 hgt = baGetDW(ba, ipos); - if (wdt > 0x7fff || hgt > 0x7fff) continue; // invalid sizes - // check for data presence - if ((ipos+3*4)+(wdt*hgt*4) > (quint32)ba.size()) continue; // out of data - // load image - const uchar *dta = (const uchar *)ba.constData(); - dta += dataOfs; - XCursorImage *img = new XCursorImageXCur(mName+"_"+QString::number(cnt), dta); - if (img->isValid()) mList << img; else delete img; - } - return true; -} diff --git a/liblxqt-config-cursor/xcr/xcrxcur.h b/liblxqt-config-cursor/xcr/xcrxcur.h deleted file mode 100644 index 96e862d..0000000 --- a/liblxqt-config-cursor/xcr/xcrxcur.h +++ /dev/null @@ -1,40 +0,0 @@ -/* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar) - * (c)DWTFYW - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -#ifndef XCRXCUR_H -#define XCRXCUR_H - -#include -#include -#include - -#include "xcrimg.h" - - -class XCursorImageXCur : public XCursorImage { -public: - XCursorImageXCur (const QString &aName, const void *aImgData); // create from Xcursor file contents (ptr to image) - virtual ~XCursorImageXCur (); - -protected: - void parseImgData (const void *aImgData); -}; - - -class XCursorImagesXCur : public XCursorImages { -public: - XCursorImagesXCur (const QDir &aDir, const QString &aName); - XCursorImagesXCur (const QString &aFileName); - -protected: - bool parseCursorFile (const QString &fname); -}; - - -#endif diff --git a/lxqt-config-appearance.png b/lxqt-config-appearance.png deleted file mode 100644 index 6d77584f8bc4801a3a818eca1fd162b562eb9e3d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29640 zcmXtg1z1#F+x38;qzv6Dk^@rGEunOGcb9Z`he|zkNymUlw+cvulyrA@!@qt1>pRLN z4C9Ht?_6u$6Q!gejfqBr27y2@KfISvfj|&GfiFoEMDU6{E9?dM=edcjv;^eo-=EyJ z;zaNYs?&Szj}XYqU;n-kl9^wUf)`)7evp@Zv5flSCHZrW9;`kHgbMOOLQKtbc0bF* z6JL@rVr2jDfTvCKJyjeIRp=;g^dF=h_2|%-Op(D1G|Lge4C>L*k->kk@xDsRF#NG4 zp~n9+C-3k^ck|A4g{18Li!DEgY|Ep?g&F>i%#RkE7^i1vA6;A!5rafM<5#>4ipSX%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iwieExM2u6BkVtHVQ+&$5Zb6-bXfMm>4;5tQN8n-~XrQpHy+t}Kr(N# z+`i+f>SMb-LCmC#(5=e)risf@7bBt;>^c`QE0( z0d~m2{K=bs<3L80viLw(v{m!9LgaEf!D5z5!Vj7vY94%Tyv!PN4ZsyFOk z7+Ybt#pSKFvsWOEXp!El$ySgKk}~wICl^6)&`y{$KedHi`nTL>@JKIP&xwu4Wr=7~ zIT!!?K`YYffQ?!2uCK}&jUk*K8-rTS@rP;DRJsvJDY$4d$Y#-KDs zNKp~^s6mgWpuJfn`E3;o&^S)D1d!kE2aQx|u|boFbaWcscU!;-=P&=aRYRr^lyGqt zmV-##xYmOX6lf%o$Rwxf>V_KdNYX0JR~zxQq0f@UtY?fPvP*~{Bc}#0dKcK&w&JV< za=n`qIp`%l#YIHkV<2O&W-zcqQj$nV}p`m97GrWM%>0`QnjfE8sAtHHrePLf-YwIO}lbMus)OyQFCA?Sp zr?L_>9obh4`Ud2lb9GLmc1QPq^?^Z?!tpBO_Gmc}<1*w$ z_r5;=P-{Ogbe<1-7yeGka01y))bGd7K|WGIr}*TjIMPAQ#s&(13)P~5GSt_ftELP5 zo)joP6d~hJQ;8E7ul=68-WKxq%NGWI$uk(s&oY)4Kvwuu$$PiD_1i481o+LhHQqX1 ziIn#~B%`W#T5frULwH|_#(SqU080rRAlF&gudh!(Co(Pyu8g#0OBHPW2y5#fA_2t~ zBn^8Sb9LaWBfS4dm^yv*pgT502$b}nSTa>V37If_52@Z$VI0@d|1aA4A3a!dN{Q2GXN4~9x3oZt_gS2!= z>{JKaK3gORvug4cZEU>t^(`DHCJV?WK8d`%P9?^yUyUhYZ_r#T5dGhS$bUk!|3+n6 z>hHtikB$QL8%V%$MdhO9I*jN6IeES - * LXQt project: http://lxde.org/ - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "fontconfigfile.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -FontConfigFile::FontConfigFile(QObject* parent): - QObject(parent), - mAntialias(true), - mHinting(true), - mSubpixel("rgb"), - mHintStyle("hintslight"), - mDpi(96), - mAutohint(false), - mSaveTimer(NULL) -{ - mDirPath = QString::fromLocal8Bit(qgetenv("XDG_CONFIG_HOME")); - QString homeDir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation); - if(mDirPath.isEmpty()) - mDirPath = homeDir % "/.config"; - mDirPath += "/fontconfig"; - mFilePath = mDirPath + "/fonts.conf"; - - load(); -} - -FontConfigFile::~FontConfigFile() -{ - if(mSaveTimer) // has pending save request - { - delete mSaveTimer; - mSaveTimer = NULL; - save(); - } -} - -void FontConfigFile::setAntialias(bool value) -{ - mAntialias = value; - queueSave(); -} - -void FontConfigFile::setSubpixel(QByteArray value) -{ - mSubpixel = value; - queueSave(); -} - -void FontConfigFile::setHinting(bool value) -{ - mHinting = value; - queueSave(); -} - -void FontConfigFile::setHintStyle(QByteArray value) -{ - mHintStyle = value; - queueSave(); -} - -void FontConfigFile::setDpi(int value) -{ - mDpi = value; - queueSave(); -} - -void FontConfigFile::setAutohint(bool value) -{ - mAutohint = value; - queueSave(); -} - -void FontConfigFile::load() -{ - QFile file(mFilePath); - if(file.open(QIODevice::ReadOnly)) - { - QByteArray buffer = file.readAll(); - file.close(); - if(buffer.contains("lxqt-config-appearance")) // the config file is created by us - { - // doing full xml parsing is over-kill. let's use some simpler brute-force methods. - QDomDocument doc; - doc.setContent(&file); - file.close(); - QDomElement docElem = doc.documentElement(); - QDomNodeList editNodes = docElem.elementsByTagName("edit"); - for(int i = 0; i < editNodes.count(); ++i) - { - QDomElement editElem = editNodes.at(i).toElement(); - QByteArray name = editElem.attribute("name").toLatin1(); - if(name == "antialias") - { - QString value = editElem.firstChildElement("bool").text(); - mAntialias = value[0] == 't' ? true : false; - } - else if(name == "rgba") - { - QString value = editElem.firstChildElement("const").text(); - mSubpixel = value.toLatin1(); - } - else if(name == "hinting") - { - QString value = editElem.firstChildElement("bool").text(); - mHinting = value[0] == 't' ? true : false; - } - else if(name == "hintstyle") - { - QString value = editElem.firstChildElement("const").text(); - mHintStyle = value.toLatin1(); - } - else if(name == "dpi") - { - QString value = editElem.firstChildElement("double").text(); - mDpi = value.toInt(); - } - else if(name == "autohint") - { - QString value = editElem.firstChildElement("bool").text(); - mAutohint = value[0] == 't' ? true : false; - } - } - } - else // the config file is created by others => make a backup and write our config - { - QFile backup(mFilePath + ".bak"); - if(backup.open(QIODevice::WriteOnly)) - { - backup.write(buffer); - backup.close(); - } - queueSave(); // overwrite with our file - } - } -} - -void FontConfigFile::save() -{ - if(mSaveTimer) - { - mSaveTimer->deleteLater(); - mSaveTimer = NULL; - } - - QFile file(mFilePath); - QDir().mkdir(mDirPath); - // References: https://wiki.archlinux.org/index.php/Font_Configuration - if(file.open(QIODevice::WriteOnly)) - { - QTextStream s(&file); - s << - "\n" - "\n" - "\n" - "\n" - " conf.d\n" - " \n" - " \n" - " " << (mAntialias ? "true" : "false") << "\n" - " \n" - " \n" - " \n" - " \n" - " " << mSubpixel << "\n" - " \n" - " \n" - " \n" - " \n" - " lcddefault\n" - " \n" - " \n" - " \n" - " \n" - " " << (mHinting ? "true" : "false") << "\n" - " \n" - " \n" - " \n" - " \n" - " " << mHintStyle << "\n" - " \n" - " \n" - " \n" - " \n" - " " << (mAutohint ? "true" : "false") << "\n" - " \n" - " \n" - " \n" - " \n" - " " << mDpi << "\n" - " \n" - " \n" - ""; - s.flush(); - file.close(); - } -} - -void FontConfigFile::queueSave() -{ - if(mSaveTimer) - mSaveTimer->start(1500); - else - { - mSaveTimer = new QTimer(); - mSaveTimer->setSingleShot(true); - connect(mSaveTimer, SIGNAL(timeout()), this, SLOT(save())); - mSaveTimer->start(1500); - } -} - diff --git a/lxqt-config-appearance/fontconfigfile.h b/lxqt-config-appearance/fontconfigfile.h deleted file mode 100644 index 61620c3..0000000 --- a/lxqt-config-appearance/fontconfigfile.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2014 Hong Jen Yee (PCMan) - * LXQt project: http://lxde.org/ - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef FONTCONFIGFILE_H -#define FONTCONFIGFILE_H - -#include -#include -#include - -class QTimer; - -class FontConfigFile: public QObject -{ - Q_OBJECT -public: - explicit FontConfigFile(QObject* parent = 0); - virtual ~FontConfigFile(); - - bool antialias() const { - return mAntialias; - } - void setAntialias(bool value); - - bool hinting() const { - return mHinting; - } - void setHinting(bool value); - - QByteArray subpixel() const { - return mSubpixel; - } - void setSubpixel(QByteArray value); - - QByteArray hintStyle() const { - return mHintStyle; - } - void setHintStyle(QByteArray value); - - int dpi() const { - return mDpi; - } - void setDpi(int value); - - bool autohint() const { - return mAutohint; - } - void setAutohint(bool value); - -private Q_SLOTS: - void save(); - -private: - void load(); - void queueSave(); - -private: - bool mAntialias; - bool mHinting; - QByteArray mSubpixel; - QByteArray mHintStyle; - int mDpi; - bool mAutohint; - QString mDirPath; - QString mFilePath; - QTimer* mSaveTimer; -}; - -#endif // FONTCONFIGFILE_H diff --git a/lxqt-config-appearance/fontsconfig.cpp b/lxqt-config-appearance/fontsconfig.cpp deleted file mode 100644 index 687fe83..0000000 --- a/lxqt-config-appearance/fontsconfig.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://lxde.org/ - * - * Copyright: 2014 LXQt team - * Authors: - * Hong Jen Yee (PCMan) - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include "fontsconfig.h" -#include "ui_fontsconfig.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef Q_WS_X11 -extern void qt_x11_apply_settings_in_all_apps(); -#endif - -static const char* subpixelNames[] = {"none", "rgb", "bgr", "vrgb", "vbgr"}; -static const char* hintStyleNames[] = {"hintnone", "hintslight", "hintmedium", "hintfull"}; - -FontsConfig::FontsConfig(LXQt::Settings* settings, QSettings* qtSettings, QWidget* parent) : - QWidget(parent), - ui(new Ui::FontsConfig), - mQtSettings(qtSettings), - mSettings(settings), - mFontConfigFile() -{ - ui->setupUi(this); - - initControls(); - - connect(ui->fontName, SIGNAL(currentFontChanged(QFont)), SLOT(updateQtFont())); - connect(ui->fontStyle, SIGNAL(currentIndexChanged(int)), SLOT(updateQtFont())); - connect(ui->fontSize, SIGNAL(valueChanged(int)), SLOT(updateQtFont())); - - connect(ui->antialias, SIGNAL(toggled(bool)), SLOT(antialiasToggled(bool))); - connect(ui->subpixel, SIGNAL(currentIndexChanged(int)), SLOT(subpixelChanged(int))); - connect(ui->hinting, SIGNAL(toggled(bool)), SLOT(hintingToggled(bool))); - connect(ui->hintStyle, SIGNAL(currentIndexChanged(int)), SLOT(hintStyleChanged(int))); - connect(ui->dpi, SIGNAL(valueChanged(int)), SLOT(dpiChanged(int))); - connect(ui->autohint, SIGNAL(toggled(bool)), SLOT(autohintToggled(bool))); -} - - -FontsConfig::~FontsConfig() -{ - delete ui; -} - - -void FontsConfig::initControls() -{ - // read Qt style settings from Qt Trolltech.conf config - mQtSettings->beginGroup(QLatin1String("Qt")); - - QString fontName = mQtSettings->value("font").toString(); - QFont font; - font.fromString(fontName); - ui->fontName->setCurrentFont(font); - ui->fontSize->setValue(font.pointSize()); - int fontStyle = 0; - if(font.bold()) - fontStyle = font.italic() ? 3 : 1; - else if(font.italic()) - fontStyle = 2; - ui->fontStyle->setCurrentIndex(fontStyle); - - mQtSettings->endGroup(); - - // load fontconfig config - ui->antialias->setChecked(mFontConfigFile.antialias()); - ui->autohint->setChecked(mFontConfigFile.autohint()); - - QByteArray subpixelStr = mFontConfigFile.subpixel(); - int subpixel; - for(subpixel = 0; subpixel < 5; ++subpixel) - { - if(subpixelStr == subpixelNames[subpixel]) - break; - } - if(subpixel < 5) - ui->subpixel->setCurrentIndex(subpixel); - - ui->hinting->setChecked(mFontConfigFile.hinting()); - - QByteArray hintStyleStr = mFontConfigFile.hintStyle(); - int hintStyle; - for(hintStyle = 0; hintStyle < 4; ++hintStyle) - { - if(hintStyleStr == hintStyleNames[hintStyle]) - break; - } - if(hintStyle < 4) - ui->hintStyle->setCurrentIndex(hintStyle); - - int dpi = mFontConfigFile.dpi(); - ui->dpi->setValue(dpi); - - update(); -} - -void FontsConfig::antialiasToggled(bool toggled) -{ - mFontConfigFile.setAntialias(toggled); -} - -void FontsConfig::dpiChanged(int value) -{ - mFontConfigFile.setDpi(value); -} - -void FontsConfig::hintingToggled(bool toggled) -{ - mFontConfigFile.setHinting(toggled); -} - -void FontsConfig::subpixelChanged(int index) -{ - mFontConfigFile.setSubpixel(subpixelNames[index]); -} - -void FontsConfig::hintStyleChanged(int index) -{ - mFontConfigFile.setHintStyle(hintStyleNames[index]); -} - -void FontsConfig::autohintToggled(bool toggled) -{ - mFontConfigFile.setAutohint(toggled); -} - -void FontsConfig::updateQtFont() -{ - // FIXME: the change does not apply to some currently running Qt programs. - // FIXME: does not work with KDE apps - // TODO: also write the config values to GTK+ config files (gtk-2.0.rc and gtk3/settings.ini) - // FIXME: the selected font does not apply to our own application. Why? - - QFont font = ui->fontName->currentFont(); - int size = ui->fontSize->value(); - bool bold = false; - bool italic = false; - switch(ui->fontStyle->currentIndex()) - { - case 1: - bold = true; - break; - case 2: - italic = true; - break; - case 3: - bold = italic = true; - } - - font.setPointSize(size); - font.setBold(bold); - font.setItalic(italic); - - mQtSettings->beginGroup(QLatin1String("Qt")); - mQtSettings->setValue("font", font.toString()); - mQtSettings->endGroup(); - mQtSettings->sync(); - -#ifdef Q_WS_X11 - qt_x11_apply_settings_in_all_apps(); -#endif - - update(); -} diff --git a/lxqt-config-appearance/fontsconfig.h b/lxqt-config-appearance/fontsconfig.h deleted file mode 100644 index 807fd45..0000000 --- a/lxqt-config-appearance/fontsconfig.h +++ /dev/null @@ -1,70 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2012 Razor team - * Authors: - * Alexander Sokoloff - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef FONTSCONFIG_H -#define FONTSCONFIG_H - -#include -#include -#include -#include "fontconfigfile.h" - -class QTreeWidgetItem; -class QSettings; - -namespace Ui { - class FontsConfig; -} - -class FontsConfig : public QWidget -{ - Q_OBJECT - -public: - explicit FontsConfig(LXQt::Settings *settings, QSettings *qtSettings, QWidget *parent = 0); - ~FontsConfig(); - -public Q_SLOTS: - void initControls(); - -private Q_SLOTS: - void updateQtFont(); - void antialiasToggled(bool toggled); - void hintingToggled(bool toggled); - void subpixelChanged(int index); - void hintStyleChanged(int index); - void dpiChanged(int value); - void autohintToggled(bool toggled); - -private: - Ui::FontsConfig *ui; - QSettings *mQtSettings; - LXQt::Settings *mSettings; - FontConfigFile mFontConfigFile; -}; - -#endif // FONTSCONFIG_H diff --git a/lxqt-config-appearance/fontsconfig.ui b/lxqt-config-appearance/fontsconfig.ui deleted file mode 100644 index 64e3c6e..0000000 --- a/lxqt-config-appearance/fontsconfig.ui +++ /dev/null @@ -1,261 +0,0 @@ - - - FontsConfig - - - - 0 - 0 - 421 - 379 - - - - - - - - 75 - true - - - - Font - - - - - - - Default font for user interface - - - - - - Font name: - - - - - - - - - - Style: - - - - - - - Point size: - - - - - - - 4 - - - - - - - - Normal - - - - - Bold - - - - - Italic - - - - - Bold Italic - - - - - - - - - - - The following settings only affect newly started applications - - - - - - Use antialias fonts - - - - - - - Font hinting style: - - - - - - - false - - - - None - - - - - Slight - - - - - Medium - - - - - Full - - - - - - - - Font hinting - - - - - - - Resolution (DPI): - - - - - - - Autohint - - - - - - - -1 - - - 1048576 - - - - - - - Subpixel antialiasing: - - - - - - - false - - - - None - - - - - RGB - - - - - BGR - - - - - VRGB - - - - - VBGR - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - antialias - toggled(bool) - subpixel - setEnabled(bool) - - - 225 - 109 - - - 298 - 140 - - - - - hinting - toggled(bool) - hintStyle - setEnabled(bool) - - - 225 - 171 - - - 298 - 202 - - - - - diff --git a/lxqt-config-appearance/iconthemeconfig.cpp b/lxqt-config-appearance/iconthemeconfig.cpp deleted file mode 100644 index fb15e9e..0000000 --- a/lxqt-config-appearance/iconthemeconfig.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2010-2011 Razor team - * Authors: - * Petr Vanek - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include "iconthemeconfig.h" - -#include -#include -#include -#include - -IconThemeConfig::IconThemeConfig(LXQt::Settings* settings, QWidget* parent): - QWidget(parent), - m_settings(settings) -{ - setupUi(this); - - initIconsThemes(); - initControls(); - connect(iconThemeList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), - this, SLOT(iconThemeSelected(QTreeWidgetItem*,int))); - connect(iconFollowColorSchemeCB, &QAbstractButton::toggled, this, [this] (bool checked) { - m_settings->setValue("icon_follow_color_scheme", checked); - }); -} - - -void IconThemeConfig::initIconsThemes() -{ - QStringList processed; - const QStringList baseDirs = QIcon::themeSearchPaths(); - static const QStringList iconNames = QStringList() - << QStringLiteral("document-open") - << QStringLiteral("document-new") - << QStringLiteral("edit-undo") - << QStringLiteral("media-playback-start"); - - const int iconNamesN = iconNames.size(); - iconThemeList->setColumnCount(iconNamesN + 2); - - QList items; - foreach (const QString &baseDirName, baseDirs) - { - QDir baseDir(baseDirName); - if (!baseDir.exists()) - continue; - - const QFileInfoList dirs = baseDir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name); - foreach (const QFileInfo &dir, dirs) - { - if (!processed.contains(dir.canonicalFilePath())) - { - processed << dir.canonicalFilePath(); - - IconThemeInfo theme(QDir(dir.canonicalFilePath())); - if (theme.isValid() && (!theme.isHidden())) - { - QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0); - item->setSizeHint(0, QSize(42,42)); // make icons non-cropped - item->setData(0, Qt::UserRole, theme.name()); - - const QVector icons = theme.icons(iconNames); - - const int K = icons.size(); - for (int i = 0; i < K; ++i) - { - item->setIcon(i, icons.at(i)); - } - - QString themeDescription; - if (theme.comment().isEmpty()) - { - themeDescription = theme.text(); - } - else - { - themeDescription = theme.text() % QStringLiteral(" (") % theme.comment() % QStringLiteral(")"); - } - - item->setText(iconNamesN + 1, themeDescription); - - items.append(item); - } - } - } - } - - iconThemeList->insertTopLevelItems(0, items); - for (int i=0; iheader()->count()-1; ++i) - { - iconThemeList->resizeColumnToContents(i); - } -} - - -void IconThemeConfig::initControls() -{ - QString currentTheme = QIcon::themeName(); - QTreeWidgetItemIterator it(iconThemeList); - while (*it) { - if ((*it)->data(0, Qt::UserRole).toString() == currentTheme) - { - iconThemeList->setCurrentItem((*it)); - break; - } - ++it; - } - - iconFollowColorSchemeCB->setChecked(m_settings->value("icon_follow_color_scheme", true).toBool()); - - update(); -} - - -IconThemeConfig::~IconThemeConfig() -{ -} - - -void IconThemeConfig::iconThemeSelected(QTreeWidgetItem *item, int column) -{ - Q_UNUSED(column); - const QString theme = item->data(0, Qt::UserRole).toString(); - if (!theme.isEmpty()) - { - // Ensure that this widget also updates it's own icons - QIcon::setThemeName(theme); - - m_settings->setValue("icon_theme", theme); - m_settings->sync(); - } -} diff --git a/lxqt-config-appearance/iconthemeconfig.h b/lxqt-config-appearance/iconthemeconfig.h deleted file mode 100644 index 7ab2e08..0000000 --- a/lxqt-config-appearance/iconthemeconfig.h +++ /dev/null @@ -1,58 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2010-2011 Razor team - * Authors: - * Petr Vanek - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include "ui_iconthemeconfig.h" -#include "iconthemeinfo.h" - -namespace LXQt { -class Settings; -} - - -class IconThemeConfig : public QWidget, public Ui::IconThemeConfig -{ - Q_OBJECT - -public: - IconThemeConfig(LXQt::Settings *settings, QWidget *parent = 0); - ~IconThemeConfig(); - -private: - LXQt::Settings *m_settings; - void initIconsThemes(); - -public slots: - void initControls(); - -private slots: - void iconThemeSelected(QTreeWidgetItem *item, int column); -}; - -#endif diff --git a/lxqt-config-appearance/iconthemeconfig.ui b/lxqt-config-appearance/iconthemeconfig.ui deleted file mode 100644 index 8777a3c..0000000 --- a/lxqt-config-appearance/iconthemeconfig.ui +++ /dev/null @@ -1,98 +0,0 @@ - - - IconThemeConfig - - - - 0 - 0 - 450 - 327 - - - - LXQt Appearance Configuration - - - - - - - 75 - true - - - - Icons Theme - - - - - - - - 0 - 0 - - - - Qt::ScrollBarAlwaysOff - - - true - - - - 22 - 22 - - - - false - - - true - - - 4 - - - false - - - - 1 - - - - - 2 - - - - - 3 - - - - - 4 - - - - - - - - The KDE extension of XDG icon themes -> FollowsColorScheme - - - Colorize icons based on widget style (palette) - - - - - - - - diff --git a/lxqt-config-appearance/iconthemeinfo.cpp b/lxqt-config-appearance/iconthemeinfo.cpp deleted file mode 100644 index b7042c9..0000000 --- a/lxqt-config-appearance/iconthemeinfo.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * https://sourceforge.net/projects/lxde-qt/ - * - * Copyright: 2010-2011 Razor team - * Authors: - * Alexander Sokoloff - * Luis Pereira - * - * The directoryMatchesSize() and thedirectorySizeDistance() functions were - * taken from Qt5 qtbase/src/gui/image/qiconloader.cpp - * Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include "iconthemeinfo.h" - -#define PREVIEW_ICON_SIZE 22 - -IconThemeInfo::IconThemeInfo(const QDir &dir): - mValid(false), - mHidden(false) -{ - mName = dir.dirName(); - if (dir.exists(QStringLiteral("index.theme"))) - load(dir.absoluteFilePath(QStringLiteral("index.theme"))); -} - - -void IconThemeInfo::load(const QString &fileName) -{ - mFileName = fileName; - mValid = false; - QSettings file(mFileName, QSettings::IniFormat); - if (file.status() != QSettings::NoError) - return; - - if (file.value(QStringLiteral("Icon Theme/Directories")).toStringList().join(QLatin1Char(' ')).isEmpty()) - return; - - mHidden = file.value(QStringLiteral("Icon Theme/Hidden"), false).toBool(); - mText = file.value(QStringLiteral("Icon Theme/Name")).toString(); - mComment = file.value(QStringLiteral("Icon Theme/Comment")).toString(); - - mValid = true; -} - - -QVector IconThemeInfo::icons(const QStringList &iconNames) const -{ - QVector icons; - QString current_theme = QIcon::themeName(); - - QIcon::setThemeName(mName); - for (const auto & i : iconNames) - { - icons.push_back({QIcon::fromTheme(i).pixmap({PREVIEW_ICON_SIZE, PREVIEW_ICON_SIZE})}); - } - - QIcon::setThemeName(current_theme); - - return icons; -} diff --git a/lxqt-config-appearance/iconthemeinfo.h b/lxqt-config-appearance/iconthemeinfo.h deleted file mode 100644 index fe1d82c..0000000 --- a/lxqt-config-appearance/iconthemeinfo.h +++ /dev/null @@ -1,65 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * https://sourceforge.net/projects/lxde-qt/ - * - * Copyright: 2010-2011 Razor team - * Authors: - * Alexander Sokoloff - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef ICONTHEMEINFO_H -#define ICONTHEMEINFO_H - -#include - -#include -#include -#include -#include - -class IconThemeInfo -{ -public: - IconThemeInfo(const QDir &dir); - - QString fileName() const { return mFileName; } - QString name() const { return mName; } - QString text() const { return mText; } - QString comment() const { return mComment; } - - bool isValid() const { return mValid; } - bool isHidden() const { return mHidden; } - QVector icons(const QStringList &iconNames) const; - -private: - QString mFileName; - QString mName; - QString mText; - QString mComment; - - bool mValid; - bool mHidden; - - void load(const QString &fileName); -}; - - -#endif // ICONTHEMEINFO_H diff --git a/lxqt-config-appearance/lxqt-config-appearance.desktop.in b/lxqt-config-appearance/lxqt-config-appearance.desktop.in deleted file mode 100644 index 8565232..0000000 --- a/lxqt-config-appearance/lxqt-config-appearance.desktop.in +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Appearance -GenericName=Appearance settings -Comment=Appearance settings for LXQt -Exec=lxqt-config-appearance -Icon=preferences-desktop-theme -Categories=Settings;DesktopSettings;Qt;LXQt; -OnlyShowIn=LXQt; - -#TRANSLATIONS_DIR=translations diff --git a/lxqt-config-appearance/lxqtthemeconfig.cpp b/lxqt-config-appearance/lxqtthemeconfig.cpp deleted file mode 100644 index 45bcbfe..0000000 --- a/lxqt-config-appearance/lxqtthemeconfig.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2012 Razor team - * Authors: - * Alexander Sokoloff - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include "lxqtthemeconfig.h" -#include "ui_lxqtthemeconfig.h" -#include -#include -#include -#include -#include - -/*! - * \brief Simple delegate to draw system background color below decoration/icon - * (needed by System theme, which uses widget background and therefore provides semi-transparent preview) - */ -class ThemeDecorator : public QItemDelegate -{ -public: - using QItemDelegate::QItemDelegate; -protected: - virtual void drawDecoration(QPainter * painter, const QStyleOptionViewItem & option, const QRect & rect, const QPixmap & pixmap) const override - { - //Note: can't use QItemDelegate::drawDecoration, because it is ignoring pixmap, - //if the icon is valid (and that is set in paint()) - if (pixmap.isNull() || !rect.isValid()) - return; - - QPoint p = QStyle::alignedRect(option.direction, option.decorationAlignment, pixmap.size(), rect).topLeft(); - painter->fillRect(QRect{p, pixmap.size()}, QApplication::palette().color(QPalette::Window)); - painter->drawPixmap(p, pixmap); - } -}; - -/*! - * \brief Check if currently configured wallpaper (read from pcmanfm-qt's - * settings) is the same as \param themeWallpaper - */ -static bool isWallpaperChanged(const QString & themeWallpaper) -{ - static const QString config_path = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) - + QStringLiteral("/pcmanfm-qt/lxqt/settings.conf"); - static const QString wallpaper_key = QStringLiteral("Desktop/Wallpaper"); - const QString current_wallpaper = QSettings{config_path, QSettings::IniFormat}.value(wallpaper_key).toString(); - return themeWallpaper != current_wallpaper; -} - -LXQtThemeConfig::LXQtThemeConfig(LXQt::Settings *settings, QWidget *parent) : - QWidget(parent), - ui(new Ui::LXQtThemeConfig), - mSettings(settings) -{ - ui->setupUi(this); - { - QScopedPointer p{ui->lxqtThemeList->itemDelegate()}; - ui->lxqtThemeList->setItemDelegate(new ThemeDecorator{this}); - } - - connect(ui->lxqtThemeList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), - this, SLOT(lxqtThemeSelected(QTreeWidgetItem*,int))); - connect(ui->wallpaperOverride, &QAbstractButton::toggled, [this] (bool checked) { - if (checked) - lxqtThemeSelected(ui->lxqtThemeList->currentItem(), 0/*not used*/); - }); - - - const QList themes = LXQt::LXQtTheme::allThemes(); - foreach(const LXQt::LXQtTheme &theme, themes) - { - QString themeName = theme.name(); - themeName[0] = themeName[0].toTitleCase(); - QTreeWidgetItem *item = new QTreeWidgetItem(QStringList(themeName)); - if (!theme.previewImage().isEmpty()) - { - item->setIcon(0, QIcon(theme.previewImage())); - } - item->setSizeHint(0, QSize(42,42)); // make icons non-cropped - item->setData(0, Qt::UserRole, theme.name()); - ui->lxqtThemeList->addTopLevelItem(item); - } - - initControls(); -} - - -LXQtThemeConfig::~LXQtThemeConfig() -{ - delete ui; -} - - -void LXQtThemeConfig::initControls() -{ - QString currentTheme = mSettings->value("theme").toString(); - - QTreeWidgetItemIterator it(ui->lxqtThemeList); - while (*it) { - if ((*it)->data(0, Qt::UserRole).toString() == currentTheme) - { - ui->lxqtThemeList->setCurrentItem((*it)); - break; - } - ++it; - } - - update(); -} - - -void LXQtThemeConfig::lxqtThemeSelected(QTreeWidgetItem* item, int column) -{ - Q_UNUSED(column); - if (!item) - return; - - LXQt::LXQtTheme currentTheme{mSettings->value("theme").toString()}; - QVariant themeName = item->data(0, Qt::UserRole); - mSettings->setValue("theme", themeName); - LXQt::LXQtTheme theme(themeName.toString()); - if(theme.isValid()) { - QString wallpaper = theme.desktopBackground(); - if(!wallpaper.isEmpty() && (ui->wallpaperOverride->isChecked() || !isWallpaperChanged(currentTheme.desktopBackground()))) { - // call pcmanfm-qt to update wallpaper - QStringList args; - args << "--set-wallpaper" << wallpaper; - QProcess::startDetached("pcmanfm-qt", args); - } - } -} diff --git a/lxqt-config-appearance/lxqtthemeconfig.h b/lxqt-config-appearance/lxqtthemeconfig.h deleted file mode 100644 index fcdff5c..0000000 --- a/lxqt-config-appearance/lxqtthemeconfig.h +++ /dev/null @@ -1,59 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2012 Razor team - * Authors: - * Alexander Sokoloff - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef LXQTTHEMECONFIG_H -#define LXQTTHEMECONFIG_H - -#include -#include - -class QTreeWidgetItem; - -namespace Ui { - class LXQtThemeConfig; -} - -class LXQtThemeConfig : public QWidget -{ - Q_OBJECT - -public: - explicit LXQtThemeConfig(LXQt::Settings *settings, QWidget *parent = 0); - ~LXQtThemeConfig(); - -public slots: - void initControls(); - -private slots: - void lxqtThemeSelected(QTreeWidgetItem* item, int column); - -private: - Ui::LXQtThemeConfig *ui; - LXQt::Settings *mSettings; -}; - -#endif // LXQTTHEMECONFIG_H diff --git a/lxqt-config-appearance/lxqtthemeconfig.ui b/lxqt-config-appearance/lxqtthemeconfig.ui deleted file mode 100644 index d3c63a3..0000000 --- a/lxqt-config-appearance/lxqtthemeconfig.ui +++ /dev/null @@ -1,65 +0,0 @@ - - - LXQtThemeConfig - - - - 0 - 0 - 400 - 300 - - - - - - - - 75 - true - - - - LXQt Theme - - - - - - - true - - - - 100 - 32 - - - - false - - - true - - - false - - - - 1 - - - - - - - - Override user-defined wallpaper - - - - - - - - diff --git a/lxqt-config-appearance/main.cpp b/lxqt-config-appearance/main.cpp deleted file mode 100644 index 8319f91..0000000 --- a/lxqt-config-appearance/main.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2010-2011 Razor team - * Authors: - * Petr Vanek - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include - -#include -#include -#include -#include "iconthemeconfig.h" -#include "lxqtthemeconfig.h" -#include "styleconfig.h" -#include "fontsconfig.h" - -#include "../liblxqt-config-cursor/selectwnd.h" - -int main (int argc, char **argv) -{ - LXQt::SingleApplication app(argc, argv); - app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); - - QCommandLineParser parser; - parser.setApplicationDescription(QStringLiteral("LXQt Config Appearance")); - const QString VERINFO = QStringLiteral(LXQT_CONFIG_VERSION - "\nliblxqt " LXQT_VERSION - "\nQt " QT_VERSION_STR); - app.setApplicationVersion(VERINFO); - parser.addVersionOption(); - parser.addHelpOption(); - parser.process(app); - - LXQt::Settings* settings = new LXQt::Settings("lxqt"); - LXQt::Settings* sessionSettings = new LXQt::Settings("session"); - LXQt::ConfigDialog* dialog = new LXQt::ConfigDialog(QObject::tr("LXQt Appearance Configuration"), settings); - - app.setActivationWindow(dialog); - - QSettings& qtSettings = *settings; // use lxqt config file for Qt settings in Qt5. - StyleConfig* stylePage = new StyleConfig(settings, &qtSettings, dialog); - dialog->addPage(stylePage, QObject::tr("Widget Style"), QStringList() << "preferences-desktop-theme" << "preferences-desktop"); - QObject::connect(dialog, SIGNAL(reset()), stylePage, SLOT(initControls())); - - IconThemeConfig* iconPage = new IconThemeConfig(settings, dialog); - dialog->addPage(iconPage, QObject::tr("Icons Theme"), QStringList() << "preferences-desktop-icons" << "preferences-desktop"); - QObject::connect(dialog, SIGNAL(reset()), iconPage, SLOT(initControls())); - - LXQtThemeConfig* themePage = new LXQtThemeConfig(settings, dialog); - dialog->addPage(themePage, QObject::tr("LXQt Theme"), QStringList() << "preferences-desktop-color" << "preferences-desktop"); - QObject::connect(dialog, SIGNAL(reset()), themePage, SLOT(initControls())); - - FontsConfig* fontsPage = new FontsConfig(settings, &qtSettings, dialog); - dialog->addPage(fontsPage, QObject::tr("Font"), QStringList() << "preferences-desktop-font" << "preferences-desktop"); - QObject::connect(dialog, SIGNAL(reset()), fontsPage, SLOT(initControls())); - - SelectWnd* cursorPage = new SelectWnd(sessionSettings, dialog); - cursorPage->setCurrent(); - dialog->addPage(cursorPage, QObject::tr("Cursor"), QStringList() << "input-mouse" << "preferences-desktop"); - - dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->setWindowIcon(QIcon::fromTheme("preferences-desktop-theme")); - dialog->show(); - - return app.exec(); -} - diff --git a/lxqt-config-appearance/man/lxqt-config-appearance.1 b/lxqt-config-appearance/man/lxqt-config-appearance.1 deleted file mode 100644 index f5c04a1..0000000 --- a/lxqt-config-appearance/man/lxqt-config-appearance.1 +++ /dev/null @@ -1,50 +0,0 @@ -.TH lxqt-config-appearance "1" "September 2012" "LXQt\ 0.7.0" "LXQt\ GUI settings" -.SH NAME -lxqt-config-appearance \- GUI appearance application of \fBLXQt\fR: the faster and lighter QT Desktop Environment -.SH SYNOPSIS -.B lxqt-config-appearance -.br -.SH DESCRIPTION -With this application you can setting and configuring qt/lxqt gui appearance of programs. -.P -The GUI applications in linux depends of their respective subsystem, in lxqt the overal aspect of -many apps relies on QT4 framework gui. The \fBlxqt-config-appearance\fR application its the configuration center -to provide all aspects of setting \fBLXQt\fR desktop in session settings related programs. -.P -All remaining mayor aspect for lxqt appearance relies over qt4 config application (\fBqtconfig\-qt4\fR), due -the \fBLXQt\fR DE are based on Qt framework. -.P -\fBLXQt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt -technologies, ships several core desktop components, all of which are optional: -.P - * Panel - * Desktop - * Application launcher - * Settings center \fI(related to this)\fR - * Session handler - * Polkit handler - * SSH pasword manager - * Display manager handler - * Power manager -.P -These components perform similar actions to those available in other desktop -environments, and their name is self-descriptive. They are usually not launched -by hand but automatically, when choosing a \fBLXQt\-qt\fR session in the Display -Manager. -.P -.SH "REPORTING BUGS" -Report bugs to https://github.com/lxde/lxqt/issues -.SH "SEE ALSO" -\fBLXQt\fR it has been tailored for users who value simplicity, speed, and -an intuitive interface, also intended for less powerful machines. See also: -.\" any module must refers to session app, for more info on start it -.P -\fBlxqt-session.1\fR LXQt module for manage LXQt complete environment. -.P -\fBlxqt-config.1\fR LXQt application for general config and settings. -.P -\fBqtconfig-qt4.1\fR Qt4 application for gui and appereance settings over all qt4 based software. -.P -.SH AUTHOR -This manual page was created by \fBPICCORO Lenz McKAY\fR \fI\fR -for \fBLXQt\fR project and VENENUX GNU/Linux but can be used by others. diff --git a/lxqt-config-appearance/styleconfig.cpp b/lxqt-config-appearance/styleconfig.cpp deleted file mode 100644 index 1a99596..0000000 --- a/lxqt-config-appearance/styleconfig.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://lxde.org/ - * - * Copyright: 2014 LXQt team - * Authors: - * Hong Jen Yee (PCMan) - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include "styleconfig.h" -#include "ui_styleconfig.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef Q_WS_X11 -extern void qt_x11_apply_settings_in_all_apps(); -#endif - -StyleConfig::StyleConfig(LXQt::Settings* settings, QSettings* qtSettings, QWidget* parent) : - QWidget(parent), - ui(new Ui::StyleConfig), - mQtSettings(qtSettings), - mSettings(settings) -{ - ui->setupUi(this); - - connect(ui->styleList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), - this, SLOT(styleSelected(QTreeWidgetItem*,int))); - - Q_FOREACH(const QString& name, QStyleFactory::keys()) - { - QTreeWidgetItem *item = new QTreeWidgetItem(QStringList(name)); - ui->styleList->addTopLevelItem(item); - } - - initControls(); - - connect(ui->toolButtonStyle, SIGNAL(currentIndexChanged(int)), SLOT(toolButtonStyleSelected(int))); - connect(ui->singleClickActivate, SIGNAL(toggled(bool)), SLOT(singleClickActivateToggled(bool))); -} - - -StyleConfig::~StyleConfig() -{ - delete ui; -} - - -void StyleConfig::initControls() -{ - // read Qt style settings from Qt Trolltech.conf config - mQtSettings->beginGroup(QLatin1String("Qt")); - QString currentTheme = mQtSettings->value("style").toString(); - mQtSettings->endGroup(); - - QTreeWidgetItemIterator it(ui->styleList); - while (*it) { - if ((*it)->data(0, Qt::DisplayRole).toString() == currentTheme) - { - ui->styleList->setCurrentItem((*it)); - break; - } - ++it; - } - - // read other widget related settings form LXQt settings. - QByteArray tb_style = mSettings->value("tool_button_style").toByteArray(); - // convert toolbar style name to value - QMetaEnum me = QToolBar::staticMetaObject.property(QToolBar::staticMetaObject.indexOfProperty("toolButtonStyle")).enumerator(); - int val = me.keyToValue(tb_style.constData()); - if(val == -1) - val = Qt::ToolButtonTextBesideIcon; - ui->toolButtonStyle->setCurrentIndex(val); - - // activate item views with single click - ui->singleClickActivate->setChecked( mSettings->value("single_click_activate", false).toBool()); - - update(); -} - - -void StyleConfig::styleSelected(QTreeWidgetItem* item, int column) -{ - Q_UNUSED(column); - if (!item) - return; - QVariant themeName = item->data(0, Qt::DisplayRole); - mQtSettings->beginGroup(QLatin1String("Qt")); - mQtSettings->setValue("style", themeName); - mQtSettings->endGroup(); - mQtSettings->sync(); - -#ifdef Q_WS_X11 - qt_x11_apply_settings_in_all_apps(); -#endif -} - -void StyleConfig::toolButtonStyleSelected(int index) -{ - // convert style value to string - QMetaEnum me = QToolBar::staticMetaObject.property(QToolBar::staticMetaObject.indexOfProperty("toolButtonStyle")).enumerator(); - if(index == -1) - index = Qt::ToolButtonTextBesideIcon; - const char* str = me.valueToKey(index); - if(str) - { - mSettings->setValue("tool_button_style", str); - mSettings->sync(); - } -} - -void StyleConfig::singleClickActivateToggled(bool toggled) -{ - mSettings->setValue("single_click_activate", toggled); - mSettings->sync(); -} - diff --git a/lxqt-config-appearance/styleconfig.h b/lxqt-config-appearance/styleconfig.h deleted file mode 100644 index a680ca8..0000000 --- a/lxqt-config-appearance/styleconfig.h +++ /dev/null @@ -1,63 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2012 Razor team - * Authors: - * Alexander Sokoloff - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef STYLECONFIG_H -#define STYLECONFIG_H - -#include -#include - -class QTreeWidgetItem; -class QSettings; - -namespace Ui { - class StyleConfig; -} - -class StyleConfig : public QWidget -{ - Q_OBJECT - -public: - explicit StyleConfig(LXQt::Settings *settings, QSettings *qtSettings, QWidget *parent = 0); - ~StyleConfig(); - -public slots: - void initControls(); - -private slots: - void styleSelected(QTreeWidgetItem* item, int column); - void toolButtonStyleSelected(int index); - void singleClickActivateToggled(bool toggled); - -private: - Ui::StyleConfig *ui; - QSettings *mQtSettings; - LXQt::Settings *mSettings; -}; - -#endif // STYLECONFIG_H diff --git a/lxqt-config-appearance/styleconfig.ui b/lxqt-config-appearance/styleconfig.ui deleted file mode 100644 index 9a086aa..0000000 --- a/lxqt-config-appearance/styleconfig.ui +++ /dev/null @@ -1,98 +0,0 @@ - - - StyleConfig - - - - 0 - 0 - 490 - 363 - - - - - - - - 75 - true - - - - Widget Style - - - - - - - - 0 - 1 - - - - true - - - false - - - false - - - - 1 - - - - - - - - Toolbar button style: - - - - - - - - Only display the icon - - - - - Only display the text - - - - - The text appears beside the icon - - - - - The text appears under the icon - - - - - Default - - - - - - - - Activate item on single click - - - - - - - - diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_ar.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_ar.desktop deleted file mode 100644 index cf108d8..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_ar.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ar]=إعدادات مظهر لكسكيوت -GenericName[ar]=إعدادات المظهر -Name[ar]=المظهر diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_ca.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_ca.desktop deleted file mode 100644 index 506793c..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_ca.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[ca]=Aparença -GenericName[ca]=Ajusts de l'aparença -Comment[ca]=Ajusts de l'aparença per a LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_cs.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_cs.desktop deleted file mode 100644 index ca0140a..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_cs.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[cs]=Nastavit vzhled pracovní plochy LXQt -GenericName[cs]=Nastavení vzhledu -Name[cs]=Nastavení vzhledu diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_cs_CZ.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_cs_CZ.desktop deleted file mode 100644 index 45646d0..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_cs_CZ.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[cs_CZ]=Nastavit vzhled pracovní plochy LXQt -GenericName[cs_CZ]=Nastavení vzhledu -Name[cs_CZ]=Nastavení vzhledu diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_da.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_da.desktop deleted file mode 100644 index 768abf6..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_da.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[da]=Udseende -GenericName[da]=Udseendeindstillinger -Comment[da]=Udseendeindstillinger for LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_de.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_de.desktop deleted file mode 100644 index ebabc1e..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_de.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[de]=Erscheinungsbild -GenericName[de]=Erscheinungsbild Einstellungen -Comment[de]=Einstellungen zum Aussehen der LXQt Arbeitsfläche diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_el.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_el.desktop deleted file mode 100644 index c9e42fe..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_el.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[el]=Διαμόρφωση εμφάνισης της επιφάνειας εργασίας LXQt -GenericName[el]=Διαμόρφωση εμφάνισης LXQt -Name[el]=Διαμόρφωση εμφάνισης LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_eo.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_eo.desktop deleted file mode 100644 index 9e90feb..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_eo.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[eo]=Agordi aperon de LXQt-labortablo -GenericName[eo]=Agordoj de apero de LXQt -Name[eo]=Agordoj de apero de LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_es.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_es.desktop deleted file mode 100644 index a45f295..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_es.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[es]=Configura el aspecto del escritorio LXQt -GenericName[es]=Configuración de Aspecto LXQt -Name[es]=Configuración de Aspecto LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_es_VE.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_es_VE.desktop deleted file mode 100644 index bfb3e11..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_es_VE.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[es_VE]=Configurar apariencia del escritorio LXQt -GenericName[es_VE]=Configuración de apariencia de LXQt -Name[es_VE]=Configuración de apariencia de LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_eu.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_eu.desktop deleted file mode 100644 index d630fb7..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_eu.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[eu]=Konfiguratu LXQt mahaigainaren itxura -GenericName[eu]=LXQt itxuraren konfigurazioa -Name[eu]=LXQt itxuraren konfigurazioa diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_fi.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_fi.desktop deleted file mode 100644 index f332a5b..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_fi.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[fi]=Hallitse LXQt-työpöydän ulkoasua -GenericName[fi]=LXQtin ulkoasun hallinta -Name[fi]=LXQtin ulkoasun hallinta diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_fr.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_fr.desktop deleted file mode 100644 index 2caea96..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_fr.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[fr]=Apparence -GenericName[fr]=Configurer l'apparence -Comment[fr]=Configurer l'apparence de LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_hu.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_hu.desktop deleted file mode 100644 index c3f22db..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_hu.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[hu]=A LXQt asztal megjelenésének beállítása -GenericName[hu]=LXQt megjelenésbeállító -Name[hu]=LXQt megjelenésbeállító diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_ia.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_ia.desktop deleted file mode 100644 index 26b0d99..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_ia.desktop +++ /dev/null @@ -1 +0,0 @@ -# Translations diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_id_ID.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_id_ID.desktop deleted file mode 100644 index 26b0d99..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_id_ID.desktop +++ /dev/null @@ -1 +0,0 @@ -# Translations diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_it.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_it.desktop deleted file mode 100644 index 7adb9f6..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_it.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -GenericName[it]=Aspetto -Name[it]=Aspetto -Comment[it]=Configura l'aspetto di LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_ja.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_ja.desktop deleted file mode 100644 index 1209541..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_ja.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ja]=LXQtデスクトップの外観を設定 -GenericName[ja]=LXQt外観の設定 -Name[ja]=LXQt外観の設定 diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_ko.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_ko.desktop deleted file mode 100644 index 26b0d99..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_ko.desktop +++ /dev/null @@ -1 +0,0 @@ -# Translations diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_lt.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_lt.desktop deleted file mode 100644 index 451fa64..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_lt.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[lt]=LXQt išvaizdos nustatymai -GenericName[lt]=Išvaizdos nustatymai -Name[lt]=Išvaizda diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_nl.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_nl.desktop deleted file mode 100644 index 0c56d11..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_nl.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[nl]=Configureer het uiterlijk van het LXQt bureaublad -GenericName[nl]=LXQt Uiterlijk Configuratie -Name[nl]=LXQt Uiterlijk Configuratie diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_pl_PL.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_pl_PL.desktop deleted file mode 100644 index 45b7f9b..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_pl_PL.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[pl_PL]=Konfiguruj wygląd pulpitu LXQt -GenericName[pl_PL]=Konfiguracja wyglądu LXQt -Name[pl_PL]=Konfiguracja wyglądu LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_pt.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_pt.desktop deleted file mode 100644 index f114950..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_pt.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[pt]=Configurar o aspeto do LXQt -GenericName[pt]=Configuração da aparência do LXQt -Name[pt]=Configuração da aparência do LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_pt_BR.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_pt_BR.desktop deleted file mode 100644 index b26cf8c..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_pt_BR.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[pt_BR]=Configure a aparência da área de trabalho LXQt -GenericName[pt_BR]=Configuração da aparência do LXQt -Name[pt_BR]=Configuração da aparência do LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_ro_RO.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_ro_RO.desktop deleted file mode 100644 index 20da510..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_ro_RO.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ro_RO]=Configurează aspectul desktopului LXQt -GenericName[ro_RO]=Configurare aspect LXQt -Name[ro_RO]=Configurare aspect LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_ru.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_ru.desktop deleted file mode 100644 index 2453235..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_ru.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ru]=Настройки внешнего вида LXQt -GenericName[ru]=Настройка внешнего вида -Name[ru]=Внешний вид \ No newline at end of file diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_sk.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_sk.desktop deleted file mode 100644 index cace414..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_sk.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[sk]=Nastavenie vzhľadu prostredia LXQt -GenericName[sk]=Nastavenie vzhľadu -Name[sk]=Nastavenie vzhľadu diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_sl.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_sl.desktop deleted file mode 100644 index 3fd428c..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_sl.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[sl]=Nastavite videz namizja LXQt -GenericName[sl]=Nastavitev videza -Name[sl]=Nastavitev videza namizja LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_sr.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_sr.desktop deleted file mode 100644 index 8a8351f..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_sr.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[sr]=Подесите изглед Рејзорове радне површи -GenericName[sr]=Подешавање изгледа -Name[sr]=Подешавање изгледа Рејзора diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_sr@ijekavian.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_sr@ijekavian.desktop deleted file mode 100644 index 8943815..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_sr@ijekavian.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[sr@ijekavian]=Подешавање изгледа Рејзора -Comment[sr@ijekavian]=Подесите изглед Рејзорове радне површи -GenericName[sr@ijekavian]=Подешавање изгледа diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_sr@ijekavianlatin.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_sr@ijekavianlatin.desktop deleted file mode 100644 index 69661a6..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_sr@ijekavianlatin.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[sr@ijekavianlatin]=Podešavanje izgleda Rejzora -Comment[sr@ijekavianlatin]=Podesite izgled Rejzorove radne površi -GenericName[sr@ijekavianlatin]=Podešavanje izgleda diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_sr@latin.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_sr@latin.desktop deleted file mode 100644 index 3aebf95..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_sr@latin.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[sr@latin]=Podesite izgled Rejzorove radne površi -GenericName[sr@latin]=Podešavanje izgleda -Name[sr@latin]=Podešavanje izgleda Rejzora diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_th_TH.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_th_TH.desktop deleted file mode 100644 index f4b0fa1..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_th_TH.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[th_TH]=ตั้งค่ารูปลักษณ์ของเดสก์ท็อป LXQt -GenericName[th_TH]=การตั้งค่ารูปลักษณ์ LXQt -Name[th_TH]=การตั้งค่ารูปลักษณ์ LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_tr.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_tr.desktop deleted file mode 100644 index 9d01a71..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_tr.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[tr]=LXQt masaüstünün görünümünü yapılandırın -GenericName[tr]=LXQt Görünüm Yapılandırıcı -Name[tr]=LXQt Görünüm Yapılandırıcı diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_uk.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_uk.desktop deleted file mode 100644 index 3398c37..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_uk.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[uk]=Налаштувати вигляд стільниці LXQt -GenericName[uk]=Налаштування вигляду LXQt -Name[uk]=Налаштування вигляду LXQt diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_zh_CN.GB2312.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_zh_CN.GB2312.desktop deleted file mode 100644 index 26b0d99..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_zh_CN.GB2312.desktop +++ /dev/null @@ -1 +0,0 @@ -# Translations diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_zh_CN.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_zh_CN.desktop deleted file mode 100644 index cc576f7..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_zh_CN.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[zh_CN]=配置 LXQt 桌面的外观 -GenericName[zh_CN]=LXQt 外观配置 -Name[zh_CN]=LXQt 外观配置 diff --git a/lxqt-config-appearance/translations/lxqt-config-appearance_zh_TW.desktop b/lxqt-config-appearance/translations/lxqt-config-appearance_zh_TW.desktop deleted file mode 100644 index 038f4b2..0000000 --- a/lxqt-config-appearance/translations/lxqt-config-appearance_zh_TW.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[zh_TW]=自定LXQt桌面的外觀 -GenericName[zh_TW]=LXQt外觀設定 -Name[zh_TW]=LXQt外觀設定 diff --git a/lxqt-config-brightness/CMakeLists.txt b/lxqt-config-brightness/CMakeLists.txt deleted file mode 100644 index c21ab45..0000000 --- a/lxqt-config-brightness/CMakeLists.txt +++ /dev/null @@ -1,84 +0,0 @@ -project(lxqt-config-brightness) - -find_package(Qt5Widgets REQUIRED QUIET) -find_package(Qt5X11Extras REQUIRED QUIET) - -find_package(XCB REQUIRED xcb xcb-randr) - -set(QTX_LIBRARIES Qt5::Widgets Qt5::X11Extras) - - -include_directories ( - ${XCB_INCLUDE_DIRS} -) - -set(H_FILES - brightnesssettings.h - xrandrbrightness.h - monitorinfo.h - outputwidget.h -) - -set(CPP_FILES - main.cpp - brightnesssettings.cpp - xrandrbrightness.cpp - monitorinfo.cpp - outputwidget.cpp -) - -set(UI_FILES - brightnesssettings.ui - outputwidget.ui -) - -qt5_wrap_ui(UI_HEADERS ${UI_FILES}) - - -# Translations ********************************** -lxqt_translate_ts(QM_FILES - UPDATE_TRANSLATIONS - ${UPDATE_TRANSLATIONS} - SOURCES - ${H_FILES} - ${CPP_FILES} - ${UI_FILES} - INSTALL_DIR - "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}" - PULL_TRANSLATIONS - ${PULL_TRANSLATIONS} - CLEAN_TRANSLATIONS - ${CLEAN_TRANSLATIONS} - TRANSLATIONS_REPO - ${TRANSLATIONS_REPO} - TRANSLATIONS_REFSPEC - ${TRANSLATIONS_REFSPEC} - REPO_SUBDIR - "lxqt-config/${PROJECT_NAME}" -) - -lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME}) -lxqt_translate_desktop(DESKTOP_FILES SOURCES "resources/${PROJECT_NAME}.desktop.in") - - -add_executable(${PROJECT_NAME} ${CPP_FILES} ${UI_FILES} ${QM_FILES} ${DESKTOP_FILES} ${QM_LOADER}) - -target_link_libraries( - ${PROJECT_NAME} - ${QTX_LIBRARIES} - ${XCB_LIBRARIES} - lxqt -) - -add_definitions( - -DICON_DIR="${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps" -) - - -install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) -install(FILES ${DESKTOP_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) -install( - FILES icons/brightnesssettings.svg - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps" -) - diff --git a/lxqt-config-brightness/README.md b/lxqt-config-brightness/README.md deleted file mode 100644 index 99c1da9..0000000 --- a/lxqt-config-brightness/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# brightness-settings - -This tool changes brightness and gamma of your screen. It is a X11 tool. LibKScreen can not change brightness or gamma yet. - diff --git a/lxqt-config-brightness/brightnesssettings.cpp b/lxqt-config-brightness/brightnesssettings.cpp deleted file mode 100644 index bd66f48..0000000 --- a/lxqt-config-brightness/brightnesssettings.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - Copyright (C) 2016 P.L. Lucas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "brightnesssettings.h" -#include "outputwidget.h" -#include -#include - -BrightnessSettings::BrightnessSettings(QWidget *parent):QDialog(parent) -{ - ui = new Ui::BrightnessSettings(); - ui->setupUi(this); - - mBrightness = new XRandrBrightness(); - mMonitors = mBrightness->getMonitorsInfo(); - - for(const MonitorInfo &monitor: mMonitors) - { - OutputWidget *output = new OutputWidget(monitor, this); - ui->layout->addWidget(output); - output->show(); - connect(output, SIGNAL(changed(MonitorInfo)), this, SLOT(monitorSettingsChanged(MonitorInfo))); - connect(this, &BrightnessSettings::monitorReverted, output, &OutputWidget::setRevertedValues); - } - - mConfirmRequestTimer.setSingleShot(true); - mConfirmRequestTimer.setInterval(1000); - connect(&mConfirmRequestTimer, &QTimer::timeout, this, &BrightnessSettings::requestConfirmation); - -} - -void BrightnessSettings::monitorSettingsChanged(MonitorInfo monitor) -{ - mBrightness->setMonitorsSettings(QList{} << monitor); - if (ui->confirmCB->isChecked()) - { - mConfirmRequestTimer.start(); - } else - { - for (auto & m : mMonitors) - { - if (m.id() == monitor.id() && m.name() == monitor.name()) - { - m.setBacklight(monitor.backlight()); - m.setBrightness(monitor.brightness()); - } - } - } -} - -void BrightnessSettings::requestConfirmation() -{ - QMessageBox msg{QMessageBox::Question, tr("Brightness settings changed") - , tr("Confirmation required. Are the settings correct?") - , QMessageBox::Yes | QMessageBox::No}; - int timeout = 5; // seconds - QString no_text = msg.button(QMessageBox::No)->text(); - no_text += QStringLiteral("(%1)"); - msg.setButtonText(QMessageBox::No, no_text.arg(timeout)); - msg.setDefaultButton(QMessageBox::No); - - QTimer timeoutTimer; - timeoutTimer.setSingleShot(false); - timeoutTimer.setInterval(1000); - connect(&timeoutTimer, &QTimer::timeout, [&] { - msg.setButtonText(QMessageBox::No, no_text.arg(--timeout)); - if (timeout == 0) - { - timeoutTimer.stop(); - msg.reject(); - } - }); - timeoutTimer.start(); - - if (QMessageBox::Yes == msg.exec()) - { - // re-read current values - mMonitors = mBrightness->getMonitorsInfo(); - } else - { - // revert the changes - mBrightness->setMonitorsSettings(mMonitors); - for (const auto & monitor : mMonitors) - emit monitorReverted(monitor); - } -} diff --git a/lxqt-config-brightness/brightnesssettings.h b/lxqt-config-brightness/brightnesssettings.h deleted file mode 100644 index 6d5bd36..0000000 --- a/lxqt-config-brightness/brightnesssettings.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2016 P.L. Lucas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef __BRIGHTNESS_SETTINGS_H__ -#define __BRIGHTNESS_SETTINGS_H__ - -#include -#include -#include "xrandrbrightness.h" -#include "ui_brightnesssettings.h" - - -class BrightnessSettings: public QDialog -{ -Q_OBJECT - -public: - BrightnessSettings(QWidget *parent =0); - -signals: - void monitorReverted(const MonitorInfo & monitor); - -public slots: - void monitorSettingsChanged(MonitorInfo monitor); - void requestConfirmation(); - -private: - XRandrBrightness *mBrightness; - QList mMonitors; - QTimer mConfirmRequestTimer; - Ui::BrightnessSettings *ui; - - -}; - - -#endif - diff --git a/lxqt-config-brightness/brightnesssettings.ui b/lxqt-config-brightness/brightnesssettings.ui deleted file mode 100644 index 0832376..0000000 --- a/lxqt-config-brightness/brightnesssettings.ui +++ /dev/null @@ -1,89 +0,0 @@ - - - BrightnessSettings - - - - 0 - 0 - 406 - 110 - - - - Brightness Settings - - - - - - - - - - - <html><head/><body><p><span style=" font-weight:600;">Backlight and brightness settings:</span></p><p>Use arrow keys to change settings.</p></body></html> - - - - - - - - - - Require confirmation after settings change - - - true - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - - - - - - - - buttonBox - accepted() - BrightnessSettings - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - BrightnessSettings - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/lxqt-config-brightness/icons/brightnesssettings.svg b/lxqt-config-brightness/icons/brightnesssettings.svg deleted file mode 100644 index 40a0c7c..0000000 --- a/lxqt-config-brightness/icons/brightnesssettings.svg +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/lxqt-config-brightness/main.cpp b/lxqt-config-brightness/main.cpp deleted file mode 100644 index ccb6908..0000000 --- a/lxqt-config-brightness/main.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright (C) 2016 P.L. Lucas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "xrandrbrightness.h" -#include -#include -#include -#include "brightnesssettings.h" - -int main(int argn, char* argv[]) -{ - LXQt::SingleApplication app(argn, argv); - app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); - - // Command line options - QCommandLineParser parser; - parser.setApplicationDescription(QStringLiteral("LXQt Config Brightness")); - const QString VERINFO = QStringLiteral(LXQT_CONFIG_VERSION - "\nliblxqt " LXQT_VERSION - "\nQt " QT_VERSION_STR); - app.setApplicationVersion(VERINFO); - QCommandLineOption increaseOption(QStringList() << "i" << "icrease", - app.tr("Increase brightness.")); - parser.addOption(increaseOption); - QCommandLineOption decreaseOption(QStringList() << "d" << "decrease", - app.tr("Decrease brightness.")); - parser.addOption(decreaseOption); - QCommandLineOption setOption(QStringList() << "s" << "set", - app.tr("Set brightness from 1 to 100."), "brightness"); - parser.addOption(setOption); - QCommandLineOption helpOption = parser.addHelpOption(); - parser.addOption(increaseOption); - parser.addOption(decreaseOption); - parser.addOption(setOption); - parser.addOption(helpOption); - parser.addVersionOption(); - - parser.process(app); - if( parser.isSet(increaseOption) || parser.isSet(decreaseOption) || parser.isSet(setOption) ) - { - XRandrBrightness *brightness = new XRandrBrightness(); - QList monitors = brightness->getMonitorsInfo(); - QList monitorsChanged; - float sign = parser.isSet(decreaseOption)?-1.0:1.0; - double brightness_value = parser.value(setOption).toFloat(); - brightness_value = qMin( qMax(brightness_value, 0.0), 100.0 ) / 100.0; - if(!parser.value(setOption).isEmpty()) - sign = 0.0; - foreach(MonitorInfo monitor, monitors) - { - if( monitor.isBacklightSupported() ) - { - long backlight = ( monitor.backlight() + sign*(monitor.backlightMax()/50 + 1) )*qAbs(sign) + brightness_value*monitor.backlightMax(); - if(backlight0) - { - monitor.setBacklight(backlight); - monitorsChanged.append(monitor); - } - } - else - { - float brightness = (monitor.brightness() + 0.1*sign)*qAbs(sign) + brightness_value*2.0; - if(brightness<2.0 && brightness>0.0) - { - monitor.setBrightness(brightness); - monitorsChanged.append(monitor); - } - } - } - brightness->setMonitorsSettings(monitorsChanged); - return 0; - } - - BrightnessSettings *brightnessSettings = new BrightnessSettings(); - brightnessSettings->setWindowIcon(QIcon(ICON_DIR "/brightnesssettings.svg")); - brightnessSettings->show(); - - return app.exec(); -} - diff --git a/lxqt-config-brightness/monitorinfo.cpp b/lxqt-config-brightness/monitorinfo.cpp deleted file mode 100644 index 992dd81..0000000 --- a/lxqt-config-brightness/monitorinfo.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright (C) 2016 P.L. Lucas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "monitorinfo.h" - -MonitorInfo::MonitorInfo(int id, QString name, long backlightMax) -{ - mId = id; - mName = name; - mBacklightMax = backlightMax; -} - -MonitorInfo::MonitorInfo(const MonitorInfo &monitor) -{ - mId = monitor.mId; - mName = monitor.mName; - mBacklightMax = monitor.mBacklightMax; - mBacklight = monitor.mBacklight; - mBrightness = monitor.mBrightness; -} - -bool MonitorInfo::isBacklightSupported() const -{ - return mBacklightMax > 0; -} - -long MonitorInfo::backlightMax() const -{ - return mBacklightMax; -} - -long MonitorInfo::backlight() const -{ - return mBacklight; -} - -void MonitorInfo::setBacklight(const long value) -{ - mBacklight = value; -} - -float MonitorInfo::brightness() const -{ - return mBrightness; -} - -void MonitorInfo::setBrightness(const float percent) -{ - mBrightness = qMax(qMin((float)2.0, percent), (float)0.0); -} - -int MonitorInfo::id() const -{ - return mId; -} - -QString MonitorInfo::name() const -{ - return mName; -} - diff --git a/lxqt-config-brightness/monitorinfo.h b/lxqt-config-brightness/monitorinfo.h deleted file mode 100644 index 9d5b123..0000000 --- a/lxqt-config-brightness/monitorinfo.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2016 P.L. Lucas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef __MONITOR_INFO_H__ -#define __MONITOR_INFO_H__ - -#include - - -/** This class represents backlight and brightness values of screen. - * If backlight is supported, backlight power of screen can be changed. - * Brightness represents color saturation. - */ -class MonitorInfo -{ -public: - MonitorInfo(int id, QString name, long backlightMax); - MonitorInfo(const MonitorInfo &monitor); - - bool isBacklightSupported() const; - long backlight() const; - long backlightMax() const; - void setBacklight(const long value); - - float brightness() const; - /**Brightness is a number between 0 and 2.*/ - void setBrightness(const float percent); - - int id() const; - QString name() const; - -private: - long mBacklightMax; - long mBacklight; - - float mBrightness; - - QString mName; - int mId; -}; - -#endif - diff --git a/lxqt-config-brightness/outputwidget.cpp b/lxqt-config-brightness/outputwidget.cpp deleted file mode 100644 index 4aac9a5..0000000 --- a/lxqt-config-brightness/outputwidget.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright (C) 2016 P.L. Lucas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "outputwidget.h" - -OutputWidget::OutputWidget(MonitorInfo monitor, QWidget *parent):QWidget(parent), mMonitor(monitor) -{ - ui = new Ui::OutputWidget(); - ui->setupUi(this); - - ui->label->setText(""+monitor.name()+":"); - if ( monitor.isBacklightSupported() ) - { - ui->backlightSlider->setMinimum(0); - ui->backlightSlider->setMaximum(monitor.backlightMax()); - ui->backlightSlider->setValue(monitor.backlight()); - ui->backlightSlider->setFocus(Qt::OtherFocusReason); - } - else - ui->backlightSlider->hide(); - ui->brightnessSlider->setMinimum(0); - ui->brightnessSlider->setMaximum(200); - ui->brightnessSlider->setValue(monitor.brightness()*100); - - connect(ui->backlightSlider, SIGNAL(valueChanged(int)), this, SLOT(backlightChanged(int))); - connect(ui->brightnessSlider, SIGNAL(valueChanged(int)), this, SLOT(brightnessChanged(int))); -} - -void OutputWidget::backlightChanged(int value) -{ - mMonitor.setBacklight(value); - emit changed(mMonitor); -} - - -void OutputWidget::brightnessChanged(int value) -{ - mMonitor.setBrightness((float)value/100.0); - emit changed(mMonitor); -} - -void OutputWidget::setRevertedValues(const MonitorInfo & monitor) -{ - if (mMonitor.id() == monitor.id() && mMonitor.name() == monitor.name()) - { - ui->backlightSlider->blockSignals(true); - ui->backlightSlider->setValue(monitor.backlight()); - ui->backlightSlider->blockSignals(false); - ui->brightnessSlider->blockSignals(true); - ui->brightnessSlider->setValue(monitor.brightness()*100); - ui->brightnessSlider->blockSignals(false); - } -} diff --git a/lxqt-config-brightness/outputwidget.h b/lxqt-config-brightness/outputwidget.h deleted file mode 100644 index e464147..0000000 --- a/lxqt-config-brightness/outputwidget.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2016 P.L. Lucas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef __OUTPUT_WIDGET_H__ -#define __OUTPUT_WIDGET_H__ - -#include -#include "monitorinfo.h" -#include "ui_outputwidget.h" - -class OutputWidget: public QWidget -{ -Q_OBJECT -public: - OutputWidget(MonitorInfo monitor, QWidget *parent); - -signals: - void changed(MonitorInfo info); - -public slots: - void backlightChanged(int value); - void brightnessChanged(int value); - void setRevertedValues(const MonitorInfo & monitor); -private: - MonitorInfo mMonitor; - Ui::OutputWidget *ui; -}; - -#endif - diff --git a/lxqt-config-brightness/outputwidget.ui b/lxqt-config-brightness/outputwidget.ui deleted file mode 100644 index bd6427f..0000000 --- a/lxqt-config-brightness/outputwidget.ui +++ /dev/null @@ -1,84 +0,0 @@ - - - OutputWidget - - - - 0 - 0 - 478 - 86 - - - - - 0 - 0 - - - - Form - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - 5 - - - - - - <b>Output:</b> - - - Qt::RichText - - - - - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 48 - 48 - - - - false - - - 10.000000000000000 - - - true - - - - - - - - - - - diff --git a/lxqt-config-brightness/resources/lxqt-config-brightness.desktop.in b/lxqt-config-brightness/resources/lxqt-config-brightness.desktop.in deleted file mode 100644 index 0bb2459..0000000 --- a/lxqt-config-brightness/resources/lxqt-config-brightness.desktop.in +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Name=Brightness -GenericName=Brightness Settings -Comment=Configure brightness -Exec=lxqt-config-brightness -Terminal=false -Type=Application -Icon=brightnesssettings -Categories=Settings;DesktopSettings;Qt;LXQt;HardwareSettings; -OnlyShowIn=LXQt; - -#TRANSLATIONS_DIR=translations diff --git a/lxqt-config-brightness/translations/lxqt-config-brightness_ar.desktop b/lxqt-config-brightness/translations/lxqt-config-brightness_ar.desktop deleted file mode 100644 index 73e7d25..0000000 --- a/lxqt-config-brightness/translations/lxqt-config-brightness_ar.desktop +++ /dev/null @@ -1,2 +0,0 @@ -# Translations -Name[ar]=إعدادات السّطوع diff --git a/lxqt-config-brightness/translations/lxqt-config-brightness_ca.desktop b/lxqt-config-brightness/translations/lxqt-config-brightness_ca.desktop deleted file mode 100644 index b575944..0000000 --- a/lxqt-config-brightness/translations/lxqt-config-brightness_ca.desktop +++ /dev/null @@ -1,2 +0,0 @@ -# Translations -Name[ca]=Ajusts de la brillantor diff --git a/lxqt-config-brightness/translations/lxqt-config-brightness_da.desktop b/lxqt-config-brightness/translations/lxqt-config-brightness_da.desktop deleted file mode 100644 index 94c7345..0000000 --- a/lxqt-config-brightness/translations/lxqt-config-brightness_da.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[da]=Lysstyrke -GenericName[da]=Lysstyrkeindstillinger -Comment[da]=Konfigurér lysstyrke diff --git a/lxqt-config-brightness/translations/lxqt-config-brightness_es.desktop b/lxqt-config-brightness/translations/lxqt-config-brightness_es.desktop deleted file mode 100644 index 069729b..0000000 --- a/lxqt-config-brightness/translations/lxqt-config-brightness_es.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[es]=Permite cambiar el brillo y el contraste del monitor -GenericName[es]=Configuración de Brillo y contraste LXQt -Name[es]=Configuración de Brillo y contraste LXQt diff --git a/lxqt-config-brightness/translations/lxqt-config-brightness_fr.desktop b/lxqt-config-brightness/translations/lxqt-config-brightness_fr.desktop deleted file mode 100644 index 461e526..0000000 --- a/lxqt-config-brightness/translations/lxqt-config-brightness_fr.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[fr]=Paramètres de luminosité -GenericName[fr]=Paramètres de luminosité de l'écran -Comment[fr]=Régler la luminosité et le contraste de l'écran diff --git a/lxqt-config-brightness/translations/lxqt-config-brightness_it.desktop b/lxqt-config-brightness/translations/lxqt-config-brightness_it.desktop deleted file mode 100644 index 3d589f3..0000000 --- a/lxqt-config-brightness/translations/lxqt-config-brightness_it.desktop +++ /dev/null @@ -1,2 +0,0 @@ -Name[it]=Luminosità -Comment[it]=Permette di cambiare la luminosità e il contrasto dello schermo diff --git a/lxqt-config-brightness/translations/lxqt-config-brightness_lt.desktop b/lxqt-config-brightness/translations/lxqt-config-brightness_lt.desktop deleted file mode 100644 index 17fe957..0000000 --- a/lxqt-config-brightness/translations/lxqt-config-brightness_lt.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[lt]=Konfigūruoti ryškumą -GenericName[lt]=Ryškumo nustatymai -Name[lt]=Ryškumas diff --git a/lxqt-config-brightness/translations/lxqt-config-brightness_pl.desktop b/lxqt-config-brightness/translations/lxqt-config-brightness_pl.desktop deleted file mode 100644 index b8420d2..0000000 --- a/lxqt-config-brightness/translations/lxqt-config-brightness_pl.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[pl]=Ustawienia jasności -GenericName[pl]=Ustawienia jasności wyświetlacza -Comment[pl]=Dostosuj jasność i kontrast wyświetlacza diff --git a/lxqt-config-brightness/translations/lxqt-config-brightness_ru.desktop b/lxqt-config-brightness/translations/lxqt-config-brightness_ru.desktop deleted file mode 100644 index 1e22633..0000000 --- a/lxqt-config-brightness/translations/lxqt-config-brightness_ru.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ru]=Позволяет менять яркость и контраст монитора -GenericName[ru]=Настройка яркости и контраста LXQt -Name[ru]=Настройка яркости и контраста LXQt diff --git a/lxqt-config-brightness/xrandrbrightness.cpp b/lxqt-config-brightness/xrandrbrightness.cpp deleted file mode 100644 index 20d1310..0000000 --- a/lxqt-config-brightness/xrandrbrightness.cpp +++ /dev/null @@ -1,411 +0,0 @@ -/* This file is part of the KDE project - * Copyright (C) 2010 Lukas Tinkl - * Copyright (C) 2015 Kai Uwe Broulik - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - - -#include -#include - -#include "xrandrbrightness.h" - -XRandrBrightness::XRandrBrightness() -{ - if (!QX11Info::isPlatformX11()) { - return; - } - ScopedCPointer versionReply(xcb_randr_query_version_reply(QX11Info::connection(), - xcb_randr_query_version(QX11Info::connection(), 1, 2), - nullptr)); - - if (!versionReply) { - qDebug() << "RandR Query version returned null"; - return; - } - - if (versionReply->major_version < 1 || (versionReply->major_version == 1 && versionReply->minor_version < 2)) { - qDebug() << "RandR version" << versionReply->major_version << "." << versionReply->minor_version << " too old"; - return; - } - ScopedCPointer backlightReply(xcb_intern_atom_reply(QX11Info::connection(), - xcb_intern_atom (QX11Info::connection(), 1, strlen("Backlight"), "Backlight"), - nullptr)); - - if (!backlightReply) { - qDebug() << "Intern Atom for Backlight returned null"; - return; - } - - m_backlight = backlightReply->atom; - - if (m_backlight == XCB_NONE) { - qDebug() << "No outputs have backlight property"; - //return; - } - xcb_screen_iterator_t iter = xcb_setup_roots_iterator(xcb_get_setup(QX11Info::connection())); - if (!iter.rem) { - qDebug() << "XCB Screen Roots Iterator rem was null"; - return; - } - - xcb_screen_t *screen = iter.data; - xcb_window_t root = screen->root; - - m_resources.reset(xcb_randr_get_screen_resources_current_reply(QX11Info::connection(), - xcb_randr_get_screen_resources_current(QX11Info::connection(), root) - , nullptr)); - - if (!m_resources) { - qDebug() << "RANDR Get Screen Resources returned null"; - return; - } -} - - - -bool XRandrBrightness::backlight_get_with_range(xcb_randr_output_t output, long &value, long &min, long &max) const { - long cur = backlight_get(output); - if (cur == -1) { - return false; - } - - ScopedCPointer propertyReply(xcb_randr_query_output_property_reply(QX11Info::connection(), - xcb_randr_query_output_property(QX11Info::connection(), output, m_backlight) - , nullptr)); - - if (!propertyReply) { - return -1; - } - - if (propertyReply->range && xcb_randr_query_output_property_valid_values_length(propertyReply.data()) == 2) { - int32_t *values = xcb_randr_query_output_property_valid_values(propertyReply.data()); - value = cur; - min = values[0]; - max = values[1]; - return true; - } - - return false; -} - -long XRandrBrightness::backlight_get(xcb_randr_output_t output) const -{ - ScopedCPointer propertyReply; - long value; - - if (m_backlight != XCB_ATOM_NONE) { - propertyReply.reset(xcb_randr_get_output_property_reply(QX11Info::connection(), - xcb_randr_get_output_property(QX11Info::connection(), output, m_backlight, XCB_ATOM_NONE, 0, 4, 0, 0) - , nullptr)); - - if (!propertyReply) { - return -1; - } - } - - if (!propertyReply || propertyReply->type != XCB_ATOM_INTEGER || propertyReply->num_items != 1 || propertyReply->format != 32) { - value = -1; - } else { - value = *(reinterpret_cast(xcb_randr_get_output_property_data(propertyReply.data()))); - } - return value; -} - -void XRandrBrightness::backlight_set(xcb_randr_output_t output, long value) -{ - xcb_randr_change_output_property(QX11Info::connection(), output, m_backlight, XCB_ATOM_INTEGER, - 32, XCB_PROP_MODE_REPLACE, - 1, reinterpret_cast(&value)); -} - - -float XRandrBrightness::gamma_brightness_get(xcb_randr_output_t output) -{ - xcb_generic_error_t *error; - - xcb_randr_get_output_info_cookie_t output_info_cookie = xcb_randr_get_output_info (QX11Info::connection(), output, 0); - xcb_randr_get_output_info_reply_t * output_info = xcb_randr_get_output_info_reply (QX11Info::connection(), output_info_cookie, &error); - if(error != NULL) - { - qDebug() << "Error getting output_info"; - return -1; - } - if(output_info == NULL) - { - qDebug() << "Error: output_info is null"; - return -1; - } - // xcb_randr_get_output_info_reply_t tiene como elemento crtc - xcb_randr_get_crtc_gamma_cookie_t gamma_cookie = xcb_randr_get_crtc_gamma_unchecked (QX11Info::connection(), output_info->crtc); - xcb_randr_get_crtc_gamma_reply_t *gamma_reply = xcb_randr_get_crtc_gamma_reply (QX11Info::connection(), gamma_cookie, &error); - if(error != NULL) - { - qDebug() << "Error getting gamma_reply"; - return -1; - } - if(gamma_reply == NULL) - { - qDebug() << "Error: gamma_reply is null"; - return -1; - } - uint16_t *red = xcb_randr_get_crtc_gamma_red (gamma_reply); - if(red == NULL) - { - qDebug() << "Error: red is null"; - return -1; - } - int red_length = xcb_randr_get_crtc_gamma_red_length(gamma_reply); - - // uint16_t *green = xcb_randr_get_crtc_gamma_green (gamma_reply); - // if(green == NULL) - // { - // qDebug() << "Error: green is null"; - // return -1; - // } - // uint16_t *blue = xcb_randr_get_crtc_gamma_blue (gamma_reply); - // if(blue == NULL) - // { - // qDebug() << "Error: blue is null"; - // return -1; - // } - - float brightness = (float)red[red_length-1]/65535.0; - return brightness; -} - -void XRandrBrightness::gamma_brightness_set(xcb_randr_output_t output, float percent) -{ - xcb_generic_error_t *error; - - xcb_randr_get_output_info_cookie_t output_info_cookie = xcb_randr_get_output_info (QX11Info::connection(), output, 0); - xcb_randr_get_output_info_reply_t * output_info = xcb_randr_get_output_info_reply (QX11Info::connection(), output_info_cookie, &error); - if(error != NULL) - { - qDebug() << "Error getting output_info"; - return; - } - if(output_info == NULL) - { - qDebug() << "Error: output_info is null"; - return; - } - // xcb_randr_get_output_info_reply_t tiene como elemento crtc - xcb_randr_get_crtc_gamma_cookie_t gamma_cookie = xcb_randr_get_crtc_gamma_unchecked (QX11Info::connection(), output_info->crtc); - xcb_randr_get_crtc_gamma_reply_t *gamma_reply = xcb_randr_get_crtc_gamma_reply (QX11Info::connection(), gamma_cookie, &error); - if(error != NULL) - { - qDebug() << "Error getting gamma_reply"; - return; - } - if(gamma_reply == NULL) - { - qDebug() << "Error: gamma_reply is null"; - return; - } - uint16_t *red = xcb_randr_get_crtc_gamma_red (gamma_reply); - if(red == NULL) - { - qDebug() << "Error: red is null"; - return; - } - int red_length = xcb_randr_get_crtc_gamma_red_length(gamma_reply); - uint16_t *green = xcb_randr_get_crtc_gamma_green (gamma_reply); - if(green == NULL) - { - qDebug() << "Error: green is null"; - return; - } - uint16_t *blue = xcb_randr_get_crtc_gamma_blue (gamma_reply); - if(blue == NULL) - { - qDebug() << "Error: blue is null"; - return; - } - - float max_gamma = 65535*percent; - for(int i=0;icrtc, red_length, red, green, blue); -} - - -QList XRandrBrightness::getMonitorsInfo() -{ - QList monitors; - - if (!m_resources) { - return monitors; - } - - auto *outputs = xcb_randr_get_screen_resources_current_outputs(m_resources.data()); - for (int i = 0; i < m_resources->num_outputs; ++i) { - xcb_randr_output_t output = outputs[i]; - - xcb_generic_error_t *error; - - xcb_randr_get_output_info_cookie_t output_info_cookie = xcb_randr_get_output_info (QX11Info::connection(), output, 0); - xcb_randr_get_output_info_reply_t * output_info = xcb_randr_get_output_info_reply (QX11Info::connection(), output_info_cookie, &error); - if(error != NULL) - { - qDebug() << "Error getting output_info"; - continue; - } - if(output_info == NULL) - { - qDebug() << "Error: output_info is null"; - continue; - } - - QString name = QString::fromUtf8((const char *) xcb_randr_get_output_info_name(output_info), output_info->name_len); - - - qDebug() << "Found output:" << name; - - - // Is connected? - if ( (xcb_randr_connection_t)(output_info->connection) != XCB_RANDR_CONNECTION_CONNECTED ) - { - qDebug() << "Output is not connected"; - continue; // This output is not connected. Check other - } - - // Is enabled? - if( output_info->crtc == 0) - { - qDebug() << "Crtc is not null. Output not enabled."; - continue; - } - xcb_randr_get_crtc_info_cookie_t crtc_info_cookie = xcb_randr_get_crtc_info_unchecked (QX11Info::connection(), output_info->crtc, 0); - xcb_randr_get_crtc_info_reply_t *crtc_info =xcb_randr_get_crtc_info_reply (QX11Info::connection(), crtc_info_cookie, &error); - if(error != NULL) - { - qDebug() << "Error getting output_info"; - continue; - } - if(crtc_info == NULL) - { - qDebug() << "Error: output_info is null"; - continue; - } - if( crtc_info->mode == XCB_NONE ) - { - qDebug() << "No modes. Output not enabled."; - continue; - } - - // Output is connected and enabled. Get data: - bool backlightIsSuported = false; - long cur, min, max, backlight_max = -1; - if (backlight_get(output) != -1) - { - if (backlight_get_with_range(output, cur, min, max)) - { - backlightIsSuported = true; - backlight_max = max - min; - } - } - - MonitorInfo monitor((int)output, name, backlight_max); - - if(backlightIsSuported) - monitor.setBacklight(cur-min); - - monitor.setBrightness(gamma_brightness_get(output)); - - qDebug() << "Output:" << name << "added"; - monitors.append(monitor); - - } - - return monitors; -} - -void XRandrBrightness::setMonitorsSettings(QList monitors) -{ - if (!m_resources) { - return; - } - - auto *outputs = xcb_randr_get_screen_resources_current_outputs(m_resources.data()); - for (int i = 0; i < m_resources->num_outputs; ++i) { - xcb_randr_output_t output = outputs[i]; - - xcb_generic_error_t *error; - - xcb_randr_get_output_info_cookie_t output_info_cookie = xcb_randr_get_output_info (QX11Info::connection(), output, 0); - xcb_randr_get_output_info_reply_t * output_info = xcb_randr_get_output_info_reply (QX11Info::connection(), output_info_cookie, &error); - if(error != NULL) - { - qDebug() << "Error getting output_info"; - continue; - } - if(output_info == NULL) - { - qDebug() << "Error: output_info is null"; - continue; - } - - // Is connected? - if ( (xcb_randr_connection_t)(output_info->connection) != XCB_RANDR_CONNECTION_CONNECTED ) - continue; // This output is not connected. Check other - - // Is enabled? - if( output_info->crtc == 0) - continue; - xcb_randr_get_crtc_info_cookie_t crtc_info_cookie = xcb_randr_get_crtc_info_unchecked (QX11Info::connection(), output_info->crtc, 0); - xcb_randr_get_crtc_info_reply_t *crtc_info =xcb_randr_get_crtc_info_reply (QX11Info::connection(), crtc_info_cookie, &error); - if(error != NULL) - continue; - if(crtc_info == NULL && crtc_info->mode == XCB_NONE ) - continue; - - QString name = QString::fromUtf8((const char *) xcb_randr_get_output_info_name(output_info), output_info->name_len); - - // Output is connected and enabled. Get data: - bool backlightIsSuported = false; - long cur, min, max, backlight_max = -1, backlight_value = 0; - if (backlight_get(output) != -1) - { - if (backlight_get_with_range(output, cur, min, max)) - { - backlightIsSuported = true; - backlight_max = max - min; - backlight_value = cur - min; - } - } - float brightness_value = gamma_brightness_get(output); - - // Compare output info with settings and set it. - for(const MonitorInfo &monitor: monitors) - { - if(monitor.id() == (int)output && monitor.name() == name) - { - // Set settings - if(backlightIsSuported && monitor.backlight() != backlight_value) - backlight_set(output, min+monitor.backlight()); - if(monitor.brightness() != brightness_value) - gamma_brightness_set(output, monitor.brightness()); - break; - } - } - } -} - diff --git a/lxqt-config-brightness/xrandrbrightness.h b/lxqt-config-brightness/xrandrbrightness.h deleted file mode 100644 index d3a7917..0000000 --- a/lxqt-config-brightness/xrandrbrightness.h +++ /dev/null @@ -1,56 +0,0 @@ -/* This file is part of the KDE project - * Copyright (C) 2010 Lukas Tinkl - * Copyright (C) 2015 Kai Uwe Broulik - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef XRANDRBRIGHTNESS_H -#define XRANDRBRIGHTNESS_H - -#include -#include - -#include -#include - -#include "monitorinfo.h" - -template using ScopedCPointer = QScopedPointer; - -class XRandrBrightness -{ -public: - XRandrBrightness(); - ~XRandrBrightness() = default; - - QList getMonitorsInfo(); - void setMonitorsSettings(QList monitors); - -private: - bool backlight_get_with_range(xcb_randr_output_t output, long &value, long &min, long &max) const; - long backlight_get(xcb_randr_output_t output) const; - void backlight_set(xcb_randr_output_t output, long value); - float gamma_brightness_get(xcb_randr_output_t output); - void gamma_brightness_set(xcb_randr_output_t output, float percent); - - xcb_atom_t m_backlight = XCB_ATOM_NONE; - ScopedCPointer m_resources; - -}; - -#endif // XRANDRBRIGHTNESS_H - diff --git a/lxqt-config-file-associations/CMakeLists.txt b/lxqt-config-file-associations/CMakeLists.txt deleted file mode 100644 index ca27020..0000000 --- a/lxqt-config-file-associations/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -project(lxqt-config-file-associations) - -set(H_FILES - mimetypedata.h - mimetypeviewer.h - applicationchooser.h -) - -set(MOC_FILES - mimetypedata.h - mimetypeviewer.h - applicationchooser.h -) - -set(CPP_FILES - mimetypedata.cpp - mimetypeviewer.cpp - applicationchooser.cpp - main.cpp -) - -set(UI_FILES - mimetypeviewer.ui - applicationchooser.ui -) - -set(QRC_FILES "") - -set(LIBRARIES - lxqt -) - -# Translations ********************************** -lxqt_translate_ts(QM_FILES - UPDATE_TRANSLATIONS - ${UPDATE_TRANSLATIONS} - SOURCES - ${H_FILES} - ${CPP_FILES} - ${UI_FILES} - INSTALL_DIR - "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}" - PULL_TRANSLATIONS - ${PULL_TRANSLATIONS} - CLEAN_TRANSLATIONS - ${CLEAN_TRANSLATIONS} - TRANSLATIONS_REPO - ${TRANSLATIONS_REPO} - TRANSLATIONS_REFSPEC - ${TRANSLATIONS_REFSPEC} - REPO_SUBDIR - "lxqt-config/${PROJECT_NAME}" -) - -lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME}) -lxqt_translate_desktop(DESKTOP_FILES SOURCES ${PROJECT_NAME}.desktop.in) - -#************************************************ - -add_executable(${PROJECT_NAME} - ${CPP_FILES} - ${RESOURCES} - ${QRC_FILES} - ${QM_FILES} - ${QM_LOADER} - ${DESKTOP_FILES} -) - -target_link_libraries(${PROJECT_NAME} - KF5::WindowSystem - Qt5::Xml - Qt5::DBus - Qt5::Widgets - Qt5::Concurrent - ${LIBRARIES} -) - -install(TARGETS - ${PROJECT_NAME} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - COMPONENT Runtime -) -install(FILES - ${DESKTOP_FILES} - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" - COMPONENT Runtime -) diff --git a/lxqt-config-file-associations/applicationchooser.cpp b/lxqt-config-file-associations/applicationchooser.cpp deleted file mode 100644 index 71fd612..0000000 --- a/lxqt-config-file-associations/applicationchooser.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2013 Christian Surlykke - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "applicationchooser.h" - -Q_DECLARE_METATYPE(XdgDesktopFile*) - -ApplicationChooser::ApplicationChooser(const XdgMimeType& mimeInfo, bool showUseAlwaysCheckBox) -{ - m_MimeInfo = mimeInfo; - m_CurrentDefaultApplication = XdgDesktopFileCache::getDefaultApp(m_MimeInfo.name()); - widget.setupUi(this); - - widget.mimetypeIconLabel->setPixmap(m_MimeInfo.icon().pixmap(widget.mimetypeIconLabel->size())); - widget.mimetypeLabel->setText(m_MimeInfo.comment()); - widget.alwaysUseCheckBox->setVisible(showUseAlwaysCheckBox); - widget.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); -} - -ApplicationChooser::~ApplicationChooser() -{ -} - -int ApplicationChooser::exec() -{ - show(); - fillApplicationListWidget(); - - return QDialog::exec(); -} - - - -bool lessThan(XdgDesktopFile* a, XdgDesktopFile* b) -{ - return a && b && a->name().toLower() < b->name().toLower(); -} - -void ApplicationChooser::updateAllIcons() { - // loading all icons is very time-consuming... - QCoreApplication::processEvents(); - QTreeWidget* tree = widget.applicationTreeWidget; - int updated = 0; - int top_n = tree->topLevelItemCount(); - for(int top_i = 0; top_i < top_n; ++top_i) { - QTreeWidgetItem* parent = tree->topLevelItem(top_i); - int n = parent->childCount(); - for(int i = 0; i < n; ++i) { - QTreeWidgetItem* item = parent->child(i); - XdgDesktopFile* desktopFile = item->data(0, 32).value(); - if(Q_LIKELY(desktopFile != NULL && !desktopFile->icon().isNull())) { - item->setIcon(0, desktopFile->icon()); - ++updated; - if(updated % 8 == 0) // update the UI in batch is more efficient - QCoreApplication::processEvents(); - } - } - } - QCoreApplication::processEvents(); - QApplication::restoreOverrideCursor(); -} - -void ApplicationChooser::fillApplicationListWidget() -{ - widget.applicationTreeWidget->clear(); - - QSet addedApps; - QList applicationsThatHandleThisMimetype = XdgDesktopFileCache::getApps(m_MimeInfo.name()); - QList otherApplications; - - QStringList mimetypes; - mimetypes << m_MimeInfo.name() << m_MimeInfo.allAncestors(); - - // Adding all apps takes some time. Make the user aware by setting the - // cursor to Wait. - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - QMimeDatabase db; - foreach(const QString& mts, mimetypes) { - QMimeType mt = db.mimeTypeForName(mts); - QString heading; - heading = mt.name() == QLatin1String("application/octet-stream") ? - tr("Other applications") : - tr("Applications that handle %1").arg(mt.comment()); - - QList applications; - applications = mt.name() == QLatin1String("application/octet-stream") ? - XdgDesktopFileCache::getAllFiles() : - XdgDesktopFileCache::getApps(mt.name()); - - qSort(applications.begin(), applications.end(), lessThan); - - QTreeWidgetItem* headingItem = new QTreeWidgetItem(widget.applicationTreeWidget); - headingItem->setExpanded(true); - headingItem->setFlags(Qt::ItemIsEnabled); - headingItem->setText(0, heading); - headingItem->setSizeHint(0, QSize(0, 25)); - - addApplicationsToApplicationListWidget(headingItem, applications, addedApps); - } - connect(widget.applicationTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(selectionChanged())); - widget.applicationTreeWidget->setFocus(); - - if (!applicationsThatHandleThisMimetype.isEmpty()) { - widget.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); - } - - // delay icon update for faster loading - QTimer::singleShot(0, this, SLOT(updateAllIcons())); -} - -void ApplicationChooser::addApplicationsToApplicationListWidget(QTreeWidgetItem* parent, - QList applications, - QSet& alreadyAdded) -{ - QIcon placeHolderIcon = QIcon::fromTheme("application-x-executable"); - - if (applications.isEmpty()) - { - QTreeWidgetItem* noAppsFoundItem = new QTreeWidgetItem(parent); - noAppsFoundItem->setText(0, tr("No applications found")); - noAppsFoundItem->setFlags(0); - QFont font = noAppsFoundItem->font(0); - font.setStyle(QFont::StyleItalic); - noAppsFoundItem->setFont(0, font); - } - else - { - // Insert applications in the listwidget, skipping already added applications - foreach (XdgDesktopFile* desktopFile, applications) - { - if (alreadyAdded.contains(desktopFile)) - continue; - - // Only applications - if (desktopFile->type() != XdgDesktopFile::ApplicationType) - continue; - - QTreeWidgetItem *item = new QTreeWidgetItem(parent); - item->setIcon(0, placeHolderIcon); - item->setText(0, desktopFile->name()); - item->setData(0, 32, QVariant::fromValue(desktopFile)); - - if (desktopFile == m_CurrentDefaultApplication) - { - widget.applicationTreeWidget->setCurrentItem(item); - } - - alreadyAdded.insert(desktopFile); - } - } -} - -void ApplicationChooser::selectionChanged() -{ - widget.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); - - QTreeWidgetItem* newItem = widget.applicationTreeWidget->currentItem(); - if (newItem && newItem->data(0, 32).value()) - { - widget.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); - m_CurrentDefaultApplication = newItem->data(0, 32).value(); - } -} diff --git a/lxqt-config-file-associations/applicationchooser.h b/lxqt-config-file-associations/applicationchooser.h deleted file mode 100644 index 3191163..0000000 --- a/lxqt-config-file-associations/applicationchooser.h +++ /dev/null @@ -1,61 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2013 Christian Surlykke - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef _APPLICATIONCHOOSER_H -#define _APPLICATIONCHOOSER_H - -#include "ui_applicationchooser.h" -#include -#include - -class QSettings; - -class ApplicationChooser : public QDialog -{ - Q_OBJECT -public: - ApplicationChooser(const XdgMimeType& mimeInfo, bool showUseAlwaysCheckBox = false); - - virtual ~ApplicationChooser(); - XdgDesktopFile* DefaultApplication() const { return m_CurrentDefaultApplication; } - - virtual int exec(); - -private slots: - void selectionChanged(); - void updateAllIcons(); - -private: - void fillApplicationListWidget(); - - void addApplicationsToApplicationListWidget(QTreeWidgetItem* parent, - QList applications, - QSet & alreadyAdded); - XdgMimeType m_MimeInfo; - Ui::ApplicationChooser widget; - XdgDesktopFile* m_CurrentDefaultApplication; -}; - -#endif /* _APPLICATIONCHOOSER_H */ diff --git a/lxqt-config-file-associations/applicationchooser.ui b/lxqt-config-file-associations/applicationchooser.ui deleted file mode 100644 index 3015234..0000000 --- a/lxqt-config-file-associations/applicationchooser.ui +++ /dev/null @@ -1,207 +0,0 @@ - - - ApplicationChooser - - - - 0 - 0 - 385 - 417 - - - - ApplicationChooser - - - - - - QFrame::NoFrame - - - QFrame::Raised - - - - - - - 0 - 0 - - - - - 0 - 30 - - - - - 12 - - - - Pick an application for: - - - - - - - - 0 - 0 - - - - - 30 - 30 - - - - Icon - - - - - - - Mimetype - - - - - - - - - - - 240 - 200 - - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::SelectRows - - - false - - - false - - - true - - - false - - - - 1 - - - - - Applications that handle JPEG - - - - - - - - - New Subitem - - - - - New Subitem - - - - - - Other applications - - - - New Subitem - - - - - New Subitem - - - - - - - - - - - - - - - - Qt::LeftToRight - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - ApplicationChooser - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - ApplicationChooser - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/lxqt-config-file-associations/lxqt-config-file-associations.desktop.in b/lxqt-config-file-associations/lxqt-config-file-associations.desktop.in deleted file mode 100644 index f686f7a..0000000 --- a/lxqt-config-file-associations/lxqt-config-file-associations.desktop.in +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Type=Application -Name=File Associations -GenericName=File Association Settings -Comment=Configure applications associated with known file types -Exec=lxqt-config-file-associations -Icon=preferences-desktop-filetype-association -Categories=Settings;DesktopSettings;Qt;LXQt; -OnlyShowIn=LXQt; - -#TRANSLATIONS_DIR=translations diff --git a/lxqt-config-file-associations/main.cpp b/lxqt-config-file-associations/main.cpp deleted file mode 100644 index a2b04bb..0000000 --- a/lxqt-config-file-associations/main.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2013 Christian Surlykke - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "mimetypeviewer.h" -#include - -int main (int argc, char **argv) -{ - LXQt::SingleApplication app(argc, argv); - app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); - - QCommandLineParser parser; - parser.setApplicationDescription(QStringLiteral("LXQt Config File Associations")); - const QString VERINFO = QStringLiteral(LXQT_CONFIG_VERSION - "\nliblxqt " LXQT_VERSION - "\nQt " QT_VERSION_STR); - app.setApplicationVersion(VERINFO); - parser.addVersionOption(); - parser.addHelpOption(); - parser.process(app); - - MimetypeViewer mimetypeViewer; - app.setActivationWindow(&mimetypeViewer); - mimetypeViewer.setWindowIcon(QIcon::fromTheme("preferences-desktop-filetype-association")); - mimetypeViewer.show(); - - return app.exec(); - qDebug() << "Efter exec"; -} - diff --git a/lxqt-config-file-associations/mimetypedata.cpp b/lxqt-config-file-associations/mimetypedata.cpp deleted file mode 100644 index 8967796..0000000 --- a/lxqt-config-file-associations/mimetypedata.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://lxqt.org - * - * Copyright: 2014 LXQt team - * Authors: - * Luís Pereira - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - - -#include "mimetypedata.h" - -MimeTypeData::MimeTypeData() -{ -} - - -MimeTypeData::MimeTypeData(const XdgMimeType& mime) -{ - mName = mime.name(); - mPatterns = mime.globPatterns().join(" "); - mComment = mime.comment(); -} - - -bool MimeTypeData::matches(const QString &filter) const -{ - if (mName.contains(filter) || mPatterns.contains(filter) || - mComment.contains(filter)) { - return true; - } else { - return false; - } -} diff --git a/lxqt-config-file-associations/mimetypedata.h b/lxqt-config-file-associations/mimetypedata.h deleted file mode 100644 index 47f33bc..0000000 --- a/lxqt-config-file-associations/mimetypedata.h +++ /dev/null @@ -1,54 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://lxqt.org - * - * Copyright: 2014 LXQt team - * Authors: - * Luís Pereira - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - - -#ifndef MIMETYPEDATA_H -#define MIMETYPEDATA_H - -#include -#include - - -class MimeTypeData { -public: - MimeTypeData(); - MimeTypeData(const XdgMimeType& mime); - - QString inline name() const { return mName; }; - QString inline patterns() const { return mPatterns; }; - QString inline comment() const { return mComment; }; - - bool matches(const QString& filter) const; - -private: - QString mName; - QString mPatterns; - QString mComment; -}; - -Q_DECLARE_METATYPE(MimeTypeData) -#endif // MIMETYPEDATA_H diff --git a/lxqt-config-file-associations/mimetypeitemmodel.cpp b/lxqt-config-file-associations/mimetypeitemmodel.cpp deleted file mode 100644 index 0e1fd44..0000000 --- a/lxqt-config-file-associations/mimetypeitemmodel.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/* -* Copyright (c) Christian Surlykke -* -* This file is part of the LXQt project. -* It is distributed under the LGPL 2.1 or later license. -* Please refer to the LICENSE file for a copy of the license, and -* the AUTHORS file for copyright and authorship information. -*/ - -#include -#include - -#include "mimetypeitemmodel.h" -#include - -/* - * Implementation note: - * - * MimetypeItemModel is an implementation of QAbstractItemModel with XdgMimeInfoCache as backing store. - * - * There are 2 levels of items in this model: mediatype ('application', 'audio', 'image' etc.) and - * subtype ('application/pdf' which is a child of 'application' or 'image/jpeg' which is a child of 'image'. - * - * A QModelIndex for a mediatype has a zero internal pointer. - * - * A QModelIndex for a subtype has an internal pointer to the XdgMimeInfo for that subtype - so the QModelIndex for - * 'image/jpeg' has an internal pointer that points to the XdgMineInfo for 'image/jpeg' which is held in XdgMimeInfoCache. - * - * QModelIndexes for mediatypes have no parents, and QModelIndexes for subtypes have no children. - */ - - -MimetypeItemModel::MimetypeItemModel(QObject *parent) : -QAbstractItemModel(parent) -{ -} - -MimetypeItemModel::~MimetypeItemModel() -{ -} - -QVariant MimetypeItemModel::data(const QModelIndex& index, int role) const -{ - if (!index.isValid()) - { - return QVariant(); - } - - XdgMimeInfo *mimeInfo = 0; - QString text; - - if (index.parent().isValid()) - { - mimeInfo = static_cast(index.internalPointer()); - text = mimeInfo->subType(); - } - else - { - text = XdgMimeInfoCache::mediatypes().value(index.row()); - } - - switch (role) - { - case Qt::DisplayRole : return QVariant(text); - case MimeInfoRole : return QVariant::fromValue(mimeInfo); - default : return QVariant(); - } -} - -QModelIndex MimetypeItemModel::index(int row, int column, const QModelIndex& parent) const -{ - if (column != 0) - { - return QModelIndex(); - } - - if (parent.isValid()) - { - if (parent.row() >= XdgMimeInfoCache::mediatypes().size()) - { - return QModelIndex(); - } - - QString mediatype = XdgMimeInfoCache::mediatypes().value(parent.row()); - - if (row >= XdgMimeInfoCache::subtypes(mediatype).size()) - { - return QModelIndex(); - } - - QString subtype = XdgMimeInfoCache::subtypes(mediatype).value(row); - - XdgMimeInfo* mimeInfo = XdgMimeInfoCache::xdgMimeInfo(mediatype, subtype); - return createIndex(row, 0, mimeInfo); - } - else - { - if (row >= XdgMimeInfoCache::mediatypes().size()) - { - return QModelIndex(); - } - - return createIndex(row, 0); - } -} - -QModelIndex MimetypeItemModel::parent(const QModelIndex& index) const -{ - if (index.isValid() && index.internalPointer()) - { - XdgMimeInfo* mimeInfo = static_cast(index.internalPointer()); - - int row = XdgMimeInfoCache::mediatypes().indexOf(mimeInfo->mediaType()); - return createIndex(row, 0); - } - else - { - return QModelIndex(); - } -} - - -int MimetypeItemModel::rowCount(const QModelIndex& parent) const -{ - if (parent.column() > 0) - { - return 0; - } - - if (parent.parent().isValid()) - { - return 0; - } - else if (parent.isValid()) - { - QString media = XdgMimeInfoCache::mediatypes().value(parent.row()); - return XdgMimeInfoCache::subtypes(media).size(); - } - else - { - return XdgMimeInfoCache::mediatypes().size(); - } -} - - -MimetypeFilterItemModel::MimetypeFilterItemModel(QObject* parent) : - QSortFilterProxyModel(parent) -{ -} - -bool MimetypeFilterItemModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const -{ - QModelIndex index = sourceModel()->index(source_row, 0, source_parent); - - if (source_parent.isValid()) - { - return filterHelper(index); - } - else - { - for (int i = 0; i < sourceModel()->rowCount(index); i++) - { - if (filterAcceptsRow(i, index)) - { - return true; - } - } - } - - return false; -} - -bool MimetypeFilterItemModel::filterHelper(QModelIndex& source_index) const -{ - XdgMimeInfo* mimeInfo = source_index.data(MimeInfoRole).value(); - if (!mimeInfo) - { - return false; - } - - if (mimeInfo->mimeType().contains(filterRegExp())) - { - return true; - } - - if (mimeInfo->comment().contains(filterRegExp())) - { - return true; - } - - foreach (const QString &pattern, mimeInfo->patterns()) - { - if (pattern.contains(filterRegExp())) - { - return true; - } - } - - return false; -} diff --git a/lxqt-config-file-associations/mimetypeitemmodel.h b/lxqt-config-file-associations/mimetypeitemmodel.h deleted file mode 100644 index 5155aa7..0000000 --- a/lxqt-config-file-associations/mimetypeitemmodel.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -* Copyright (c) Christian Surlykke -* -* This file is part of the LXQt project. -* It is distributed under the LGPL 2.1 or later license. -* Please refer to the LICENSE file for a copy of the license, and -* the AUTHORS file for copyright and authorship information. -*/ - -#ifndef MIMETYPEITEMMODEL_H -#define MIMETYPEITEMMODEL_H - -#include -#include - -#include - -// Used for MimetypeItemModel::data to return a QVariant wrapping an XdgMimeInfo* -#define MimeInfoRole 32 - -Q_DECLARE_METATYPE(XdgMimeInfo*) - -/*! - * - */ -class MimetypeItemModel : public QAbstractItemModel -{ -public: - MimetypeItemModel(QObject *parent = 0); - virtual ~MimetypeItemModel(); - - QVariant data(const QModelIndex &index, int role) const; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &index) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const {return 1;} -}; - -class MimetypeFilterItemModel : public QSortFilterProxyModel -{ -public: - MimetypeFilterItemModel(QObject *parent = 0); - - bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; - - bool filterHelper(QModelIndex& source_index) const; -}; - - -#endif /* MIMETYPEITEMMODEL_H */ - diff --git a/lxqt-config-file-associations/mimetypeviewer.cpp b/lxqt-config-file-associations/mimetypeviewer.cpp deleted file mode 100644 index 6277517..0000000 --- a/lxqt-config-file-associations/mimetypeviewer.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2013 Christian Surlykke - * 2014 Luís Pereira - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -#include "mimetypeviewer.h" -#include "ui_mimetypeviewer.h" - -#include "applicationchooser.h" - - -enum ItemTypeEntries { - GroupType = 1001, - EntrieType = 1002 -}; - -static bool mimeTypeLessThan(const QMimeType& m1, const QMimeType& m2) -{ - return m1.name() < m2.name(); -} - -void MimetypeViewer::loadAllMimeTypes() -{ - mediaTypes.clear(); - mGroupItems.clear(); - mItemList.clear(); - QStringList selectedMimeTypes; - - QMimeDatabase db; - QList mimetypes = db.allMimeTypes(); - - qSort(mimetypes.begin(), mimetypes.end(), mimeTypeLessThan); - foreach (const QMimeType &mt, mimetypes) { - const QString mimetype = mt.name(); - const int i = mimetype.indexOf(QLatin1Char('/')); - const QString mediaType = mimetype.left(i); - const QString subType = mimetype.mid(i + 1); - - MimeTypeData* data = new MimeTypeData(mt); - - if (!mediaTypes.contains(mediaType)) { // A new type of media - mediaTypes.append(mediaType); - QTreeWidgetItem *item = new QTreeWidgetItem(widget.mimetypeTreeWidget, GroupType); - item->setText(0, mediaType); - widget.mimetypeTreeWidget->insertTopLevelItem(0, item); - mGroupItems.insert(mediaType, item); - } - QTreeWidgetItem *item = new QTreeWidgetItem(mGroupItems.value(mediaType), EntrieType); - QVariant v; - v.setValue(*data); - item->setData(0, Qt::UserRole, v); - item->setText(0, subType); - mItemList.append(item); - } - - widget.mimetypeTreeWidget->resizeColumnToContents(1); - widget.mimetypeTreeWidget->show(); -} - - -MimetypeViewer::MimetypeViewer(QWidget *parent) - : QDialog(parent) -{ - widget.setupUi(this); - addSearchIcon(); - widget.searchTermLineEdit->setEnabled(false); - - connect(widget.searchTermLineEdit, SIGNAL(textChanged(const QString&)), - this, SLOT(filter(const QString&))); - - connect(widget.chooseApplicationsButton, SIGNAL(clicked()), this, SLOT(chooseApplication())); - connect(widget.dialogButtonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonBoxClicked(QAbstractButton*))); - - QString mimeappsListPath(XdgDirs::configHome(true) + "/mimeapps.list"); - mDefaultsList = new QSettings(mimeappsListPath, XdgDesktopFileCache::desktopFileSettingsFormat(), this); - mSettingsCache = new LXQt::SettingsCache(mDefaultsList); - mSettingsCache->loadFromSettings(); - initializeMimetypeTreeView(); - loadAllMimeTypes(); - widget.searchTermLineEdit->setFocus(); - - connect(widget.mimetypeTreeWidget, SIGNAL(itemSelectionChanged()), - this, SLOT(currentMimetypeChanged())); -} - -MimetypeViewer::~MimetypeViewer() -{ -} - -void MimetypeViewer::addSearchIcon() -{ - QIcon searchIcon = QIcon::fromTheme("system-search"); - if (searchIcon.isNull()) - return; - - widget.searchTermLineEdit->setTextMargins(0, 0, 30, 0); - QHBoxLayout *hBoxLayout = new QHBoxLayout(widget.searchTermLineEdit); - hBoxLayout->setContentsMargins(0,0,0,0); - widget.searchTermLineEdit->setLayout(hBoxLayout); - QLabel *searchIconLabel = new QLabel(widget.searchTermLineEdit); - searchIconLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); - searchIconLabel->setMinimumHeight(30); - searchIconLabel->setMinimumWidth(30); - - searchIconLabel->setPixmap(searchIcon.pixmap(QSize(20,20))); - hBoxLayout->addWidget(searchIconLabel, 0, Qt::AlignRight | Qt::AlignVCenter); -} - - -void MimetypeViewer::initializeMimetypeTreeView() -{ - currentMimetypeChanged(); - widget.mimetypeTreeWidget->setColumnCount(2); - widget.searchTermLineEdit->setEnabled(true); -} - -void MimetypeViewer::currentMimetypeChanged() -{ - widget.iconLabel->hide(); - widget.descriptionLabel->setText(tr("None")); - widget.mimetypeGroupBox->setEnabled(false); - - widget.patternsLabel->clear(); - widget.patternsGroupBox->setEnabled(false); - - widget.appIcon->hide(); - widget.applicationLabel->clear(); - widget.applicationsGroupBox->setEnabled(false); - - QTreeWidgetItem *sel = widget.mimetypeTreeWidget->currentItem(); - - if (!sel || sel->type() == GroupType) { - return; - } - - MimeTypeData mimeData = sel->data(0, Qt::UserRole).value(); - - QMimeDatabase db; - XdgMimeType mt = db.mimeTypeForName(mimeData.name()); - if (mt.name().isEmpty()) - return; - - m_CurrentMime = mt; - - widget.descriptionLabel->setText(mimeData.comment()); - - QIcon icon = m_CurrentMime.icon(); - if (! icon.isNull()) - { - widget.iconLabel->setPixmap(icon.pixmap(widget.iconLabel->size())); - widget.iconLabel->show(); - } - - widget.mimetypeGroupBox->setEnabled(true); - widget.patternsLabel->setText(mimeData.patterns()); - widget.patternsGroupBox->setEnabled(true); - - XdgDesktopFile* defaultApp = XdgDesktopFileCache::getDefaultApp(m_CurrentMime.name()); - if (defaultApp && defaultApp->isValid()) - { - QString nonLocalizedName = defaultApp->value("Name").toString(); - QString localizedName = defaultApp->localizedValue("Name", nonLocalizedName).toString(); - QIcon appIcon = defaultApp->icon(); - widget.appIcon->setPixmap(appIcon.pixmap(widget.iconLabel->size())); - widget.appIcon->show(); - widget.applicationLabel->setText(localizedName); - widget.chooseApplicationsButton->setText(tr("&Change...")); - } - else - { - widget.applicationLabel->setText(tr("None")); - widget.chooseApplicationsButton->setText(tr("&Choose...")); - } - - widget.applicationsGroupBox->setEnabled(true); - -} - -void MimetypeViewer::filter(const QString& pattern) -{ - QMimeDatabase db; - MimeTypeData mimeData; - - for (int i = 0; i < widget.mimetypeTreeWidget->topLevelItemCount(); ++i) { - widget.mimetypeTreeWidget->topLevelItem(i)->setHidden(true); - } - - foreach(QTreeWidgetItem* it, mItemList) { - mimeData = it->data(0, Qt::UserRole).value(); - if (pattern.isEmpty() || mimeData.matches(pattern)) { - const int i = mimeData.name().indexOf(QLatin1Char('/')); - const QString mediaType = mimeData.name().left(i); - QTreeWidgetItem* groupItem = mGroupItems.value(mediaType); - Q_ASSERT(groupItem); - if (groupItem) { - groupItem->setHidden(false); - it->setHidden(false); - } - } else { - it->setHidden(true); - } - } -} - - -void MimetypeViewer::chooseApplication() -{ - ApplicationChooser applicationChooser(m_CurrentMime); - if (applicationChooser.exec() == QDialog::Accepted && applicationChooser.DefaultApplication()) - { - QString fileNameNoPath = QFileInfo(applicationChooser.DefaultApplication()->fileName()).fileName(); - mDefaultsList->beginGroup("Default Applications"); - mDefaultsList->setValue(m_CurrentMime.name(), fileNameNoPath); - mDefaultsList->endGroup(); - currentMimetypeChanged(); - } - widget.mimetypeTreeWidget->setFocus(); -} - -void MimetypeViewer::dialogButtonBoxClicked(QAbstractButton* button) -{ - QDialogButtonBox::ButtonRole role = widget.dialogButtonBox->buttonRole(button); - if (role == QDialogButtonBox::ResetRole) - { - mSettingsCache->loadToSettings(); - currentMimetypeChanged(); - } - else - { - close(); - } -} - diff --git a/lxqt-config-file-associations/mimetypeviewer.h b/lxqt-config-file-associations/mimetypeviewer.h deleted file mode 100644 index eb7aab4..0000000 --- a/lxqt-config-file-associations/mimetypeviewer.h +++ /dev/null @@ -1,69 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2013 Christian Surlykke - * 2014 Luís Pereira - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef _MIMETYPEVIEWER_H -#define _MIMETYPEVIEWER_H - -#include -#include - -#include - -#include "mimetypedata.h" -#include "ui_mimetypeviewer.h" - -class QSettings; - -namespace LXQt { -class SettingsCache; -} - -class MimetypeViewer : public QDialog { - Q_OBJECT -public: - MimetypeViewer(QWidget *parent = 0); - virtual ~MimetypeViewer(); - -private slots: - void initializeMimetypeTreeView(); - void currentMimetypeChanged(); - void filter(const QString&); - void chooseApplication(); - void dialogButtonBoxClicked(QAbstractButton *button); - -private: - void addSearchIcon(); - void loadAllMimeTypes(); - XdgMimeType m_CurrentMime; - QSettings* mDefaultsList; - LXQt::SettingsCache *mSettingsCache; - Ui::mimetypeviewer widget; - QStringList mediaTypes; - QList mItemList; - QMap mGroupItems; -}; - -#endif /* _MIMETYPEVIEWER_H */ diff --git a/lxqt-config-file-associations/mimetypeviewer.ui b/lxqt-config-file-associations/mimetypeviewer.ui deleted file mode 100644 index 2d1daa0..0000000 --- a/lxqt-config-file-associations/mimetypeviewer.ui +++ /dev/null @@ -1,275 +0,0 @@ - - - mimetypeviewer - - - - 0 - 0 - 565 - 370 - - - - - 530 - 370 - - - - File Associations - - - - - - true - - - - 0 - 0 - - - - - 280 - 260 - - - - QFrame::NoFrame - - - QFrame::Plain - - - - - 10 - 170 - 260 - 140 - - - - Default application - - - - - 140 - 90 - 110 - 30 - - - - &Choose... - - - - - - 10 - 20 - 241 - 51 - - - - QFrame::NoFrame - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 50 - 50 - - - - TextLabel - - - - - - - None - - - 10 - - - - - - - - - - 10 - 100 - 260 - 60 - - - - Patterns - - - - - 10 - 20 - 230 - 30 - - - - *.txt *.xml - - - true - - - - - - - 10 - 0 - 260 - 90 - - - - MIME type - - - - - - - 0 - 0 - - - - - 50 - 50 - - - - Icon - - - - - - - Description - - - true - - - - - - - - - - - - 0 - 30 - - - - - - - - - - - QDialogButtonBox::Close|QDialogButtonBox::Reset - - - - - - - - 0 - 0 - - - - - 180 - 275 - - - - QAbstractItemView::NoEditTriggers - - - false - - - true - - - false - - - 0 - - - false - - - 500 - - - - - - - searchTermLineEdit - mimetypeTreeWidget - chooseApplicationsButton - - - - diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_ar.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_ar.desktop deleted file mode 100644 index 538a087..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_ar.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[ar]=ارتباطات الملفّات -GenericName[ar]=إعدادات ارتباطات الملفّات -Comment[ar]=اضبط التّطبيقات المرتبطة بأنواع الملفّات المعروفة diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_ca.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_ca.desktop deleted file mode 100644 index 9920c27..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_ca.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[ca]=Associacions dels fitxers -GenericName[ca]=Ajusts de les associacions dels fitxers -Comment[ca]=Configureu les aplicacions associades amb els tipus de fitxers coneguts diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_da.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_da.desktop deleted file mode 100644 index 41dc557..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_da.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[da]=Filtilknytninger -GenericName[da]=Filtilknytningsindstillinger -Comment[da]=Konfigurér programmer tilknyttet kendte filtyper diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_de.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_de.desktop deleted file mode 100644 index 8c8ae89..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_de.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[de]=Dateizuordnungen -GenericName[de]=Setzen von Dateizuordnungen -Comment[de]=Zuordnen von Dateitypen zu Anwendungsprogrammen diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_el.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_el.desktop deleted file mode 100644 index 4953479..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_el.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[el]=Συσχετίσεις αρχείων -GenericName[el]=Ρυθμίσεις των συσχετίσεων αρχείων -Comment[el]=Διαμόρφωση της συσχέτισης των εφαρμογών με γνωστούς τύπους αρχείων diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_fr.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_fr.desktop deleted file mode 100644 index 3d68e6c..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_fr.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[fr]=Association des fichiers -GenericName[fr]=Paramètres d'association des fichiers -Comment[fr]=Configurer les applications associées avec les types de fichier diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_hu.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_hu.desktop deleted file mode 100644 index 8dfdf40..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_hu.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[hu]=Fájlhozzárendelések -GenericName[hu]=Fájltípusok hozzárendelése -Comment[hu]=Fájltípusok hozzárandelése programokhoz diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_it.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_it.desktop deleted file mode 100644 index 70fac81..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_it.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[it]=Associazioni file -GenericName[it]=Imposta le associazioni file -Comment[it]=Imposta le associazioni file per le applicazioni installate diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_ja.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_ja.desktop deleted file mode 100644 index 8213df7..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_ja.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ja]=既知のファイル種類に対するアプリケーション関連付けの設定 -GenericName[ja]=ファイル関連付けの設定 -Name[ja]=ファイル関連付け diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_lt.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_lt.desktop deleted file mode 100644 index 2d9638f..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_lt.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[lt]=Failų susiejimai -GenericName[lt]=Failų susiejimų nustatymai -Comment[lt]=Konfigūruoti su žinomais failų tipais susietas programas diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_pl_PL.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_pl_PL.desktop deleted file mode 100644 index 1dc89d0..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_pl_PL.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[pl]=Skojarzenia plików -GenericName[pl]=Ustawienia skojarzeń plików -Comment[pl]=Ustawienia domyślnych programów dla danego typu pliku diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_pt.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_pt.desktop deleted file mode 100644 index 49ffd2a..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_pt.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[pt]=Associação de ficheiros -GenericName[pt]=Definições de associação de ficheiros -Comment[pt]=Configurar associação de ficheiros para os tipos de ficheiro conhecidos diff --git a/lxqt-config-file-associations/translations/lxqt-config-file-associations_ru.desktop b/lxqt-config-file-associations/translations/lxqt-config-file-associations_ru.desktop deleted file mode 100644 index 3a1697e..0000000 --- a/lxqt-config-file-associations/translations/lxqt-config-file-associations_ru.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ru]=Настроить приложения, ассоциированные с известными типами файлов -GenericName[ru]=Настройки ассоциации файлов -Name[ru]=Ассоциация файлов \ No newline at end of file diff --git a/lxqt-config-input/CMakeLists.txt b/lxqt-config-input/CMakeLists.txt deleted file mode 100644 index cad1b83..0000000 --- a/lxqt-config-input/CMakeLists.txt +++ /dev/null @@ -1,92 +0,0 @@ -project(lxqt-config-input) -find_package(X11 REQUIRED) - -include_directories( - ${X11_INCLUDE_DIR} - "${CMAKE_CURRENT_SOURCE_DIR}/../liblxqt-config-cursor" -) - -set(lxqt-config-input_HDRS - keyboardconfig.h - mouseconfig.h - mouseconfig.h - keyboardlayoutconfig.h - selectkeyboardlayoutdialog.h -) - -set(lxqt-config-input_SRCS - lxqt-config-input.cpp - keyboardconfig.cpp - mouseconfig.cpp - keyboardlayoutconfig.cpp - selectkeyboardlayoutdialog.cpp -) - -set(lxqt-config-input_UIS - mouseconfig.ui - keyboardconfig.ui - keyboardlayoutconfig.ui - selectkeyboardlayoutdialog.ui -) - -# Translations ********************************** -lxqt_translate_ts(QM_FILES - UPDATE_TRANSLATIONS - ${UPDATE_TRANSLATIONS} - SOURCES - ${lxqt-config-input_HDRS} - ${lxqt-config-input_SRCS} - ${lxqt-config-input_UIS} - INSTALL_DIR - "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}" - PULL_TRANSLATIONS - ${PULL_TRANSLATIONS} - CLEAN_TRANSLATIONS - ${CLEAN_TRANSLATIONS} - TRANSLATIONS_REPO - ${TRANSLATIONS_REPO} - TRANSLATIONS_REFSPEC - ${TRANSLATIONS_REFSPEC} - REPO_SUBDIR - "lxqt-config/${PROJECT_NAME}" -) - -lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME}) -lxqt_translate_desktop(DESKTOP_FILES SOURCES ${PROJECT_NAME}.desktop.in) - -#************************************************ - -add_definitions( - -DPACKAGE_DATA_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/lxqt-config-input" -) - -add_executable(lxqt-config-input - ${lxqt-config-input_SRCS} - ${DESKTOP_FILES} - ${QM_FILES} - ${QM_LOADER} -) - -target_link_libraries(lxqt-config-input - Qt5::Widgets - Qt5::X11Extras - ${X11_LIBRARIES} - lxqt - lxqt-config-cursor -) - -set_target_properties(lxqt-config-input - PROPERTIES - INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}/${LXQT_CONFIG_PROJECT}" -) - -install(TARGETS - lxqt-config-input - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - COMPONENT Runtime -) -install(FILES - ${DESKTOP_FILES} - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" - COMPONENT Runtime -) diff --git a/lxqt-config-input/data/input-keyboard.png b/lxqt-config-input/data/input-keyboard.png deleted file mode 100644 index 80d8774d4079f3da04c9a37d6e20b2a05c0e856a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5998 zcmcIohd&%$7oJ_4Se@{y8#V|l1wjz3vWOD0dP@jVf+!I-I;*bUdksQ@S46Z()U1+Z z1+hv*?=?!4RpXoYkND&WYB$ufageO$z`3gO;Y60eHs$x5F=j zN1~z)2|U3(FS=59%wE*}`IFpD1#SRfU)NGoG4jd#ZTY|x(S!TD)F88Q0jA81hs8j(SdceA zX~ra!{(Ro_&2Kwwo?vvVN)0LwCfG`iep1{!FUgis!j>Tj;n+NY zOXEI1PC!_>JDC+Z|Ai*WV*&O>_BqrJaR(xi@c+I|=nZCusmv$^b>P149EF~7=(V4T zB{9PwT#CPe=llv=@DHP3SYRscJP)`p|5-8av=j6(fv2308((VP2?Tfn@4Yn$+-`%X z4S2a%TX@#PWMX3S*WS6}_&thuga1uM%;}@<`|J@INV@i7`_q7FLK#D&w2aL8K0)b} zkPGMl(g61EPcj`)1`L^+SpD7U?d=^iDEFGt4MQq_n(Qt&l*Fnhi$Mzm{s8qBmm_VI zQ`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AX(4w;63~ZKdYp=dS_T@a-cIMfkwkgx`kw zhMC=@Z82ii^&HY7$UuzIkKp334+CvC&*3HscgwAl0iX*-h`f`-?3n4#?1M>Pz~eQT zTeQ^P4(x%`VmSukM?>bGwu6(mLf zeIvM~F5sL*PxbNMs{HF77iEw=%EYJ&Ey(HTuo??S|ArURbc<(8adyf3S-kJ%C=8ip zpal$RsdAVtJXqU2^0=X_sUl+FJPauAWjb*C3?Z$UTAsBzRvr)ts8P^stOC6-NmEnj zQGac>Ewq=ryZAq_vAzB1PdCk|zf55r)7D{#(!GhtBmOoCtd2(LtLWmG0%wxW<&M)@ zL$}SaaLTJ9a8(#E8wJ4cL;r9FjuJA3gtgfu>JdbI0UU?N#}>fB7tY$fE?-?Jnzh5< zX2Rbln|0n8ZKL{3hptkr@Mb*PIk#yMLI|r~mE??@&$8YG?1d{JEYy6}DEqcn1j?@% z*@HvMPw}8ho3LU-v?5yU?E{zQm6p+)E^bpAb%oWT81Gs*d!N$)0MI!>)30t^i;Tb+ zau@Dex+(kATn%fj>fqo9N;Zaj8P;dGUd?AA#6cK^Q1vnJ)c$@YfF$2!0c!m2r1Ohk zof0T-$^?JPhzc7AP@iXN7(Co{ghKkLgt-sCuixEEX?HYHNL6PBM5$PRrQ}*(b;aG_ zgaV6bW^sb1)^bCL2td%G<34cC?8nXs+=@xqI)gB0ScPi^IX8hLnSi#szFL{8edPZD DKud{G diff --git a/lxqt-config-input/keyboardconfig.cpp b/lxqt-config-input/keyboardconfig.cpp deleted file mode 100644 index 996d24d..0000000 --- a/lxqt-config-input/keyboardconfig.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - Copyright (C) 2013-2014 Hong Jen Yee (PCMan) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - - -#include "keyboardconfig.h" -#include -#include -#include -#include -#include -#include -#include - -// FIXME: how to support XCB or Wayland? -#include -#include -#include - -#ifdef Q_WS_X11 -extern void qt_x11_apply_settings_in_all_apps(); -#endif - -KeyboardConfig::KeyboardConfig(LXQt::Settings* _settings, QSettings* _qtSettings, QWidget* parent): - QWidget(parent), - settings(_settings), - qtSettings(_qtSettings), - delay(500), - oldDelay(500), - interval(30), - oldInterval(30), - beep(true), - oldBeep(true), - numlock(false) { - - ui.setupUi(this); - - /* read the config flie */ - loadSettings(); - initControls(); - - // set_range_stops(ui.keyboardDelay, 10); - connect(ui.keyboardDelay, SIGNAL(valueChanged(int)), SLOT(onKeyboardSliderChanged(int))); - // set_range_stops(ui.keyboardInterval, 10); - connect(ui.keyboardInterval, SIGNAL(valueChanged(int)), SLOT(onKeyboardSliderChanged(int))); - connect(ui.keyboardBeep, SIGNAL(toggled(bool)), SLOT(onKeyboardBeepToggled(bool))); - connect(ui.cursorFlashTime, SIGNAL(valueChanged(int)), SLOT(onCorsorFlashTimeChanged(int))); - connect(ui.keyboardNumLock, SIGNAL(toggled(bool)), SLOT(onKeyboardNumLockToggled(bool))); -} - -KeyboardConfig::~KeyboardConfig() { - -} - -void KeyboardConfig::initControls() { - ui.keyboardDelay->setValue(delay); - ui.keyboardInterval->setValue(interval); - ui.keyboardBeep->setChecked(beep); - ui.keyboardNumLock->setChecked(numlock); - - qtSettings->beginGroup(QLatin1String("Qt")); - int value = qtSettings->value(QLatin1String("cursorFlashTime"), 1000).toInt(); - ui.cursorFlashTime->setValue(value); - qtSettings->endGroup(); -} - -void KeyboardConfig::onKeyboardSliderChanged(int value) { - QSlider* slider = static_cast(sender()); - - if(slider == ui.keyboardDelay) - delay = value; - else if(slider == ui.keyboardInterval) - interval = value; - - /* apply keyboard values */ - XkbSetAutoRepeatRate(QX11Info::display(), XkbUseCoreKbd, delay, interval); - - accept(); -} - -void KeyboardConfig::onKeyboardBeepToggled(bool checked) { - XKeyboardControl values; - beep = checked; - values.bell_percent = beep ? -1 : 0; - XChangeKeyboardControl(QX11Info::display(), KBBellPercent, &values); - - accept(); -} - -void KeyboardConfig::onKeyboardNumLockToggled(bool checked) { - numlock = checked; - accept(); -} - -void KeyboardConfig::onCorsorFlashTimeChanged(int value) -{ - qtSettings->beginGroup(QLatin1String("Qt")); - qtSettings->setValue(QLatin1String("cursorFlashTime"), value); - qtSettings->endGroup(); - qtSettings->sync(); -#ifdef Q_WS_X11 - qt_x11_apply_settings_in_all_apps(); -#endif -} - - -void KeyboardConfig::loadSettings() { - settings->beginGroup("Keyboard"); - oldDelay = delay = settings->value("delay", 500).toInt(); - oldInterval = interval = settings->value("interval", 30).toInt(); - oldBeep = beep = settings->value("beep", true).toBool(); - numlock = settings->value("numlock", false).toBool(); - settings->endGroup(); -} - -void KeyboardConfig::accept() { - settings->beginGroup("Keyboard"); - settings->setValue("delay", delay); - settings->setValue("interval", interval); - settings->setValue("beep", beep); - settings->setValue("numlock", numlock); - settings->endGroup(); -} - -void KeyboardConfig::reset() { - /* restore to original settings */ - /* keyboard */ - delay = oldDelay; - interval = oldInterval; - beep = oldBeep; - XkbSetAutoRepeatRate(QX11Info::display(), XkbUseCoreKbd, delay, interval); - /* FIXME: beep? */ - - initControls(); - accept(); -} diff --git a/lxqt-config-input/keyboardconfig.h b/lxqt-config-input/keyboardconfig.h deleted file mode 100644 index 505edc3..0000000 --- a/lxqt-config-input/keyboardconfig.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright (C) 2013-2014 Hong Jen Yee (PCMan) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - - -#ifndef KEYBOARDCONFIG_H -#define KEYBOARDCONFIG_H - -#include -#include "ui_keyboardconfig.h" - -namespace LXQt { - class Settings; -} -class QSettings; - -class KeyboardConfig : public QWidget { - Q_OBJECT - -public: - KeyboardConfig(LXQt::Settings* _settings, QSettings* _qtSettings, QWidget* parent = 0); - virtual ~KeyboardConfig(); - - void accept(); - -public Q_SLOTS: - void reset(); - -private: - void setLeftHandedMouse(); - void loadSettings(); - void initControls(); - -private Q_SLOTS: - void onKeyboardSliderChanged(int value); - void onKeyboardBeepToggled(bool checked); - void onCorsorFlashTimeChanged(int value); - void onKeyboardNumLockToggled(bool checked); - -private: - Ui::KeyboardConfig ui; - LXQt::Settings* settings; - QSettings* qtSettings; - int delay; - int oldDelay; - int interval; - int oldInterval; - bool beep; - bool oldBeep; - bool numlock; -}; - -#endif // KEYBOARDCONFIG_H diff --git a/lxqt-config-input/keyboardconfig.ui b/lxqt-config-input/keyboardconfig.ui deleted file mode 100644 index 99647f9..0000000 --- a/lxqt-config-input/keyboardconfig.ui +++ /dev/null @@ -1,208 +0,0 @@ - - - KeyboardConfig - - - - 0 - 0 - 375 - 276 - - - - Form - - - - - - Cursor flash time: - - - - - - - <b>Keyboard</b> - - - - - - - Beep when there is an error of keyboard input - - - - - - - ms - - - 10000 - - - - - - - Character Repeat - - - - - - - - - 10 - - - 210 - - - 10 - - - Qt::Horizontal - - - QSlider::TicksAbove - - - - - - - Long - - - - - - - 100 - - - 1100 - - - 100 - - - 100 - - - Qt::Horizontal - - - QSlider::TicksAbove - - - - - - - Repeat delay: - - - - - - - Short - - - - - - - Repeat interval: - - - - - - - Type in the following box to test your keyboard settings - - - - - - - Short - - - - - - - Long - - - - - - - 0 - - - - - - - 0 - - - - - - - - - - Turn on NumLock after login - - - - - - - - - keyboardDelay - valueChanged(int) - label_16 - setNum(int) - - - 245 - 65 - - - 405 - 70 - - - - - keyboardInterval - valueChanged(int) - label_17 - setNum(int) - - - 198 - 93 - - - 403 - 97 - - - - - diff --git a/lxqt-config-input/keyboardlayoutconfig.cpp b/lxqt-config-input/keyboardlayoutconfig.cpp deleted file mode 100644 index 7bbe6a0..0000000 --- a/lxqt-config-input/keyboardlayoutconfig.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "keyboardlayoutconfig.h" -#include -#include -#include -#include -#include "selectkeyboardlayoutdialog.h" -#include - -KeyboardLayoutConfig::KeyboardLayoutConfig(LXQt::Settings* _settings, QWidget* parent): - QWidget(parent), - settings(_settings) { - ui.setupUi(this); - - loadLists(); - loadSettings(); - initControls(); - - connect(ui.addLayout, SIGNAL(clicked(bool)), SLOT(onAddLayout())); - connect(ui.removeLayout, SIGNAL(clicked(bool)), SLOT(onRemoveLayout())); - connect(ui.moveUp, SIGNAL(clicked(bool)), SLOT(onMoveUp())); - connect(ui.moveDown, SIGNAL(clicked(bool)), SLOT(onMoveDown())); - connect(ui.keyboardModel, SIGNAL(currentIndexChanged(int)), SLOT(accept())); - connect(ui.switchKey, SIGNAL(currentIndexChanged(int)), SLOT(accept())); -} - -KeyboardLayoutConfig::~KeyboardLayoutConfig() { -} - -void KeyboardLayoutConfig::loadSettings() { - // load current settings from the output of setxkbmap command - QProcess setxkbmap; - setxkbmap.start(QLatin1String("setxkbmap -query -verbose 5")); - setxkbmap.waitForFinished(); - if(setxkbmap.exitStatus() == QProcess::NormalExit) { - QList layouts, variants; - while(!setxkbmap.atEnd()) { - QByteArray line = setxkbmap.readLine(); - if(line.startsWith("model:")) { - keyboardModel_ = QString::fromLatin1(line.mid(6).trimmed()); - } - else if(line.startsWith("layout:")) { - layouts = line.mid(7).trimmed().split(','); - } - else if(line.startsWith("variant:")) { - variants = line.mid(8).trimmed().split(','); - } - else if(line.startsWith("options:")) { - const QList options = line.mid(9).trimmed().split(','); - Q_FOREACH(const QByteArray &option, options) { - if(option.startsWith("grp:")) - switchKey_ = QString::fromLatin1(option); - else - currentOptions_ << QString::fromLatin1(option); - } - } - } - - const int size = layouts.size(), variantsSize = variants.size(); - for(int i = 0; i < size; ++i) { - currentLayouts_.append(QPair(layouts.at(i), variantsSize > 0 ? variants.at(i) : QString())); - } - - setxkbmap.close(); - } -} - -enum ListSection{ - NoSection, - ModelSection, - LayoutSection, - VariantSection, - OptionSection -}; - -void KeyboardLayoutConfig::loadLists() { - // load known lists from xkb data files - // XKBD_BASELIST_PATH is os dependent see keyboardlayoutconfig.h - QFile file(QLatin1String(XKBD_BASELIST_PATH)); - if(file.open(QIODevice::ReadOnly)) { - ListSection section = NoSection; - while(!file.atEnd()) { - QByteArray line = file.readLine().trimmed(); - if(section == NoSection) { - if(line.startsWith("! model")) - section = ModelSection; - else if(line.startsWith("! layout")) - section = LayoutSection; - else if(line.startsWith("! variant")) - section = VariantSection; - else if(line.startsWith("! option")) - section = OptionSection; - } - else { - if(line.isEmpty()) { - section = NoSection; - continue; - } - int sep = line.indexOf(' '); - QString name = QString::fromLatin1(line, sep); - while(line[sep] == ' ') // skip spaces - ++sep; - QString description = QString::fromUtf8(line.constData() + sep); - - switch(section) { - case ModelSection: { - ui.keyboardModel->addItem(description, name); - break; - } - case LayoutSection: - knownLayouts_[name] = KeyboardLayoutInfo(description); - break; - case VariantSection: { - // the descriptions of variants are prefixed by their language ids - sep = description.indexOf(": "); - if(sep >= 0) { - QString lang = description.left(sep); - QMap::iterator it = knownLayouts_.find(lang); - if(it != knownLayouts_.end()) { - KeyboardLayoutInfo& info = *it; - info.variants.append(LayoutVariantInfo(name, description.mid(sep + 2))); - } - } - break; - } - case OptionSection: - if(line.startsWith("grp:")) { // key used to switch to another layout - ui.switchKey->addItem(description, name); - } - break; - default:; - } - } - } - file.close(); - } -} - -void KeyboardLayoutConfig::initControls() { - QList >::iterator it; - for(it = currentLayouts_.begin(); it != currentLayouts_.end(); ++it) { - QString name = it->first; - QString variant = it->second; - addLayout(name, variant); - } - - int n = ui.keyboardModel->count(); - int row; - for(row = 0; row < n; ++row) { - if(ui.keyboardModel->itemData(row, Qt::UserRole).toString() == keyboardModel_) { - ui.keyboardModel->setCurrentIndex(row); - break; - } - } - - n = ui.switchKey->count(); - for(row = 0; row < n; ++row) { - if(ui.switchKey->itemData(row, Qt::UserRole).toString() == switchKey_) { - ui.switchKey->setCurrentIndex(row); - break; - } - } - -} - -void KeyboardLayoutConfig::addLayout(QString name, QString variant) { - qDebug() << "add" << name << variant; - const KeyboardLayoutInfo& info = knownLayouts_.value(name); - QTreeWidgetItem* item = new QTreeWidgetItem(); - item->setData(0, Qt::DisplayRole, info.description); - item->setData(0, Qt::UserRole, name); - const LayoutVariantInfo* vinfo = info.findVariant(variant); - if(vinfo) { - item->setData(1, Qt::DisplayRole, vinfo->description); - item->setData(1, Qt::UserRole, variant); - } - ui.layouts->addTopLevelItem(item); -} - -void KeyboardLayoutConfig::reset() { - ui.layouts->clear(); - initControls(); - accept(); -} - -void KeyboardLayoutConfig::accept() { - // call setxkbmap to apply the changes - QProcess setxkbmap; - // clear existing options - setxkbmap.start("setxkbmap -option"); - setxkbmap.waitForFinished(); - setxkbmap.close(); - - QString command = "setxkbmap"; - // set keyboard model - QString model; - int cur_model = ui.keyboardModel->currentIndex(); - if(cur_model >= 0) { - model = ui.keyboardModel->itemData(cur_model, Qt::UserRole).toString(); - command += " -model "; - command += model; - } - - // set keyboard layout - int n = ui.layouts->topLevelItemCount(); - QString layouts, variants; - if(n > 0) { - for(int row = 0; row < n; ++row) { - QTreeWidgetItem* item = ui.layouts->topLevelItem(row); - layouts += item->data(0, Qt::UserRole).toString(); - variants += item->data(1, Qt::UserRole).toString(); - if(row < n - 1) { // not the last row - layouts += ','; - variants += ','; - } - } - command += " -layout "; - command += layouts; - - if (variants.indexOf(',') > -1 || !variants.isEmpty()) { - command += " -variant "; - command += variants; - } - } - - Q_FOREACH(QString option, currentOptions_) { - if (!option.startsWith("grp:")) { - command += " -option "; - command += option; - } - } - - QString switchKey; - int cur_switch_key = ui.switchKey->currentIndex(); - if(cur_switch_key > 0) { // index 0 is "None" - switchKey = ui.switchKey->itemData(cur_switch_key, Qt::UserRole).toString(); - command += " -option "; - command += switchKey; - } - - qDebug() << command; - - // execute the command line - setxkbmap.start(command); - setxkbmap.waitForFinished(); - - // save to lxqt-session config file. - settings->beginGroup("Keyboard"); - settings->setValue("layout", layouts); - settings->setValue("variant", variants); - settings->setValue("model", model); - if(switchKey.isEmpty() && currentOptions_ .isEmpty()) - settings->remove("options"); - else - settings->setValue("options", switchKey.isEmpty() ? currentOptions_ : (currentOptions_ << switchKey)); - settings->endGroup(); -} - -void KeyboardLayoutConfig::onAddLayout() { - SelectKeyboardLayoutDialog dlg(knownLayouts_, this); - if(dlg.exec() == QDialog::Accepted) { - addLayout(dlg.selectedLayout(), dlg.selectedVariant()); - accept(); - } -} - -void KeyboardLayoutConfig::onRemoveLayout() { - if(ui.layouts->topLevelItemCount() > 1) { - QTreeWidgetItem* item = ui.layouts->currentItem(); - if(item) { - delete item; - accept(); - } - } -} - -void KeyboardLayoutConfig::onMoveDown() { - QTreeWidgetItem* item = ui.layouts->currentItem(); - if(!item) - return; - int pos = ui.layouts->indexOfTopLevelItem(item); - if(pos < ui.layouts->topLevelItemCount() - 1) { // not the last item - ui.layouts->takeTopLevelItem(pos); - ui.layouts->insertTopLevelItem(pos + 1, item); - ui.layouts->setCurrentItem(item); - accept(); - } -} - -void KeyboardLayoutConfig::onMoveUp() { - QTreeWidgetItem* item = ui.layouts->currentItem(); - if(!item) - return; - int pos = ui.layouts->indexOfTopLevelItem(item); - if(pos > 0) { // not the first item - ui.layouts->takeTopLevelItem(pos); - ui.layouts->insertTopLevelItem(pos - 1, item); - ui.layouts->setCurrentItem(item); - accept(); - } -} - diff --git a/lxqt-config-input/keyboardlayoutconfig.h b/lxqt-config-input/keyboardlayoutconfig.h deleted file mode 100644 index 383335f..0000000 --- a/lxqt-config-input/keyboardlayoutconfig.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef KEYBOARDLAYOUTCONFIG_H -#define KEYBOARDLAYOUTCONFIG_H - -#include -#ifdef Q_OS_LINUX -#define XKBD_BASELIST_PATH "/usr/share/X11/xkb/rules/base.lst" -#elif defined(Q_OS_FREEBSD) -#define XKBD_BASELIST_PATH "/usr/local/share/X11/xkb/rules/base.lst" -#elif defined(Q_OS_OPENBSD) -#define XKBD_BASELIST_PATH "/usr/X11R6/share/X11/xkb/rules/base.lst" -#else -#define XKBD_BASELIST_PATH "/usr/local/share/X11/xkb/rules/base.lst" -#endif - -#include -#include "keyboardlayoutinfo.h" -#include -#include "ui_keyboardlayoutconfig.h" - -namespace LXQt { - class Settings; -} - -class KeyboardLayoutConfig : public QWidget { - Q_OBJECT -public: - KeyboardLayoutConfig(LXQt::Settings* _settings, QWidget* parent = 0); - virtual ~KeyboardLayoutConfig(); - -public Q_SLOTS: - void accept(); - void reset(); - void onAddLayout(); - void onRemoveLayout(); - void onMoveUp(); - void onMoveDown(); - -private: - void loadSettings(); - void loadLists(); - void initControls(); - void addLayout(QString name, QString variant); - -private: - Ui::KeyboardLayoutConfig ui; - QString keyboardModel_; - QString switchKey_; - QStringList currentOptions_; - QList > currentLayouts_; - QMap knownLayouts_; - LXQt::Settings* settings; -}; - -#endif // KEYBOARDLAYOUTCONFIG_H diff --git a/lxqt-config-input/keyboardlayoutconfig.ui b/lxqt-config-input/keyboardlayoutconfig.ui deleted file mode 100644 index d2235aa..0000000 --- a/lxqt-config-input/keyboardlayoutconfig.ui +++ /dev/null @@ -1,152 +0,0 @@ - - - KeyboardLayoutConfig - - - - 0 - 0 - 428 - 322 - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - <b>Keyboard Layout</b> - - - - - - - - - - 1 - 1 - - - - true - - - QAbstractItemView::InternalMove - - - false - - - false - - - - Layout - - - - - Variant - - - - - - - - - - &Add - - - - - - - &Remove - - - - - - - up - - - - - - - down - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Keyboard model: - - - - - - - QComboBox::AdjustToMinimumContentsLengthWithIcon - - - - - - - Keys to change layout: - - - - - - - QComboBox::AdjustToMinimumContentsLengthWithIcon - - - - None - - - - - - - - <html><head/><body><p><span style=" font-weight:600;">Note</span>: If you are using an <span style=" font-weight:600;">input method</span>, such as IBus, uim, fcitx, or gcin, the settings here <span style=" font-weight:600;">might not work</span> because they are overridden by the input methods.</p></body></html> - - - true - - - - - - - - diff --git a/lxqt-config-input/keyboardlayoutinfo.h b/lxqt-config-input/keyboardlayoutinfo.h deleted file mode 100644 index da31996..0000000 --- a/lxqt-config-input/keyboardlayoutinfo.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef _KEYBOARD_LAYOUT_INFO_H_ -#define _KEYBOARD_LAYOUT_INFO_H_ - -#include -#include - -struct LayoutVariantInfo { - QString name; - QString description; - LayoutVariantInfo(QString _name, QString desc): name(_name), description(desc) { - } -}; - -struct KeyboardLayoutInfo { - QString description; - QList variants; - - KeyboardLayoutInfo(QString desc = QString()): description(desc) { - } - - const LayoutVariantInfo* findVariant(QString name) const { - if(!name.isEmpty()) { - Q_FOREACH(const LayoutVariantInfo& vinfo, variants) { - if(vinfo.name == name) - return &vinfo; - } - } - return NULL; - } -}; - -#endif diff --git a/lxqt-config-input/lxqt-config-input.cpp b/lxqt-config-input/lxqt-config-input.cpp deleted file mode 100644 index 379ceac..0000000 --- a/lxqt-config-input/lxqt-config-input.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2013-2014 Hong Jen Yee (PCMan) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include -#include -#include -#include -#include "mouseconfig.h" -#include "keyboardconfig.h" -#include "../liblxqt-config-cursor/selectwnd.h" -#include "keyboardlayoutconfig.h" - -int main(int argc, char** argv) { - LXQt::SingleApplication app(argc, argv); - app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); - - QCommandLineParser parser; - parser.setApplicationDescription(QStringLiteral("LXQt Config Input")); - const QString VERINFO = QStringLiteral(LXQT_CONFIG_VERSION - "\n\nliblxqt: " LXQT_VERSION - "\nQt: " QT_VERSION_STR); - app.setApplicationVersion(VERINFO); - parser.addVersionOption(); - parser.addHelpOption(); - parser.process(app); - - QByteArray configName = qgetenv("LXQT_SESSION_CONFIG"); - if(configName.isEmpty()) - configName = "session"; - LXQt::Settings settings(configName); - LXQt::ConfigDialog dlg(QObject::tr("Keyboard and Mouse Settings"), &settings); - app.setActivationWindow(&dlg); - - LXQt::Settings qtSettings("lxqt"); - MouseConfig* mouseConfig = new MouseConfig(&settings, &qtSettings, &dlg); - dlg.addPage(mouseConfig, QObject::tr("Mouse"), "input-mouse"); - QObject::connect(&dlg, SIGNAL(reset()), mouseConfig, SLOT(reset())); - - SelectWnd* cursorConfig = new SelectWnd(&settings, &dlg); - cursorConfig->setCurrent(); - dlg.addPage(cursorConfig, QObject::tr("Cursor"), "preferences-desktop-theme"); - - KeyboardConfig* keyboardConfig = new KeyboardConfig(&settings, &qtSettings, &dlg); - dlg.addPage(keyboardConfig, QObject::tr("Keyboard"), "input-keyboard"); - QObject::connect(&dlg, SIGNAL(reset()), keyboardConfig, SLOT(reset())); - - KeyboardLayoutConfig* keyboardLayoutConfig = new KeyboardLayoutConfig(&settings, &dlg); - dlg.addPage(keyboardLayoutConfig, QObject::tr("Keyboard Layout"), "input-keyboard"); - QObject::connect(&dlg, SIGNAL(reset()), keyboardLayoutConfig, SLOT(reset())); - - dlg.setWindowIcon(QIcon::fromTheme("input-keyboard")); - - dlg.exec(); - return 0; -} diff --git a/lxqt-config-input/lxqt-config-input.desktop.in b/lxqt-config-input/lxqt-config-input.desktop.in deleted file mode 100644 index b1088b9..0000000 --- a/lxqt-config-input/lxqt-config-input.desktop.in +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Keyboard and Mouse -GenericName=Input settings -Comment=Configure keyboard, mouse, and other input devices -Exec=lxqt-config-input -Icon=input-keyboard -Categories=Qt;Settings;HardwareSettings;DesktopSettings;LXQt; -OnlyShowIn=LXQt; - -#TRANSLATIONS_DIR=translations diff --git a/lxqt-config-input/lxqt-config-input.h b/lxqt-config-input/lxqt-config-input.h deleted file mode 100644 index 1f9e0e3..0000000 --- a/lxqt-config-input/lxqt-config-input.h +++ /dev/null @@ -1,15 +0,0 @@ -/* -* Copyright (c) LXQt contributors. -* -* This file is part of the LXQt project. -* It is distributed under the LGPL 2.1 or later license. -* Please refer to the LICENSE file for a copy of the license, and -* the AUTHORS file for copyright and authorship information. -*/ - -#ifndef LXQT_CONFIG_INPUT_H -#define LXQT_CONFIG_INPUT_H - - - -#endif // LXQT_CONFIG_INPUT_H diff --git a/lxqt-config-input/mouseconfig.cpp b/lxqt-config-input/mouseconfig.cpp deleted file mode 100644 index 0f25283..0000000 --- a/lxqt-config-input/mouseconfig.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* - Copyright (C) 2013-2014 Hong Jen Yee (PCMan) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - - -#include "mouseconfig.h" -#include -#include -#include -#include -#include -#include -#include -#include - -// FIXME: how to support XCB or Wayland? -#include -#include -#include - -#ifdef Q_WS_X11 -extern void qt_x11_apply_settings_in_all_apps(); -#endif - -MouseConfig::MouseConfig(LXQt::Settings* _settings, QSettings* _qtSettings, QWidget* parent): - QWidget(parent), - settings(_settings), - qtSettings(_qtSettings), - accel(20), - oldAccel(20), - threshold(10), - oldThreshold(10), - leftHanded(false), - oldLeftHanded(false), - singleClick(false), - oldSingleClick(false) { - - ui.setupUi(this); - - /* read the config flie */ - loadSettings(); - initControls(); - - // set_range_stops(ui.mouseAccel, 10); - connect(ui.mouseAccel, SIGNAL(valueChanged(int)), SLOT(onMouseAccelChanged(int))); - // set_range_stops(ui.mouseThreshold, 10); - connect(ui.mouseThreshold, SIGNAL(valueChanged(int)), SLOT(onMouseThresholdChanged(int))); - connect(ui.mouseLeftHanded, SIGNAL(toggled(bool)), SLOT(onMouseLeftHandedToggled(bool))); - - connect(ui.doubleClickInterval, SIGNAL(valueChanged(int)), SLOT(onDoubleClickIntervalChanged(int))); - connect(ui.wheelScrollLines, SIGNAL(valueChanged(int)), SLOT(onWheelScrollLinesChanged(int))); - connect(ui.singleClick, SIGNAL(toggled(bool)), SLOT(onSingleClickChanged(bool))); -} - -MouseConfig::~MouseConfig() { -} - -void MouseConfig::initControls() { - ui.mouseAccel->setValue(accel); - ui.mouseThreshold->setValue(110 - threshold); - ui.mouseLeftHanded->setChecked(leftHanded); - - ui.singleClick->setChecked(qtSettings->value(QLatin1String("single_click_activate"), false).toBool()); - - qtSettings->beginGroup(QLatin1String("Qt")); - int value = qtSettings->value(QLatin1String("doubleClickInterval"), 400).toInt(); - ui.doubleClickInterval->setValue(value); - - value = qtSettings->value(QLatin1String("wheelScrollLines"), 3).toInt(); - ui.wheelScrollLines->setValue(value); - qtSettings->endGroup(); -} - - -void MouseConfig::onMouseAccelChanged(int value) { - accel = value; - XChangePointerControl(QX11Info::display(), True, False, - accel, 10, 0); - accept(); -} - -void MouseConfig::onMouseThresholdChanged(int value) { - /* threshold = 110 - sensitivity. The lower the threshold, the higher the sensitivity */ - threshold = 110 - value; - XChangePointerControl(QX11Info::display(), False, True, - 0, 10, threshold); - accept(); -} - -/* This function is taken from Gnome's control-center 2.6.0.3 (gnome-settings-mouse.c) and was modified*/ -#define DEFAULT_PTR_MAP_SIZE 128 -void MouseConfig::setLeftHandedMouse() { - unsigned char* buttons; - unsigned char* more_buttons; - int n_buttons, i; - int idx_1 = 0, idx_3 = 1; - - buttons = (unsigned char*)malloc(DEFAULT_PTR_MAP_SIZE); - if(!buttons) { - return; - } - n_buttons = XGetPointerMapping(QX11Info::display(), buttons, DEFAULT_PTR_MAP_SIZE); - - if(n_buttons > DEFAULT_PTR_MAP_SIZE) { - more_buttons = (unsigned char*)realloc(buttons, n_buttons); - if(!more_buttons) { - free(buttons); - return; - } - buttons = more_buttons; - n_buttons = XGetPointerMapping(QX11Info::display(), buttons, n_buttons); - } - - for(i = 0; i < n_buttons; i++) { - if(buttons[i] == 1) - idx_1 = i; - else if(buttons[i] == ((n_buttons < 3) ? 2 : 3)) - idx_3 = i; - } - - if((leftHanded && idx_1 < idx_3) || - (!leftHanded && idx_1 > idx_3)) { - buttons[idx_1] = ((n_buttons < 3) ? 2 : 3); - buttons[idx_3] = 1; - XSetPointerMapping(QX11Info::display(), buttons, n_buttons); - } - free(buttons); -} - -void MouseConfig::onMouseLeftHandedToggled(bool checked) { - leftHanded = checked; - setLeftHandedMouse(); - accept(); -} - -void MouseConfig::onDoubleClickIntervalChanged(int value) -{ - qtSettings->beginGroup(QLatin1String("Qt")); - qtSettings->setValue(QLatin1String("doubleClickInterval"), value); - qtSettings->endGroup(); - qtSettings->sync(); -#ifdef Q_WS_X11 - qt_x11_apply_settings_in_all_apps(); -#endif -} - -void MouseConfig::onWheelScrollLinesChanged(int value) -{ - qtSettings->beginGroup(QLatin1String("Qt")); - qtSettings->setValue(QLatin1String("wheelScrollLines"), value); - qtSettings->endGroup(); - qtSettings->sync(); -#ifdef Q_WS_X11 - qt_x11_apply_settings_in_all_apps(); -#endif -} - -void MouseConfig::onSingleClickChanged(bool checked) -{ - qtSettings->setValue(QLatin1String("single_click_activate"), checked); - qtSettings->sync(); -#ifdef Q_WS_X11 - qt_x11_apply_settings_in_all_apps(); -#endif -} - -void MouseConfig::loadSettings() { - oldSingleClick = singleClick = qtSettings->value("single_click_activate", false).toBool(); - - settings->beginGroup("Mouse"); - oldAccel = accel = settings->value("accel_factor", 20).toInt(); - oldThreshold = threshold = settings->value("accel_threshold", 10).toInt(); - oldLeftHanded = leftHanded = settings->value("left_handed", false).toBool(); - settings->endGroup(); -} - -void MouseConfig::accept() { - qtSettings->setValue("single_click_activate", singleClick); - - settings->beginGroup("Mouse"); - settings->setValue("accel_factor", accel); - settings->setValue("accel_threshold", threshold); - settings->setValue("left_handed", leftHanded); - settings->endGroup(); -} - -void MouseConfig::reset() { - /* restore to original settings */ - /* mouse */ - accel = oldAccel; - threshold = oldThreshold; - leftHanded = oldLeftHanded; - singleClick = oldSingleClick; - XChangePointerControl(QX11Info::display(), True, True, - accel, 10, threshold); - setLeftHandedMouse(); - - initControls(); - accept(); -} diff --git a/lxqt-config-input/mouseconfig.h b/lxqt-config-input/mouseconfig.h deleted file mode 100644 index d11ec9d..0000000 --- a/lxqt-config-input/mouseconfig.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright (C) 2013-2014 Hong Jen Yee (PCMan) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - - -#ifndef MOUSECONFIG_H -#define MOUSECONFIG_H - -#include -#include "ui_mouseconfig.h" - -namespace LXQt { - class Settings; -} -class QSettings; - -class MouseConfig : public QWidget { - Q_OBJECT - -public: - MouseConfig(LXQt::Settings* _settings, QSettings* _qtSettings, QWidget* parent); - virtual ~MouseConfig(); - - void accept(); -public Q_SLOTS: - void reset(); - -private: - void setLeftHandedMouse(); - void loadSettings(); - void initControls(); - -private Q_SLOTS: - void onMouseAccelChanged(int value); - void onMouseThresholdChanged(int value); - void onMouseLeftHandedToggled(bool checked); - void onDoubleClickIntervalChanged(int value); - void onWheelScrollLinesChanged(int value); - void onSingleClickChanged(bool checked); - -private: - Ui::MouseConfig ui; - LXQt::Settings* settings; - QSettings* qtSettings; - int accel; - int oldAccel; - int threshold; - int oldThreshold; - bool leftHanded; - bool oldLeftHanded; - bool singleClick; - bool oldSingleClick; -}; - -#endif // MOUSECONFIG_H diff --git a/lxqt-config-input/mouseconfig.ui b/lxqt-config-input/mouseconfig.ui deleted file mode 100644 index 775c99d..0000000 --- a/lxqt-config-input/mouseconfig.ui +++ /dev/null @@ -1,208 +0,0 @@ - - - MouseConfig - - - - 0 - 0 - 324 - 223 - - - - Form - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - <b>Mouse</b> - - - - - - - Motion - - - - - - High - - - - - - - Fast - - - - - - - Sensitivity: - - - - - - - Low - - - - - - - 10 - - - 110 - - - 10 - - - Qt::Horizontal - - - QSlider::TicksAbove - - - - - - - Acceleration: - - - - - - - 10 - - - 110 - - - 10 - - - Qt::Horizontal - - - QSlider::TicksAbove - - - - - - - Slow - - - - - - - 0 - - - - - - - 0 - - - - - - - - - - Double click interval: - - - - - - - ms - - - 10000 - - - - - - - Wheel scroll lines: - - - - - - - - - - Left handed (Swap left and right mouse buttons) - - - - - - - Single click to activate items - - - - - - - - - mouseAccel - valueChanged(int) - label_41 - setNum(int) - - - 175 - 74 - - - 342 - 73 - - - - - mouseThreshold - valueChanged(int) - label_42 - setNum(int) - - - 191 - 95 - - - 347 - 95 - - - - - diff --git a/lxqt-config-input/selectkeyboardlayoutdialog.cpp b/lxqt-config-input/selectkeyboardlayoutdialog.cpp deleted file mode 100644 index edcd6a5..0000000 --- a/lxqt-config-input/selectkeyboardlayoutdialog.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "selectkeyboardlayoutdialog.h" -#include - -SelectKeyboardLayoutDialog::SelectKeyboardLayoutDialog(QMap< QString, KeyboardLayoutInfo>& knownLayouts, QWidget* parent): - QDialog(parent), - knownLayouts_(knownLayouts) { - ui.setupUi(this); - connect(ui.layouts, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), SLOT(onLayoutChanged())); - - QMap::const_iterator it; - for(it = knownLayouts_.constBegin(); it != knownLayouts_.constEnd(); ++it) { - const QString& name = it.key(); - const KeyboardLayoutInfo& info = *it; - QListWidgetItem * item = new QListWidgetItem(info.description); - item->setData(Qt::UserRole, name); - ui.layouts->addItem(item); - } - ui.layouts->setCurrentItem(ui.layouts->item(0)); -} - -SelectKeyboardLayoutDialog::~SelectKeyboardLayoutDialog() { - -} - -void SelectKeyboardLayoutDialog::onLayoutChanged() { - QListWidgetItem* item = ui.layouts->currentItem(); - ui.variants->clear(); - - ui.variants->addItem("None"); - ui.variants->setCurrentItem(ui.variants->item(0)); - if(item) { // add variants of this layout to the list view - QString name = item->data(Qt::UserRole).toString(); - const KeyboardLayoutInfo& info = knownLayouts_[name]; - Q_FOREACH(const LayoutVariantInfo& vinfo, info.variants) { - QListWidgetItem * vitem = new QListWidgetItem(vinfo.description); - // qDebug() << "vitem" << vinfo.name << vinfo.description; - vitem->setData(Qt::UserRole, vinfo.name); - ui.variants->addItem(vitem); - } - } -} - -QString SelectKeyboardLayoutDialog::selectedLayout() { - QListWidgetItem* layoutItem = ui.layouts->currentItem(); - if(layoutItem) { - return layoutItem->data(Qt::UserRole).toString(); - } - return QString(); -} - -QString SelectKeyboardLayoutDialog::selectedVariant() { - QListWidgetItem* variantItem = ui.variants->currentItem(); - if(variantItem) - return variantItem->data(Qt::UserRole).toString(); - return QString(); -} diff --git a/lxqt-config-input/selectkeyboardlayoutdialog.h b/lxqt-config-input/selectkeyboardlayoutdialog.h deleted file mode 100644 index 838d032..0000000 --- a/lxqt-config-input/selectkeyboardlayoutdialog.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef SELECTKEYBOARDLAYOUTDIALOG_H -#define SELECTKEYBOARDLAYOUTDIALOG_H - -#include -#include "ui_selectkeyboardlayoutdialog.h" -#include "keyboardlayoutinfo.h" - -class SelectKeyboardLayoutDialog : public QDialog { - Q_OBJECT -public: - SelectKeyboardLayoutDialog(QMap< QString, KeyboardLayoutInfo >& knownLayouts, QWidget* parent = 0); - virtual ~SelectKeyboardLayoutDialog(); - - QString selectedLayout(); - QString selectedVariant(); - -private Q_SLOTS: - void onLayoutChanged(); - -private: - Ui::SelectKeyboardLayoutDialog ui; - QMap& knownLayouts_; -}; - -#endif // SELECTKEYBOARDLAYOUTDIALOG_H diff --git a/lxqt-config-input/selectkeyboardlayoutdialog.ui b/lxqt-config-input/selectkeyboardlayoutdialog.ui deleted file mode 100644 index 36bb688..0000000 --- a/lxqt-config-input/selectkeyboardlayoutdialog.ui +++ /dev/null @@ -1,88 +0,0 @@ - - - SelectKeyboardLayoutDialog - - - - 0 - 0 - 480 - 384 - - - - Select a keyboard layout - - - - - - Keyboard layout - - - - - - - Variant - - - - - - - true - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - SelectKeyboardLayoutDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - SelectKeyboardLayoutDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/lxqt-config-input/translations/lxqt-config-input_ar.desktop b/lxqt-config-input/translations/lxqt-config-input_ar.desktop deleted file mode 100644 index d1d9769..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_ar.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[ar]=لوحة المفاتيح والفأرة -GenericName[ar]=إعدادات الدّخل -Comment[ar]=اضبط لوحة المفاتيح، والفأرة وأجهزة الدّخل الأخرى diff --git a/lxqt-config-input/translations/lxqt-config-input_ca.desktop b/lxqt-config-input/translations/lxqt-config-input_ca.desktop deleted file mode 100644 index 7f62fd0..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_ca.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[ca]=Teclat i ratolí -GenericName[ca]=Ajusts de l'entrada -Comment[ca]=Configureu el teclat, el ratolí i altres dispositius d'entrada diff --git a/lxqt-config-input/translations/lxqt-config-input_da.desktop b/lxqt-config-input/translations/lxqt-config-input_da.desktop deleted file mode 100644 index 681a16d..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_da.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[da]=Tastatur og mus -GenericName[da]=Input-indstillinger -Comment[da]=Konfigurér tastatur, mus og andre input-enheder diff --git a/lxqt-config-input/translations/lxqt-config-input_de.desktop b/lxqt-config-input/translations/lxqt-config-input_de.desktop deleted file mode 100644 index da426fc..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_de.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[de]=Tastatur und Maus -GenericName[de]=Eingabegerätekonfiguration -Comment[de]=Tastatur, Maus und andere Eingabegeräte konfigurieren diff --git a/lxqt-config-input/translations/lxqt-config-input_el.desktop b/lxqt-config-input/translations/lxqt-config-input_el.desktop deleted file mode 100644 index addfbad..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_el.desktop +++ /dev/null @@ -1,4 +0,0 @@ -#Translations -Name[el]=Πληκτρολόγιο και ποντίκι -GenericName[el]=Ρυθμίσεις εισαγωγής -Comment[el]=Διαμόρφωση του πληκτρολογίου, του ποντικιού, και άλλων συσκευών εισαγωγής diff --git a/lxqt-config-input/translations/lxqt-config-input_fr.desktop b/lxqt-config-input/translations/lxqt-config-input_fr.desktop deleted file mode 100644 index 84f9355..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_fr.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[fr]=Clavier et Souris -GenericName[fr]=Paramètres des périphériques d'entrée -Comment[fr]=Configurer les claviers, souris et les autres périphériques d'entrée diff --git a/lxqt-config-input/translations/lxqt-config-input_hu.desktop b/lxqt-config-input/translations/lxqt-config-input_hu.desktop deleted file mode 100644 index 42db5bd..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_hu.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[hu]=Billentyű és egérbeállítás -GenericName[hu]=Beviteli eszközbeállítás -Comment[hu]=TA billentyűzet és egér beállítása diff --git a/lxqt-config-input/translations/lxqt-config-input_it.desktop b/lxqt-config-input/translations/lxqt-config-input_it.desktop deleted file mode 100644 index db4e585..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_it.desktop +++ /dev/null @@ -1,6 +0,0 @@ -# Translations -Name[it]=Tastiera e mouse -GenericName[it]=Configura i dispositivi di immissione -Comment[it]=Configura tastiera, mouse e altri dispositivi di immissione - - diff --git a/lxqt-config-input/translations/lxqt-config-input_ja.desktop b/lxqt-config-input/translations/lxqt-config-input_ja.desktop deleted file mode 100644 index 201a9b7..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_ja.desktop +++ /dev/null @@ -1,5 +0,0 @@ -# Translations -Name[ja]=キーボードとマウス -GenericName[ja]=入力の設定 -Comment[ja]=キーボードやマウス、その他の入力デバイスの設定 - diff --git a/lxqt-config-input/translations/lxqt-config-input_lt.desktop b/lxqt-config-input/translations/lxqt-config-input_lt.desktop deleted file mode 100644 index 706d6dd..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_lt.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[lt]=Klaviatūra ir pelė -GenericName[lt]=Įvedimo nustatymai -Comment[lt]=Konfigūruoti klaviatūrą, pelę ir kitus įvedimo įrenginius diff --git a/lxqt-config-input/translations/lxqt-config-input_pl.desktop b/lxqt-config-input/translations/lxqt-config-input_pl.desktop deleted file mode 100644 index 7a64193..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_pl.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[pl]=Mysz i Klawiatura -GenericName[pl]=Urządzenia wejścia -Comment[pl]=Konfiguracja klawiatury i myszy diff --git a/lxqt-config-input/translations/lxqt-config-input_pt.desktop b/lxqt-config-input/translations/lxqt-config-input_pt.desktop deleted file mode 100644 index 565b74f..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_pt.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[pt]=Teclado e rato -GenericName[pt]=Definições de introdução -Comment[pt]=Configuração do rato, teclado e outros dispositivos de introdução diff --git a/lxqt-config-input/translations/lxqt-config-input_ru.desktop b/lxqt-config-input/translations/lxqt-config-input_ru.desktop deleted file mode 100644 index 6d441bb..0000000 --- a/lxqt-config-input/translations/lxqt-config-input_ru.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ru]=Настроить клавиатуру, мышь и другие устройства ввода -Name[ru]=Клавиатура и мышь -GenericName[ru]=Настройки ввода \ No newline at end of file diff --git a/lxqt-config-locale/CMakeLists.txt b/lxqt-config-locale/CMakeLists.txt deleted file mode 100644 index efa8702..0000000 --- a/lxqt-config-locale/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -project(lxqt-config-locale) - -set(H_FILES - localeconfig.h -) - - -set(CPP_FILES - main.cpp - localeconfig.cpp -) - -set(UI_FILES - localeconfig.ui -) - -# Translations ********************************** -lxqt_translate_ts(QM_FILES - UPDATE_TRANSLATIONS - ${UPDATE_TRANSLATIONS} - SOURCES - ${H_FILES} - ${CPP_FILES} - ${UI_FILES} - INSTALL_DIR - "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}" - PULL_TRANSLATIONS - ${PULL_TRANSLATIONS} - CLEAN_TRANSLATIONS - ${CLEAN_TRANSLATIONS} - TRANSLATIONS_REPO - ${TRANSLATIONS_REPO} - TRANSLATIONS_REFSPEC - ${TRANSLATIONS_REFSPEC} - REPO_SUBDIR - "lxqt-config/${PROJECT_NAME}" -) - -lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME}) -lxqt_translate_desktop(DESKTOP_FILES SOURCES ${PROJECT_NAME}.desktop.in) - -#************************************************ - -add_executable(${PROJECT_NAME} - ${CPP_FILES} - ${RESOURCES} - ${QRC_SOURCES} - ${QM_FILES} - ${DESKTOP_FILES} - ${QM_LOADER} -) - -target_link_libraries(${PROJECT_NAME} - Qt5::Widgets - Qt5::Xml - lxqt -) - -install(TARGETS - ${PROJECT_NAME} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - COMPONENT Runtime -) -install(FILES - ${DESKTOP_FILES} - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" - COMPONENT Runtime -) diff --git a/lxqt-config-locale/localeconfig.cpp b/lxqt-config-locale/localeconfig.cpp deleted file mode 100644 index 76ca2a7..0000000 --- a/lxqt-config-locale/localeconfig.cpp +++ /dev/null @@ -1,452 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)GPL2+ - * - * - * Copyright: 2014 LXQt team - * 2014 Sebastian Kügler - * Authors: - * Julien Lavergne - * Sebastian Kügler - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * - * END_COMMON_COPYRIGHT_HEADER - * - * Based on plasma-desktop/kcms/formats module - */ - -#include "localeconfig.h" -#include "ui_localeconfig.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -const static QString lcLang = QStringLiteral("LANG"); - -const static QString lcNumeric = QStringLiteral("LC_NUMERIC"); -const static QString lcTime = QStringLiteral("LC_TIME"); -const static QString lcMonetary = QStringLiteral("LC_MONETARY"); -const static QString lcMeasurement = QStringLiteral("LC_MEASUREMENT"); -const static QString lcCollate = QStringLiteral("LC_COLLATE"); -const static QString lcCtype = QStringLiteral("LC_CTYPE"); - -const static QString lcLanguage = QStringLiteral("LANGUAGE"); - -LocaleConfig::LocaleConfig(LXQt::Settings* settings, LXQt::Settings* session_settings, QWidget* parent) : - QWidget(parent), - m_ui(new Ui::LocaleConfig), - hasChanged(new bool), - mSettings(settings), - sSettings(session_settings) - - -{ - m_ui->setupUi(this); - m_combos << m_ui->comboGlobal - << m_ui->comboNumbers - << m_ui->comboTime - << m_ui->comboCurrency - << m_ui->comboMeasurement - << m_ui->comboCollate; - - hasChanged = false; - - initControls(); -} - - -LocaleConfig::~LocaleConfig() -{ - delete m_ui; -} - -bool countryLessThan(const QLocale & c1, const QLocale & c2) -{ - return QString::localeAwareCompare(c1.nativeCountryName(), c2.nativeCountryName()) < 0; -} - -void LocaleConfig::load() -{ - QList allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry); - qSort(allLocales.begin(), allLocales.end(), countryLessThan); - foreach(QComboBox * combo, m_combos) - { - initCombo(combo, allLocales); - } - - readConfig(); - - foreach(QComboBox * combo, m_combos) - { - connectCombo(combo); - } - - connect(m_ui->checkDetailed, &QAbstractButton::toggled, [ = ]() - { - updateExample(); - updateEnabled(); - hasChanged = true; - }); - - updateEnabled(); - updateExample(); - hasChanged = false; -} - -void LocaleConfig::initCombo(QComboBox *combo, const QList & allLocales) -{ - combo->clear(); - const QString clabel = tr("No change"); - combo->setInsertPolicy(QComboBox::InsertAlphabetically); - combo->addItem(clabel, QString()); - foreach(const QLocale & l, allLocales) - { - addLocaleToCombo(combo, l); - } -} - -void LocaleConfig::connectCombo(QComboBox *combo) -{ - connect(combo, &QComboBox::currentTextChanged, [ = ]() - { - hasChanged = true; - updateExample(); - }); -} - -void LocaleConfig::addLocaleToCombo(QComboBox *combo, const QLocale &locale) -{ - const QString clabel = !locale.nativeCountryName().isEmpty() ? locale.nativeCountryName() : locale.countryToString(locale.country()); - // This needs to use name() rather than bcp47name() or later on the export will generate a non-sense locale (e.g. "it" instead of - // "it_IT") - // TODO: Properly handle scripts (@foo) - QString cvalue = locale.name(); - if (!cvalue.contains('.')) - { // explicitely add the encoding, otherwise Qt doesn't accept dead keys and garbles the output as well - cvalue.append(QLatin1Char('.') + QTextCodec::codecForLocale()->name()); - } - - QString flagcode; - const QStringList split = locale.name().split('_'); - if (split.count() > 1) - { - flagcode = split[1].toLower(); - } - /* TODO Find a better place for flags ... */ - QString flag(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kf5/locale/countries/%1/flag.png").arg(flagcode))); - QIcon flagIcon; - if (!flag.isEmpty()) - { - flagIcon = QIcon(flag); - } - - QString itemResult; - itemResult = QString("%1 - %2 (%3)") - .arg(clabel) - .arg(locale.nativeLanguageName()) - .arg(locale.name()); - - combo->addItem(flagIcon, itemResult, cvalue); -} - -void setCombo(QComboBox *combo, const QString &key) -{ - const int ix = combo->findData(key); - if (ix > -1) - { - combo->setCurrentIndex(ix); - } -} - -void LocaleConfig::readConfig() -{ - mSettings->beginGroup("Formats"); - - bool useDetailed = mSettings->value("useDetailed", false).toBool(); - m_ui->checkDetailed->setChecked(useDetailed); - - setCombo(m_ui->comboGlobal, mSettings->value(lcLang, qgetenv(lcLang.toLatin1())).toString()); - - setCombo(m_ui->comboNumbers, mSettings->value(lcNumeric, qgetenv(lcNumeric.toLatin1())).toString()); - setCombo(m_ui->comboTime, mSettings->value(lcTime, qgetenv(lcTime.toLatin1())).toString()); - setCombo(m_ui->comboCollate, mSettings->value(lcCollate, qgetenv(lcCollate.toLatin1())).toString()); - setCombo(m_ui->comboCurrency, mSettings->value(lcMonetary, qgetenv(lcMonetary.toLatin1())).toString()); - setCombo(m_ui->comboMeasurement, mSettings->value(lcMeasurement, qgetenv(lcMeasurement.toLatin1())).toString()); - - updateEnabled(); - - mSettings->endGroup(); -} - -void LocaleConfig::writeConfig() -{ - mSettings->beginGroup("Formats"); - - // global ends up empty here when OK button is clicked from kcmshell5, - // apparently the data in the combo is gone by the time save() is called. - // This might be a problem in KCModule, but does not directly affect us - // since within systemsettings, it works fine. - // See https://bugs.kde.org/show_bug.cgi?id=334624 - if (m_ui->comboGlobal->count() == 0) - { - qWarning() << "Couldn't read data from UI, writing configuration failed."; - return; - } - const QString global = m_ui->comboGlobal->currentData().toString(); - - if (!m_ui->checkDetailed->isChecked()) - { - // Global setting, clean up config - mSettings->remove("useDetailed"); - if (global.isEmpty()) - { - mSettings->remove(lcLang); - } - else - { - mSettings->setValue(lcLang, global); - } - mSettings->remove(lcNumeric); - mSettings->remove(lcTime); - mSettings->remove(lcMonetary); - mSettings->remove(lcMeasurement); - mSettings->remove(lcCollate); - mSettings->remove(lcCtype); - } - else - { - // Save detailed settings - mSettings->setValue("useDetailed", true); - - if (global.isEmpty()) - { - mSettings->remove(lcLang); - } - else - { - mSettings->setValue(lcLang, global); - } - - const QString numeric = m_ui->comboNumbers->currentData().toString(); - if (numeric.isEmpty()) - { - mSettings->remove(lcNumeric); - } - else - { - mSettings->setValue(lcNumeric, numeric); - } - - const QString time = m_ui->comboTime->currentData().toString(); - if (time.isEmpty()) - { - mSettings->remove(lcTime); - } - else - { - mSettings->setValue(lcTime, time); - } - - const QString monetary = m_ui->comboCurrency->currentData().toString(); - if (monetary.isEmpty()) - { - mSettings->remove(lcMonetary); - } - else - { - mSettings->setValue(lcMonetary, monetary); - } - - const QString measurement = m_ui->comboMeasurement->currentData().toString(); - if (measurement.isEmpty()) - { - mSettings->remove(lcMeasurement); - } - else - { - mSettings->setValue(lcMeasurement, measurement); - } - - const QString collate = m_ui->comboCollate->currentData().toString(); - if (collate.isEmpty()) - { - mSettings->remove(lcCollate); - } - else - { - mSettings->setValue(lcCollate, collate); - } - } - mSettings->endGroup(); -} - -void LocaleConfig::saveSettings() -{ - if (hasChanged) - { - QMessageBox msgBox; - msgBox.setWindowTitle(tr("Format Settings Changed")); - msgBox.setText(tr("Do you want to save your changes? They will take effect the next time you log in.")); - msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Cancel); - msgBox.setDefaultButton(QMessageBox::Cancel); - - int ret = msgBox.exec(); - if( ret == QMessageBox::Save ) - { - writeConfig(); - writeExports(); - } - } - -} - -void LocaleConfig::writeExports() -{ - sSettings->beginGroup("Environment"); - mSettings->beginGroup("Formats"); - if (!mSettings->value(lcLang).toString().isNull()) - { - sSettings->setValue(lcLang, mSettings->value(lcLang).toString()); - - if (mSettings->value("useDetailed").toBool()) - { - if (!mSettings->value(lcNumeric).toString().isNull()) - { - sSettings->setValue(lcNumeric, mSettings->value(lcNumeric).toString()); - } - if (!mSettings->value(lcTime).toString().isNull()) - { - sSettings->setValue(lcTime, mSettings->value(lcTime).toString()); - } - if (!mSettings->value(lcCollate).toString().isNull()) - { - sSettings->setValue(lcCollate, mSettings->value(lcCollate).toString()); - } - if (!mSettings->value(lcMonetary).toString().isNull()) - { - sSettings->setValue(lcMonetary, mSettings->value(lcMonetary).toString()); - } - if (!mSettings->value(lcMeasurement).toString().isNull()) - { - sSettings->setValue(lcMeasurement, mSettings->value(lcMeasurement).toString()); - } - } - else - { - sSettings->setValue(lcNumeric, mSettings->value(lcLang).toString()); - sSettings->setValue(lcTime, mSettings->value(lcLang).toString()); - sSettings->setValue(lcCollate, mSettings->value(lcLang).toString()); - sSettings->setValue(lcMonetary, mSettings->value(lcLang).toString()); - sSettings->setValue(lcMeasurement, mSettings->value(lcLang).toString()); - } - } - mSettings->endGroup(); - sSettings->endGroup(); - sSettings->sync(); -} - -void LocaleConfig::defaults() -{ - m_ui->checkDetailed->setChecked(false); - - // restore user defaults from env vars - setCombo(m_ui->comboGlobal, qgetenv(lcLang.toLatin1())); - setCombo(m_ui->comboNumbers, qgetenv(lcNumeric.toLatin1())); - setCombo(m_ui->comboTime, qgetenv(lcTime.toLatin1())); - setCombo(m_ui->comboCollate, qgetenv(lcCollate.toLatin1())); - setCombo(m_ui->comboCurrency, qgetenv(lcMonetary.toLatin1())); - setCombo(m_ui->comboMeasurement, qgetenv(lcMeasurement.toLatin1())); - - updateEnabled(); -} - -void LocaleConfig::updateEnabled() -{ - const bool enabled = m_ui->checkDetailed->isChecked(); - - m_ui->labelNumbers->setEnabled(enabled); - m_ui->labelTime->setEnabled(enabled); - m_ui->labelCurrency->setEnabled(enabled); - m_ui->labelMeasurement->setEnabled(enabled); - m_ui->labelCollate->setEnabled(enabled); - m_ui->comboNumbers->setEnabled(enabled); - m_ui->comboTime->setEnabled(enabled); - m_ui->comboCurrency->setEnabled(enabled); - m_ui->comboMeasurement->setEnabled(enabled); - m_ui->comboCollate->setEnabled(enabled); -} - -void LocaleConfig::updateExample() -{ - const bool useDetailed = m_ui->checkDetailed->isChecked(); - - QLocale nloc; - QLocale tloc; - QLocale cloc; - QLocale mloc; - - if (useDetailed) - { - nloc = QLocale(m_ui->comboNumbers->currentData().toString()); - tloc = QLocale(m_ui->comboTime->currentData().toString()); - cloc = QLocale(m_ui->comboCurrency->currentData().toString()); - mloc = QLocale(m_ui->comboMeasurement->currentData().toString()); - } - else - { - nloc = QLocale(m_ui->comboGlobal->currentData().toString()); - tloc = QLocale(m_ui->comboGlobal->currentData().toString()); - cloc = QLocale(m_ui->comboGlobal->currentData().toString()); - mloc = QLocale(m_ui->comboGlobal->currentData().toString()); - } - - const QString numberExample = nloc.toString(1000.01); - const QString timeExample = tloc.toString(QDateTime::currentDateTime()); - const QString currencyExample = cloc.toCurrencyString(24); - - QString measurementSetting; - if (mloc.measurementSystem() == QLocale::ImperialUKSystem) - { - measurementSetting = tr("Imperial UK"); - } - else if (mloc.measurementSystem() == QLocale::ImperialUSSystem) - { - measurementSetting = tr("Imperial US"); - } - else - { - measurementSetting = tr("Metric"); - } - - m_ui->exampleNumbers->setText(numberExample); - m_ui->exampleTime->setText(timeExample); - m_ui->exampleCurrency->setText(currencyExample); - m_ui->exampleMeasurement->setText(measurementSetting); -} - -void LocaleConfig::initControls() -{ - defaults(); - load(); - hasChanged = false; -} diff --git a/lxqt-config-locale/localeconfig.h b/lxqt-config-locale/localeconfig.h deleted file mode 100644 index a25a513..0000000 --- a/lxqt-config-locale/localeconfig.h +++ /dev/null @@ -1,79 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)GPL2+ - * - * - * Copyright: 2014 LXQt team - * 2014 Sebastian Kügler - * Authors: - * Julien Lavergne - * Sebastian Kügler - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef LOCALECONFIG_H -#define LOCALECONFIG_H - -#include -#include - -class QTreeWidgetItem; -class QSettings; - - -namespace Ui { - class LocaleConfig; -} - -class QComboBox; -class QMessageWidget; - -class LocaleConfig : public QWidget -{ - Q_OBJECT - -public: - explicit LocaleConfig(LXQt::Settings *settings, LXQt::Settings *session_settings, QWidget *parent = 0); - ~LocaleConfig(); - - void load(); - void save(); - void defaults(); - -public slots: - void initControls(); - void saveSettings(); - -private: - void addLocaleToCombo(QComboBox *combo, const QLocale &locale); - void initCombo(QComboBox *combo, const QList &allLocales); - void connectCombo(QComboBox *combo); - QList m_combos; - - void readConfig(); - void writeConfig(); - void writeExports(); - - void updateExample(); - void updateEnabled(); - - Ui::LocaleConfig *m_ui; - bool hasChanged; - LXQt::Settings *mSettings; - LXQt::Settings *sSettings; -}; - -#endif // LOCALECONFIG_H diff --git a/lxqt-config-locale/localeconfig.ui b/lxqt-config-locale/localeconfig.ui deleted file mode 100644 index f7aecc3..0000000 --- a/lxqt-config-locale/localeconfig.ui +++ /dev/null @@ -1,385 +0,0 @@ - - - Sebastian Kuegler - LocaleConfig - - - - 0 - 0 - 600 - 450 - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 16 - - - - - - - - - - QFormLayout::ExpandingFieldsGrow - - - 6 - - - 6 - - - - - Re&gion: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - comboGlobal - - - - - - - - 0 - 0 - - - - - 300 - 0 - - - - - - - - De&tailed Settings - - - - - - - &Numbers: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - comboNumbers - - - - - - - - 0 - 0 - - - - - 300 - 0 - - - - - - - - &Time: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - comboTime - - - - - - - - 0 - 0 - - - - - 300 - 0 - - - - - - - - Currenc&y: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - comboCurrency - - - - - - - - 0 - 0 - - - - - 300 - 0 - - - - - - - - Measurement &Units: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - comboMeasurement - - - - - - - - 0 - 0 - - - - - 300 - 0 - - - - - - - - Co&llation and Sorting: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - comboCollate - - - - - - - - 0 - 0 - - - - - 300 - 0 - - - - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - <b>Examples</b> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Numbers: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - Time: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - Currency: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - Measurement Units: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 16 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 16 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 32 - - - - - - - - - - - - - - - - diff --git a/lxqt-config-locale/lxqt-config-locale.desktop.in b/lxqt-config-locale/lxqt-config-locale.desktop.in deleted file mode 100644 index 46cf666..0000000 --- a/lxqt-config-locale/lxqt-config-locale.desktop.in +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Locale -GenericName=Locale settings -Comment=Locale settings for LXQt -Exec=lxqt-config-locale -Icon=preferences-desktop-locale -Categories=Settings;DesktopSettings;Qt;LXQt; -OnlyShowIn=LXQt; - -#TRANSLATIONS_DIR=translations diff --git a/lxqt-config-locale/main.cpp b/lxqt-config-locale/main.cpp deleted file mode 100644 index 28dbc65..0000000 --- a/lxqt-config-locale/main.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)GPL2+ - * - * - * Copyright: 2014 LXQt team - * - * Authors: - * Julien Lavergne - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include - -#include -#include -#include -#include "localeconfig.h" - -int main (int argc, char **argv) -{ - LXQt::SingleApplication app(argc, argv); - app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); - - QCommandLineParser parser; - parser.setApplicationDescription(QStringLiteral("LXQt Config Locale")); - const QString VERINFO = QStringLiteral(LXQT_CONFIG_VERSION - "\nliblxqt " LXQT_VERSION - "\nQt " QT_VERSION_STR); - app.setApplicationVersion(VERINFO); - parser.addVersionOption(); - parser.addHelpOption(); - parser.process(app); - - LXQt::Settings settings("lxqt-config-locale"); - LXQt::Settings session_settings("session"); - LXQt::ConfigDialog* dialog = new LXQt::ConfigDialog(QObject::tr("LXQt Locale Configuration"), &settings); - - app.setActivationWindow(dialog); - - LocaleConfig* localePage = new LocaleConfig(&settings, &session_settings, dialog); - dialog->addPage(localePage, QObject::tr("Locale Settings"), QStringList() << "preferences-desktop-locale" << "preferences-desktop"); - QObject::connect(dialog, SIGNAL(reset()), localePage, SLOT(initControls())); - QObject::connect(dialog, SIGNAL(save()), localePage, SLOT(saveSettings())); - - dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->setWindowIcon(QIcon::fromTheme("preferences-desktop-locale")); - dialog->show(); - - return app.exec(); -} diff --git a/lxqt-config-locale/translations/lxqt-config-locale_ar.desktop b/lxqt-config-locale/translations/lxqt-config-locale_ar.desktop deleted file mode 100644 index 812d306..0000000 --- a/lxqt-config-locale/translations/lxqt-config-locale_ar.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[ar]=المحليّة -GenericName[ar]=إعدادات المحليّة -Comment[ar]=إعدادات المحليّة للكسكيوت diff --git a/lxqt-config-locale/translations/lxqt-config-locale_ca.desktop b/lxqt-config-locale/translations/lxqt-config-locale_ca.desktop deleted file mode 100644 index 1487277..0000000 --- a/lxqt-config-locale/translations/lxqt-config-locale_ca.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[ca]=Configuració regional -GenericName[ca]=Ajusts de la configuració regional -Comment[ca]=Ajusts de la configuració regional per a LXQt diff --git a/lxqt-config-locale/translations/lxqt-config-locale_da.desktop b/lxqt-config-locale/translations/lxqt-config-locale_da.desktop deleted file mode 100644 index c585032..0000000 --- a/lxqt-config-locale/translations/lxqt-config-locale_da.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[da]=Sprog -GenericName[da]=Sprogindstillinger -Comment[da]=Sprogindstillinger for LXQt diff --git a/lxqt-config-locale/translations/lxqt-config-locale_de.desktop b/lxqt-config-locale/translations/lxqt-config-locale_de.desktop deleted file mode 100644 index f286c87..0000000 --- a/lxqt-config-locale/translations/lxqt-config-locale_de.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[de]=Regionaleinstellungen -GenericName[de]=Regionaleinstellungen -Comment[de]=Regionaleinstellungen für LXQt diff --git a/lxqt-config-locale/translations/lxqt-config-locale_fr.desktop b/lxqt-config-locale/translations/lxqt-config-locale_fr.desktop deleted file mode 100644 index 250d44c..0000000 --- a/lxqt-config-locale/translations/lxqt-config-locale_fr.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[fr]=Région -GenericName[fr]=Paramètres de la région -Comment[fr]=Paramètres de la région pour LXQt diff --git a/lxqt-config-locale/translations/lxqt-config-locale_it.desktop b/lxqt-config-locale/translations/lxqt-config-locale_it.desktop deleted file mode 100644 index 28e8bb0..0000000 --- a/lxqt-config-locale/translations/lxqt-config-locale_it.desktop +++ /dev/null @@ -1,2 +0,0 @@ -Name[it]=Lingua e Paese -Comment[it]=Preferenze della lingua e del paese diff --git a/lxqt-config-locale/translations/lxqt-config-locale_lt.desktop b/lxqt-config-locale/translations/lxqt-config-locale_lt.desktop deleted file mode 100644 index 799f1de..0000000 --- a/lxqt-config-locale/translations/lxqt-config-locale_lt.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[lt]=Lokalė -GenericName[lt]=Lokalės nustatymai -Comment[lt]=LXQt lokalės nustatymai diff --git a/lxqt-config-locale/translations/lxqt-config-locale_pl.desktop b/lxqt-config-locale/translations/lxqt-config-locale_pl.desktop deleted file mode 100644 index a9061fb..0000000 --- a/lxqt-config-locale/translations/lxqt-config-locale_pl.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[pl]=Region i język -GenericName[pl]=Ustawienia regionalne -Comment[pl]=Zmień region i język LXQt diff --git a/lxqt-config-locale/translations/lxqt-config-locale_ru.desktop b/lxqt-config-locale/translations/lxqt-config-locale_ru.desktop deleted file mode 100644 index a8706bc..0000000 --- a/lxqt-config-locale/translations/lxqt-config-locale_ru.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[ru]=Локаль -GenericName[ru]=Настройки локали -Comment[ru]=Настройки локали для LXQt diff --git a/lxqt-config-monitor/CMakeLists.txt b/lxqt-config-monitor/CMakeLists.txt deleted file mode 100644 index c4e5e84..0000000 --- a/lxqt-config-monitor/CMakeLists.txt +++ /dev/null @@ -1,92 +0,0 @@ -project(lxqt-config-monitor) - -find_package(KF5Screen REQUIRED) -find_package(Qt5Svg REQUIRED) - -set(HEADERS - monitorsettingsdialog.h - monitor.h - monitorwidget.h - monitorpicture.h - loadsettings.h - settingsdialog.h - managesavedsettings.h - fastmenu.h -) - -set(SOURCES - main.cpp - monitorsettingsdialog.cpp - monitor.cpp - monitorwidget.cpp - timeoutdialog.cpp - monitorpicture.cpp - loadsettings.cpp - settingsdialog.cpp - managesavedsettings.cpp - fastmenu.cpp -) - -set(UIS - monitorsettingsdialog.ui - monitorwidget.ui - timeoutdialog.ui - monitorpicture.ui - managesavedsettings.ui - fastmenu.ui -) - -set(ICONS - icons/monitor.svg -) - -# Config file -configure_file(resources/configure.in configure.h) - -# Translations ********************************** -lxqt_translate_ts(QM_FILES - UPDATE_TRANSLATIONS - ${UPDATE_TRANSLATIONS} - SOURCES - ${HEADERS} - ${SOURCES} - ${UIS} - INSTALL_DIR - "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}" - PULL_TRANSLATIONS - ${PULL_TRANSLATIONS} - CLEAN_TRANSLATIONS - ${CLEAN_TRANSLATIONS} - TRANSLATIONS_REPO - ${TRANSLATIONS_REPO} - TRANSLATIONS_REFSPEC - ${TRANSLATIONS_REFSPEC} - REPO_SUBDIR - "lxqt-config/${PROJECT_NAME}" -) - -lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME}) -lxqt_translate_desktop(DESKTOP_FILES SOURCES "resources/${PROJECT_NAME}.desktop.in") - -#************************************************ - -add_executable(${PROJECT_NAME} - ${SOURCES} - ${RESOURCES} - ${QRC_SOURCES} - ${DESKTOP_FILES} - ${QM_FILES} - ${QM_LOADER} -) - -target_link_libraries(${PROJECT_NAME} - Qt5::Widgets - Qt5::X11Extras - Qt5::Svg - KF5::Screen - lxqt -) - -install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) -install(FILES ${DESKTOP_FILES} DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/applications") -install(FILES ${ICONS} DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/lxqt/icons") diff --git a/lxqt-config-monitor/LICENSE b/lxqt-config-monitor/LICENSE deleted file mode 100644 index d7f1051..0000000 --- a/lxqt-config-monitor/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ -GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/lxqt-config-monitor/README.md b/lxqt-config-monitor/README.md deleted file mode 100644 index 7574bf9..0000000 --- a/lxqt-config-monitor/README.md +++ /dev/null @@ -1,4 +0,0 @@ -lxqt-config-monitor -=================== - -This tool lets you change monitor settings. It was based on lxrandr-qt but now uses libkscreen. diff --git a/lxqt-config-monitor/fakeTest.sh b/lxqt-config-monitor/fakeTest.sh deleted file mode 100644 index 6aa23c8..0000000 --- a/lxqt-config-monitor/fakeTest.sh +++ /dev/null @@ -1,6 +0,0 @@ -export KSCREEN_BACKEND=Fake -export KSCREEN_BACKEND_ARGS=TEST_DATA=/home/lucas/prog/lxqt/libkscreen/autotests/configs/multipleoutput.json -killall kscreen_backend_launcher -#`find /usr -name 'kscreen_backend_launcher'` -lxqt-config-monitor - diff --git a/lxqt-config-monitor/fastmenu.cpp b/lxqt-config-monitor/fastmenu.cpp deleted file mode 100644 index 1f124e1..0000000 --- a/lxqt-config-monitor/fastmenu.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - Copyright (C) 2016 P.L. Lucas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include "fastmenu.h" -#include "timeoutdialog.h" - -#include -#include -#include -#include -#include - -enum Options -{ - None=0, Extended=1, Unified=2, OnlyFirst=3, OnlySecond=4 -}; - -FastMenu::FastMenu(KScreen::ConfigPtr config, QWidget* parent) : - QGroupBox(parent) -{ - this->mConfig = config; - this->mOldConfig = mConfig->clone(); - - ui.setupUi(this); - - connect(ui.comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onSeleccionChanged(int))); -} - -FastMenu::~FastMenu() -{ -} - -void FastMenu::extended() -{ - int width = 0; - KScreen::OutputList outputs = mConfig->outputs(); - for (const KScreen::OutputPtr &output : outputs) - { - if( !output->isConnected() ) - continue; - QPoint pos = output->pos(); - pos.setX(width); - pos.setY(0); - output->setPos(pos); - output->setEnabled(true); - //first left one as primary - output->setPrimary(width == 0); - KScreen::ModePtr mode(output->currentMode()); - if (!mode) - { // set first mode - mode = output->modes().first(); - if (mode) - { - output->setCurrentModeId(mode->id()); - } - } - if (mode) { - width += mode->size().width(); - } - } -} - -static bool sizeBiggerThan(const QSize &sizeA, const QSize &sizeB) -{ - return sizeA.width() * sizeA.height() > sizeB.width() * sizeB.height(); -} - -void FastMenu::unified() -{ - KScreen::OutputList outputs = mConfig->outputs(); - // Look for common size - QList commonSizes; - for (const KScreen::OutputPtr &output : outputs) - { - if( !output->isConnected() ) - continue; - for(const KScreen::ModePtr &mode: output->modes()) - { - commonSizes.append(mode->size()); - } - break; - } - for (const KScreen::OutputPtr &output : outputs) - { - if( !output->isConnected() ) - continue; - QList sizes; - for(const KScreen::ModePtr &mode: output->modes()) - { - if( commonSizes.contains(mode->size()) ) - sizes.append(mode->size()); - } - commonSizes = sizes; - } - // Select the bigest common size - qSort(commonSizes.begin(), commonSizes.end(), sizeBiggerThan); - if(commonSizes.isEmpty()) - return; - QSize commonSize = commonSizes[0]; - // Put all monitors in (0,0) position and set size - for (const KScreen::OutputPtr &output : outputs) - { - if( !output->isConnected() ) - continue; - QPoint pos = output->pos(); - pos.setX(0); - pos.setY(0); - output->setPos(pos); - output->setEnabled(true); - // Select mode with the biggest refresh rate - float maxRefreshRate = 0.0; - for(const KScreen::ModePtr &mode: output->modes()) - { - if(mode->size() == commonSize && maxRefreshRate < mode->refreshRate()) - { - output->setCurrentModeId(mode->id()); - maxRefreshRate = mode->refreshRate(); - } - } - } -} - -void FastMenu::onlyFirst() -{ - bool foundOk = false; - KScreen::OutputList outputs = mConfig->outputs(); - for (const KScreen::OutputPtr &output : outputs) - { - if( !output->isConnected() ) - continue; - QPoint pos = output->pos(); - pos.setX(0); - pos.setY(0); - output->setPos(pos); - output->setEnabled(!foundOk); - foundOk = true; - } -} - -void FastMenu::onlySecond() -{ - bool foundOk = true; - KScreen::OutputList outputs = mConfig->outputs(); - for (const KScreen::OutputPtr &output : outputs) - { - if( !output->isConnected() ) - continue; - QPoint pos = output->pos(); - pos.setX(0); - pos.setY(0); - output->setPos(pos); - output->setEnabled(!foundOk); - foundOk = false; - } -} - -void FastMenu::onSeleccionChanged(int index) -{ - switch((Options) index) - { - case Extended: - extended(); - break; - case Unified: - unified(); - break; - case OnlyFirst: - onlyFirst(); - break; - case OnlySecond: - onlySecond(); - break; - case None: - return; - break; - }; - - if (mConfig && KScreen::Config::canBeApplied(mConfig)) - { - KScreen::SetConfigOperation(mConfig).exec(); - - TimeoutDialog mTimeoutDialog; - if (mTimeoutDialog.exec() == QDialog::Rejected) - KScreen::SetConfigOperation(mOldConfig).exec(); - else - mOldConfig = mConfig->clone(); - } -} diff --git a/lxqt-config-monitor/fastmenu.h b/lxqt-config-monitor/fastmenu.h deleted file mode 100644 index f83a94f..0000000 --- a/lxqt-config-monitor/fastmenu.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2016 P.L. Lucas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#ifndef _FASTMENU_H_ -#define _FASTMENU_H_ - -#include "ui_fastmenu.h" - -#include -#include -#include -#include -#include - - - -class FastMenu : public QGroupBox -{ - Q_OBJECT - - -public: - FastMenu(KScreen::ConfigPtr config, QWidget* parent = 0); - ~FastMenu(); - -private Q_SLOTS: - void onSeleccionChanged(int index); - -private: - Ui::FastMenu ui; - KScreen::ConfigPtr mConfig; - KScreen::ConfigPtr mOldConfig; - - void extended(); - void unified(); - void onlyFirst(); - void onlySecond(); -}; - -#endif // _FASTMENU_H_ diff --git a/lxqt-config-monitor/fastmenu.ui b/lxqt-config-monitor/fastmenu.ui deleted file mode 100644 index b2bcc54..0000000 --- a/lxqt-config-monitor/fastmenu.ui +++ /dev/null @@ -1,80 +0,0 @@ - - - FastMenu - - - - 0 - 0 - 298 - 164 - - - - Form - - - - - - Fast options - - - false - - - - - - - 20 - - - - - - - - - - ❶ ❷ Extended view - - - - - ❶ ❶ Unified view - - - - - ❶ Only first - - - - - ❷ Only second - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - diff --git a/lxqt-config-monitor/icons/monitor.svg b/lxqt-config-monitor/icons/monitor.svg deleted file mode 100644 index 102ec12..0000000 --- a/lxqt-config-monitor/icons/monitor.svg +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xmlOpenclipartmonitoring2011-02-16T19:15:54Iconos para monitoreo de proyectoshttps://openclipart.org/detail/119695/monitoring-by-jabernaljabernalbúsquedamonitoreomonitoringprojectproyectosearch - - image/svg+xml - - - - - - - - - - - - - diff --git a/lxqt-config-monitor/loadsettings.cpp b/lxqt-config-monitor/loadsettings.cpp deleted file mode 100644 index 19dbc7b..0000000 --- a/lxqt-config-monitor/loadsettings.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - Copyright (C) 2015 P.L. Lucas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - - - - -#include "loadsettings.h" -#include -#include -#include -#include -#include -#include -#include - - -LoadSettings::LoadSettings(QObject *parent):QObject(parent) -{ - KScreen::GetConfigOperation *operation = new KScreen::GetConfigOperation(); - connect(operation, &KScreen::GetConfigOperation::finished, [this, operation] (KScreen::ConfigOperation *op) { - KScreen::GetConfigOperation *configOp = qobject_cast(op); - if (configOp) - { - loadConfiguration(configOp->config()); - operation->deleteLater(); - } - }); -} - -void LoadSettings::loadConfiguration(KScreen::ConfigPtr config) -{ - LXQt::Settings settings("lxqt-config-monitor"); - QList monitors; - settings.beginGroup("currentConfig"); - loadMonitorSettings(settings, monitors); - settings.endGroup(); - - applySettings(config, monitors); -} - - -void applySettings(KScreen::ConfigPtr config, QList monitors) -{ - KScreen::OutputList outputs = config->outputs(); - for (const KScreen::OutputPtr &output : outputs) - { - qDebug() << "Output: " << output->name(); - for(int i=0;iname() ) - { - KScreen::Edid* edid = output->edid(); - if (edid && edid->isValid()) - if( monitor.hash != edid->hash() ) - { - qDebug() << "Hash: " << monitor.hash << "==" << edid->hash(); - return QCoreApplication::instance()->exit(1); // Saved settings are from other monitor - } - if( monitor.connected != output->isConnected() ) - return QCoreApplication::instance()->exit(2); // Saved settings are from other monitor - if( !output->isConnected() ) - continue; - output->setEnabled( monitor.enabled ); - output->setPrimary( monitor.primary ); - output->setPos( QPoint(monitor.xPos, monitor.yPos) ); - output->setRotation( (KScreen::Output::Rotation)(monitor.rotation) ); - // output->setCurrentModeId could fail. KScreen sometimes changes mode Id. - KScreen::ModeList modeList = output->modes(); - foreach(const KScreen::ModePtr &mode, modeList) - { - if( mode->id() == QString(monitor.currentMode) - || - ( - mode->size().width() == monitor.currentModeWidth - && - mode->size().height() == monitor.currentModeHeight - && - mode->refreshRate() == monitor.currentModeRate - ) - ) - { - output->setCurrentModeId( mode->id() ); - break; - } - } - - } - } - } - - if (KScreen::Config::canBeApplied(config)) - KScreen::SetConfigOperation(config).exec(); - - QCoreApplication::instance()->exit(0); -} - diff --git a/lxqt-config-monitor/loadsettings.h b/lxqt-config-monitor/loadsettings.h deleted file mode 100644 index 9af3c95..0000000 --- a/lxqt-config-monitor/loadsettings.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2015 P.L. Lucas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#ifndef __LOADSETTINGS_H__ -#define __LOADSETTINGS_H__ - - -#include -#include -#include "monitor.h" - -class LoadSettings : public QObject -{ - Q_OBJECT - -public: - LoadSettings(QObject *parent = 0); - -private Q_SLOTS: - void loadConfiguration(KScreen::ConfigPtr config); - -private: - - // Configutarions - KScreen::ConfigPtr mConfig; -}; - -/*! Apply settings. - */ -void applySettings(KScreen::ConfigPtr config, QList monitors); - - -#endif // __LOADSETTINGS_H__ diff --git a/lxqt-config-monitor/main.cpp b/lxqt-config-monitor/main.cpp deleted file mode 100644 index 316b1d0..0000000 --- a/lxqt-config-monitor/main.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - Copyright (C) 2014 P.L. Lucas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include "monitorsettingsdialog.h" -#include -#include "loadsettings.h" - -static bool loadSettingsOk(int argc, char** argv) -{ - for(int i=0; i - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - - -#include "managesavedsettings.h" -#include "loadsettings.h" -#include "configure.h" -#include "monitor.h" -#include -#include -#include - -Q_DECLARE_METATYPE(MonitorSavedSettings) - - -ManageSavedSettings::ManageSavedSettings(LXQt::Settings * applicationSettings, KScreen::ConfigPtr config, QWidget * parent): -QDialog(parent) -{ - - this->applicationSettings = applicationSettings; - this->config = config; - - ui.setupUi(this); - - connect(ui.allConfigs, SIGNAL(itemActivated(QListWidgetItem *)), SLOT(showSelectedConfig(QListWidgetItem *))); - connect(ui.deletePushButton, SIGNAL(clicked()), SLOT(onDeleteItem())); - connect(ui.renamePushButton, SIGNAL(clicked()), SLOT(onRenameItem())); - connect(ui.applyPushButton, SIGNAL(clicked()), SLOT(onApplyItem())); - - loadSettings(); -} - - -void ManageSavedSettings::showSelectedConfig(QListWidgetItem * item) -{ - MonitorSavedSettings o = item->data(Qt::UserRole).value(); - QString text; - for(int i=0; i < o.monitors.size(); i++) - { - MonitorSettings setting = o.monitors[i]; - if(! setting.connected ) - continue; - text += QString("%1:
").arg(setting.name); - text += QString(" Mode: %1x%2
").arg(setting.currentModeWidth).arg(setting.currentModeHeight); - text += QString(" Rate: %1 Hz
").arg(setting.currentModeRate); - switch(setting.rotation) - { - case KScreen::Output::Rotation::None: - text += QString(" Rotation: %1
").arg(tr("None")); - break; - case KScreen::Output::Rotation::Left: - text += QString(" Rotation: %1
").arg(tr("Left")); - break; - case KScreen::Output::Rotation::Inverted: - text += QString(" Rotation: %1
").arg(tr("Inverted")); - break; - case KScreen::Output::Rotation::Right: - text += QString(" Rotation: %1
").arg(tr("Right")); - break; - } - text += QString(" Position: %1x%2
").arg(setting.xPos).arg(setting.yPos); - text += QString(" Primary: %1
").arg(setting.primary?tr("True"):tr("False")); - text += QString(" Enabled: %1
").arg(setting.enabled?tr("True"):tr("False")); - } - text += "
"; - ui.selectedSettingsTextEdit->setText(text); - ui.applyPushButton->setEnabled(isHardwareCompatible(o)); -} - - -bool ManageSavedSettings::isHardwareCompatible(MonitorSavedSettings &settings) -{ - KScreen::OutputList outputs = config->outputs(); - for (const KScreen::OutputPtr &output : outputs) - { - bool ok = false; - for (int i=0; i < settings.monitors.size(); i++) - { - MonitorSettings o = settings.monitors[i]; - if(o.name != output->name()) - continue; - KScreen::Edid *edid = output->edid(); - if(edid && edid->isValid()) - if(o.hash != output->edid()->hash()) - return false; - ok = true; - break; - } - if(!ok) - return false; - } - return true; -} - -void ManageSavedSettings::onDeleteItem() -{ - if (ui.allConfigs->currentItem() == NULL) - return; - MonitorSavedSettings obj = ui.allConfigs->currentItem()->data(Qt::UserRole).value(); - - LXQt::Settings settings("lxqt-config-monitor"); - QList monitors; - settings.beginGroup("SavedConfigs"); - loadMonitorSettings(settings, monitors); - for (int i = 0; i < monitors.size(); i++) { - MonitorSavedSettings o = monitors[i]; - if (o == obj) { - monitors.removeAt(i); - break; - } - } - saveMonitorSettings(settings, monitors); - - settings.endGroup(); - - loadSettings(); -} - -void ManageSavedSettings::onRenameItem() -{ - if (ui.allConfigs->currentItem() == NULL) - return; - MonitorSavedSettings obj = ui.allConfigs->currentItem()->data(Qt::UserRole).value(); - bool ok; - QString configName = QInputDialog::getText(this, tr("Name"), tr("Name:"), - QLineEdit::Normal, - obj.name, &ok); - if (!ok || configName.isEmpty()) - return; - - LXQt::Settings settings("lxqt-config-monitor"); - QList monitors; - settings.beginGroup("SavedConfigs"); - loadMonitorSettings(settings, monitors); - for (int i = 0; i < monitors.size(); i++) { - MonitorSavedSettings o = monitors[i]; - if (o == obj) { - monitors.removeAt(i); - obj.name = configName; - monitors.append(obj); - break; - } - } - saveMonitorSettings(settings, monitors); - - settings.endGroup(); - - loadSettings(); -} - -void ManageSavedSettings::onApplyItem() -{ - if (ui.allConfigs->currentItem() == NULL) - return; - MonitorSavedSettings settings = ui.allConfigs->currentItem()->data(Qt::UserRole).value(); - applySettings(config, settings.monitors); -} - - - -void ManageSavedSettings::loadSettings() -{ - ui.allConfigs->clear(); - //ui.hardwareCompatibleConfigs->clear(); - LXQt::Settings settings("lxqt-config-monitor"); - QList monitors; - settings.beginGroup("SavedConfigs"); - loadMonitorSettings(settings, monitors); - settings.endGroup(); - foreach(MonitorSavedSettings o, monitors) { - QListWidgetItem *item = new QListWidgetItem(o.name+" - "+o.date, ui.allConfigs); - QVariant var; - var.setValue(o); - item->setData(Qt::UserRole, var); - if (isHardwareCompatible(o)) { - QFont font = ui.allConfigs->font(); - font.setBold(true); - item->setData(Qt::FontRole, font); - } - } -} diff --git a/lxqt-config-monitor/managesavedsettings.h b/lxqt-config-monitor/managesavedsettings.h deleted file mode 100644 index 4cbb305..0000000 --- a/lxqt-config-monitor/managesavedsettings.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (C) 2015 P.L. Lucas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - - -#ifndef _SAVESETTINGS_H_ -#define _SAVESETTINGS_H_ - -#include "ui_managesavedsettings.h" -#include "monitor.h" -#include -#include -#include -#include - -class ManageSavedSettings : public QDialog { - Q_OBJECT - -public: - ManageSavedSettings(LXQt::Settings *applicationSettings, KScreen::ConfigPtr config, QWidget* parent = 0); - - Ui::ManageSavedSettings ui; - -public slots: - /*! Load settings to QListWidgets. - edids is hardware code to detect hardware compatible settings. - */ - void loadSettings(); - - void showSelectedConfig(QListWidgetItem * item); - - void onDeleteItem(); - - void onRenameItem(); - - void onApplyItem(); - -private: - LXQt::Settings *applicationSettings; - KScreen::ConfigPtr config; - bool isHardwareCompatible(MonitorSavedSettings &settings); - -}; - -#endif // _SAVESETTINGS_H_ diff --git a/lxqt-config-monitor/managesavedsettings.ui b/lxqt-config-monitor/managesavedsettings.ui deleted file mode 100644 index 55357e6..0000000 --- a/lxqt-config-monitor/managesavedsettings.ui +++ /dev/null @@ -1,74 +0,0 @@ - - - ManageSavedSettings - - - - 0 - 0 - 521 - 312 - - - - Monitor Settings - - - - - - - - - - - - - Saved settings - - - - - - - - - - - Rename - - - - - - - Delete - - - - - - - Apply - - - - - - - - - true - - - - - - - - - - - - - diff --git a/lxqt-config-monitor/monitor.cpp b/lxqt-config-monitor/monitor.cpp deleted file mode 100644 index 1afa4a3..0000000 --- a/lxqt-config-monitor/monitor.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - Copyright (C) 2014 P.L. Lucas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include "monitor.h" - -bool MonitorSavedSettings::operator==(const MonitorSavedSettings &obj) -{ - if(name != obj.name) - return false; - if(date != obj.date) - return false; - // TODO: Check QList monitors. - return true; -} - -void saveMonitorSettings(QSettings & settings, QList monitors) -{ - settings.remove("settings"); - settings.beginWriteArray("settings"); - int i = 0; - Q_FOREACH(MonitorSettings monitor, monitors) - { - settings.setArrayIndex(i++); - saveMonitorSettings(settings, monitor); - } - settings.endArray(); -} - -void saveMonitorSettings(QSettings &settings, MonitorSettings &monitor) -{ - settings.setValue("name", monitor.name); - settings.setValue("hash", monitor.hash); - settings.setValue("connected", monitor.connected); - if(monitor.connected) - { - settings.setValue("enabled", monitor.enabled); - settings.setValue("primary", monitor.primary); - settings.setValue("xPos", monitor.xPos); - settings.setValue("yPos", monitor.yPos); - settings.setValue("currentMode", monitor.currentMode); - settings.setValue("currentModeWidth", monitor.currentModeWidth); - settings.setValue("currentModeHeight", monitor.currentModeHeight); - settings.setValue("currentModeRate", monitor.currentModeRate); - settings.setValue("rotation", monitor.rotation); - } -} - -void loadMonitorSettings(QSettings & settings, QList &monitors) -{ - int size = settings.beginReadArray("settings"); - for(int i=0; i monitors) -{ - settings.remove("SavedSettings"); - settings.beginWriteArray("SavedSettings"); - int i = 0; - Q_FOREACH(MonitorSavedSettings monitor, monitors) - { - settings.setArrayIndex(i++); - saveMonitorSettings(settings, monitor); - } - settings.endArray(); -} - -void saveMonitorSettings(QSettings &settings, MonitorSavedSettings &monitor) -{ - settings.setValue("name", monitor.name); - settings.setValue("date", monitor.date); - saveMonitorSettings(settings, monitor.monitors); -} - -void loadMonitorSettings(QSettings & settings, QList &monitors) -{ - int size = settings.beginReadArray("SavedSettings"); - for(int i=0; i - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#ifndef _MONITOR_H_ -#define _MONITOR_H_ - -#include -#include -#include - -//Settings to be stored or read from settings file. -struct MonitorSettings { - QString name; - QString hash; - bool connected; - bool enabled; - bool primary; - QString currentMode; - int currentModeWidth; - int currentModeHeight; - float currentModeRate; - int xPos; - int yPos; - int rotation; -}; - -struct MonitorSavedSettings { - QString name; - QString date; - QList monitors; - - bool operator==(const MonitorSavedSettings &obj); -}; - -/**This function saves a list of MonitorSettings in QSettings file. - * Before using this function, QSettings group must be opened. - */ -void saveMonitorSettings(QSettings &settings, QList monitors); -void saveMonitorSettings(QSettings &settings, MonitorSettings &monitor); - -/**This function loads a list of MonitorSettings from QSettings file. - * Before using this function, QSettings group must be opened. - */ -void loadMonitorSettings(QSettings &settings, QList &monitors); -void loadMonitorSettings(QSettings &settings, MonitorSettings &monitor); - -/**This function saves a list of MonitorSavedSettings in QSettings file. - * Before using this function, QSettings group must be opened. - */ -void saveMonitorSettings(QSettings &settings, QList monitors); -void saveMonitorSettings(QSettings &settings, MonitorSavedSettings &monitor); - -/**This function loads a list of MonitorSavedSettings in QSettings file. - * Before using this function, QSettings group must be opened. - */ -void loadMonitorSettings(QSettings &settings, QList &monitors); -void loadMonitorSettings(QSettings &settings, MonitorSavedSettings &monitor); - -#endif // _MONITOR_H_ diff --git a/lxqt-config-monitor/monitorpicture.cpp b/lxqt-config-monitor/monitorpicture.cpp deleted file mode 100644 index 05a8efb..0000000 --- a/lxqt-config-monitor/monitorpicture.cpp +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Copyright (C) 2014 P.L. Lucas - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "monitorpicture.h" - -#include -#include -#include -#include -#include -#include - -#include "configure.h" - -// Gets size from string rate. String rate format is "widthxheight". Example: 800x600 -static QSize sizeFromString(QString str) -{ - int width = 0; - int height = 0; - int x = str.indexOf('x'); - if (x > 0) - { - width = str.leftRef(x).toInt(); - height = str.midRef(x + 1).toInt(); - } - return QSize(width, height); -} - -MonitorPictureProxy::MonitorPictureProxy(QObject *parent, MonitorPicture *monitorPicture):QObject(parent) -{ - this->monitorPicture = monitorPicture; -} - -void MonitorPictureProxy::updateSize() -{ - KScreen::OutputPtr output = monitorPicture->monitorWidget->output; - QSize size = output->currentMode()->size(); - monitorPicture->updateSize(size); -} - -void MonitorPictureProxy::updatePosition() -{ - KScreen::OutputPtr output = monitorPicture->monitorWidget->output; - QPoint pos = output->pos(); - //qDebug() << "MonitorPictureProxy:updatePosition]" << pos; - monitorPicture->setMonitorPosition(pos.x(), pos.y()); -} - -MonitorPictureDialog::MonitorPictureDialog(KScreen::ConfigPtr config, QWidget * parent, Qt::WindowFlags f) : - QDialog(parent,f) -{ - updatingOk = false; - firstShownOk = false; - maxMonitorSize = 0; - mConfig = config; - ui.setupUi(this); -} - - -void MonitorPictureDialog::setScene(QList monitors) -{ - int monitorsWidth =0; - int monitorsHeight = 0; - QGraphicsScene *scene = new QGraphicsScene(); - for (MonitorWidget *monitor : monitors) - { - MonitorPicture *monitorPicture = new MonitorPicture(nullptr, monitor, this); - pictures.append(monitorPicture); - scene->addItem(monitorPicture); - monitorsWidth += monitorPicture->rect().width(); - monitorsHeight += monitorPicture->rect().height(); - MonitorPictureProxy *proxy = new MonitorPictureProxy(this, monitorPicture); - proxy->connect(monitor->output.data(), SIGNAL(currentModeIdChanged()), SLOT(updateSize())); - proxy->connect(monitor->output.data(), SIGNAL(posChanged()), SLOT(updatePosition())); - } - // The blue rectangle is maximum size of virtual screen (framebuffer) - scene->addRect(0, 0, mConfig->screen()->maxSize().width(), mConfig->screen()->maxSize().height(), QPen(Qt::blue, 20))->setOpacity(0.5); - maxMonitorSize = qMax(monitorsWidth, monitorsHeight); - ui.graphicsView->setScene(scene); -} - -void MonitorPictureDialog::showEvent(QShowEvent * event) -{ - QWidget::showEvent(event); - if( ! firstShownOk ) - { - // Update scale and set scrollbar position. - // Real widget size is not set, until widget is shown. - firstShownOk = true; - int minWidgetLength = qMin(ui.graphicsView->size().width(), ui.graphicsView->size().width()) / 1.5; - qDebug() << "minWidgetLength" << minWidgetLength << "maxMonitorSize" << maxMonitorSize << "scale" << minWidgetLength / (float) maxMonitorSize; - ui.graphicsView->scale(minWidgetLength / (float) maxMonitorSize, minWidgetLength / (float) maxMonitorSize); - updateScene(); - ui.graphicsView->verticalScrollBar()->setValue(0); - ui.graphicsView->horizontalScrollBar()->setValue(0); - } -} - -void MonitorPictureDialog::updateScene() -{ - ui.graphicsView->scene()->update(); -} - -void MonitorPictureDialog::updateMonitorWidgets(QString primaryMonitor) -{ - // This method update spin boxes of position. - // If position is changed when this method is running, position is changed until buffer overflow. - // updatingOk control that this method can not be run twice in the same position change. - - if(updatingOk) - return; - updatingOk = true; - int x0, y0; - x0 = y0 = 0; - - for (MonitorPicture *picture : pictures) - { - if (picture->monitorWidget->output->name() == primaryMonitor - || primaryMonitor == QStringLiteral("")) - { - x0 = picture->originX + picture->pos().x(); - y0 = picture->originY + picture->pos().y(); - break; - } - } - - if( primaryMonitor == QStringLiteral("") ) - { - for(MonitorPicture *picture: pictures) - { - int x1 = picture->originX + picture->pos().x(); - int y1 = picture->originY + picture->pos().y(); - x0 = qMin(x0, x1); - y0 = qMin(y0, y1); - } - } - - for (MonitorPicture *picture : pictures) - { - int x = picture->originX + picture->pos().x() - x0; - int y = picture->originY + picture->pos().y() - y0; - if( x != picture->monitorWidget->ui.xPosSpinBox->value() ) - picture->monitorWidget->ui.xPosSpinBox->setValue(x); - //else - // qDebug() << "x Iguales"; - if( y != picture->monitorWidget->ui.yPosSpinBox->value() ) - picture->monitorWidget->ui.yPosSpinBox->setValue(y); - //else - // qDebug() << "y Iguales"; - //qDebug() << "[MonitorPictureDialog::updateMonitorWidgets]" << x << '=' << picture->monitorWidget->ui.xPosSpinBox->value() << ',' << y << '=' << picture->monitorWidget->ui.yPosSpinBox->value(); - } - updatingOk = false; -} - -MonitorPicture::MonitorPicture(QGraphicsItem * parent, - MonitorWidget *monitorWidget, - MonitorPictureDialog *monitorPictureDialog) : - QGraphicsRectItem(parent) -{ - this->monitorWidget = monitorWidget; - this->monitorPictureDialog = monitorPictureDialog; - QSize currentSize = sizeFromString(monitorWidget->ui.resolutionCombo->currentText()); - if( monitorWidget->output->rotation() == KScreen::Output::Left || monitorWidget->output->rotation() == KScreen::Output::Right ) - currentSize.transpose(); - int x = monitorWidget->ui.xPosSpinBox->value(); - int y = monitorWidget->ui.yPosSpinBox->value(); - setAcceptedMouseButtons(Qt::LeftButton); - setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemSendsGeometryChanges); - originX = x; - originY = y; - - setRect(x, y, currentSize.width(), currentSize.height()); - // setPen(QPen(Qt::black, 20)); - // textItem = new QGraphicsTextItem(monitorWidget->output->name(), this); - // textItem->setX(x); - // textItem->setY(y); - // textItem->setParentItem(this); - - QSvgRenderer *renderer = new QSvgRenderer(QLatin1String(ICON_PATH "monitor.svg")); - svgItem = new QGraphicsSvgItem(); - svgItem->setSharedRenderer(renderer); - svgItem->setX(x); - svgItem->setY(y); - svgItem->setOpacity(0.7); - svgItem->setParentItem(this); - - - textItem = new QGraphicsTextItem(monitorWidget->output->name(), this); - textItem->setDefaultTextColor(Qt::white); - textItem->setX(x); - textItem->setY(y); - textItem->setParentItem(this); - setPen(QPen(Qt::black, 20)); - - - adjustNameSize(); -} - -void MonitorPicture::adjustNameSize() -{ - prepareGeometryChange(); - qreal fontWidth = QFontMetrics(textItem->font()).width(monitorWidget->output->name() + QStringLiteral(" ")); - textItem->setScale((qreal) this->rect().width() / fontWidth); - QTransform transform; - qreal width = qAbs(this->rect().width()/svgItem->boundingRect().width()); - qreal height = qAbs(this->rect().height()/svgItem->boundingRect().height()); - qDebug() << "Width x Height" << width << "x" << height; - transform.scale(width, height); - svgItem->setTransform(transform); -} - -void MonitorPicture::updateSize(QSize currentSize) -{ - QRectF r = rect(); - r.setSize(currentSize); - setRect(r); - adjustNameSize(); -} - -QVariant MonitorPicture::itemChange(GraphicsItemChange change, const QVariant & value) -{ - //qDebug() << "[MonitorPicture::itemChange]: "; - //if ( change == ItemPositionChange && scene()) { - // value is the new position. - //QPointF newPos = value.toPointF(); - //qDebug() << "[MonitorPictureDialog::updateMonitorWidgets]: " << newPos.x() << "x" << newPos.y(); - //} - QVariant v = QGraphicsItem::itemChange(change, value); - //monitorPictureDialog->updateMonitorWidgets(QString()); - return v; -} - -void MonitorPicture::setMonitorPosition(int x, int y) -{ - setX( x - originX ); - setY( y - originY ); -} - -void MonitorPicture::mouseReleaseEvent(QGraphicsSceneMouseEvent * event) -{ - QGraphicsRectItem::mouseReleaseEvent(event); - monitorPictureDialog->moveMonitorPictureToNearest(this); - monitorPictureDialog->updateMonitorWidgets(QString()); -} - -////////////////////////////////////////////////////////////////////////////////// -// Move picture to nearest picture procedure. -// Read magnetic_attraction.html for more info about the algorithm used. -////////////////////////////////////////////////////////////////////////////////// - -struct Parameters { - float t1, t2; - QVector2D cutPoint; -}; - -static Parameters segmentsCut(QVector2D p0, QVector2D p1, QVector2D s0, QVector2D s1) -{ - Parameters result; - QVector2D v0 = p1 - p0; - QVector2D v1 = s1 - s0; - QVector2D P = s0 - p0; - - float det = v0.y() * v1.x() - v0.x() * v1.y(); - if (det == 0.0) - result.t1 = result.t2 = -1.0; - - result.t1 = 1 / det * (-v1.y() * P.x() + v1.x() * P.y()); - result.t2 = 1 / det * (-v0.y() * P.x() + v0.x() * P.y()); - result.cutPoint = v0 * result.t1 + p0; - return result; -} - -static QVector2D computeCenter(MonitorPicture* monitorPicture) -{ - float x0 = monitorPicture->x() + monitorPicture->originX; - float y0 = monitorPicture->y() + monitorPicture->originY; - float x1 = x0 + monitorPicture->rect().width(); - float y1 = y0 + monitorPicture->rect().height(); - QVector2D p0(x0, y0); - QVector2D p1(x1, y1); - QVector2D center = p0 + (p1 - p0) * 0.5; - return center; -} - -struct Result_moveMonitorPictureToNearest -{ - bool ok; - QVector2D vector; -}; - -static Result_moveMonitorPictureToNearest compareTwoMonitors(MonitorPicture* monitorPicture1, - MonitorPicture* monitorPicture2) -{ - Result_moveMonitorPictureToNearest result; - QVector2D center1 = computeCenter(monitorPicture1); - QVector2D center2 = computeCenter(monitorPicture2); - float x0 = monitorPicture2->x() + monitorPicture2->originX; - float y0 = monitorPicture2->y() + monitorPicture2->originY; - float x1 = x0 + monitorPicture2->rect().width(); - float y1 = y0 + monitorPicture2->rect().height(); - - QVector2D p0(x0, y0); - QVector2D p1(x1, y1); - QVector2D P1, P2; - float t1 = -1.0, t2 = -1.0; - - Parameters params = segmentsCut(center1, center2, QVector2D(x0, y0), QVector2D(x1, y0)); - if (params.t1 >= 0.0 && params.t1 <= 1.0 && params.t2 >= 0.0 && params.t2 <= 1.0 && t1 < 0) - { - t1 = params.t1; - P1 = params.cutPoint; - } - - params = segmentsCut(center1, center2, QVector2D(x0, y0), QVector2D(x0, y1)); - if (params.t1 >= 0.0 && params.t1 <= 1.0 && params.t2 >= 0.0 && params.t2 <= 1.0 && t1 < 0) - { - t1 = params.t1; - P1 = params.cutPoint; - } - - params = segmentsCut(center1, center2, QVector2D(x1, y1), QVector2D(x1, y0)); - if (params.t1 >= 0.0 && params.t1 <= 1.0 && params.t2 >= 0.0 && params.t2 <= 1.0 && t1 < 0) - { - t1 = params.t1; - P1 = params.cutPoint; - } - - params = segmentsCut(center1, center2, QVector2D(x1, y1), QVector2D(x0, y1)); - if (params.t1 >= 0.0 && params.t1 <= 1.0 && params.t2 >= 0.0 && params.t2 <= 1.0 && t1 < 0) - { - t1 = params.t1; - P1 = params.cutPoint; - } - - x0 = monitorPicture1->x() + monitorPicture1->originX; - y0 = monitorPicture1->y() + monitorPicture1->originY; - x1 = x0 + monitorPicture1->rect().width(); - y1 = y0 + monitorPicture1->rect().height(); - p0 = QVector2D(x0, y0); - p1 = QVector2D(x1, y1); - - params = segmentsCut(center1, center2, QVector2D(x0, y0), QVector2D(x1, y0)); - if (params.t1 >= 0.0 && params.t1 <= 1.0 && params.t2 >= 0.0 && params.t2 <= 1.0 && t2 < 0) - { - t2 = params.t1; - P2 = params.cutPoint; - } - - params = segmentsCut(center1, center2, QVector2D(x0, y0), QVector2D(x0, y1)); - if (params.t1 >= 0.0 && params.t1 <= 1.0 && params.t2 >= 0.0 && params.t2 <= 1.0 && t2 < 0) - { - t2 = params.t1; - P2 = params.cutPoint; - } - - params = segmentsCut(center1, center2, QVector2D(x1, y1), QVector2D(x1, y0)); - if (params.t1 >= 0.0 && params.t1 <= 1.0 && params.t2 >= 0.0 && params.t2 <= 1.0 && t2 < 0) - { - t2 = params.t1; - P2 = params.cutPoint; - } - - params = segmentsCut(center1, center2, QVector2D(x1, y1), QVector2D(x0, y1)); - if (params.t1 >= 0.0 && params.t1 <= 1.0 && params.t2 >= 0.0 && params.t2 <= 1.0 && t2 < 0) - { - t2 = params.t1; - P2 = params.cutPoint; - } - - // Monitor outside - if (t1 > t2) - { - result.vector = P1 - P2; - result.ok = false; - } else - result.ok = true; - - return result; -} - -void MonitorPictureDialog::moveMonitorPictureToNearest(MonitorPicture* monitorPicture) -{ - if (!ui.magneticCheckBox->isChecked()) - return; - - QVector2D vector(0, 0); - for (MonitorPicture *picture : pictures) - { - if (picture == monitorPicture) - continue; - - Result_moveMonitorPictureToNearest result = compareTwoMonitors(monitorPicture, picture); - if (result.ok) - return; - else if (result.vector.length() < vector.length() || vector.length() == 0.0) - vector = result.vector; - } - - int x = monitorPicture->x(); - int y = monitorPicture->y(); - monitorPicture->setX(x + vector.x()); - monitorPicture->setY(y + vector.y()); -} diff --git a/lxqt-config-monitor/monitorpicture.h b/lxqt-config-monitor/monitorpicture.h deleted file mode 100644 index 8e85e94..0000000 --- a/lxqt-config-monitor/monitorpicture.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - Copyright (C) 2014 P.L. Lucas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#ifndef _MONITORPICTURE_H_ -#define _MONITORPICTURE_H_ - -#include -#include -#include -#include -#include -#include -#include "monitor.h" -#include "ui_monitorpicture.h" -#include "monitorwidget.h" - -class MonitorPicture; - -class MonitorPictureDialog : public QDialog -{ - Q_OBJECT - -public: - MonitorPictureDialog(KScreen::ConfigPtr config, QWidget * parent = 0, Qt::WindowFlags f = 0); - void setScene(QList monitors); - void updateMonitorWidgets(QString primaryMonitor); - void moveMonitorPictureToNearest(MonitorPicture* monitorPicture); - void updateScene(); - -protected: - virtual void showEvent(QShowEvent * event); - -private: - Ui::MonitorPictureDialog ui; - QList pictures; - bool updatingOk; - KScreen::ConfigPtr mConfig; - bool firstShownOk; - int maxMonitorSize; -}; - -class MonitorPicture : public QGraphicsRectItem -{ -public: - MonitorPicture(QGraphicsItem *parent, - MonitorWidget *monitorWidget, - MonitorPictureDialog *monitorPictureDialog); - void setMonitorPosition(int x, int y); - void adjustNameSize(); - - MonitorWidget *monitorWidget; - int originX, originY; - - void updateSize(QSize size); - -private: - QGraphicsTextItem *textItem; - QGraphicsSvgItem *svgItem; - MonitorPictureDialog *monitorPictureDialog; - - -protected: - QVariant itemChange(GraphicsItemChange change, const QVariant & value); - void mouseReleaseEvent(QGraphicsSceneMouseEvent * event); -}; - -class MonitorPictureProxy: public QObject -{ - Q_OBJECT - public: - MonitorPictureProxy(QObject *parent, MonitorPicture *monitorPicture); - MonitorPicture *monitorPicture; - - public slots: - void updateSize(); - void updatePosition(); - -}; - - -#endif // _MONITORPICTURE_H_ diff --git a/lxqt-config-monitor/monitorpicture.ui b/lxqt-config-monitor/monitorpicture.ui deleted file mode 100644 index bdce68e..0000000 --- a/lxqt-config-monitor/monitorpicture.ui +++ /dev/null @@ -1,38 +0,0 @@ - - - MonitorPictureDialog - - - - 0 - 0 - 462 - 362 - - - - Dialog - - - - - - - - - - - - - Keep monitors attached - - - true - - - - - - - - diff --git a/lxqt-config-monitor/monitorsettingsdialog.cpp b/lxqt-config-monitor/monitorsettingsdialog.cpp deleted file mode 100644 index 2730413..0000000 --- a/lxqt-config-monitor/monitorsettingsdialog.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* - Copyright (C) 2014 P.L. Lucas - Copyright (C) 2013 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include "monitorsettingsdialog.h" - -#include "monitorwidget.h" -#include "monitor.h" -#include "timeoutdialog.h" -#include "monitorpicture.h" -#include "settingsdialog.h" -#include "fastmenu.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -MonitorSettingsDialog::MonitorSettingsDialog() : - QDialog(nullptr, 0) -{ - ui.setupUi(this); - - KScreen::GetConfigOperation *operation = new KScreen::GetConfigOperation(); - connect(operation, &KScreen::GetConfigOperation::finished, [this, operation] (KScreen::ConfigOperation *op) { - KScreen::GetConfigOperation *configOp = qobject_cast(op); - qDebug() << "Connecting to KScreen..."; - if (configOp && configOp->config() && configOp->config()->screen()) - { - mOldConfig = configOp->config()->clone(); - loadConfiguration(configOp->config()); - operation->deleteLater(); - } - else if(configOp && !configOp->config()) - { - qDebug() << "Error: Config is invalid, probably backend couldn't load"; - exit(1); - } - else if(configOp && configOp->config() && !configOp->config()->screen()) - { - qDebug() << "Error: No screen in the configuration, broken backend"; - exit(2); - } - else - { - qDebug() << "Error: Connect to KScreen is not possible"; - exit(3); - } - }); - - connect(ui.buttonBox, &QDialogButtonBox::clicked, [&] (QAbstractButton *button) { - if (ui.buttonBox->standardButton(button) == QDialogButtonBox::Apply) - applyConfiguration(false); - if (ui.buttonBox->standardButton(button) == QDialogButtonBox::Save) - { - applyConfiguration(true); - } - - }); - - connect(ui.settingsButton, SIGNAL(clicked()), this, SLOT(showSettingsDialog())); -} - -MonitorSettingsDialog::~MonitorSettingsDialog() -{ -} - -void MonitorSettingsDialog::loadConfiguration(KScreen::ConfigPtr config) -{ - if (mConfig == config) - return; - - mConfig = config; - - MonitorPictureDialog *monitorPicture = nullptr; - FastMenu *fastMenu = nullptr; - KScreen::OutputList outputs = mConfig->outputs(); - - int nMonitors = 0; - for (const KScreen::OutputPtr &output : outputs) - { - if (output->isConnected()) - nMonitors++; - - if (nMonitors > 1) - { - fastMenu = new FastMenu(config, this); - ui.monitorList->addItem(tr("Fast Menu")); - ui.stackedWidget->addWidget(fastMenu); - - monitorPicture = new MonitorPictureDialog(config, this); - ui.monitorList->addItem(tr("Set position")); - ui.stackedWidget->addWidget(monitorPicture); - break; - } - } - - QList monitors; - - for (const KScreen::OutputPtr &output : outputs) - { - if (output->isConnected()) - { - MonitorWidget *monitor = new MonitorWidget(output, mConfig, this); - ui.monitorList->addItem(output->name()); - ui.stackedWidget->addWidget(monitor); - monitors.append(monitor); - } - } - - Q_FOREACH(MonitorWidget *monitor1, monitors) - { - Q_FOREACH(MonitorWidget *monitor, monitors) - { - if(monitor != monitor1) - connect(monitor, SIGNAL(primaryOutputChanged(MonitorWidget *)), monitor1, SLOT(onPrimaryOutputChanged(MonitorWidget *))); - } - } - - if (monitorPicture) - monitorPicture->setScene(monitors); - - ui.monitorList->setCurrentRow(0); - adjustSize(); -} - -void MonitorSettingsDialog::applyConfiguration(bool saveConfigOk) -{ - if (mConfig && KScreen::Config::canBeApplied(mConfig)) - { - KScreen::SetConfigOperation(mConfig).exec(); - - TimeoutDialog mTimeoutDialog; - if (mTimeoutDialog.exec() == QDialog::Rejected) - KScreen::SetConfigOperation(mOldConfig).exec(); - else - { - mOldConfig = mConfig->clone(); - if (saveConfigOk) - saveConfiguration(mConfig); - } - } -} - -void MonitorSettingsDialog::accept() -{ - //applyConfiguration(true); - QDialog::accept(); -} - -void MonitorSettingsDialog::reject() -{ - QDialog::reject(); -} - -void MonitorSettingsDialog::saveConfiguration(KScreen::ConfigPtr config) -{ - - QList currentSettings; - KScreen::OutputList outputs = config->outputs(); - for (const KScreen::OutputPtr &output : outputs) - { - MonitorSettings monitor; - monitor.name = output->name(); - KScreen::Edid* edid = output->edid(); - if (edid && edid->isValid()) - monitor.hash = edid->hash(); - monitor.connected = output->isConnected(); - if ( output->isConnected() ) - { - monitor.enabled = output->isEnabled(); - monitor.primary = output->isPrimary(); - monitor.xPos = output->pos().x(); - monitor.yPos = output->pos().y(); - monitor.currentMode = output->currentModeId(); - monitor.currentModeWidth = output->currentMode()->size().width(); - monitor.currentModeHeight = output->currentMode()->size().height(); - monitor.currentModeRate = output->currentMode()->refreshRate(); - monitor.rotation = output->rotation(); - } - currentSettings.append(monitor); - } - - LXQt::Settings settings("lxqt-config-monitor"); - settings.beginGroup("currentConfig"); - saveMonitorSettings(settings, currentSettings); - settings.endGroup(); - - QList monitors; - settings.beginGroup("SavedConfigs"); - loadMonitorSettings(settings, monitors); - qDebug() << "[ MonitorSettingsDialog::saveConfiguration] # monitors Read:" << monitors.size(); - MonitorSavedSettings monitor; - monitor.name = QDateTime::currentDateTime().toString(); - monitor.date = QDateTime::currentDateTime().toString(Qt::ISODate); - monitor.monitors = currentSettings; - monitors.append(monitor); - saveMonitorSettings(settings, monitors); - qDebug() << "[ MonitorSettingsDialog::saveConfiguration] # monitors Write:" << monitors.size(); - settings.endGroup(); - - LXQt::AutostartEntry autoStart("lxqt-config-monitor-autostart.desktop"); - XdgDesktopFile desktopFile(XdgDesktopFile::ApplicationType, "lxqt-config-monitor-autostart", "lxqt-config-monitor -l"); - //desktopFile.setValue("OnlyShowIn", QString(qgetenv("XDG_CURRENT_DESKTOP"))); - desktopFile.setValue("OnlyShowIn", "LXQt"); - desktopFile.setValue("Comment", "Autostart monitor settings for LXQt-config-monitor"); - autoStart.setFile(desktopFile); - autoStart.commit(); -} - - -void MonitorSettingsDialog::showSettingsDialog() -{ - QByteArray configName = qgetenv("LXQT_SESSION_CONFIG"); - - if (configName.isEmpty()) - configName = "MonitorSettings"; - - LXQt::Settings settings(configName); - - SettingsDialog settingsDialog(tr("Advanced settings"), &settings, mConfig); - settingsDialog.exec(); -} diff --git a/lxqt-config-monitor/monitorsettingsdialog.h b/lxqt-config-monitor/monitorsettingsdialog.h deleted file mode 100644 index dbd8af7..0000000 --- a/lxqt-config-monitor/monitorsettingsdialog.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright (C) 2014 P.L. Lucas - Copyright (C) 2013 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#ifndef MONITORSETTINGSDIALOG_H -#define MONITORSETTINGSDIALOG_H - -#include "ui_monitorsettingsdialog.h" -#include "timeoutdialog.h" - -#include -#include -#include -#include - -class MonitorSettingsDialog : public QDialog -{ - Q_OBJECT - -public: - MonitorSettingsDialog(); - virtual ~MonitorSettingsDialog(); - - virtual void accept(); - virtual void reject(); - -private: - void applyConfiguration(bool saveConfigOk); - void cancelConfiguration(); - -private Q_SLOTS: - void loadConfiguration(KScreen::ConfigPtr config); - void showSettingsDialog(); - -private: - void saveConfiguration(KScreen::ConfigPtr config); - - Ui::MonitorSettingsDialog ui; - - // Configutarions - KScreen::ConfigPtr mOldConfig; - KScreen::ConfigPtr mConfig; -}; - -#endif // MONITORSETTINGSDIALOG_H diff --git a/lxqt-config-monitor/monitorsettingsdialog.ui b/lxqt-config-monitor/monitorsettingsdialog.ui deleted file mode 100644 index b48d4f6..0000000 --- a/lxqt-config-monitor/monitorsettingsdialog.ui +++ /dev/null @@ -1,136 +0,0 @@ - - - MonitorSettingsDialog - - - - 0 - 0 - 510 - 131 - - - - Monitor Settings - - - - - - - - - - - Qt::Horizontal - - - false - - - - - 0 - 0 - - - - - 150 - 0 - - - - Qt::ScrollBarAlwaysOff - - - QListView::Adjust - - - - - - 1 - 0 - - - - - 350 - 0 - - - - - - - - - - - Settings - - - - - - Qt::ToolButtonTextBesideIcon - - - false - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Apply|QDialogButtonBox::Close|QDialogButtonBox::Save - - - false - - - - - - - - - - - monitorList - currentRowChanged(int) - stackedWidget - setCurrentIndex(int) - - - 126 - 181 - - - 20 - 20 - - - - - buttonBox - rejected() - MonitorSettingsDialog - reject() - - - 338 - 439 - - - 286 - 257 - - - - - diff --git a/lxqt-config-monitor/monitorwidget.cpp b/lxqt-config-monitor/monitorwidget.cpp deleted file mode 100644 index de0ae12..0000000 --- a/lxqt-config-monitor/monitorwidget.cpp +++ /dev/null @@ -1,282 +0,0 @@ -/* - Copyright (C) 2014 P.L. Lucas - Copyright (C) 2014 Hong Jen Yee (PCMan) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include "monitorwidget.h" - -#include -#include -#include -#include - - - -QString modeToString(KScreen::ModePtr mode) -{ - // mode->name() can be anything, not just widthxheight. eg if added with cvt. - return QString("%1x%2").arg(mode->size().width()).arg(mode->size().height()); -} - -KScreen::OutputPtr getOutputById(int id, KScreen::OutputList outputs) -{ - for (const KScreen::OutputPtr &output : outputs) - if (output->id() == id) - return output; - - return KScreen::OutputPtr(nullptr); -} - -KScreen::ModePtr getModeById(QString id, KScreen::ModeList modes) -{ - for (const KScreen::ModePtr &mode : modes) - if (mode->id() == id) - return mode; - - return KScreen::ModePtr(NULL); -} - -static bool sizeBiggerThan(const KScreen::ModePtr &modeA, const KScreen::ModePtr &modeB) -{ - QSize sizeA = modeA->size(); - QSize sizeB = modeB->size(); - return sizeA.width() * sizeA.height() > sizeB.width() * sizeB.height(); -} - - -MonitorWidget::MonitorWidget(KScreen::OutputPtr output, KScreen::ConfigPtr config, QWidget* parent) : - QGroupBox(parent) -{ - this->output = output; - this->config = config; - - ui.setupUi(this); - - ui.enabledCheckbox->setChecked(output->isEnabled()); - - QList modeList = output->modes().values(); - - // Remove duplicate sizes - QMap noDuplicateModes; - foreach(const KScreen::ModePtr &mode, modeList) - { - if( noDuplicateModes.keys().contains(modeToString(mode)) ) - { - KScreen::ModePtr actual = noDuplicateModes[modeToString(mode)]; - bool isActualPreferred = output->preferredModes().contains(actual->id()); - bool isModePreferred = output->preferredModes().contains(mode->id()); - if( ( mode->refreshRate() > actual->refreshRate() && !isActualPreferred ) || isModePreferred ) - noDuplicateModes[modeToString(mode)] = mode; - } - else - noDuplicateModes[modeToString(mode)] = mode; - } - - // Sort modes by size - modeList = noDuplicateModes.values(); - qSort(modeList.begin(), modeList.end(), sizeBiggerThan); - - // Add each mode to the list - foreach (const KScreen::ModePtr &mode, modeList) - { - ui.resolutionCombo->addItem(modeToString(mode), mode->id()); - if(output->preferredModes().contains(mode->id())) - { - // Make bold preferredModes - QFont font = ui.resolutionCombo->font(); - font.setBold(true); - ui.resolutionCombo->setItemData(ui.resolutionCombo->count()-1, font, Qt::FontRole); - } - } - connect(ui.resolutionCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onResolutionChanged(int))); - - // Select actual mode in list - if (output->currentMode()) - { - // Set the current mode in dropdown - int idx = ui.resolutionCombo->findData(output->currentMode()->id()); - if (idx < 0) - { - // Select mode with same size - foreach (const KScreen::ModePtr &mode, modeList) - { - if( mode->size() == output->currentMode()->size() ) - idx = ui.resolutionCombo->findData(output->currentMode()->id()); - } - } - if(idx < 0) - idx = ui.resolutionCombo->findData(output->preferredMode()->id()); - if (idx >= 0) - ui.resolutionCombo->setCurrentIndex(idx); - } - updateRefreshRates(); - - - // Update EDID information - // KScreen doesn't make much public but that's ok... - KScreen::Edid* edid = output->edid(); - if (edid && edid->isValid()) - { - ui.outputInfoLabel->setText( - tr("Name: %1\n").arg(edid->name()) % - tr("Vendor: %1\n").arg(edid->vendor()) % - tr("Serial: %1\n").arg(edid->serial()) % - tr("Display size: %1cm x %2cm\n").arg(edid->width()).arg(edid->height()) % - tr("Serial number: %1\n").arg(edid->serial()) % - tr("EISA device ID: %1\n").arg(edid->eisaId()) - ); - } - - if (config->connectedOutputs().count() == 1) - { - setOnlyMonitor(true); - // There isn't always a primary output. Gross. - output->setPrimary(true); - } - - ui.xPosSpinBox->setValue(output->pos().x()); - ui.yPosSpinBox->setValue(output->pos().y()); - - // Behavior chooser - if (output->isPrimary()) - ui.behaviorCombo->setCurrentIndex(PrimaryDisplay); - else - ui.behaviorCombo->setCurrentIndex(ExtendDisplay); - - // Insert orientations - ui.orientationCombo->addItem(tr("None"), KScreen::Output::None); - ui.orientationCombo->addItem(tr("Left"), KScreen::Output::Left); - ui.orientationCombo->addItem(tr("Right"), KScreen::Output::Right); - ui.orientationCombo->addItem(tr("Inverted"), KScreen::Output::Inverted); - switch(output->rotation()) - { - case KScreen::Output::None: - ui.orientationCombo->setCurrentIndex(0); - break; - case KScreen::Output::Left: - ui.orientationCombo->setCurrentIndex(1); - break; - case KScreen::Output::Right: - ui.orientationCombo->setCurrentIndex(2); - break; - case KScreen::Output::Inverted: - ui.orientationCombo->setCurrentIndex(3); - break; - } - - connect(ui.enabledCheckbox, SIGNAL(toggled(bool)), this, SLOT(onEnabledChanged(bool))); - connect(ui.behaviorCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onBehaviorChanged(int))); - connect(ui.xPosSpinBox, SIGNAL(valueChanged(int)), this, SLOT(onPositionChanged(int))); - connect(ui.yPosSpinBox, SIGNAL(valueChanged(int)), this, SLOT(onPositionChanged(int))); - connect(ui.orientationCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onOrientationChanged(int))); - - // Force update behavior visibility - onBehaviorChanged(ui.behaviorCombo->currentIndex()); -} - -MonitorWidget::~MonitorWidget() -{ -} - -void MonitorWidget::onEnabledChanged(bool enabled) -{ - output->setEnabled(enabled); - - // If we're enabling a disabled output for the first time - if (enabled && !output->currentMode()) - { - // order here matters - onResolutionChanged(ui.resolutionCombo->currentIndex()); - onOrientationChanged(ui.orientationCombo->currentIndex()); - onBehaviorChanged(ui.behaviorCombo->currentIndex()); - } -} - -void MonitorWidget::onOrientationChanged(int idx) -{ - output->setRotation((KScreen::Output::Rotation) ui.orientationCombo->currentData().toInt(0)); -} - -void MonitorWidget::onBehaviorChanged(int idx) -{ - // Behavior should match the index of the selected element - ui.xPosSpinBox->setVisible(idx == ExtendDisplay); - ui.yPosSpinBox->setVisible(idx == ExtendDisplay); - - output->setPrimary(idx == PrimaryDisplay); - if(idx == PrimaryDisplay) - emit primaryOutputChanged(this); -} - -void MonitorWidget::onPositionChanged(int value) -{ - output->setPos(QPoint(ui.xPosSpinBox->value(), ui.yPosSpinBox->value())); -} - -void MonitorWidget::onResolutionChanged(int index) -{ - output->setCurrentModeId(ui.resolutionCombo->currentData().toString()); - updateRefreshRates(); -} - -void MonitorWidget::onRateChanged(int index) -{ - output->setCurrentModeId(ui.rateCombo->currentData().toString()); -} - -void MonitorWidget::updateRefreshRates() -{ - disconnect(ui.rateCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onRateChanged(int))); - ui.rateCombo->clear(); - - if (output->modes().size() < 0) - return; - - KScreen::ModePtr selectedMode = output->currentMode(); - if (selectedMode) - { - for (const KScreen::ModePtr &mode : output->modes()) - if (mode->size() == selectedMode->size()) - ui.rateCombo->addItem(tr("%1 Hz").arg(mode->refreshRate()), mode->id()); - - int idx = ui.rateCombo->findData(selectedMode->id()); - if (idx >= 0) - ui.rateCombo->setCurrentIndex(idx); - } - - connect(ui.rateCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onRateChanged(int))); -} - -void MonitorWidget::setOnlyMonitor(bool isOnlyMonitor) -{ - ui.enabledCheckbox->setEnabled(!isOnlyMonitor); - ui.behaviorCombo->setEnabled(!isOnlyMonitor); - ui.xPosSpinBox->setVisible(!isOnlyMonitor); - ui.yPosSpinBox->setVisible(!isOnlyMonitor); - if(isOnlyMonitor) - { - ui.xPosSpinBox->setValue(0); - ui.yPosSpinBox->setValue(0); - } -} - -void MonitorWidget::onPrimaryOutputChanged(MonitorWidget *widget) -{ - if(widget == this) - return; - ui.behaviorCombo->setCurrentIndex(ExtendDisplay); -} diff --git a/lxqt-config-monitor/monitorwidget.h b/lxqt-config-monitor/monitorwidget.h deleted file mode 100644 index ced3caf..0000000 --- a/lxqt-config-monitor/monitorwidget.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright (C) 2014 P.L. Lucas - Copyright (C) 2014 Hong Jen Yee (PCMan) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#ifndef _MONITORWIDGET_H_ -#define _MONITORWIDGET_H_ - -#include "ui_monitorwidget.h" - -#include -#include -#include -#include -#include -#include - -#define PrimaryDisplay 0 -#define ExtendDisplay 1 - -#define RightOf 0 -#define LeftOf 1 -#define Above 2 -#define Below 3 -#define Manually 4 - -class MonitorWidget : public QGroupBox -{ - Q_OBJECT - - friend class MonitorPicture; - friend class MonitorPictureDialog; - -public: - MonitorWidget(KScreen::OutputPtr output, KScreen::ConfigPtr config, QWidget* parent = 0); - ~MonitorWidget(); - - void updateRefreshRates(); - - KScreen::OutputPtr output; - KScreen::ConfigPtr config; - -signals: - void primaryOutputChanged(MonitorWidget *widget); - -public Q_SLOTS: - void setOnlyMonitor(bool isOnlyMonitor); - -private Q_SLOTS: - void onEnabledChanged(bool); - void onBehaviorChanged(int); - void onPositionChanged(int); - void onResolutionChanged(int); - void onRateChanged(int); - void onOrientationChanged(int); - void onPrimaryOutputChanged(MonitorWidget *widget); - -private: - Ui::MonitorWidget ui; -}; - -#endif // _MONITORWIDGET_H_ diff --git a/lxqt-config-monitor/monitorwidget.ui b/lxqt-config-monitor/monitorwidget.ui deleted file mode 100644 index 07488d1..0000000 --- a/lxqt-config-monitor/monitorwidget.ui +++ /dev/null @@ -1,210 +0,0 @@ - - - MonitorWidget - - - - 0 - 0 - 313 - 274 - - - - - - - 0 - - - - Setup - - - - - - - - (x) - - - - - - -10000000 - - - 10000000 - - - - - - - (y) - - - - - - -10000000 - - - 10000000 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Resolution: - - - - - - - - - - - - Enable this display - - - - - - - - This is my primary display - - - - - This screen extends another display - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Advanced - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Refresh rate: - - - - - - - Rotation: - - - - - - - - - - - 0 - 0 - - - - - - - - - - - Info - - - - - - Display information - - - true - - - - - - - Qt::Vertical - - - - 20 - 1 - - - - - - - - - - - - - diff --git a/lxqt-config-monitor/resources/configure.in b/lxqt-config-monitor/resources/configure.in deleted file mode 100644 index c0cd07a..0000000 --- a/lxqt-config-monitor/resources/configure.in +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef __CONFIG_H__ -#define ICON_PATH "${CMAKE_INSTALL_PREFIX}/share/lxqt/icons/" -#define __CONFIG_H__ -#endif \ No newline at end of file diff --git a/lxqt-config-monitor/resources/lxqt-config-monitor.desktop.in b/lxqt-config-monitor/resources/lxqt-config-monitor.desktop.in deleted file mode 100644 index bb7939e..0000000 --- a/lxqt-config-monitor/resources/lxqt-config-monitor.desktop.in +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Monitor settings -GenericName=Monitor settings -Comment=Configure monitors -Exec=lxqt-config-monitor -Icon=preferences-desktop-display -Categories=Settings;DesktopSettings;Qt;LXQt;HardwareSettings; -OnlyShowIn=LXQt; - -#TRANSLATIONS_DIR=translations diff --git a/lxqt-config-monitor/resources/magnetic_attraction.html b/lxqt-config-monitor/resources/magnetic_attraction.html deleted file mode 100644 index 0fd6900..0000000 --- a/lxqt-config-monitor/resources/magnetic_attraction.html +++ /dev/null @@ -1,42 +0,0 @@ - - -Magnetic attraction algorithm - - - -

Magnetic attraction algorithm

-

The algorithm used to move monitors to the nearest one in “position dialog” is explained here.

-

Segment equation is used. Let’s explain segment equation in order to understand the proccess:

-

If you have two points, p0, p1 ∈ ℝ 2, the equation of straight line between p0 and p1 is:

- -r = v · t + p0 - -

where v = p1 - p0, and t ∈ [0,1].

-

Algorithm calculates equation of the segment between monitor centers. Then, it gets intersection points with edges of monitors:

- - - - Layer 1 - - - - c_0 - c_1 - t_2 - t_1 - - - - -

If v = c1 - c0, c0 and c1 are monitors centers, the equation between them is r = v · t + c0.

-

where t1 is the parameter of the mentioned equation to get the intersection point with the c1 monitor.

-

where t2 the parameter with the c0 monitor.

-

t1, t2 ∈ [0,1].

- -

If t2<t1, the monitors are separated, otherwise the monitors are overlapped.

-

With the previous information we get:

-

r1 = v· t1 + c0

-

r2 = v· t2 + c0

-

Iff t2<t1, c0 monitor must be moved, and its displacement is provided by r = r1-r2

- - diff --git a/lxqt-config-monitor/savesettings.cpp b/lxqt-config-monitor/savesettings.cpp deleted file mode 100644 index 331f164..0000000 --- a/lxqt-config-monitor/savesettings.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - Copyright (C) 2015 P.L. Lucas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include -#include -#include "savesettings.h" -#include "configure.h" -#include -#include -#include -#include - -SaveSettings::SaveSettings(LXQt::Settings*applicationSettings, QWidget* parent): - QDialog(parent) { - - this->applicationSettings = applicationSettings; - - ui.setupUi(this); - - QSize size(128,64); - ui.save->setIcon(QIcon::fromTheme("document-save")); - ui.save->setIconSize(size); - - connect(ui.hardwareCompatibleConfigs, SIGNAL(itemDoubleClicked(QListWidgetItem *)), SLOT(setSavedSettings(QListWidgetItem *))); - connect(ui.deletePushButton, SIGNAL(clicked()), SLOT(onDeleteItem())); - connect(ui.renamePushButton, SIGNAL(clicked()), SLOT(onRenameItem())); - - loadSettings(); -} - -void SaveSettings::setHardwareIdentifier(QString hardwareIdentifier) { - this->hardwareIdentifier = hardwareIdentifier; - loadSettings(); -} - -void SaveSettings::setSavedSettings(QListWidgetItem * item) { - QJsonObject o = item->data(Qt::UserRole).toJsonObject(); - QString cmd = o["command"].toString(); - qDebug() << "[SaveSettings::setSavedSettings]: " << cmd; - QProcess::execute(cmd); -} - -void SaveSettings::onDeleteItem() { - if( ui.allConfigs->currentItem() == NULL ) - return; - QJsonObject obj = ui.allConfigs->currentItem()->data(Qt::UserRole).toJsonObject(); - applicationSettings->beginGroup("configMonitor"); - QJsonArray savedConfigs = QJsonDocument::fromJson(applicationSettings->value("saved").toByteArray()).array(); - for(int i=0;isetValue("saved", QVariant(QJsonDocument(savedConfigs).toJson())); - applicationSettings->endGroup(); - loadSettings(); -} - -void SaveSettings::onRenameItem() { - if( ui.allConfigs->currentItem() == NULL ) - return; - QJsonObject obj = ui.allConfigs->currentItem()->data(Qt::UserRole).toJsonObject(); - bool ok; - QString configName = QInputDialog::getText(this, tr("Name"), tr("Name:"), QLineEdit::Normal, obj["name"].toString(), &ok); - if (!ok || configName.isEmpty()) - return; - applicationSettings->beginGroup("configMonitor"); - QJsonArray savedConfigs = QJsonDocument::fromJson(applicationSettings->value("saved").toByteArray()).array(); - for(int i=0;isetValue("saved", QVariant(QJsonDocument(savedConfigs).toJson())); - applicationSettings->endGroup(); - loadSettings(); -} - -void SaveSettings::loadSettings() { - ui.allConfigs->clear(); - ui.hardwareCompatibleConfigs->clear(); - applicationSettings->beginGroup("configMonitor"); - QJsonArray savedConfigs = QJsonDocument::fromJson(applicationSettings->value("saved").toByteArray()).array(); - foreach (const QJsonValue & v, savedConfigs) { - QJsonObject o = v.toObject(); - QListWidgetItem *item = new QListWidgetItem(o["name"].toString(), ui.allConfigs); - item->setData(Qt::UserRole, QVariant(o)); - if(o["hardwareIdentifier"].toString() == hardwareIdentifier) { - QListWidgetItem *item = new QListWidgetItem(o["name"].toString(), ui.hardwareCompatibleConfigs); - item->setData(Qt::UserRole, QVariant(o)); - } - } - applicationSettings->endGroup(); -} diff --git a/lxqt-config-monitor/settingsdialog.cpp b/lxqt-config-monitor/settingsdialog.cpp deleted file mode 100644 index 8ba7c9c..0000000 --- a/lxqt-config-monitor/settingsdialog.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright (C) 2015 P.L. Lucas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include "settingsdialog.h" -#include "managesavedsettings.h" -#include - -SettingsDialog::SettingsDialog(const QString &title, LXQt::Settings *settings, KScreen::ConfigPtr config, QWidget *parent) - : LXQt::ConfigDialog(title, settings, parent) -{ - setButtons(QDialogButtonBox::QDialogButtonBox::Apply | QDialogButtonBox::Close); - setWindowIcon(QIcon::fromTheme("preferences-desktop-display")); - - //DaemonSettings *daemon = new DaemonSettings(settings, this); - //addPage(daemon, QObject::tr("Daemon"), "system-run"); - - ManageSavedSettings * savedSettings = new ManageSavedSettings(settings, config, this); - addPage(savedSettings, QObject::tr("Manage Saved Settings"), "system-run"); -} diff --git a/lxqt-config-monitor/settingsdialog.h b/lxqt-config-monitor/settingsdialog.h deleted file mode 100644 index 3094f2f..0000000 --- a/lxqt-config-monitor/settingsdialog.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2015 P.L. Lucas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#ifndef __SETTINGSDIALOG_H__ -#define __SETTINGSDIALOG_H__ - -#include -#include -#include -#include - - -class SettingsDialog : public LXQt::ConfigDialog -{ - Q_OBJECT - -public: - SettingsDialog(const QString &title, LXQt::Settings *settings, KScreen::ConfigPtr config, QWidget *parent = 0); - -private Q_SLOTS: - -private: - - // Configutarions -}; - -#endif // __SETTINGSDIALOG_H__ - diff --git a/lxqt-config-monitor/timeoutdialog.cpp b/lxqt-config-monitor/timeoutdialog.cpp deleted file mode 100644 index 55302a9..0000000 --- a/lxqt-config-monitor/timeoutdialog.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * Copyright (C) 2014 PCMan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#define TIMER_DURATION 10 - -#include "timeoutdialog.h" - -TimeoutDialog::TimeoutDialog(QWidget* parent, Qt::WindowFlags f) : - QDialog(parent, f) -{ - ui.setupUi(this); - - QIcon icon = style()->standardIcon(QStyle::SP_MessageBoxQuestion); - int size = style()->pixelMetric(QStyle::PM_MessageBoxIconSize); - ui.icon->setPixmap(icon.pixmap(QSize(size, size))); - - connect(&timer, &QTimer::timeout, this, &TimeoutDialog::onTimeout); - adjustSize(); -} - -TimeoutDialog::~TimeoutDialog() -{ -} - -void TimeoutDialog::showEvent(QShowEvent* e) -{ - timer.start(1000); - QDialog::showEvent(e); -} - -void TimeoutDialog::onTimeout() -{ - int maximum = ui.progressBar->maximum(); - int time = ui.progressBar->value() + maximum / TIMER_DURATION; - - // if time is finished, settings are restored. - if (time >= maximum) - { - timer.stop(); - reject(); - } - else - { - int remaining = maximum / TIMER_DURATION - TIMER_DURATION * time / maximum; - ui.remainingTime->setText(tr("%n second(s) remaining", nullptr, remaining).arg(remaining)); - ui.progressBar->setValue(time); - } -} diff --git a/lxqt-config-monitor/timeoutdialog.h b/lxqt-config-monitor/timeoutdialog.h deleted file mode 100644 index c6c0601..0000000 --- a/lxqt-config-monitor/timeoutdialog.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * Copyright (C) 2014 PCMan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef TIMEOUTDIALOG_H -#define TIMEOUTDIALOG_H - -#include "ui_timeoutdialog.h" -#include -#include - -class TimeoutDialog : public QDialog -{ - Q_OBJECT - -public: - TimeoutDialog(QWidget* parent = 0, Qt::WindowFlags f = 0); - virtual ~TimeoutDialog(); - -protected: - virtual void showEvent(QShowEvent* e); - -private Q_SLOTS: - void onTimeout(); - -private: - Ui::TimeoutDialog ui; - QTimer timer; -}; - -#endif // TIMEOUTDIALOG_H diff --git a/lxqt-config-monitor/timeoutdialog.ui b/lxqt-config-monitor/timeoutdialog.ui deleted file mode 100644 index 0d1ec14..0000000 --- a/lxqt-config-monitor/timeoutdialog.ui +++ /dev/null @@ -1,107 +0,0 @@ - - - TimeoutDialog - - - - 0 - 0 - 255 - 152 - - - - Settings are changed - - - true - - - - - - - 0 - 0 - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - QDialogButtonBox::No|QDialogButtonBox::Yes - - - - - - - Are the current settings OK for you? - - - 10 - - - - - - - false - - - - - - - Qt::AlignCenter - - - 5 - - - - - - - - - buttonBox - accepted() - TimeoutDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - TimeoutDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_ar.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_ar.desktop deleted file mode 100644 index 7a9960b..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_ar.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[ar]=إعدادات الشّاشة -GenericName[ar]=إعدادات الشّاشة -Comment[ar]=اضبط الشّاشات diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_ca.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_ca.desktop deleted file mode 100644 index c73ebb8..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_ca.desktop +++ /dev/null @@ -1,4 +0,0 @@ -#Translations -Name[ca]=Ajusts del monitor -GenericName[ca]=Ajusts del monitor -Comment[ca]=Configureu els monitors diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_da.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_da.desktop deleted file mode 100644 index 9f0e877..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_da.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[da]=Skærmindstillinger -GenericName[da]=Skærmindstillinger -Comment[da]=Konfigurér skærme diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_de.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_de.desktop deleted file mode 100644 index abdbf8c..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_de.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[de]=Bildschirmeinstellungen -GenericName[de]=Bildschirmeinstellungen -Comment[de]=Bildschirmauflösung und externe Monitore konfigurieren diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_el.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_el.desktop deleted file mode 100644 index b741f35..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_el.desktop +++ /dev/null @@ -1,4 +0,0 @@ -#Translations -Name[el]=Ρυθμίσεις οθόνης -GenericName[el]=Ρυθμίσεις οθόνης -Comment[el]=Διαμόρφωση οθονών diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_fr.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_fr.desktop deleted file mode 100644 index 3d9f7ca..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_fr.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[fr]=Paramètres de l'écran -GenericName[fr]=Paramètres de l'écran -Comment[fr]=Configurer les écrans diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_hu.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_hu.desktop deleted file mode 100644 index dbd544c..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_hu.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[hu]=LXQt képernyőbeállítás -GenericName[hu]=Képernyőbeállítások -Comment[hu]=Képfelbontás és külső monitorok beállítása diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_it.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_it.desktop deleted file mode 100644 index 4e34f16..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_it.desktop +++ /dev/null @@ -1,4 +0,0 @@ -Name[it]=Monitor -GenericName[it]=Impostazioni dei monitor -Comment[it]=Configura la risoluzione e i monitor esterni - diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_ja.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_ja.desktop deleted file mode 100644 index 6c6a98c..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_ja.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[ja]=モニターの設定 -GenericName[ja]=モニターの設定 -Comment[ja]=モニターの設定 diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_lt.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_lt.desktop deleted file mode 100644 index ae994ec..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_lt.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[lt]=Monitoriaus nustatymai -GenericName[lt]=Monitoriaus nustatymai -Comment[lt]=Konfigūruoti monitorius diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_pl_PL.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_pl_PL.desktop deleted file mode 100644 index 0bbd58d..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_pl_PL.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[pl]=Monitor -GenericName[pl]=Ustawienia monitora -Comment[pl]=Konfiguracja monitora diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_pt.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_pt.desktop deleted file mode 100644 index d86f841..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_pt.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[pt]=Definições do monitor -GenericName[pt]=Definições do monitor -Comment[pt]=Configuração de monitores diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_ru.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_ru.desktop deleted file mode 100644 index ab3984e..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_ru.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ru]=Настроить мониторы -Name[ru]=Настройки монитора -GenericName[ru]=Настройки монитора \ No newline at end of file diff --git a/lxqt-config-monitor/translations/lxqt-config-monitor_zh_TW.desktop b/lxqt-config-monitor/translations/lxqt-config-monitor_zh_TW.desktop deleted file mode 100644 index 638e341..0000000 --- a/lxqt-config-monitor/translations/lxqt-config-monitor_zh_TW.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[zh_TW]=設定螢幕 -GenericName[zh_TW]=螢幕設定 -Name[zh_TW]=LXQt螢幕設定 diff --git a/lxqt-config.png b/lxqt-config.png deleted file mode 100644 index d95a9592f84120fc6c063d4a7e6879d44a385b81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32184 zcmY(r1z43^7cIOADNzBDmXPjF5d`V(?vhdjB&9*5LmC96ySqVu_y z?tPy7@AGif&CA~JUTdy7#~fo!LRFNc?_iN&ArOc=vN95C2n13Ld=X$E!!vz6T1M~( znwh+`1mgPUzmIJNaqtZ0D;Zs91mbSb%@x|YCbm?7ZE!DuJ_vghcL~xN5w3mWg{t5(l=LfLSL7 z4gz7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^h6jCsQWs8qEGKO#NMM9S{;%)@8QV zSLaZRCWyFc9oOvr6 z`QL)1Yge>#7?P39rJ>TZ|4Cn{&k(i^YzA3lBeG)c=Plfya`C>L&gA%z74Pe0?IDj> o$Fkybt!utYe8Gw-Lu)kWBfc=s?9h0QJJty`Wv%1+isnK82e|GU^Z)<= diff --git a/man/lxqt-config.1 b/man/lxqt-config.1 deleted file mode 100644 index 69a9de2..0000000 --- a/man/lxqt-config.1 +++ /dev/null @@ -1,59 +0,0 @@ -.TH lxqt-config "1" "September 2012" "LXQt 0.7.0" "LXQt System Settings" -.SH NAME -lxqt-config \- \fBLXQt\fR Settings Center for all related modules and applications -.SH SYNOPSIS -.B lxqt-config -.br -.SH DESCRIPTION -This application its a settings center of all environment related applications, and all -config software instaled and registered by the \fBLXQt\fR desktop environment. -.P -\fBLXQt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt -technologies, ships several core desktop components, all of which are optional: -.P - * Panel - * Desktop - * Application launcher - * Settings center \fI(this)\fR - * Session handler - * Polkit handler - * SSH password access - * Display manager handler -.P -These components perform similar actions to those available in other desktop -environments, and their names are self-descriptive. They are usually not launched -by hand but automatically, when choosing a \fBLXQt\fR session in the Display -Manager. -.P -.SH LXQt Settings Center related applications -.P -\fBLXQt\fR has various config applications: -.P - * Mouse settings: (\fBlxqt-config-mouse\fR) - * Desktop settings: (\fBlxqt-config-desktop\fR) - * Appereance settings: (\fBlxqt-config-appearance\fR) - * Session settings: (\fBlxqt-config-session\fR) - * Notification settings: (\fBlxqt-config-notificationd\fR) -.P -All of this also can be find in Settings or Preferences menu, please consult the respective manpages. -.SH "REPORTING BUGS" -Report bugs to https://github.com/lxde/lxqt/issues -.SH "SEE ALSO" -\fBLXQt\fR has been tailored for users who value simplicity, speed, and -an intuitive interface. LXQt is also intended for less powerful machines. See: - -.\" any module must refers to session app, for more info on start it -.P - * Mouse settings: \fBlxqt-config-mouse(1)\fR -.P - * Desktop settings: \fBlxqt-config-desktop(1)\fR -.P - * Appeareance settings: \fBlxqt-config-appearance(1)\fR -.P - * Session settings: \fBlxqt-config-session(1)\fR -.P - * Notification settings: \fBlxqt-config-notificationd(1)\fR -.P -.SH AUTHOR -This manual page was created by \fBPICCORO Lenz McKAY\fR \fI\fR -for \fBLXQt\fR project and VENENUX GNU/Linux but can be used by others. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 1f9c86b..0000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,81 +0,0 @@ -project(lxqt-config) -add_subdirectory(qcategorizedview) - -include_directories ( - "${CMAKE_CURRENT_SOURCE_DIR}/qcategorizedview" -) - -set(lxqt-config_HDRS "") - -set(lxqt-config_SRCS - main.cpp - mainwindow.cpp -) - -set(lxqt-config_MOCS - mainwindow.h -) - -set(lxqt-config_UIS - mainwindow.ui -) - -# Translations ********************************** -lxqt_translate_ts(QM_FILES - UPDATE_TRANSLATIONS - ${UPDATE_TRANSLATIONS} - SOURCES - ${lxqt-config_HDRS} - ${lxqt-config_SRCS} - ${lxqt-config_UIS} - INSTALL_DIR - "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}" - PULL_TRANSLATIONS - ${PULL_TRANSLATIONS} - CLEAN_TRANSLATIONS - ${CLEAN_TRANSLATIONS} - TRANSLATIONS_REPO - ${TRANSLATIONS_REPO} - TRANSLATIONS_REFSPEC - ${TRANSLATIONS_REFSPEC} - REPO_SUBDIR - "lxqt-config/${PROJECT_NAME}" -) - -lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME}) -lxqt_translate_desktop(DESKTOP_FILES SOURCES lxqt-config.desktop.in) - -#************************************************ - -add_executable(lxqt-config - ${lxqt-config_SRCS} - ${DESKTOP_FILES} - ${QM_FILES} - ${QM_LOADER} -) - -target_link_libraries(lxqt-config - KF5::WindowSystem - Qt5::Widgets - Qt5::Xml - lxqt -) - -# helper static lib -link_directories(${CMAKE_CURRENT_SOURCE_DIR}/qcategorizedview) -target_link_libraries(lxqt-config qcategorizedview) - -install(TARGETS - lxqt-config - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - COMPONENT Runtime -) -install(FILES - ${DESKTOP_FILES} - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" - COMPONENT Runtime -) -install(FILES lxqt-config.menu - DESTINATION "${LXQT_ETC_XDG_DIR}/menus" - COMPONENT Runtime -) diff --git a/src/lxqt-config.desktop.in b/src/lxqt-config.desktop.in deleted file mode 100644 index e36dd86..0000000 --- a/src/lxqt-config.desktop.in +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Type=Application -Name=LXQt Configuration Center -GenericName=System Settings -Comment=Configure your system -Exec=lxqt-config -Icon=preferences-system -Categories=Settings;DesktopSettings;Qt;LXQt; -OnlyShowIn=LXQt; - -#TRANSLATIONS_DIR=translations diff --git a/src/lxqt-config.menu b/src/lxqt-config.menu deleted file mode 100644 index b2e4a7d..0000000 --- a/src/lxqt-config.menu +++ /dev/null @@ -1,71 +0,0 @@ - - - Settings - lxqt-menu-applications.directory - - - - - - - Settings - - - - LXQt settings - lxqt-settings-lxqt.directory - - - DesktopSettings - - LXQt - X-LXQt - - obconf-qt.desktop - compton-conf.desktop - pcmanfm-qt-desktop-pref.desktop - - - lxqt-config.desktop - System - - - - - - - System settings - lxqt-settings-system.directory - - - Settings - System - - - - - - Other settings - lxqt-settings-other.directory - - - - Settings - - - LXQt - LXDE - System - - - - - - - - LXQt settings - System settings - - - - diff --git a/src/main.cpp b/src/main.cpp deleted file mode 100644 index abe16a2..0000000 --- a/src/main.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2010-2011 Razor team - * Authors: - * Petr Vanek - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include -#include -#include "mainwindow.h" -#include "QCommandLineParser" - - -int main(int argc, char **argv) -{ - LXQt::SingleApplication app(argc, argv); - app.setOrganizationName(QStringLiteral("lxqt")); - app.setApplicationName(QStringLiteral("lxqt-config")); - app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); - - QCommandLineParser parser; - parser.setApplicationDescription(QStringLiteral("LXQt Config")); - const QString VERINFO = QStringLiteral(LXQT_CONFIG_VERSION - "\nliblxqt " LXQT_VERSION - "\nQt " QT_VERSION_STR); - app.setApplicationVersion(VERINFO); - parser.addVersionOption(); - parser.addHelpOption(); - parser.process(app); - - // ensure that we use lxqt-config.menu file. - qputenv("XDG_MENU_PREFIX", "lxqt-"); - - LXQtConfig::MainWindow w; - app.setActivationWindow(&w); - QSize s = QSettings{}.value("size").toSize(); - if (!s.isEmpty()) - w.resize(s); - w.show(); - - int ret = app.exec(); - - QSettings{}.setValue("size", w.size()); - - return ret; -} diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp deleted file mode 100644 index 7641e79..0000000 --- a/src/mainwindow.cpp +++ /dev/null @@ -1,329 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://lxqt.org - * - * Copyright: 2010-2011 Razor team - * Authors: - * Petr Vanek - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include -#include -#include - -#include "mainwindow.h" -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "qcategorizedview.h" -#include "qcategorydrawer.h" -#include "qcategorizedsortfilterproxymodel.h" - -namespace LXQtConfig { - -struct ConfigPaneData: public QSharedData -{ - QString id; - QString category; - XdgDesktopFile xdg; -}; - -class ConfigPane -{ -public: - ConfigPane(): d(new ConfigPaneData) { } - ConfigPane(const ConfigPane &other): d(other.d) { } - - inline QString &id() const { return d->id; } - inline XdgDesktopFile xdg() const { return d->xdg; } - inline void setXdg(XdgDesktopFile xdg) { d->xdg = xdg; } - inline QString &category() const { return d->category; } - - bool operator==(const ConfigPane &other) - { - return d->id == other.id(); - } - -private: - QExplicitlySharedDataPointer d; -}; - - -class ConfigPaneModel: public QAbstractListModel -{ -public: - ConfigPaneModel(): QAbstractListModel() - { - QString menuFile = XdgMenu::getMenuFileName("config.menu"); - XdgMenu xdgMenu; - xdgMenu.setEnvironments(QStringList() << "X-LXQT" << "LXQt" << "LXDE"); - bool res = xdgMenu.read(menuFile); - if (!res) - { - QMessageBox::warning(0, "Parse error", xdgMenu.errorString()); - return; - } - - DomElementIterator it(xdgMenu.xml().documentElement() , "Menu"); - while(it.hasNext()) - { - this->buildGroup(it.next()); - } - } - - void buildGroup(const QDomElement& xml) - { - QString category; - if (! xml.attribute("title").isEmpty()) - category = xml.attribute("title"); - else - category = xml.attribute("name"); - - DomElementIterator it(xml , "AppLink"); - while(it.hasNext()) - { - QDomElement x = it.next(); - - XdgDesktopFile xdg; - xdg.load(x.attribute("desktopFile")); - - ConfigPane pane; - pane.id() = xdg.value("Icon").toString(); - pane.category() = category; - pane.setXdg(xdg); - m_list.append(pane); - } - } - - void activateItem(const QModelIndex &index) - { - if (!index.isValid()) - return; - m_list[index.row()].xdg().startDetached(); - } - - ~ConfigPaneModel() { } - - int rowCount(const QModelIndex &parent = QModelIndex()) const - { - return m_list.count(); - } - - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) - { - return false; - } - - QVariant data(const QModelIndex &index, int role) const - { - if (role == Qt::DisplayRole || role == Qt::ToolTipRole) - return m_list[index.row()].xdg().name(); - if (role == QCategorizedSortFilterProxyModel::CategoryDisplayRole) - return m_list[index.row()].category(); - if (role == QCategorizedSortFilterProxyModel::CategorySortRole) - return m_list[index.row()].category(); - if (role == Qt::UserRole) - return m_list[index.row()].id(); - if (role == Qt::DecorationRole) - { - return m_list[index.row()].xdg().icon(XdgIcon::defaultApplicationIcon()); - } - return QVariant(); - } - -private: - QList m_list; -}; - -} - - -class ConfigItemDelegate : public QStyledItemDelegate -{ -public: - ConfigItemDelegate(QCategorizedView* view) : mView(view) { } - ~ConfigItemDelegate() { } - - QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const - { - /* We let Qt calculate the real cell size but consider the 4-px margin - around each cell and try to add a 2-px margin around the selection - rectangle for styles that, unlike Fusion, highlight the whole item. */ - QStyleOptionViewItem opt = option; - int delta = opt.rect.width() - (mView->gridSize().width() - 8); - if (delta > 0) - opt.rect.adjust(delta/2, 0 , -delta/2, 0); - QSize defaultSize = QStyledItemDelegate::sizeHint(opt, index); - return QSize(qMin(defaultSize.width() + 4, mView->gridSize().width() - 8), - qMin(defaultSize.height() + 4, mView->gridSize().height() - 8)); - } - -protected: - void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const - { - QStyleOptionViewItem opt = option; - initStyleOption(&opt, index); - - const QSize & iconSize = option.decorationSize; - QSize size(mView->gridSize().width() - 8, // 4-px margin around each cell - iconSize.height()); - // for having sharp non-scalable icons with HDPI - int dpr = qApp->devicePixelRatio(); - if (dpr < 1) dpr = 1; - QPixmap pixmap = opt.icon.pixmap(iconSize / dpr); // -> Qt doc -> QIcon::pixmap() - if (dpr > 1 && pixmap.size() == iconSize) // exceptional (scalable or not from icon set) - pixmap = opt.icon.pixmap(iconSize); - opt.icon = QIcon(pixmap.copy(QRect(QPoint(0, 0), size * dpr))); - opt.decorationSize = size; - - QApplication::style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter); - } - -private: - QCategorizedView *mView; -}; - - -LXQtConfig::MainWindow::MainWindow() : QMainWindow() -{ - setupUi(this); - view->installEventFilter(this); - - /* To always have the intended layout on startup, - the listview should be shown after it's fully formed. */ - view->hide(); - - model = new ConfigPaneModel(); - - view->setViewMode(QListView::IconMode); - view->setWordWrap(true); - view->setUniformItemSizes(true); - view->setCategoryDrawer(new QCategoryDrawerV3(view)); - - connect(view, &QAbstractItemView::activated, [this] (const QModelIndex & index) { pendingActivation = index; }); - view->setFocus(); - - QTimer::singleShot(0, [this] { setSizing(); }); - QTimer::singleShot(1, this, SLOT(load())); - new QShortcut{QKeySequence{Qt::CTRL + Qt::Key_Q}, this, SLOT(close())}; -} - -void LXQtConfig::MainWindow::load() -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - proxyModel = new QCategorizedSortFilterProxyModel(); - proxyModel->setCategorizedModel(true); - proxyModel->setSourceModel(model); - - view->setModel(proxyModel); - view->setItemDelegate(new ConfigItemDelegate(view)); - - view->show(); - - QApplication::restoreOverrideCursor(); -} - -void LXQtConfig::MainWindow::activateItem() -{ - if (pendingActivation.isValid()) - { - model->activateItem(pendingActivation); - pendingActivation = QModelIndex{}; - } -} - -/*Note: all this delayed activation is here to workaround the auto-repeated - * Enter/Return key activation -> if the user keeps pressing the enter/return - * we normaly will keep activating (spawning new processes) until the focus - * isn't stolen from our window. New process is not spawned until the - * (non-autorepeated) KeyRelease is delivered. - * - * ref https://github.com/lxde/lxqt/issues/965 - */ -bool LXQtConfig::MainWindow::eventFilter(QObject * watched, QEvent * event) -{ - if (view != watched) - return false; - switch (event->type()) - { - case QEvent::KeyPress: - case QEvent::KeyRelease: - { - QKeyEvent * ev = dynamic_cast(event); - switch (ev->key()) - { - case Qt::Key_Enter: - case Qt::Key_Return: - if (QEvent::KeyRelease == ev->type() && !ev->isAutoRepeat()) - activateItem(); - } - } - break; - case QEvent::MouseButtonRelease: - activateItem(); - break; - default: - //keep warnings quiet - break; - } - return false; -} - -void LXQtConfig::MainWindow::setSizing() -{ - // consult the style to know the icon size - int iconSize = qBound(16, view->decorationSize().height(), 256); - // DPR is automatically taken into account in setIconSize() - // but wee need to consider it explicitly below - int dpr = qApp->devicePixelRatio(); - if (dpr < 1) dpr = 1; - iconSize *= dpr; - /* To have an appropriate grid size, we suppose that - * - * (1) The text has 3 lines and each line has 16 chars (for languages like German), at most; - * (2) The selection rect has a margin of 2 px, at most; - * (3) There is, at most, a 3-px spacing between text and icon; and - * (4) There is a 4-px margin around each cell. - */ - QFontMetrics fm = fontMetrics(); - int textWidth = fm.averageCharWidth() * 16; - int textHeight = fm.lineSpacing() * 3; - QSize grid; - grid.setWidth(qMax(iconSize, textWidth) + 4); - grid.setHeight(iconSize + textHeight + 4 + 3); - view->setGridSize(grid + QSize(8, 8)); -} - -bool LXQtConfig::MainWindow::event(QEvent * event) -{ - if (QEvent::StyleChange == event->type()) - setSizing(); - return QMainWindow::event(event); -} diff --git a/src/mainwindow.h b/src/mainwindow.h deleted file mode 100644 index d768fed..0000000 --- a/src/mainwindow.h +++ /dev/null @@ -1,74 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXQt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2010-2011 Razor team - * Authors: - * Petr Vanek - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - - - -#include "ui_mainwindow.h" -#include - -class QCategorizedSortFilterProxyModel; - -namespace LXQtConfig { - - class ConfigPaneModel; - -/*! \brief Main config window. -Just read desktop files with Settings category from /usr/share/applications -and list them in view. Then it can start those standalone apps. -*/ -class MainWindow : public QMainWindow, public Ui::MainWindow -{ - Q_OBJECT - -public: - MainWindow(); - -protected: - virtual bool event(QEvent * event) override; - virtual bool eventFilter(QObject * watched, QEvent * event) override; - -private: - QCategorizedSortFilterProxyModel *proxyModel; - ConfigPaneModel *model; - QPersistentModelIndex pendingActivation; - -private: - void builGroup(const QDomElement& xml); - void setSizing(); - void activateItem(); - -private slots: - void load(); -}; - -}; // namespace - - -#endif diff --git a/src/mainwindow.ui b/src/mainwindow.ui deleted file mode 100644 index 02002d6..0000000 --- a/src/mainwindow.ui +++ /dev/null @@ -1,89 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 696 - 404 - - - - Configuration Center - - - - - - - - 0 - - - 1 - - - 1 - - - - - QFrame::NoFrame - - - - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - QDialogButtonBox::Close - - - - - - - - - - - QCategorizedView - QListView -
qcategorizedview.h
-
-
- - - - buttonBox - rejected() - MainWindow - close() - - - 481 - 324 - - - 458 - 341 - - - - -
diff --git a/src/qcategorizedview/CMakeLists.txt b/src/qcategorizedview/CMakeLists.txt deleted file mode 100644 index 2f4577f..0000000 --- a/src/qcategorizedview/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(qcategorizedview) - -set(SOURCES - qcategorizedview.cpp - qcategorydrawer.cpp - qcategorizedsortfilterproxymodel.cpp -) - -add_library(qcategorizedview STATIC ${SOURCES}) -target_link_libraries(qcategorizedview Qt5::Widgets) diff --git a/src/qcategorizedview/qcategorizedsortfilterproxymodel.cpp b/src/qcategorizedview/qcategorizedsortfilterproxymodel.cpp deleted file mode 100644 index c74636b..0000000 --- a/src/qcategorizedview/qcategorizedsortfilterproxymodel.cpp +++ /dev/null @@ -1,320 +0,0 @@ -/** - * (c)LGPL2+ - * This file is part of the KDE project - * Copyright (C) 2007 Rafael Fernández López - * Copyright (C) 2007 John Tapsell - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -#include "qcategorizedsortfilterproxymodel.h" -#include "qcategorizedsortfilterproxymodel_p.h" - -#include - -#include -#include -#include - -//#include - -int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive) -{ - // This method chops the input a and b into pieces of - // digits and non-digits (a1.05 becomes a | 1 | . | 05) - // and compares these pieces of a and b to each other - // (first with first, second with second, ...). - // - // This is based on the natural sort order code code by Martin Pool - // http://sourcefrog.net/projects/natsort/ - // Martin Pool agreed to license this under LGPL or GPL. - - // FIXME: Using toLower() to implement case insensitive comparison is - // sub-optimal, but is needed because we compare strings with - // localeAwareCompare(), which does not know about case sensitivity. - // A task has been filled for this in Qt Task Tracker with ID 205990. - // http://trolltech.com/developer/task-tracker/index_html?method=entry&id=205990 - QString a; - QString b; - if (caseSensitivity == Qt::CaseSensitive) { - a = _a; - b = _b; - } else { - a = _a.toLower(); - b = _b.toLower(); - } - - const QChar* currA = a.unicode(); // iterator over a - const QChar* currB = b.unicode(); // iterator over b - - if (currA == currB) { - return 0; - } - - while (!currA->isNull() && !currB->isNull()) { - const QChar* begSeqA = currA; // beginning of a new character sequence of a - const QChar* begSeqB = currB; - if (currA->unicode() == QChar::ObjectReplacementCharacter) { - return 1; - } - - if (currB->unicode() == QChar::ObjectReplacementCharacter) { - return -1; - } - - if (currA->unicode() == QChar::ReplacementCharacter) { - return 1; - } - - if (currB->unicode() == QChar::ReplacementCharacter) { - return -1; - } - - // find sequence of characters ending at the first non-character - while (!currA->isNull() && !currA->isDigit() && !currA->isPunct() && !currA->isSpace()) { - ++currA; - } - - while (!currB->isNull() && !currB->isDigit() && !currB->isPunct() && !currB->isSpace()) { - ++currB; - } - - // compare these sequences - const QStringRef& subA(a.midRef(begSeqA - a.unicode(), currA - begSeqA)); - const QStringRef& subB(b.midRef(begSeqB - b.unicode(), currB - begSeqB)); - const int cmp = QStringRef::localeAwareCompare(subA, subB); - if (cmp != 0) { - return cmp < 0 ? -1 : +1; - } - - if (currA->isNull() || currB->isNull()) { - break; - } - - // find sequence of characters ending at the first non-character - while ((currA->isPunct() || currA->isSpace()) && (currB->isPunct() || currB->isSpace())) { - if (*currA != *currB) { - return (*currA < *currB) ? -1 : +1; - } - ++currA; - ++currB; - if (currA->isNull() || currB->isNull()) { - break; - } - } - - // now some digits follow... - if ((*currA == QLatin1Char('0')) || (*currB == QLatin1Char('0'))) { - // one digit-sequence starts with 0 -> assume we are in a fraction part - // do left aligned comparison (numbers are considered left aligned) - while (1) { - if (!currA->isDigit() && !currB->isDigit()) { - break; - } else if (!currA->isDigit()) { - return +1; - } else if (!currB->isDigit()) { - return -1; - } else if (*currA < *currB) { - return -1; - } else if (*currA > *currB) { - return + 1; - } - ++currA; - ++currB; - } - } else { - // No digit-sequence starts with 0 -> assume we are looking at some integer - // do right aligned comparison. - // - // The longest run of digits wins. That aside, the greatest - // value wins, but we can't know that it will until we've scanned - // both numbers to know that they have the same magnitude. - - bool isFirstRun = true; - int weight = 0; - while (1) { - if (!currA->isDigit() && !currB->isDigit()) { - if (weight != 0) { - return weight; - } - break; - } else if (!currA->isDigit()) { - if (isFirstRun) { - return *currA < *currB ? -1 : +1; - } else { - return -1; - } - } else if (!currB->isDigit()) { - if (isFirstRun) { - return *currA < *currB ? -1 : +1; - } else { - return +1; - } - } else if ((*currA < *currB) && (weight == 0)) { - weight = -1; - } else if ((*currA > *currB) && (weight == 0)) { - weight = + 1; - } - ++currA; - ++currB; - isFirstRun = false; - } - } - } - - if (currA->isNull() && currB->isNull()) { - return 0; - } - - return currA->isNull() ? -1 : + 1; -} - -QCategorizedSortFilterProxyModel::QCategorizedSortFilterProxyModel(QObject *parent) - : QSortFilterProxyModel(parent) - , d(new Private()) - -{ -} - -QCategorizedSortFilterProxyModel::~QCategorizedSortFilterProxyModel() -{ - delete d; -} - -void QCategorizedSortFilterProxyModel::sort(int column, Qt::SortOrder order) -{ - d->sortColumn = column; - d->sortOrder = order; - - QSortFilterProxyModel::sort(column, order); -} - -bool QCategorizedSortFilterProxyModel::isCategorizedModel() const -{ - return d->categorizedModel; -} - -void QCategorizedSortFilterProxyModel::setCategorizedModel(bool categorizedModel) -{ - if (categorizedModel == d->categorizedModel) - { - return; - } - - d->categorizedModel = categorizedModel; - - invalidate(); -} - -int QCategorizedSortFilterProxyModel::sortColumn() const -{ - return d->sortColumn; -} - -Qt::SortOrder QCategorizedSortFilterProxyModel::sortOrder() const -{ - return d->sortOrder; -} - -void QCategorizedSortFilterProxyModel::setSortCategoriesByNaturalComparison(bool sortCategoriesByNaturalComparison) -{ - if (sortCategoriesByNaturalComparison == d->sortCategoriesByNaturalComparison) - { - return; - } - - d->sortCategoriesByNaturalComparison = sortCategoriesByNaturalComparison; - - invalidate(); -} - -bool QCategorizedSortFilterProxyModel::sortCategoriesByNaturalComparison() const -{ - return d->sortCategoriesByNaturalComparison; -} - -bool QCategorizedSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const -{ - if (d->categorizedModel) - { - int compare = compareCategories(left, right); - - if (compare > 0) // left is greater than right - { - return false; - } - else if (compare < 0) // left is less than right - { - return true; - } - } - - return subSortLessThan(left, right); -} - -bool QCategorizedSortFilterProxyModel::subSortLessThan(const QModelIndex &left, const QModelIndex &right) const -{ - return QSortFilterProxyModel::lessThan(left, right); -} - -int QCategorizedSortFilterProxyModel::compareCategories(const QModelIndex &left, const QModelIndex &right) const -{ - QVariant l = (left.model() ? left.model()->data(left, CategorySortRole) : QVariant()); - QVariant r = (right.model() ? right.model()->data(right, CategorySortRole) : QVariant()); - - Q_ASSERT(l.isValid()); - Q_ASSERT(r.isValid()); - Q_ASSERT(l.type() == r.type()); - - if (l.type() == QVariant::String) - { - QString lstr = l.toString(); - QString rstr = r.toString(); - - if (d->sortCategoriesByNaturalComparison) - { - return naturalCompare(lstr, rstr); - } - else - { - if (lstr < rstr) - { - return -1; - } - - if (lstr > rstr) - { - return 1; - } - - return 0; - } - } - - qlonglong lint = l.toLongLong(); - qlonglong rint = r.toLongLong(); - - if (lint < rint) - { - return -1; - } - - if (lint > rint) - { - return 1; - } - - return 0; -} diff --git a/src/qcategorizedview/qcategorizedsortfilterproxymodel.h b/src/qcategorizedview/qcategorizedsortfilterproxymodel.h deleted file mode 100644 index 95f0c71..0000000 --- a/src/qcategorizedview/qcategorizedsortfilterproxymodel.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - * (c)LGPL2+ - * This file is part of the KDE project - * Copyright (C) 2007 Rafael Fernández López - * Copyright (C) 2007 John Tapsell - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef KCATEGORIZEDSORTFILTERPROXYMODEL_H -#define KCATEGORIZEDSORTFILTERPROXYMODEL_H - -#include - -#define KDEUI_EXPORT - -//#include - -class QItemSelection; - - -/** - * This class lets you categorize a view. It is meant to be used along with - * QCategorizedView class. - * - * In general terms all you need to do is to reimplement subSortLessThan() and - * compareCategories() methods. In order to make categorization work, you need - * to also call setCategorizedModel() class to enable it, since the categorization - * is disabled by default. - * - * @see QCategorizedView - * - * @author Rafael Fernández López - */ -class KDEUI_EXPORT QCategorizedSortFilterProxyModel - : public QSortFilterProxyModel -{ -public: - enum AdditionalRoles { - // Note: use printf "0x%08X\n" $(($RANDOM*$RANDOM)) - // to define additional roles. - CategoryDisplayRole = 0x17CE990A, ///< This role is used for asking the category to a given index - - CategorySortRole = 0x27857E60 ///< This role is used for sorting categories. You can return a - ///< string or a long long value. Strings will be sorted alphabetically - ///< while long long will be sorted by their value. Please note that this - ///< value won't be shown on the view, is only for sorting purposes. What will - ///< be shown as "Category" on the view will be asked with the role - ///< CategoryDisplayRole. - }; - - QCategorizedSortFilterProxyModel(QObject *parent = 0); - virtual ~QCategorizedSortFilterProxyModel(); - - /** - * Overridden from QSortFilterProxyModel. Sorts the source model using - * @p column for the given @p order. - */ - virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); - - /** - * @return whether the model is categorized or not. Disabled by default. - */ - bool isCategorizedModel() const; - - /** - * Enables or disables the categorization feature. - * - * @param categorizedModel whether to enable or disable the categorization feature. - */ - void setCategorizedModel(bool categorizedModel); - - /** - * @return the column being used for sorting. - */ - int sortColumn() const; - - /** - * @return the sort order being used for sorting. - */ - Qt::SortOrder sortOrder() const; - - /** - * Set if the sorting using CategorySortRole will use a natural comparison - * in the case that strings were returned. If enabled, QString::localeAwareCompare - * will be used for sorting. - * - * @param sortCategoriesByNaturalComparison whether to sort using a natural comparison or not. - */ - void setSortCategoriesByNaturalComparison(bool sortCategoriesByNaturalComparison); - - /** - * @return whether it is being used a natural comparison for sorting. Enabled by default. - */ - bool sortCategoriesByNaturalComparison() const; - -protected: - /** - * Overridden from QSortFilterProxyModel. If you are subclassing - * QCategorizedSortFilterProxyModel, you will probably not need to reimplement this - * method. - * - * It calls compareCategories() to sort by category. If the both items are in the - * same category (i.e. compareCategories returns 0), then subSortLessThan is called. - * - * @return Returns true if the item @p left is less than the item @p right when sorting. - * - * @warning You usually won't need to reimplement this method when subclassing - * from QCategorizedSortFilterProxyModel. - */ - virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const; - - /** - * This method has a similar purpose as lessThan() has on QSortFilterProxyModel. - * It is used for sorting items that are in the same category. - * - * @return Returns true if the item @p left is less than the item @p right when sorting. - */ - virtual bool subSortLessThan(const QModelIndex &left, const QModelIndex &right) const; - - /** - * This method compares the category of the @p left index with the category - * of the @p right index. - * - * Internally and if not reimplemented, this method will ask for @p left and - * @p right models for role CategorySortRole. In order to correctly sort - * categories, the data() metod of the model should return a qlonglong (or numeric) value, or - * a QString object. QString objects will be sorted with QString::localeAwareCompare if - * sortCategoriesByNaturalComparison() is true. - * - * @note Please have present that: - * QString(QChar(QChar::ObjectReplacementCharacter)) > - * QString(QChar(QChar::ReplacementCharacter)) > - * [ all possible strings ] > - * QString(); - * - * This means that QString() will be sorted the first one, while - * QString(QChar(QChar::ObjectReplacementCharacter)) and - * QString(QChar(QChar::ReplacementCharacter)) will be sorted in last - * position. - * - * @warning Please note that data() method of the model should return always - * information of the same type. If you return a QString for an index, - * you should return always QStrings for all indexes for role CategorySortRole - * in order to correctly sort categories. You can't mix by returning - * a QString for one index, and a qlonglong for other. - * - * @note If you need a more complex layout, you will have to reimplement this - * method. - * - * @return A negative value if the category of @p left should be placed before the - * category of @p right. 0 if @p left and @p right are on the same category, and - * a positive value if the category of @p left should be placed after the - * category of @p right. - */ - virtual int compareCategories(const QModelIndex &left, const QModelIndex &right) const; - -private: - class Private; - Private *const d; -}; - - -#endif // KCATEGORIZEDSORTFILTERPROXYMODEL_H diff --git a/src/qcategorizedview/qcategorizedsortfilterproxymodel_p.h b/src/qcategorizedview/qcategorizedsortfilterproxymodel_p.h deleted file mode 100644 index f2cd9a0..0000000 --- a/src/qcategorizedview/qcategorizedsortfilterproxymodel_p.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * (c)LGPL2+ - * This file is part of the KDE project - * Copyright (C) 2007 Rafael Fernández López - * Copyright (C) 2007 John Tapsell - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef KCATEGORIZEDSORTFILTERPROXYMODEL_P_H -#define KCATEGORIZEDSORTFILTERPROXYMODEL_P_H - -class QCategorizedSortFilterProxyModel; - -class QCategorizedSortFilterProxyModel::Private -{ -public: - Private() - : sortColumn(0) - , sortOrder(Qt::AscendingOrder) - , categorizedModel(false) - , sortCategoriesByNaturalComparison(true) - { - } - - ~Private() - { - } - - int sortColumn; - Qt::SortOrder sortOrder; - bool categorizedModel; - bool sortCategoriesByNaturalComparison; -}; - -#endif diff --git a/src/qcategorizedview/qcategorizedview.cpp b/src/qcategorizedview/qcategorizedview.cpp deleted file mode 100644 index 7441a0b..0000000 --- a/src/qcategorizedview/qcategorizedview.cpp +++ /dev/null @@ -1,1581 +0,0 @@ -/** - * (c)LGPL2+ - * This file is part of the KDE project - * Copyright (C) 2007, 2009 Rafael Fernández López - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -/** - * IMPLEMENTATION NOTES: - * - * QListView::setRowHidden() and QListView::isRowHidden() are not taken into - * account. This methods should actually not exist. This effect should be handled - * by an hypothetical QSortFilterProxyModel which filters out the desired rows. - * - * In case this needs to be implemented, contact me, but I consider this a faulty - * design. - */ - -#include "qcategorizedview.h" -#include "qcategorizedview_p.h" - -#include // trunc on C99 compliant systems -//#include // trunc for not C99 compliant systems - -#include -#include -#include - -#include "qcategorydrawer.h" -#include "qcategorizedsortfilterproxymodel.h" - -//BEGIN: Private part - -struct QCategorizedView::Private::Item -{ - Item() - : topLeft(QPoint()) - , size(QSize()) - { - } - - QPoint topLeft; - QSize size; -}; - -struct QCategorizedView::Private::Block -{ - Block() - : topLeft(QPoint()) - , height(-1) - , firstIndex(QModelIndex()) - , quarantineStart(QModelIndex()) - , items(QList()) - , outOfQuarantine(false) - , alternate(false) - , collapsed(false) - { - } - - bool operator!=(const Block &rhs) const - { - return firstIndex != rhs.firstIndex; - } - - static bool lessThan(const Block &left, const Block &right) - { - Q_ASSERT(left.firstIndex.isValid()); - Q_ASSERT(right.firstIndex.isValid()); - return left.firstIndex.row() < right.firstIndex.row(); - } - - QPoint topLeft; - int height; - QPersistentModelIndex firstIndex; - // if we have n elements on this block, and we inserted an element at position i. The quarantine - // will start at index (i, column, parent). This means that for all elements j where i <= j <= n, the - // visual rect position of item j will have to be recomputed (cannot use the cached point). The quarantine - // will only affect the current block, since the rest of blocks can be affected only in the way - // that the whole block will have different offset, but items will keep the same relative position - // in terms of their parent blocks. - QPersistentModelIndex quarantineStart; - QList items; - - // this affects the whole block, not items separately. items contain the topLeft point relative - // to the block. Because of insertions or removals a whole block can be moved, so the whole block - // will enter in quarantine, what is faster than moving all items in absolute terms. - bool outOfQuarantine; - - // should we alternate its color ? is just a hint, could not be used - bool alternate; - bool collapsed; -}; - -QCategorizedView::Private::Private(QCategorizedView *q) - : q(q) - , proxyModel(0) - , categoryDrawer(0) - , categoryDrawerV2(0) - , categoryDrawerV3(0) - , categorySpacing(5) - , alternatingBlockColors(false) - , collapsibleBlocks(false) - , hoveredBlock(new Block()) - , hoveredIndex(QModelIndex()) - , pressedPosition(QPoint()) - , rubberBandRect(QRect()) -{ -} - -QCategorizedView::Private::~Private() -{ - delete hoveredBlock; -} - -bool QCategorizedView::Private::isCategorized() const -{ - return proxyModel && categoryDrawer && proxyModel->isCategorizedModel(); -} - -QStyleOptionViewItem QCategorizedView::Private::blockRect(const QModelIndex &representative) -{ - QStyleOptionViewItem option(q->viewOptions()); - const int height = categoryDrawer->categoryHeight(representative, option); - const QString categoryDisplay = representative.data(QCategorizedSortFilterProxyModel::CategoryDisplayRole).toString(); - QPoint pos = blockPosition(categoryDisplay); - pos.ry() -= height; - option.rect.setTopLeft(pos); - option.rect.setWidth(viewportWidth() + categoryDrawer->leftMargin() + categoryDrawer->rightMargin()); - option.rect.setHeight(height + blockHeight(categoryDisplay)); - option.rect = mapToViewport(option.rect); - - return option; -} - -QPair QCategorizedView::Private::intersectingIndexesWithRect(const QRect &_rect) const -{ - const int rowCount = proxyModel->rowCount(); - - const QRect rect = _rect.normalized(); - - // binary search to find out the top border - int bottom = 0; - int top = rowCount - 1; - while (bottom <= top) { - const int middle = (bottom + top) / 2; - const QModelIndex index = proxyModel->index(middle, q->modelColumn(), q->rootIndex()); - QRect itemRect = q->visualRect(index); - const int verticalOff = q->verticalOffset(); - const int horizontalOff = q->horizontalOffset(); - itemRect.topLeft().ry() += verticalOff; - itemRect.topLeft().rx() += horizontalOff; - itemRect.bottomRight().ry() += verticalOff; - itemRect.bottomRight().rx() += horizontalOff; - if (itemRect.bottomRight().y() <= rect.topLeft().y()) { - bottom = middle + 1; - } else { - top = middle - 1; - } - } - - const QModelIndex bottomIndex = proxyModel->index(bottom, q->modelColumn(), q->rootIndex()); - - // binary search to find out the bottom border - bottom = 0; - top = rowCount - 1; - while (bottom <= top) { - const int middle = (bottom + top) / 2; - const QModelIndex index = proxyModel->index(middle, q->modelColumn(), q->rootIndex()); - QRect itemRect = q->visualRect(index); - const int verticalOff = q->verticalOffset(); - const int horizontalOff = q->horizontalOffset(); - itemRect.topLeft().ry() += verticalOff; - itemRect.topLeft().rx() += horizontalOff; - itemRect.bottomRight().ry() += verticalOff; - itemRect.bottomRight().rx() += horizontalOff; - if (itemRect.topLeft().y() <= rect.bottomRight().y()) { - bottom = middle + 1; - } else { - top = middle - 1; - } - } - - const QModelIndex topIndex = proxyModel->index(top, q->modelColumn(), q->rootIndex()); - - return qMakePair(bottomIndex, topIndex); -} - -QPoint QCategorizedView::Private::blockPosition(const QString &category) -{ - Block &block = blocks[category]; - - if (block.outOfQuarantine && !block.topLeft.isNull()) { - return block.topLeft; - } - - QPoint res(categorySpacing, 0); - - const QModelIndex index = block.firstIndex; - - for (QHash::Iterator it = blocks.begin(); it != blocks.end(); ++it) { - Block &block = *it; - const QModelIndex categoryIndex = block.firstIndex; - if (index.row() < categoryIndex.row()) { - continue; - } - res.ry() += categoryDrawer->categoryHeight(categoryIndex, q->viewOptions()) + categorySpacing; - if (index.row() == categoryIndex.row()) { - continue; - } - res.ry() += blockHeight(it.key()); - } - - block.outOfQuarantine = true; - block.topLeft = res; - - return res; -} - -int QCategorizedView::Private::blockHeight(const QString &category) -{ - Block &block = blocks[category]; - - if (block.collapsed) { - return 0; - } - - if (block.height > -1) { - return block.height; - } - - const QModelIndex firstIndex = block.firstIndex; - const QModelIndex lastIndex = proxyModel->index(firstIndex.row() + block.items.count() - 1, q->modelColumn(), q->rootIndex()); - const QRect topLeft = q->visualRect(firstIndex); - QRect bottomRight = q->visualRect(lastIndex); - - if (hasGrid()) { - bottomRight.setHeight(qMax(bottomRight.height(), q->gridSize().height())); - } else { - if (!q->uniformItemSizes()) { - bottomRight.setHeight(highestElementInLastRow(block) + q->spacing() * 2); - } - } - - const int height = bottomRight.bottomRight().y() - topLeft.topLeft().y() + 1; - block.height = height; - - return height; -} - -int QCategorizedView::Private::viewportWidth() const -{ - return q->viewport()->width() - categorySpacing * 2 - categoryDrawer->leftMargin() - categoryDrawer->rightMargin(); -} - -void QCategorizedView::Private::regenerateAllElements() -{ - for (QHash::Iterator it = blocks.begin(); it != blocks.end(); ++it) { - Block &block = *it; - block.outOfQuarantine = false; - block.quarantineStart = block.firstIndex; - block.height = -1; - } -} - -void QCategorizedView::Private::rowsInserted(const QModelIndex &parent, int start, int end) -{ - if (!isCategorized()) { - return; - } - - for (int i = start; i <= end; ++i) { - const QModelIndex index = proxyModel->index(i, q->modelColumn(), parent); - - Q_ASSERT(index.isValid()); - - const QString category = categoryForIndex(index); - - Block &block = blocks[category]; - - //BEGIN: update firstIndex - // save as firstIndex in block if - // - it forced the category creation (first element on this category) - // - it is before the first row on that category - const QModelIndex firstIndex = block.firstIndex; - if (!firstIndex.isValid() || index.row() < firstIndex.row()) { - block.firstIndex = index; - } - //END: update firstIndex - - Q_ASSERT(block.firstIndex.isValid()); - - const int firstIndexRow = block.firstIndex.row(); - - block.items.insert(index.row() - firstIndexRow, Private::Item()); - block.height = -1; - - q->visualRect(index); - q->viewport()->update(); - } - - //BEGIN: update the items that are in quarantine in affected categories - { - const QModelIndex lastIndex = proxyModel->index(end, q->modelColumn(), parent); - const QString category = categoryForIndex(lastIndex); - Private::Block &block = blocks[category]; - block.quarantineStart = block.firstIndex; - } - //END: update the items that are in quarantine in affected categories - - //BEGIN: mark as in quarantine those categories that are under the affected ones - { - const QModelIndex firstIndex = proxyModel->index(start, q->modelColumn(), parent); - const QString category = categoryForIndex(firstIndex); - const QModelIndex firstAffectedCategory = blocks[category].firstIndex; - //BEGIN: order for marking as alternate those blocks that are alternate - QList blockList = blocks.values(); - qSort(blockList.begin(), blockList.end(), Block::lessThan); - QList firstIndexesRows; - foreach (const Block &block, blockList) { - firstIndexesRows << block.firstIndex.row(); - } - //END: order for marking as alternate those blocks that are alternate - for (QHash::Iterator it = blocks.begin(); it != blocks.end(); ++it) { - Private::Block &block = *it; - if (block.firstIndex.row() > firstAffectedCategory.row()) { - block.outOfQuarantine = false; - block.alternate = firstIndexesRows.indexOf(block.firstIndex.row()) % 2; - } else if (block.firstIndex.row() == firstAffectedCategory.row()) { - block.alternate = firstIndexesRows.indexOf(block.firstIndex.row()) % 2; - } - } - } - //END: mark as in quarantine those categories that are under the affected ones -} - -QRect QCategorizedView::Private::mapToViewport(const QRect &rect) const -{ - const int dx = -q->horizontalOffset(); - const int dy = -q->verticalOffset(); - return rect.adjusted(dx, dy, dx, dy); -} - -QRect QCategorizedView::Private::mapFromViewport(const QRect &rect) const -{ - const int dx = q->horizontalOffset(); - const int dy = q->verticalOffset(); - return rect.adjusted(dx, dy, dx, dy); -} - -int QCategorizedView::Private::highestElementInLastRow(const Block &block) const -{ - //Find the highest element in the last row - const QModelIndex lastIndex = proxyModel->index(block.firstIndex.row() + block.items.count() - 1, q->modelColumn(), q->rootIndex()); - const QRect prevRect = q->visualRect(lastIndex); - int res = prevRect.height(); - QModelIndex prevIndex = proxyModel->index(lastIndex.row() - 1, q->modelColumn(), q->rootIndex()); - if (!prevIndex.isValid()) { - return res; - } - Q_FOREVER { - const QRect tempRect = q->visualRect(prevIndex); - if (tempRect.topLeft().y() < prevRect.topLeft().y()) { - break; - } - res = qMax(res, tempRect.height()); - if (prevIndex == block.firstIndex) { - break; - } - prevIndex = proxyModel->index(prevIndex.row() - 1, q->modelColumn(), q->rootIndex()); - } - - return res; -} - -bool QCategorizedView::Private::hasGrid() const -{ - const QSize gridSize = q->gridSize(); - return gridSize.isValid() && !gridSize.isNull(); -} - -QString QCategorizedView::Private::categoryForIndex(const QModelIndex &index) const -{ - const QModelIndex categoryIndex = index.model()->index(index.row(), proxyModel->sortColumn(), index.parent()); - return categoryIndex.data(QCategorizedSortFilterProxyModel::CategoryDisplayRole).toString(); -} - -void QCategorizedView::Private::leftToRightVisualRect(const QModelIndex &index, Item &item, - const Block &block, const QPoint &blockPos) const -{ - const int firstIndexRow = block.firstIndex.row(); - - if (hasGrid()) { - const int relativeRow = index.row() - firstIndexRow; - const int maxItemsPerRow = qMax(viewportWidth() / q->gridSize().width(), 1); - if (q->layoutDirection() == Qt::LeftToRight) { - item.topLeft.rx() = (relativeRow % maxItemsPerRow) * q->gridSize().width() + blockPos.x() + categoryDrawer->leftMargin(); - } else { - item.topLeft.rx() = viewportWidth() - ((relativeRow % maxItemsPerRow) + 1) * q->gridSize().width() + categoryDrawer->leftMargin() + categorySpacing; - } - item.topLeft.ry() = (relativeRow / maxItemsPerRow) * q->gridSize().height(); - } else { - if (q->uniformItemSizes()) { - const int relativeRow = index.row() - firstIndexRow; - const QSize itemSize = q->sizeHintForIndex(index); - const int maxItemsPerRow = qMax((viewportWidth() - q->spacing()) / (itemSize.width() + q->spacing()), 1); - if (q->layoutDirection() == Qt::LeftToRight) { - item.topLeft.rx() = (relativeRow % maxItemsPerRow) * itemSize.width() + blockPos.x() + categoryDrawer->leftMargin(); - } else { - item.topLeft.rx() = viewportWidth() - (relativeRow % maxItemsPerRow) * itemSize.width() + categoryDrawer->leftMargin() + categorySpacing; - } - item.topLeft.ry() = (relativeRow / maxItemsPerRow) * itemSize.height(); - } else { - const QSize currSize = q->sizeHintForIndex(index); - if (index != block.firstIndex) { - const int viewportW = viewportWidth() - q->spacing(); - QModelIndex prevIndex = proxyModel->index(index.row() - 1, q->modelColumn(), q->rootIndex()); - QRect prevRect = q->visualRect(prevIndex); - prevRect = mapFromViewport(prevRect); - if ((prevRect.bottomRight().x() + 1) + currSize.width() - blockPos.x() + q->spacing() > viewportW) { - // we have to check the whole previous row, and see which one was the - // highest. - Q_FOREVER { - prevIndex = proxyModel->index(prevIndex.row() - 1, q->modelColumn(), q->rootIndex()); - const QRect tempRect = q->visualRect(prevIndex); - if (tempRect.topLeft().y() < prevRect.topLeft().y()) { - break; - } - if (tempRect.bottomRight().y() > prevRect.bottomRight().y()) { - prevRect = tempRect; - } - if (prevIndex == block.firstIndex) { - break; - } - } - if (q->layoutDirection() == Qt::LeftToRight) { - item.topLeft.rx() = categoryDrawer->leftMargin() + blockPos.x() + q->spacing(); - } else { - item.topLeft.rx() = viewportWidth() - currSize.width() + categoryDrawer->leftMargin() + categorySpacing; - } - item.topLeft.ry() = (prevRect.bottomRight().y() + 1) + q->spacing() - blockPos.y(); - } else { - if (q->layoutDirection() == Qt::LeftToRight) { - item.topLeft.rx() = (prevRect.bottomRight().x() + 1) + q->spacing(); - } else { - item.topLeft.rx() = (prevRect.bottomLeft().x() - 1) - q->spacing() - item.size.width() + categoryDrawer->leftMargin() + categorySpacing; - } - item.topLeft.ry() = prevRect.topLeft().y() - blockPos.y(); - } - } else { - if (q->layoutDirection() == Qt::LeftToRight) { - item.topLeft.rx() = blockPos.x() + categoryDrawer->leftMargin() + q->spacing(); - } else { - item.topLeft.rx() = viewportWidth() - currSize.width() + categoryDrawer->leftMargin() + categorySpacing; - } - item.topLeft.ry() = q->spacing(); - } - } - } - item.size = q->sizeHintForIndex(index); -} - -void QCategorizedView::Private::topToBottomVisualRect(const QModelIndex &index, Item &item, - const Block &block, const QPoint &blockPos) const -{ - const int firstIndexRow = block.firstIndex.row(); - - if (hasGrid()) { - const int relativeRow = index.row() - firstIndexRow; - item.topLeft.rx() = blockPos.x() + categoryDrawer->leftMargin(); - item.topLeft.ry() = relativeRow * q->gridSize().height(); - } else { - if (q->uniformItemSizes()) { - const int relativeRow = index.row() - firstIndexRow; - const QSize itemSize = q->sizeHintForIndex(index); - item.topLeft.rx() = blockPos.x() + categoryDrawer->leftMargin(); - item.topLeft.ry() = relativeRow * itemSize.height(); - } else { - if (index != block.firstIndex) { - QModelIndex prevIndex = proxyModel->index(index.row() - 1, q->modelColumn(), q->rootIndex()); - QRect prevRect = q->visualRect(prevIndex); - prevRect = mapFromViewport(prevRect); - item.topLeft.rx() = blockPos.x() + categoryDrawer->leftMargin() + q->spacing(); - item.topLeft.ry() = (prevRect.bottomRight().y() + 1) + q->spacing() - blockPos.y(); - } else { - item.topLeft.rx() = blockPos.x() + categoryDrawer->leftMargin() + q->spacing(); - item.topLeft.ry() = q->spacing(); - } - } - } - item.size = q->sizeHintForIndex(index); - item.size.setWidth(viewportWidth()); -} - -void QCategorizedView::Private::_k_slotCollapseOrExpandClicked(QModelIndex) -{ -} - -//END: Private part - -//BEGIN: Public part - -QCategorizedView::QCategorizedView(QWidget *parent) - : QListView(parent) - , d(new Private(this)) - , enterPressed(false) -{ -} - -QCategorizedView::~QCategorizedView() -{ - delete d; -} - -void QCategorizedView::setModel(QAbstractItemModel *model) -{ - if (d->proxyModel == model) { - return; - } - - d->blocks.clear(); - - if (d->proxyModel) { - disconnect(d->proxyModel, SIGNAL(layoutChanged()), this, SLOT(slotLayoutChanged())); - } - - d->proxyModel = dynamic_cast(model); - - if (d->proxyModel) { - connect(d->proxyModel, SIGNAL(layoutChanged()), this, SLOT(slotLayoutChanged())); - } - - QListView::setModel(model); - - // if the model already had information inserted, update our data structures to it - if (model->rowCount()) { - slotLayoutChanged(); - } -} - -void QCategorizedView::setGridSize(const QSize &size) -{ - setGridSizeOwn(size); -} - -void QCategorizedView::setGridSizeOwn(const QSize &size) -{ - d->regenerateAllElements(); - QListView::setGridSize(size); -} - -QRect QCategorizedView::visualRect(const QModelIndex &index) const -{ - if (!d->isCategorized()) { - return QListView::visualRect(index); - } - - if (!index.isValid()) { - return QRect(); - } - - const QString category = d->categoryForIndex(index); - - if (!d->blocks.contains(category)) { - return QRect(); - } - - Private::Block &block = d->blocks[category]; - const int firstIndexRow = block.firstIndex.row(); - - Q_ASSERT(block.firstIndex.isValid()); - - if (index.row() - firstIndexRow < 0 || index.row() - firstIndexRow >= block.items.count()) { - return QRect(); - } - - const QPoint blockPos = d->blockPosition(category); - - Private::Item &ritem = block.items[index.row() - firstIndexRow]; - - if (ritem.topLeft.isNull() || (block.quarantineStart.isValid() && - index.row() >= block.quarantineStart.row())) { - if (flow() == LeftToRight) { - d->leftToRightVisualRect(index, ritem, block, blockPos); - } else { - d->topToBottomVisualRect(index, ritem, block, blockPos); - } - - //BEGIN: update the quarantine start - const bool wasLastIndex = (index.row() == (block.firstIndex.row() + block.items.count() - 1)); - if (index.row() == block.quarantineStart.row()) { - if (wasLastIndex) { - block.quarantineStart = QModelIndex(); - } else { - const QModelIndex nextIndex = d->proxyModel->index(index.row() + 1, modelColumn(), rootIndex()); - block.quarantineStart = nextIndex; - } - } - //END: update the quarantine start - } - - // we get now the absolute position through the relative position of the parent block. do not - // save this on ritem, since this would override the item relative position in block terms. - Private::Item item(ritem); - item.topLeft.ry() += blockPos.y(); - - const QSize sizeHint = item.size; - - if (d->hasGrid()) { - const QSize sizeGrid = gridSize(); - const QSize resultingSize = sizeHint.boundedTo(sizeGrid); - QRect res(item.topLeft.x() + ((sizeGrid.width() - resultingSize.width()) / 2), - item.topLeft.y(), resultingSize.width(), resultingSize.height()); - if (block.collapsed) { - // we can still do binary search, while we "hide" items. We move those items in collapsed - // blocks to the left and set a 0 height. - res.setLeft(-resultingSize.width()); - res.setHeight(0); - } - return d->mapToViewport(res); - } - - QRect res(item.topLeft.x(), item.topLeft.y(), sizeHint.width(), sizeHint.height()); - if (block.collapsed) { - // we can still do binary search, while we "hide" items. We move those items in collapsed - // blocks to the left and set a 0 height. - res.setLeft(-sizeHint.width()); - res.setHeight(0); - } - return d->mapToViewport(res); -} - -QCategoryDrawer *QCategorizedView::categoryDrawer() const -{ - return d->categoryDrawer; -} - -void QCategorizedView::setCategoryDrawer(QCategoryDrawer *categoryDrawer) -{ - if (d->categoryDrawerV2) { - disconnect(d->categoryDrawerV2, SIGNAL(collapseOrExpandClicked(QModelIndex)), - this, SLOT(_k_slotCollapseOrExpandClicked(QModelIndex))); - } - - d->categoryDrawer = categoryDrawer; - d->categoryDrawerV2 = dynamic_cast(categoryDrawer); - d->categoryDrawerV3 = dynamic_cast(categoryDrawer); - - if (d->categoryDrawerV2) { - connect(d->categoryDrawerV2, SIGNAL(collapseOrExpandClicked(QModelIndex)), - this, SLOT(_k_slotCollapseOrExpandClicked(QModelIndex))); - } -} - -int QCategorizedView::categorySpacing() const -{ - return d->categorySpacing; -} - -void QCategorizedView::setCategorySpacing(int categorySpacing) -{ - if (d->categorySpacing == categorySpacing) { - return; - } - - d->categorySpacing = categorySpacing; - - for (QHash::Iterator it = d->blocks.begin(); it != d->blocks.end(); ++it) { - Private::Block &block = *it; - block.outOfQuarantine = false; - } -} - -bool QCategorizedView::alternatingBlockColors() const -{ - return d->alternatingBlockColors; -} - -void QCategorizedView::setAlternatingBlockColors(bool enable) -{ - d->alternatingBlockColors = enable; -} - -bool QCategorizedView::collapsibleBlocks() const -{ - return d->collapsibleBlocks; -} - -void QCategorizedView::setCollapsibleBlocks(bool enable) -{ - d->collapsibleBlocks = enable; -} - -QModelIndexList QCategorizedView::block(const QString &category) -{ - QModelIndexList res; - const Private::Block &block = d->blocks[category]; - if (block.height == -1) { - return res; - } - QModelIndex current = block.firstIndex; - const int first = current.row(); - for (int i = 1; i <= block.items.count(); ++i) { - if (current.isValid()) { - res << current; - } - current = d->proxyModel->index(first + i, modelColumn(), rootIndex()); - } - return res; -} - -QModelIndexList QCategorizedView::block(const QModelIndex &representative) -{ - return block(representative.data(QCategorizedSortFilterProxyModel::CategoryDisplayRole).toString()); -} - -QModelIndex QCategorizedView::indexAt(const QPoint &point) const -{ - if (!d->isCategorized()) { - return QListView::indexAt(point); - } - - const int rowCount = d->proxyModel->rowCount(); - if (!rowCount) { - return QModelIndex(); - } - - // Binary search that will try to spot if there is an index under point - int bottom = 0; - int top = rowCount - 1; - while (bottom <= top) { - const int middle = (bottom + top) / 2; - const QModelIndex index = d->proxyModel->index(middle, modelColumn(), rootIndex()); - QRect rect = visualRect(index); - const int verticalOff = verticalOffset(); - int horizontalOff = horizontalOffset(); - if (layoutDirection() == Qt::RightToLeft) { - horizontalOff *= -1; - } - rect.topLeft().ry() += verticalOff; - rect.topLeft().rx() += horizontalOff; - rect.bottomRight().ry() += verticalOff; - rect.bottomRight().rx() += horizontalOff; - if (rect.contains(point)) { - if (index.model()->flags(index) & Qt::ItemIsEnabled) { - return index; - } - return QModelIndex(); - } - bool directionCondition; - if (layoutDirection() == Qt::LeftToRight) { - directionCondition = point.x() > rect.bottomRight().x(); - } else { - directionCondition = point.x() < rect.bottomLeft().x(); - } - if (point.y() > rect.bottomRight().y() || - (point.y() > rect.topLeft().y() && point.y() < rect.bottomRight().y() && directionCondition)) { - bottom = middle + 1; - } else { - top = middle - 1; - } - } - return QModelIndex(); -} - -void QCategorizedView::reset() -{ - d->blocks.clear(); - QListView::reset(); -} - -QSize QCategorizedView::decorationSize() const -{ - return viewOptions().decorationSize; -} - -void QCategorizedView::paintEvent(QPaintEvent *event) -{ - if (!d->isCategorized()) { - QListView::paintEvent(event); - return; - } - - const QPair intersecting = d->intersectingIndexesWithRect(viewport()->rect().intersected(event->rect())); - - QPainter p(viewport()); - p.save(); - - Q_ASSERT(selectionModel()->model() == d->proxyModel); - - //BEGIN: draw categories - QHash::ConstIterator it(d->blocks.constBegin()); - while (it != d->blocks.constEnd()) { - const Private::Block &block = *it; - const QModelIndex categoryIndex = d->proxyModel->index(block.firstIndex.row(), d->proxyModel->sortColumn(), rootIndex()); - QStyleOptionViewItem option(viewOptions()); - option.features |= d->alternatingBlockColors && block.alternate ? QStyleOptionViewItem::Alternate - : QStyleOptionViewItem::None; - option.state |= !d->collapsibleBlocks || !block.collapsed ? QStyle::State_Open - : QStyle::State_None; - const int height = d->categoryDrawer->categoryHeight(categoryIndex, option); - QPoint pos = d->blockPosition(it.key()); - pos.ry() -= height; - option.rect.setTopLeft(pos); - option.rect.setWidth(d->viewportWidth() + d->categoryDrawer->leftMargin() + d->categoryDrawer->rightMargin()); - option.rect.setHeight(height + d->blockHeight(it.key())); - option.rect = d->mapToViewport(option.rect); - option.decorationPosition = QStyleOptionViewItem::Bottom; - if (!option.rect.intersects(viewport()->rect())) { - ++it; - continue; - } - d->categoryDrawer->drawCategory(categoryIndex, d->proxyModel->sortRole(), option, &p); - ++it; - } - //END: draw categories - - if (intersecting.first.isValid() && intersecting.second.isValid()) { - //BEGIN: draw items - int i = intersecting.first.row(); - int indexToCheckIfBlockCollapsed = i; - QModelIndex categoryIndex; - QString category; - Private::Block *block = 0; - while (i <= intersecting.second.row()) { - //BEGIN: first check if the block is collapsed. if so, we have to skip the item painting - if (i == indexToCheckIfBlockCollapsed) { - categoryIndex = d->proxyModel->index(i, d->proxyModel->sortColumn(), rootIndex()); - category = categoryIndex.data(QCategorizedSortFilterProxyModel::CategoryDisplayRole).toString(); - block = &d->blocks[category]; - indexToCheckIfBlockCollapsed = block->firstIndex.row() + block->items.count(); - if (block->collapsed) { - i = indexToCheckIfBlockCollapsed; - continue; - } - } - //END: first check if the block is collapsed. if so, we have to skip the item painting - - Q_ASSERT(block); - - const bool alternateItem = (i - block->firstIndex.row()) % 2; - - const QModelIndex index = d->proxyModel->index(i, modelColumn(), rootIndex()); - const Qt::ItemFlags flags = d->proxyModel->flags(index); - QStyleOptionViewItem option(viewOptions()); - option.rect = visualRect(index); - option.widget = this; - option.features |= wordWrap() ? QStyleOptionViewItem::WrapText - : QStyleOptionViewItem::None; - option.features |= alternatingRowColors() && alternateItem ? QStyleOptionViewItem::Alternate - : QStyleOptionViewItem::None; - if (flags & Qt::ItemIsSelectable) { - option.state |= selectionModel()->isSelected(index) ? QStyle::State_Selected - : QStyle::State_None; - } else { - option.state &= ~QStyle::State_Selected; - } - option.state |= (index == currentIndex()) ? QStyle::State_HasFocus - : QStyle::State_None; - if (!(flags & Qt::ItemIsEnabled)) { - option.state &= ~QStyle::State_Enabled; - } else { - option.state |= (index == d->hoveredIndex) ? QStyle::State_MouseOver - : QStyle::State_None; - } - - itemDelegate(index)->paint(&p, option, index); - ++i; - } - //END: draw items - } - - //BEGIN: draw selection rect - if (isSelectionRectVisible() && d->rubberBandRect.isValid()) { - QStyleOptionRubberBand opt; - opt.initFrom(this); - opt.shape = QRubberBand::Rectangle; - opt.opaque = false; - opt.rect = d->mapToViewport(d->rubberBandRect).intersected(viewport()->rect().adjusted(-16, -16, 16, 16)); - p.save(); - style()->drawControl(QStyle::CE_RubberBand, &opt, &p); - p.restore(); - } - //END: draw selection rect - - p.restore(); -} - -void QCategorizedView::resizeEvent(QResizeEvent *event) -{ - d->regenerateAllElements(); - QListView::resizeEvent(event); -} - -void QCategorizedView::setSelection(const QRect &rect, - QItemSelectionModel::SelectionFlags flags) -{ - if (!d->isCategorized()) { - QListView::setSelection(rect, flags); - return; - } - - if (rect.topLeft() == rect.bottomRight()) { - const QModelIndex index = indexAt(rect.topLeft()); - selectionModel()->select(index, flags); - return; - } - - const QPair intersecting = d->intersectingIndexesWithRect(rect); - - QItemSelection selection; - - //TODO: think of a faster implementation - QModelIndex firstIndex; - QModelIndex lastIndex; - for (int i = intersecting.first.row(); i <= intersecting.second.row(); ++i) { - const QModelIndex index = d->proxyModel->index(i, modelColumn(), rootIndex()); - const bool visualRectIntersects = visualRect(index).intersects(rect); - if (firstIndex.isValid()) { - if (visualRectIntersects) { - lastIndex = index; - } else { - selection << QItemSelectionRange(firstIndex, lastIndex); - firstIndex = QModelIndex(); - } - } else if (visualRectIntersects) { - firstIndex = index; - lastIndex = index; - } - } - - if (firstIndex.isValid()) { - selection << QItemSelectionRange(firstIndex, lastIndex); - } - - selectionModel()->select(selection, flags); -} - -void QCategorizedView::mouseMoveEvent(QMouseEvent *event) -{ - QListView::mouseMoveEvent(event); - d->hoveredIndex = indexAt(event->pos()); - const SelectionMode itemViewSelectionMode = selectionMode(); - if (state() == DragSelectingState && isSelectionRectVisible() && itemViewSelectionMode != SingleSelection - && itemViewSelectionMode != NoSelection) { - QRect rect(d->pressedPosition, event->pos() + QPoint(horizontalOffset(), verticalOffset())); - rect = rect.normalized(); - update(rect.united(d->rubberBandRect)); - d->rubberBandRect = rect; - } - if (!d->categoryDrawerV2) { - return; - } - QHash::ConstIterator it(d->blocks.constBegin()); - while (it != d->blocks.constEnd()) { - const Private::Block &block = *it; - const QModelIndex categoryIndex = d->proxyModel->index(block.firstIndex.row(), d->proxyModel->sortColumn(), rootIndex()); - QStyleOptionViewItem option(viewOptions()); - const int height = d->categoryDrawer->categoryHeight(categoryIndex, option); - QPoint pos = d->blockPosition(it.key()); - pos.ry() -= height; - option.rect.setTopLeft(pos); - option.rect.setWidth(d->viewportWidth() + d->categoryDrawer->leftMargin() + d->categoryDrawer->rightMargin()); - option.rect.setHeight(height + d->blockHeight(it.key())); - option.rect = d->mapToViewport(option.rect); - const QPoint mousePos = viewport()->mapFromGlobal(QCursor::pos()); - if (option.rect.contains(mousePos)) { - if (d->categoryDrawerV3 && d->hoveredBlock->height != -1 && *d->hoveredBlock != block) { - const QModelIndex categoryIndex = d->proxyModel->index(d->hoveredBlock->firstIndex.row(), d->proxyModel->sortColumn(), rootIndex()); - const QStyleOptionViewItem option = d->blockRect(categoryIndex); - d->categoryDrawerV3->mouseLeft(categoryIndex, option.rect); - *d->hoveredBlock = block; - d->hoveredCategory = it.key(); - viewport()->update(option.rect); - } else if (d->hoveredBlock->height == -1) { - *d->hoveredBlock = block; - d->hoveredCategory = it.key(); - } else if (d->categoryDrawerV3) { - d->categoryDrawerV3->mouseMoved(categoryIndex, option.rect, event); - } else { - d->categoryDrawerV2->mouseButtonMoved(categoryIndex, event); - } - viewport()->update(option.rect); - return; - } - ++it; - } - if (d->categoryDrawerV3 && d->hoveredBlock->height != -1) { - const QModelIndex categoryIndex = d->proxyModel->index(d->hoveredBlock->firstIndex.row(), d->proxyModel->sortColumn(), rootIndex()); - const QStyleOptionViewItem option = d->blockRect(categoryIndex); - d->categoryDrawerV3->mouseLeft(categoryIndex, option.rect); - *d->hoveredBlock = Private::Block(); - d->hoveredCategory = QString(); - viewport()->update(option.rect); - } -} - -void QCategorizedView::mousePressEvent(QMouseEvent *event) -{ - if (event->button() == Qt::LeftButton) { - d->pressedPosition = event->pos(); - d->pressedPosition.rx() += horizontalOffset(); - d->pressedPosition.ry() += verticalOffset(); - } - if (!d->categoryDrawerV2) { - QListView::mousePressEvent(event); - return; - } - QHash::ConstIterator it(d->blocks.constBegin()); - while (it != d->blocks.constEnd()) { - const Private::Block &block = *it; - const QModelIndex categoryIndex = d->proxyModel->index(block.firstIndex.row(), d->proxyModel->sortColumn(), rootIndex()); - const QStyleOptionViewItem option = d->blockRect(categoryIndex); - const QPoint mousePos = viewport()->mapFromGlobal(QCursor::pos()); - if (option.rect.contains(mousePos)) { - if (d->categoryDrawerV3) { - d->categoryDrawerV3->mouseButtonPressed(categoryIndex, option.rect, event); - } else { - d->categoryDrawerV2->mouseButtonPressed(categoryIndex, event); - } - viewport()->update(option.rect); - if (!event->isAccepted()) { - QListView::mousePressEvent(event); - } - return; - } - ++it; - } - QListView::mousePressEvent(event); -} - -void QCategorizedView::mouseReleaseEvent(QMouseEvent *event) -{ - d->pressedPosition = QPoint(); - d->rubberBandRect = QRect(); - if (!d->categoryDrawerV2) { - QListView::mouseReleaseEvent(event); - return; - } - QHash::ConstIterator it(d->blocks.constBegin()); - while (it != d->blocks.constEnd()) { - const Private::Block &block = *it; - const QModelIndex categoryIndex = d->proxyModel->index(block.firstIndex.row(), d->proxyModel->sortColumn(), rootIndex()); - const QStyleOptionViewItem option = d->blockRect(categoryIndex); - const QPoint mousePos = viewport()->mapFromGlobal(QCursor::pos()); - if (option.rect.contains(mousePos)) { - if (d->categoryDrawerV3) { - d->categoryDrawerV3->mouseButtonReleased(categoryIndex, option.rect, event); - } else { - d->categoryDrawerV2->mouseButtonReleased(categoryIndex, event); - } - viewport()->update(option.rect); - if (!event->isAccepted()) { - QListView::mouseReleaseEvent(event); - } - return; - } - ++it; - } - QListView::mouseReleaseEvent(event); -} - -void QCategorizedView::leaveEvent(QEvent *event) -{ - QListView::leaveEvent(event); - if (d->hoveredIndex.isValid()) { - viewport()->update(visualRect(d->hoveredIndex)); - d->hoveredIndex = QModelIndex(); - } - if (d->categoryDrawerV3 && d->hoveredBlock->height != -1) { - const QModelIndex categoryIndex = d->proxyModel->index(d->hoveredBlock->firstIndex.row(), d->proxyModel->sortColumn(), rootIndex()); - const QStyleOptionViewItem option = d->blockRect(categoryIndex); - d->categoryDrawerV3->mouseLeft(categoryIndex, option.rect); - *d->hoveredBlock = Private::Block(); - d->hoveredCategory = QString(); - viewport()->update(option.rect); - } -} - -void QCategorizedView::startDrag(Qt::DropActions supportedActions) -{ - QListView::startDrag(supportedActions); -} - -void QCategorizedView::dragMoveEvent(QDragMoveEvent *event) -{ - QListView::dragMoveEvent(event); - d->hoveredIndex = indexAt(event->pos()); -} - -void QCategorizedView::dragEnterEvent(QDragEnterEvent *event) -{ - QListView::dragEnterEvent(event); -} - -void QCategorizedView::dragLeaveEvent(QDragLeaveEvent *event) -{ - QListView::dragLeaveEvent(event); -} - -void QCategorizedView::dropEvent(QDropEvent *event) -{ - QListView::dropEvent(event); -} - -//TODO: improve se we take into account collapsed blocks -//TODO: take into account when there is no grid and no uniformItemSizes -QModelIndex QCategorizedView::moveCursor(CursorAction cursorAction, - Qt::KeyboardModifiers modifiers) -{ - if (!d->isCategorized()) { - return QListView::moveCursor(cursorAction, modifiers); - } - - const QModelIndex current = currentIndex(); - const QRect currentRect = visualRect(current); - if (!current.isValid()) { - const int rowCount = d->proxyModel->rowCount(rootIndex()); - if (!rowCount) { - return QModelIndex(); - } - return d->proxyModel->index(0, modelColumn(), rootIndex()); - } - - switch (cursorAction) { - case MoveLeft: { - if (!current.row()) { - return QModelIndex(); - } - const QModelIndex previous = d->proxyModel->index(current.row() - 1, modelColumn(), rootIndex()); - const QRect previousRect = visualRect(previous); - if (previousRect.top() == currentRect.top()) { - return previous; - } - - return QModelIndex(); - } - case MoveRight: { - if (current.row() == d->proxyModel->rowCount() - 1) { - return QModelIndex(); - } - const QModelIndex next = d->proxyModel->index(current.row() + 1, modelColumn(), rootIndex()); - const QRect nextRect = visualRect(next); - if (nextRect.top() == currentRect.top()) { - return next; - } - - return QModelIndex(); - } - case MoveDown: { - if (d->hasGrid() || uniformItemSizes()) { - const QModelIndex current = currentIndex(); - const QSize itemSize = d->hasGrid() ? gridSize() - : sizeHintForIndex(current); - const Private::Block &block = d->blocks[d->categoryForIndex(current)]; - const int maxItemsPerRow = qMax(d->viewportWidth() / itemSize.width(), 1); - const bool canMove = current.row() + maxItemsPerRow < block.firstIndex.row() + - block.items.count(); - - if (canMove) { - return d->proxyModel->index(current.row() + maxItemsPerRow, modelColumn(), rootIndex()); - } - - const int currentRelativePos = (current.row() - block.firstIndex.row()) % maxItemsPerRow; - const QModelIndex nextIndex = d->proxyModel->index(block.firstIndex.row() + block.items.count(), modelColumn(), rootIndex()); - - if (!nextIndex.isValid()) { - return QModelIndex(); - } - - const Private::Block &nextBlock = d->blocks[d->categoryForIndex(nextIndex)]; - - if (nextBlock.items.count() <= currentRelativePos) { - return QModelIndex(); - } - - if (currentRelativePos < (block.items.count() % maxItemsPerRow)) { - return d->proxyModel->index(nextBlock.firstIndex.row() + currentRelativePos, modelColumn(), rootIndex()); - } - - return QModelIndex(); - } - } - case MoveUp: { - if (d->hasGrid() || uniformItemSizes()) { - const QModelIndex current = currentIndex(); - const QSize itemSize = d->hasGrid() ? gridSize() - : sizeHintForIndex(current); - const Private::Block &block = d->blocks[d->categoryForIndex(current)]; - const int maxItemsPerRow = qMax(d->viewportWidth() / itemSize.width(), 1); - const bool canMove = current.row() - maxItemsPerRow >= block.firstIndex.row(); - - if (canMove) { - return d->proxyModel->index(current.row() - maxItemsPerRow, modelColumn(), rootIndex()); - } - - const int currentRelativePos = (current.row() - block.firstIndex.row()) % maxItemsPerRow; - const QModelIndex prevIndex = d->proxyModel->index(block.firstIndex.row() - 1, modelColumn(), rootIndex()); - - if (!prevIndex.isValid()) { - return QModelIndex(); - } - - const Private::Block &prevBlock = d->blocks[d->categoryForIndex(prevIndex)]; - - if (prevBlock.items.count() <= currentRelativePos) { - return QModelIndex(); - } - - const int remainder = prevBlock.items.count() % maxItemsPerRow; - if (currentRelativePos < remainder) { - return d->proxyModel->index(prevBlock.firstIndex.row() + prevBlock.items.count() - remainder + currentRelativePos, modelColumn(), rootIndex()); - } - - return QModelIndex(); - } - } - default: - break; - } - - return QModelIndex(); -} - -void QCategorizedView::rowsAboutToBeRemoved(const QModelIndex &parent, - int start, - int end) -{ - if (!d->isCategorized()) { - QListView::rowsAboutToBeRemoved(parent, start, end); - return; - } - - *d->hoveredBlock = Private::Block(); - d->hoveredCategory = QString(); - - if (end - start + 1 == d->proxyModel->rowCount()) { - d->blocks.clear(); - QListView::rowsAboutToBeRemoved(parent, start, end); - return; - } - - // Removal feels a bit more complicated than insertion. Basically we can consider there are - // 3 different cases when going to remove items. (*) represents an item, Items between ([) and - // (]) are the ones which are marked for removal. - // - // - 1st case: - // ... * * * * * * [ * * * ... - // - // The items marked for removal are the last part of this category. No need to mark any item - // of this category as in quarantine, because no special offset will be pushed to items at - // the right because of any changes (since the removed items are those on the right most part - // of the category). - // - // - 2nd case: - // ... * * * * * * ] * * * ... - // - // The items marked for removal are the first part of this category. We have to mark as in - // quarantine all items in this category. Absolutely all. All items will have to be moved to - // the left (or moving up, because rows got a different offset). - // - // - 3rd case: - // ... * * [ * * * * ] * * ... - // - // The items marked for removal are in between of this category. We have to mark as in - // quarantine only those items that are at the right of the end of the removal interval, - // (starting on "]"). - // - // It hasn't been explicitly said, but when we remove, we have to mark all blocks that are - // located under the top most affected category as in quarantine (the block itself, as a whole), - // because such a change can force it to have a different offset (note that items themselves - // contain relative positions to the block, so marking the block as in quarantine is enough). - // - // Also note that removal implicitly means that we have to update correctly firstIndex of each - // block, and in general keep updated the internal information of elements. - - QStringList listOfCategoriesMarkedForRemoval; - - QString lastCategory; - int alreadyRemoved = 0; - for (int i = start; i <= end; ++i) { - const QModelIndex index = d->proxyModel->index(i, modelColumn(), parent); - - Q_ASSERT(index.isValid()); - - const QString category = d->categoryForIndex(index); - - if (lastCategory != category) { - lastCategory = category; - alreadyRemoved = 0; - } - - Private::Block &block = d->blocks[category]; - block.items.removeAt(i - block.firstIndex.row() - alreadyRemoved); - ++alreadyRemoved; - - if (!block.items.count()) { - listOfCategoriesMarkedForRemoval << category; - } - - block.height = -1; - - viewport()->update(); - } - - //BEGIN: update the items that are in quarantine in affected categories - { - const QModelIndex lastIndex = d->proxyModel->index(end, modelColumn(), parent); - const QString category = d->categoryForIndex(lastIndex); - Private::Block &block = d->blocks[category]; - if (block.items.count() && start <= block.firstIndex.row() && end >= block.firstIndex.row()) { - block.firstIndex = d->proxyModel->index(end + 1, modelColumn(), parent); - } - block.quarantineStart = block.firstIndex; - } - //END: update the items that are in quarantine in affected categories - - Q_FOREACH (const QString &category, listOfCategoriesMarkedForRemoval) { - d->blocks.remove(category); - } - - //BEGIN: mark as in quarantine those categories that are under the affected ones - { - //BEGIN: order for marking as alternate those blocks that are alternate - QList blockList = d->blocks.values(); - qSort(blockList.begin(), blockList.end(), Private::Block::lessThan); - QList firstIndexesRows; - foreach (const Private::Block &block, blockList) { - firstIndexesRows << block.firstIndex.row(); - } - //END: order for marking as alternate those blocks that are alternate - for (QHash::Iterator it = d->blocks.begin(); it != d->blocks.end(); ++it) { - Private::Block &block = *it; - if (block.firstIndex.row() > start) { - block.outOfQuarantine = false; - block.alternate = firstIndexesRows.indexOf(block.firstIndex.row()) % 2; - } else if (block.firstIndex.row() == start) { - block.alternate = firstIndexesRows.indexOf(block.firstIndex.row()) % 2; - } - } - } - //END: mark as in quarantine those categories that are under the affected ones - - QListView::rowsAboutToBeRemoved(parent, start, end); -} - -void QCategorizedView::updateGeometries() -{ - const int oldVerticalOffset = verticalOffset(); - const Qt::ScrollBarPolicy verticalP = verticalScrollBarPolicy(), horizontalP = horizontalScrollBarPolicy(); - - //BEGIN bugs 213068, 287847 ------------------------------------------------------------ - /* - * QListView::updateGeometries() has it's own opinion on whether the scrollbars should be visible (valid range) or not - * and triggers a (sometimes additionally timered) resize through ::layoutChildren() - * http://qt.gitorious.org/qt/qt/blobs/4.7/src/gui/itemviews/qlistview.cpp#line1499 - * (the comment above the main block isn't all accurate, layoutChldren is called regardless of the policy) - * - * As a result QListView and KCategorizedView occasionally started a race on the scrollbar visibility, effectively blocking the UI - * So we prevent QListView from having an own opinion on the scrollbar visibility by - * fixing it before calling the baseclass QListView::updateGeometries() - * - * Since the implicit show/hide by the followin range setting will cause further resizes if the policy is Qt::ScrollBarAsNeeded - * we keep it static until we're done, then restore the original value and ultimately change the scrollbar visibility ourself. - */ - if (d->isCategorized()) { // important! - otherwise we'd pollute the setting if the view is initially not categorized - setVerticalScrollBarPolicy((verticalP == Qt::ScrollBarAlwaysOn || verticalScrollBar()->isVisibleTo(this)) ? - Qt::ScrollBarAlwaysOn : Qt::ScrollBarAlwaysOff); - setHorizontalScrollBarPolicy((horizontalP == Qt::ScrollBarAlwaysOn || horizontalScrollBar()->isVisibleTo(this)) ? - Qt::ScrollBarAlwaysOn : Qt::ScrollBarAlwaysOff); - } - //END bugs 213068, 287847 -------------------------------------------------------------- - - QListView::updateGeometries(); - - if (!d->isCategorized()) { - return; - } - - const int rowCount = d->proxyModel->rowCount(); - if (!rowCount) { - verticalScrollBar()->setRange(0, 0); - // unconditional, see function end todo - horizontalScrollBar()->setRange(0, 0); - return; - } - - const QModelIndex lastIndex = d->proxyModel->index(rowCount - 1, modelColumn(), rootIndex()); - Q_ASSERT(lastIndex.isValid()); - QRect lastItemRect = visualRect(lastIndex); - - if (d->hasGrid()) { - lastItemRect.setSize(lastItemRect.size().expandedTo(gridSize())); - } else { - if (uniformItemSizes()) { - QSize itemSize = sizeHintForIndex(lastIndex); - itemSize.setHeight(itemSize.height() + spacing()); - lastItemRect.setSize(itemSize); - } else { - QSize itemSize = sizeHintForIndex(lastIndex); - const QString category = d->categoryForIndex(lastIndex); - itemSize.setHeight(d->highestElementInLastRow(d->blocks[category]) + spacing()); - lastItemRect.setSize(itemSize); - } - } - - const int bottomRange = lastItemRect.bottomRight().y() + verticalOffset() - viewport()->height(); - - if (verticalScrollMode() == ScrollPerItem) { - verticalScrollBar()->setSingleStep(lastItemRect.height()); - const int rowsPerPage = qMax(viewport()->height() / lastItemRect.height(), 1); - verticalScrollBar()->setPageStep(rowsPerPage * lastItemRect.height()); - } - - verticalScrollBar()->setRange(0, bottomRange); - verticalScrollBar()->setValue(oldVerticalOffset); - - //TODO: also consider working with the horizontal scroll bar. since at this level I am not still - // supporting "top to bottom" flow, there is no real problem. If I support that someday - // (think how to draw categories), we would have to take care of the horizontal scroll bar too. - // In theory, as QCategorizedView has been designed, there is no need of horizontal scroll bar. - horizontalScrollBar()->setRange(0, 0); - - //BEGIN bugs 213068, 287847 ------------------------------------------------------------ - // restoring values from above ... - setVerticalScrollBarPolicy(verticalP); - setHorizontalScrollBarPolicy(horizontalP); - // ... and correct the visibility - bool validRange = verticalScrollBar()->maximum() != verticalScrollBar()->minimum(); - if (verticalP == Qt::ScrollBarAsNeeded && (verticalScrollBar()->isVisibleTo(this) != validRange)) - verticalScrollBar()->setVisible(validRange); - validRange = horizontalScrollBar()->maximum() > horizontalScrollBar()->minimum(); - if (horizontalP == Qt::ScrollBarAsNeeded && (horizontalScrollBar()->isVisibleTo(this) != validRange)) - horizontalScrollBar()->setVisible(validRange); - //END bugs 213068, 287847 -------------------------------------------------------------- -} - -void QCategorizedView::currentChanged(const QModelIndex ¤t, - const QModelIndex &previous) -{ - QListView::currentChanged(current, previous); -} - -void QCategorizedView::dataChanged(const QModelIndex &topLeft, - const QModelIndex &bottomRight, - const QVector & roles) -{ - QListView::dataChanged(topLeft, bottomRight); - if (!d->isCategorized()) { - return; - } - - *d->hoveredBlock = Private::Block(); - d->hoveredCategory = QString(); - - //BEGIN: since the model changed data, we need to reconsider item sizes - int i = topLeft.row(); - int indexToCheck = i; - QModelIndex categoryIndex; - QString category; - Private::Block *block; - while (i <= bottomRight.row()) { - const QModelIndex currIndex = d->proxyModel->index(i, modelColumn(), rootIndex()); - if (i == indexToCheck) { - categoryIndex = d->proxyModel->index(i, d->proxyModel->sortColumn(), rootIndex()); - category = categoryIndex.data(QCategorizedSortFilterProxyModel::CategoryDisplayRole).toString(); - block = &d->blocks[category]; - block->quarantineStart = currIndex; - indexToCheck = block->firstIndex.row() + block->items.count(); - } - visualRect(currIndex); - ++i; - } - //END: since the model changed data, we need to reconsider item sizes -} - -void QCategorizedView::rowsInserted(const QModelIndex &parent, - int start, - int end) -{ - QListView::rowsInserted(parent, start, end); - if (!d->isCategorized()) { - return; - } - - *d->hoveredBlock = Private::Block(); - d->hoveredCategory = QString(); - d->rowsInserted(parent, start, end); -} - -#ifndef KDE_NO_DEPRECATED -void QCategorizedView::rowsInsertedArtifficial(const QModelIndex &parent, - int start, - int end) -{ - Q_UNUSED(parent); - Q_UNUSED(start); - Q_UNUSED(end); -} -#endif - -#ifndef KDE_NO_DEPRECATED -void QCategorizedView::rowsRemoved(const QModelIndex &parent, - int start, - int end) -{ - Q_UNUSED(parent); - Q_UNUSED(start); - Q_UNUSED(end); -} -#endif - -void QCategorizedView::slotLayoutChanged() -{ - if (!d->isCategorized()) { - return; - } - - d->blocks.clear(); - *d->hoveredBlock = Private::Block(); - d->hoveredCategory = QString(); - if (d->proxyModel->rowCount()) { - d->rowsInserted(rootIndex(), 0, d->proxyModel->rowCount() - 1); - } -} - -void QCategorizedView::keyPressEvent(QKeyEvent *event) -{ - // Don't emit activated() by pressing Enter! ... - switch (event->key()) { - case Qt::Key_Enter: - case Qt::Key_Return: - if (state() != EditingState) { - event->ignore(); - if (hasFocus() && !event->isAutoRepeat()) - enterPressed = true; // Pressed after getting focus. - return; - } - break; - default: break; - } - QAbstractItemView::keyPressEvent(event); -} - -void QCategorizedView::keyReleaseEvent(QKeyEvent *event) -{ - // ... Emit activated() by releasing Enter instead! - switch (event->key()) { - case Qt::Key_Enter: - case Qt::Key_Return: - if (hasFocus() && state() != EditingState - && !event->isAutoRepeat() // No multiple signals. - && enterPressed // No signal if Enter is pressed before getting focus. - && currentIndex().isValid()) { - emit activated(currentIndex()); - event->accept(); - enterPressed = false; - return; - } - break; - default: break; - } - QAbstractItemView::keyReleaseEvent(event); -} - -//END: Public part - -#include "moc_qcategorizedview.cpp" diff --git a/src/qcategorizedview/qcategorizedview.h b/src/qcategorizedview/qcategorizedview.h deleted file mode 100644 index 323e012..0000000 --- a/src/qcategorizedview/qcategorizedview.h +++ /dev/null @@ -1,363 +0,0 @@ -/** - * (c)LGPL2+ - * This file is part of the KDE project - * Copyright (C) 2007, 2009 Rafael Fernández López - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef KCATEGORIZEDVIEW_H -#define KCATEGORIZEDVIEW_H - -#include - -//#include - -#define KDEUI_EXPORT -#define KDE_DEPRECATED - - -class QCategoryDrawer; -class QCategoryDrawerV2; - -/** - * @short Item view for listing items in a categorized fashion optionally - * - * QCategorizedView basically has the same functionality as QListView, only that it also lets you - * layout items in a way that they are categorized visually. - * - * For it to work you will need to set a QCategorizedSortFilterProxyModel and a QCategoryDrawer - * with methods setModel() and setCategoryDrawer() respectively. Also, the model will need to be - * flagged as categorized with QCategorizedSortFilterProxyModel::setCategorizedModel(true). - * - * The way it works (if categorization enabled): - * - * - When sorting, it does more things than QListView does. It will ask the model for the - * special role CategorySortRole (@see QCategorizedSortFilterProxyModel). This can return - * a QString or an int in order to tell the view the order of categories. In this sense, for - * instance, if we are sorting by name ascending, "A" would be before than "B". If we are - * sorting by size ascending, 512 bytes would be before 1024 bytes. This way categories are - * also sorted. - * - * - When the view has to paint, it will ask the model with the role CategoryDisplayRole - * (@see QCategorizedSortFilterProxyModel). It will for instance return "F" for "foo.pdf" if - * we are sorting by name ascending, or "Small" if a certain item has 100 bytes, for example. - * - * For drawing categories, QCategoryDrawer will be used. You can inherit this class to do your own - * drawing. - * - * @note All examples cited before talk about filesystems and such, but have present that this - * is a completely generic class, and it can be used for whatever your purpose is. For - * instance when talking about animals, you can separate them by "Mammal" and "Oviparous". In - * this very case, for example, the CategorySortRole and the CategoryDisplayRole could be the - * same ("Mammal" and "Oviparous"). - * - * @note There is a really performance boost if CategorySortRole returns an int instead of a QString. - * Have present that this role is asked (n * log n) times when sorting and compared. Comparing - * ints is always faster than comparing strings, whithout mattering how fast the string - * comparison is. Consider thinking of a way of returning ints instead of QStrings if your - * model can contain a high number of items. - * - * @warning Note that for really drawing items in blocks you will need some things to be done: - * - The model set to this view has to be (or inherit if you want to do special stuff - * in it) QCategorizedSortFilterProxyModel. - * - This model needs to be set setCategorizedModel to true. - * - Set a category drawer by calling setCategoryDrawer. - * - * @see QCategorizedSortFilterProxyModel, QCategoryDrawer - * - * @author Rafael Fernández López - */ -class KDEUI_EXPORT QCategorizedView - : public QListView -{ - Q_OBJECT - Q_PROPERTY(int categorySpacing READ categorySpacing WRITE setCategorySpacing) - Q_PROPERTY(bool alternatingBlockColors READ alternatingBlockColors WRITE setAlternatingBlockColors) - Q_PROPERTY(bool collapsibleBlocks READ collapsibleBlocks WRITE setCollapsibleBlocks) - -public: - QCategorizedView(QWidget *parent = 0); - - ~QCategorizedView(); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void setModel(QAbstractItemModel *model); - - /** - * Calls to setGridSizeOwn(). - */ - void setGridSize(const QSize &size); - - /** - * @warning note that setGridSize is not virtual in the base class (QListView), so if you are - * calling to this method, make sure you have a QCategorizedView pointer around. This - * means that something like: - * @code - * QListView *lv = new QCategorizedView(); - * lv->setGridSize(mySize); - * @endcode - * - * will not call to the expected setGridSize method. Instead do something like this: - * - * @code - * QListView *lv; - * ... - * QCategorizedView *cv = qobject_cast(lv); - * if (cv) { - * cv->setGridSizeOwn(mySize); - * } else { - * lv->setGridSize(mySize); - * } - * @endcode - * - * @note this method will call to QListView::setGridSize among other operations. - * - * @since 4.4 - */ - void setGridSizeOwn(const QSize &size); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual QRect visualRect(const QModelIndex &index) const; - - /** - * Returns the current category drawer. - */ - QCategoryDrawer *categoryDrawer() const; - - /** - * The category drawer that will be used for drawing categories. - */ - void setCategoryDrawer(QCategoryDrawer *categoryDrawer); - - /** - * @return Category spacing. The spacing between categories. - * - * @since 4.4 - */ - int categorySpacing() const; - - /** - * Stablishes the category spacing. This is the spacing between categories. - * - * @since 4.4 - */ - void setCategorySpacing(int categorySpacing); - - /** - * @return Whether blocks should be drawn with alternating colors. - * - * @since 4.4 - */ - bool alternatingBlockColors() const; - - /** - * Sets whether blocks should be drawn with alternating colors. - * - * @since 4.4 - */ - void setAlternatingBlockColors(bool enable); - - /** - * @return Whether blocks can be collapsed or not. - * - * @since 4.4 - */ - bool collapsibleBlocks() const; - - /** - * Sets whether blocks can be collapsed or not. - * - * @since 4.4 - */ - void setCollapsibleBlocks(bool enable); - - /** - * @return Block of indexes that are into @p category. - * - * @since 4.5 - */ - QModelIndexList block(const QString &category); - - /** - * @return Block of indexes that are represented by @p representative. - * - * @since 4.5 - */ - QModelIndexList block(const QModelIndex &representative); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual QModelIndex indexAt(const QPoint &point) const; - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void reset(); - - /** - * @return The icon size by considering all the styling - */ - QSize decorationSize() const; - -protected: - /** - * Reimplemented from QWidget. - */ - virtual void paintEvent(QPaintEvent *event); - - /** - * Reimplemented from QWidget. - */ - virtual void resizeEvent(QResizeEvent *event); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void setSelection(const QRect &rect, - QItemSelectionModel::SelectionFlags flags); - - /** - * Reimplemented from QWidget. - */ - virtual void mouseMoveEvent(QMouseEvent *event); - - /** - * Reimplemented from QWidget. - */ - virtual void mousePressEvent(QMouseEvent *event); - - /** - * Reimplemented from QWidget. - */ - virtual void mouseReleaseEvent(QMouseEvent *event); - - /** - * Reimplemented from QWidget. - */ - virtual void leaveEvent(QEvent *event); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void startDrag(Qt::DropActions supportedActions); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void dragMoveEvent(QDragMoveEvent *event); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void dragEnterEvent(QDragEnterEvent *event); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void dragLeaveEvent(QDragLeaveEvent *event); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void dropEvent(QDropEvent *event); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual QModelIndex moveCursor(CursorAction cursorAction, - Qt::KeyboardModifiers modifiers); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void rowsAboutToBeRemoved(const QModelIndex &parent, - int start, - int end); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void updateGeometries(); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void currentChanged(const QModelIndex ¤t, - const QModelIndex &previous); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void dataChanged(const QModelIndex &topLeft, - const QModelIndex &bottomRight, - const QVector & roles = QVector ()); - - /** - * Reimplemented from QAbstractItemView. - */ - virtual void rowsInserted(const QModelIndex &parent, - int start, - int end); - - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *event); - -protected Q_SLOTS: - /** - * @internal - * @warning Deprecated since 4.4. - */ -#ifndef KDE_NO_DEPRECATED - virtual KDE_DEPRECATED void rowsInsertedArtifficial(const QModelIndex &parent, - int start, - int end); -#endif - - /** - * @internal - * @warning Deprecated since 4.4. - */ -#ifndef KDE_NO_DEPRECATED - virtual KDE_DEPRECATED void rowsRemoved(const QModelIndex &parent, - int start, - int end); -#endif - - /** - * @internal - * Reposition items as needed. - */ - virtual void slotLayoutChanged(); - -private: - class Private; - Private *const d; - /** - * For knowing that Enter is pressed after - * the widget gets focus and not before that. - */ - bool enterPressed; - - Q_PRIVATE_SLOT(d, void _k_slotCollapseOrExpandClicked(QModelIndex)) -}; - -#endif // KCATEGORIZEDVIEW_H diff --git a/src/qcategorizedview/qcategorizedview_p.h b/src/qcategorizedview/qcategorizedview_p.h deleted file mode 100644 index 611160b..0000000 --- a/src/qcategorizedview/qcategorizedview_p.h +++ /dev/null @@ -1,160 +0,0 @@ -/** - * (c)LGPL2+ - * This file is part of the KDE project - * Copyright (C) 2007, 2009 Rafael Fernández López - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef KCATEGORIZEDVIEW_P_H -#define KCATEGORIZEDVIEW_P_H - -class QCategorizedSortFilterProxyModel; -class QCategoryDrawer; -class QCategoryDrawerV2; -class QCategoryDrawerV3; - -/** - * @internal - */ -class QCategorizedView::Private -{ -public: - struct Block; - struct Item; - - Private(QCategorizedView *q); - ~Private(); - - /** - * @return whether this view has all required elements to be categorized. - */ - bool isCategorized() const; - - /** - * @return the block rect for the representative @p representative. - */ - QStyleOptionViewItem blockRect(const QModelIndex &representative); - - /** - * Returns the first and last element that intersects with rect. - * - * @note see that here we cannot take out items between first and last (as we could - * do with the rubberband). - * - * Complexity: O(log(n)) where n is model()->rowCount(). - */ - QPair intersectingIndexesWithRect(const QRect &rect) const; - - /** - * Returns the position of the block of @p category. - * - * Complexity: O(n) where n is the number of different categories when the block has been - * marked as in quarantine. O(1) the rest of the times (the vast majority). - */ - QPoint blockPosition(const QString &category); - - /** - * Returns the height of the block determined by @p category. - */ - int blockHeight(const QString &category); - - /** - * Returns the actual viewport width. - */ - int viewportWidth() const; - - /** - * Marks all elements as in quarantine. - * - * Complexity: O(n) where n is model()->rowCount(). - * - * @warning this is an expensive operation - */ - void regenerateAllElements(); - - /** - * Update internal information, and keep sync with the real information that the model contains. - */ - void rowsInserted(const QModelIndex &parent, int start, int end); - - /** - * Returns @p rect in viewport terms, taking in count horizontal and vertical offsets. - */ - QRect mapToViewport(const QRect &rect) const; - - /** - * Returns @p rect in absolute terms, converted from viewport position. - */ - QRect mapFromViewport(const QRect &rect) const; - - /** - * Returns the height of the highest element in last row. This is only applicable if there is - * no grid set and uniformItemSizes is false. - * - * @param block in which block are we searching. Necessary to stop the search if we hit the - * first item in this block. - */ - int highestElementInLastRow(const Block &block) const; - - /** - * Returns whether the view has a valid grid size. - */ - bool hasGrid() const; - - /** - * Returns the category for the given index. - */ - QString categoryForIndex(const QModelIndex &index) const; - - /** - * Updates the visual rect for item when flow is LeftToRight. - */ - void leftToRightVisualRect(const QModelIndex &index, Item &item, - const Block &block, const QPoint &blockPos) const; - - /** - * Updates the visual rect for item when flow is TopToBottom. - * @note we only support viewMode == ListMode in this case. - */ - void topToBottomVisualRect(const QModelIndex &index, Item &item, - const Block &block, const QPoint &blockPos) const; - - /** - * Called when expand or collapse has been clicked on the category drawer. - */ - void _k_slotCollapseOrExpandClicked(QModelIndex); - - QCategorizedView *q; - QCategorizedSortFilterProxyModel *proxyModel; - QCategoryDrawer *categoryDrawer; - QCategoryDrawerV2 *categoryDrawerV2; - QCategoryDrawerV3 *categoryDrawerV3; - int categorySpacing; - bool alternatingBlockColors; - bool collapsibleBlocks; - - Block *hoveredBlock; - QString hoveredCategory; - QModelIndex hoveredIndex; - - QPoint pressedPosition; - QRect rubberBandRect; - - QHash blocks; -}; - -#endif // KCATEGORIZEDVIEW_P_H diff --git a/src/qcategorizedview/qcategorydrawer.cpp b/src/qcategorizedview/qcategorydrawer.cpp deleted file mode 100644 index 1b23861..0000000 --- a/src/qcategorizedview/qcategorydrawer.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/** - * (c)LGPL2+ - * This file is part of the KDE project - * Copyright (C) 2007, 2009 Rafael Fernández López - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "qcategorydrawer.h" - -#include -#include -#include - -//#include -#include -#include - -#define HORIZONTAL_HINT 3 - -class QCategoryDrawer::Private -{ -public: - Private() - : leftMargin(0) - , rightMargin(0) - { - } - - ~Private() - { - } - - int leftMargin; - int rightMargin; -}; - -QCategoryDrawer::QCategoryDrawer() - : d(new Private) -{ - setLeftMargin(2); - setRightMargin(2); -} - -QCategoryDrawer::~QCategoryDrawer() -{ - delete d; -} - -void QCategoryDrawer::drawCategory(const QModelIndex &index, - int /*sortRole*/, - const QStyleOption &option, - QPainter *painter) const -{ - painter->setRenderHint(QPainter::Antialiasing); - - const QString category = index.model()->data(index, QCategorizedSortFilterProxyModel::CategoryDisplayRole).toString(); - const QRect optRect = option.rect; - QFont font(QApplication::font()); - font.setBold(true); - const QFontMetrics fontMetrics = QFontMetrics(font); - - QColor outlineColor = option.palette.text().color(); - outlineColor.setAlphaF(0.35); - - //BEGIN: top left corner - { - painter->save(); - painter->setPen(outlineColor); - const QPointF topLeft(optRect.topLeft()); - QRectF arc(topLeft, QSizeF(4, 4)); - arc.translate(0.5, 0.5); - painter->drawArc(arc, 1440, 1440); - painter->restore(); - } - //END: top left corner - - //BEGIN: left vertical line - { - QPoint start(optRect.topLeft()); - start.ry() += 3; - QPoint verticalGradBottom(optRect.topLeft()); - verticalGradBottom.ry() += fontMetrics.height() + 5; - QLinearGradient gradient(start, verticalGradBottom); - gradient.setColorAt(0, outlineColor); - gradient.setColorAt(1, Qt::transparent); - painter->fillRect(QRect(start, QSize(1, fontMetrics.height() + 5)), gradient); - } - //END: left vertical line - - //BEGIN: horizontal line - { - QPoint start(optRect.topLeft()); - start.rx() += 3; - QPoint horizontalGradTop(optRect.topLeft()); - horizontalGradTop.rx() += optRect.width() - 6; - painter->fillRect(QRect(start, QSize(optRect.width() - 6, 1)), outlineColor); - } - //END: horizontal line - - //BEGIN: top right corner - { - painter->save(); - painter->setPen(outlineColor); - QPointF topRight(optRect.topRight()); - topRight.rx() -= 4; - QRectF arc(topRight, QSizeF(4, 4)); - arc.translate(0.5, 0.5); - painter->drawArc(arc, 0, 1440); - painter->restore(); - } - //END: top right corner - - //BEGIN: right vertical line - { - QPoint start(optRect.topRight()); - start.ry() += 3; - QPoint verticalGradBottom(optRect.topRight()); - verticalGradBottom.ry() += fontMetrics.height() + 5; - QLinearGradient gradient(start, verticalGradBottom); - gradient.setColorAt(0, outlineColor); - gradient.setColorAt(1, Qt::transparent); - painter->fillRect(QRect(start, QSize(1, fontMetrics.height() + 5)), gradient); - } - //END: right vertical line - - //BEGIN: text - { - QRect textRect(option.rect); - textRect.setTop(textRect.top() + 7); - textRect.setLeft(textRect.left() + 7); - textRect.setHeight(fontMetrics.height()); - textRect.setRight(textRect.right() - 7); - - painter->save(); - painter->setFont(font); - QColor penColor(option.palette.text().color()); - penColor.setAlphaF(0.6); - painter->setPen(penColor); - painter->drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, category); - painter->restore(); - } - //END: text -} - -int QCategoryDrawer::categoryHeight(const QModelIndex &index, const QStyleOption &option) const -{ - Q_UNUSED(index); - Q_UNUSED(option) - - QFont font(QApplication::font()); - font.setBold(true); - QFontMetrics fontMetrics(font); - - const int height = fontMetrics.height() + 1 /* 1 pixel-width gradient */ - + 11 /* top and bottom separation */; - return height; -} - -int QCategoryDrawer::leftMargin() const -{ - return d->leftMargin; -} - -void QCategoryDrawer::setLeftMargin(int leftMargin) -{ - d->leftMargin = leftMargin; -} - -int QCategoryDrawer::rightMargin() const -{ - return d->rightMargin; -} - -void QCategoryDrawer::setRightMargin(int rightMargin) -{ - d->rightMargin = rightMargin; -} - -QCategoryDrawer &QCategoryDrawer::operator=(const QCategoryDrawer &cd) -{ - d->leftMargin = cd.d->leftMargin; - d->rightMargin = cd.d->rightMargin; - return *this; -} - -QCategoryDrawerV2::QCategoryDrawerV2(QObject *parent) - : QObject(parent) - , QCategoryDrawer() -{ -} - -QCategoryDrawerV2::~QCategoryDrawerV2() -{ -} - -void QCategoryDrawerV2::mouseButtonPressed(const QModelIndex&, QMouseEvent *event) -{ - event->ignore(); -} - -void QCategoryDrawerV2::mouseButtonReleased(const QModelIndex&, QMouseEvent *event) -{ - event->ignore(); -} - -void QCategoryDrawerV2::mouseButtonMoved(const QModelIndex&, QMouseEvent *event) -{ - event->ignore(); -} - -void QCategoryDrawerV2::mouseButtonDoubleClicked(const QModelIndex&, QMouseEvent *event) -{ - event->ignore(); -} - -class QCategoryDrawerV3::Private -{ -public: - Private(QCategorizedView *view) - : view(view) - { - } - - ~Private() - { - } - - QCategorizedView *view; -}; - -QCategoryDrawerV3::QCategoryDrawerV3(QCategorizedView *view) - : QCategoryDrawerV2(view) - , d(new Private(view)) -{ -} - -QCategoryDrawerV3::~QCategoryDrawerV3() -{ - delete d; -} - -QCategorizedView *QCategoryDrawerV3::view() const -{ - return d->view; -} - -void QCategoryDrawerV3::mouseButtonPressed(const QModelIndex&, const QRect&, QMouseEvent *event) -{ - event->ignore(); -} - -void QCategoryDrawerV3::mouseButtonReleased(const QModelIndex&, const QRect&, QMouseEvent *event) -{ - event->ignore(); -} - -void QCategoryDrawerV3::mouseMoved(const QModelIndex&, const QRect&, QMouseEvent *event) -{ - event->ignore(); -} - -void QCategoryDrawerV3::mouseButtonDoubleClicked(const QModelIndex&, const QRect&, QMouseEvent *event) -{ - event->ignore(); -} - -void QCategoryDrawerV3::mouseLeft(const QModelIndex&, const QRect&) -{ -} - -#include "moc_qcategorydrawer.cpp" diff --git a/src/qcategorizedview/qcategorydrawer.h b/src/qcategorizedview/qcategorydrawer.h deleted file mode 100644 index 4c5af0d..0000000 --- a/src/qcategorizedview/qcategorydrawer.h +++ /dev/null @@ -1,234 +0,0 @@ -/** - * (c)LGPL2+ - * This file is part of the KDE project - * Copyright (C) 2007, 2009 Rafael Fernández López - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef KCATEGORYDRAWER_H -#define KCATEGORYDRAWER_H - -//#include - -#include -#include - -#define KDEUI_EXPORT -#define KDE_DEPRECATED - -class QPainter; -class QModelIndex; -class QStyleOption; - -class QCategorizedView; - -/** - * @deprecated - * - * The category drawing is performed by this class. It also gives information about the category - * height and margins. - * - * @warning Please use QCategoryDrawerV3 instead - */ -class KDEUI_EXPORT QCategoryDrawer -{ -public: - KDE_DEPRECATED QCategoryDrawer(); - - virtual ~QCategoryDrawer(); - - /** - * This method purpose is to draw a category represented by the given - * @param index with the given @param sortRole sorting role - * - * @note This method will be called one time per category, always with the - * first element in that category - */ - virtual void drawCategory(const QModelIndex &index, - int sortRole, - const QStyleOption &option, - QPainter *painter) const; - - /** - * @return The category height for the category representated by index @p index with - * style options @p option. - */ - virtual int categoryHeight(const QModelIndex &index, const QStyleOption &option) const; - - //TODO KDE5: make virtual as leftMargin - /** - * @note 0 by default - * - * @since 4.4 - */ - int leftMargin() const; - - /** - * @note call to this method on the QCategoryDrawer constructor to set the left margin - * - * @since 4.4 - */ - void setLeftMargin(int leftMargin); - - //TODO KDE5: make virtual as rightMargin - /** - * @note 0 by default - * - * @since 4.4 - */ - int rightMargin() const; - - /** - * @note call to this method on the QCategoryDrawer constructor to set the right margin - * - * @since 4.4 - */ - void setRightMargin(int rightMargin); - - QCategoryDrawer &operator=(const QCategoryDrawer &cd); - -private: - class Private; - Private *const d; -}; - - -/** - * @deprecated - * - * @since 4.4 - * - * @warning Please use QCategoryDrawerV3 instead - */ -class KDEUI_EXPORT QCategoryDrawerV2 - : public QObject - , public QCategoryDrawer -{ - Q_OBJECT - -public: - KDE_DEPRECATED QCategoryDrawerV2(QObject *parent = 0); - virtual ~QCategoryDrawerV2(); - - KDE_DEPRECATED virtual void mouseButtonPressed(const QModelIndex &index, QMouseEvent *event); - - KDE_DEPRECATED virtual void mouseButtonReleased(const QModelIndex &index, QMouseEvent *event); - - KDE_DEPRECATED virtual void mouseButtonMoved(const QModelIndex &index, QMouseEvent *event); - - KDE_DEPRECATED virtual void mouseButtonDoubleClicked(const QModelIndex &index, QMouseEvent *event); - -Q_SIGNALS: - /** - * This signal becomes emitted when collapse or expand has been clicked. - */ - void collapseOrExpandClicked(const QModelIndex &index); - - /** - * Emit this signal on your subclass implementation to notify that something happened. Usually - * this will be triggered when you have received an event, and its position matched some "hot spot". - * - * You give this action the integer you want, and having connected this signal to your code, - * the connected slot can perform the needed changes (view, model, selection model, delegate...) - */ - void actionRequested(int action, const QModelIndex &index); -}; - -/** - * @since 4.5 - */ -class KDEUI_EXPORT QCategoryDrawerV3 - : public QCategoryDrawerV2 -{ - friend class QCategorizedView; - -public: - QCategoryDrawerV3(QCategorizedView *view); - virtual ~QCategoryDrawerV3(); - - /** - * @return The view this category drawer is associated with. - */ - QCategorizedView *view() const; - - using QCategoryDrawerV2::mouseButtonPressed; - using QCategoryDrawerV2::mouseButtonReleased; - using QCategoryDrawerV2::mouseButtonDoubleClicked; - -protected: - /** - * Method called when the mouse button has been pressed. - * - * @param index The representative index of the block of items. - * @param blockRect The rect occupied by the block of items. - * @param event The mouse event. - * - * @warning You explicitly have to determine whether the event has been accepted or not. You - * have to call event->accept() or event->ignore() at all possible case branches in - * your code. - */ - virtual void mouseButtonPressed(const QModelIndex &index, const QRect &blockRect, QMouseEvent *event); - - /** - * Method called when the mouse button has been released. - * - * @param index The representative index of the block of items. - * @param blockRect The rect occupied by the block of items. - * @param event The mouse event. - * - * @warning You explicitly have to determine whether the event has been accepted or not. You - * have to call event->accept() or event->ignore() at all possible case branches in - * your code. - */ - virtual void mouseButtonReleased(const QModelIndex &index, const QRect &blockRect, QMouseEvent *event); - - /** - * Method called when the mouse has been moved. - * - * @param index The representative index of the block of items. - * @param blockRect The rect occupied by the block of items. - * @param event The mouse event. - */ - virtual void mouseMoved(const QModelIndex &index, const QRect &blockRect, QMouseEvent *event); - - /** - * Method called when the mouse button has been double clicked. - * - * @param index The representative index of the block of items. - * @param blockRect The rect occupied by the block of items. - * @param event The mouse event. - * - * @warning You explicitly have to determine whether the event has been accepted or not. You - * have to call event->accept() or event->ignore() at all possible case branches in - * your code. - */ - virtual void mouseButtonDoubleClicked(const QModelIndex &index, const QRect &blockRect, QMouseEvent *event); - - /** - * Method called when the mouse button has left this block. - * - * @param index The representative index of the block of items. - * @param blockRect The rect occupied by the block of items. - */ - virtual void mouseLeft(const QModelIndex &index, const QRect &blockRect); - -private: - class Private; - Private *const d; -}; - -#endif // KCATEGORYDRAWER_H diff --git a/src/translations/lxqt-config_ar.desktop b/src/translations/lxqt-config_ar.desktop deleted file mode 100644 index e251c85..0000000 --- a/src/translations/lxqt-config_ar.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ar]=اضبط نظامك -GenericName[ar]=إعدادات النّظام -Name[ar]=مركز لكسكيوت للضّبط diff --git a/src/translations/lxqt-config_ca.desktop b/src/translations/lxqt-config_ca.desktop deleted file mode 100644 index 6056656..0000000 --- a/src/translations/lxqt-config_ca.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[ca]=Centre de configuració de LXQt -GenericName[ca]=Ajusts del sistema -Comment[ca]=Configureu el vostre sistema diff --git a/src/translations/lxqt-config_cs.desktop b/src/translations/lxqt-config_cs.desktop deleted file mode 100644 index b07dceb..0000000 --- a/src/translations/lxqt-config_cs.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[cs]=Nastavit moduly LXQt -GenericName[cs]=Nastavení LXQtu -Name[cs]=Nastavení LXQtu diff --git a/src/translations/lxqt-config_cs_CZ.desktop b/src/translations/lxqt-config_cs_CZ.desktop deleted file mode 100644 index e0281d5..0000000 --- a/src/translations/lxqt-config_cs_CZ.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[cs_CZ]=Nastavit moduly LXQt -GenericName[cs_CZ]=Nastavení LXQtu -Name[cs_CZ]=Nastavení LXQtu diff --git a/src/translations/lxqt-config_da.desktop b/src/translations/lxqt-config_da.desktop deleted file mode 100644 index 6ad9e88..0000000 --- a/src/translations/lxqt-config_da.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[da]=LXQt-konfigurationscenter -GenericName[da]=Systemindstillinger -Comment[da]=Konfigurér dit system diff --git a/src/translations/lxqt-config_de.desktop b/src/translations/lxqt-config_de.desktop deleted file mode 100644 index e82005d..0000000 --- a/src/translations/lxqt-config_de.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[de]=Konfigurationszentrum -GenericName[de]=Systemeinstellungen -Comment[de]=Konfiguration von LXQt- und Systemkomponenten diff --git a/src/translations/lxqt-config_el.desktop b/src/translations/lxqt-config_el.desktop deleted file mode 100644 index 03f7713..0000000 --- a/src/translations/lxqt-config_el.desktop +++ /dev/null @@ -1,5 +0,0 @@ -# Translations -Name[el]=Κέντρο διαμόρφωσης LXQt -GenericName[el]=Ρυθμίσεις συστήματος -Comment[el]=Διαμόρφωση του συστήματος - diff --git a/src/translations/lxqt-config_eo.desktop b/src/translations/lxqt-config_eo.desktop deleted file mode 100644 index 0094fc6..0000000 --- a/src/translations/lxqt-config_eo.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[eo]=Agordi modulojn de LXQt -GenericName[eo]=Agordilo de LXQt -Name[eo]=Agordcentro de LXQt diff --git a/src/translations/lxqt-config_es.desktop b/src/translations/lxqt-config_es.desktop deleted file mode 100644 index 9dc12ca..0000000 --- a/src/translations/lxqt-config_es.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[es]=Configura módulos de LXQt -GenericName[es]=Configuración LXQt -Name[es]=Centro de Configuración LXQt diff --git a/src/translations/lxqt-config_es_VE.desktop b/src/translations/lxqt-config_es_VE.desktop deleted file mode 100644 index 4794885..0000000 --- a/src/translations/lxqt-config_es_VE.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[es_VE]=Configurar modulos de LXQt -GenericName[es_VE]=Configuracion de LXQt -Name[es_VE]=Centro de Configuracion LXQt diff --git a/src/translations/lxqt-config_eu.desktop b/src/translations/lxqt-config_eu.desktop deleted file mode 100644 index 6c54ad9..0000000 --- a/src/translations/lxqt-config_eu.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[eu]=Konfiguratu LXQt moduluak -GenericName[eu]=LXQt konfigurazioa -Name[eu]=LXQt konfigurazio-zentroa diff --git a/src/translations/lxqt-config_fi.desktop b/src/translations/lxqt-config_fi.desktop deleted file mode 100644 index 28667fe..0000000 --- a/src/translations/lxqt-config_fi.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[fi]=Hallitse LXQtin moduuleita -GenericName[fi]=LXQt-hallinta -Name[fi]=LXQtin hallintakeskus diff --git a/src/translations/lxqt-config_fr.desktop b/src/translations/lxqt-config_fr.desktop deleted file mode 100644 index cc3dfa9..0000000 --- a/src/translations/lxqt-config_fr.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[fr]=Configurer les modules de LXQt -GenericName[fr]=Configuration de LXQt -Name[fr]=Centre de configuration de LXQt diff --git a/src/translations/lxqt-config_hu.desktop b/src/translations/lxqt-config_hu.desktop deleted file mode 100644 index 504f0df..0000000 --- a/src/translations/lxqt-config_hu.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[hu]=A LXQt modulok beállítása -GenericName[hu]=LXQt beállítóközpont -Name[hu]=LXQt beállítóközpont diff --git a/src/translations/lxqt-config_id_ID.desktop b/src/translations/lxqt-config_id_ID.desktop deleted file mode 100644 index 52995bd..0000000 --- a/src/translations/lxqt-config_id_ID.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[id_ID]=Konfigurasi modul LXQt -GenericName[id_ID]=Konfigurasi LXQt -Name[id_ID]=Pusat Konfigurasi LXQt diff --git a/src/translations/lxqt-config_it.desktop b/src/translations/lxqt-config_it.desktop deleted file mode 100644 index 4c2c9d7..0000000 --- a/src/translations/lxqt-config_it.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[it]=Configura moduli di LXQt -GenericName[it]=Configura LXQt -Name[it]=Centro di configurazione LXQt diff --git a/src/translations/lxqt-config_ja.desktop b/src/translations/lxqt-config_ja.desktop deleted file mode 100644 index d12f4d3..0000000 --- a/src/translations/lxqt-config_ja.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ja]=LXQtモジュールを設定 -GenericName[ja]=LXQtの設定 -Name[ja]=LXQtコンフィグレーションセンター diff --git a/src/translations/lxqt-config_lt.desktop b/src/translations/lxqt-config_lt.desktop deleted file mode 100644 index 708ef38..0000000 --- a/src/translations/lxqt-config_lt.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Name[lt]=LXQt konfigūravimo centras -GenericName[lt]=Sistemos nustatymai -Comment[lt]=Konfigūruoti savo sistemą diff --git a/src/translations/lxqt-config_nl.desktop b/src/translations/lxqt-config_nl.desktop deleted file mode 100644 index 50514bd..0000000 --- a/src/translations/lxqt-config_nl.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[nl]=Configureer LXQt modules -GenericName[nl]=LXQt Configuratie -Name[nl]=LXQt Configuratie Centrum diff --git a/src/translations/lxqt-config_pl.desktop b/src/translations/lxqt-config_pl.desktop deleted file mode 100644 index b120eaf..0000000 --- a/src/translations/lxqt-config_pl.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[pl]=Wszystkie ustawienia LXQt -GenericName[pl]=Panel sterowania LXQt -Name[pl]=Panel sterowania LXQt diff --git a/src/translations/lxqt-config_pl_PL.desktop b/src/translations/lxqt-config_pl_PL.desktop deleted file mode 100644 index c06e74a..0000000 --- a/src/translations/lxqt-config_pl_PL.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[pl_PL]=Konfiguruj moduły LXQt -GenericName[pl_PL]=Konfiguracja LXQt -Name[pl_PL]=Panel sterowania LXQt diff --git a/src/translations/lxqt-config_pt.desktop b/src/translations/lxqt-config_pt.desktop deleted file mode 100644 index 921f3eb..0000000 --- a/src/translations/lxqt-config_pt.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[pt]=Configurar módulos do LXQt -GenericName[pt]=Configuração do LXQt -Name[pt]=Centro de configuração LXQt diff --git a/src/translations/lxqt-config_pt_BR.desktop b/src/translations/lxqt-config_pt_BR.desktop deleted file mode 100644 index 3efbf18..0000000 --- a/src/translations/lxqt-config_pt_BR.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[pt_BR]=Configurar módulos Qt -GenericName[pt_BR]=Configuração -Name[pt_BR]=Centro De Configuração diff --git a/src/translations/lxqt-config_ro_RO.desktop b/src/translations/lxqt-config_ro_RO.desktop deleted file mode 100644 index 1b723ed..0000000 --- a/src/translations/lxqt-config_ro_RO.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ro_RO]=Configurează modulele LXQt -GenericName[ro_RO]=Configurație LXQt -Name[ro_RO]=Centru de configurare LXQt diff --git a/src/translations/lxqt-config_ru.desktop b/src/translations/lxqt-config_ru.desktop deleted file mode 100644 index f9f1dac..0000000 --- a/src/translations/lxqt-config_ru.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[ru]=Настроить вашу систему -GenericName[ru]=Системные настройки -Name[ru]=Системные настройки LXQt diff --git a/src/translations/lxqt-config_sk.desktop b/src/translations/lxqt-config_sk.desktop deleted file mode 100644 index f214d5b..0000000 --- a/src/translations/lxqt-config_sk.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[sk]=Centrum nastavení prostredia LXQt -GenericName[sk]=Centrum nastavení -Name[sk]=Centrum nastavení diff --git a/src/translations/lxqt-config_sl.desktop b/src/translations/lxqt-config_sl.desktop deleted file mode 100644 index a13d84f..0000000 --- a/src/translations/lxqt-config_sl.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[sl]=Nastavitveni moduli za LXQt -GenericName[sl]=Nastavitve -Name[sl]=Nastavitveno središče za LXQt diff --git a/src/translations/lxqt-config_sr.desktop b/src/translations/lxqt-config_sr.desktop deleted file mode 100644 index 72d992b..0000000 --- a/src/translations/lxqt-config_sr.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[sr]=Подесите Рејзорове модуле -GenericName[sr]=Подешавање Рејзора -Name[sr]=Центар за подешавање diff --git a/src/translations/lxqt-config_sr@ijekavian.desktop b/src/translations/lxqt-config_sr@ijekavian.desktop deleted file mode 100644 index bf36e19..0000000 --- a/src/translations/lxqt-config_sr@ijekavian.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[sr@ijekavian]=Центар за подешавање -Comment[sr@ijekavian]=Подесите Рејзорове модуле -GenericName[sr@ijekavian]=Подешавање Рејзора diff --git a/src/translations/lxqt-config_sr@ijekavianlatin.desktop b/src/translations/lxqt-config_sr@ijekavianlatin.desktop deleted file mode 100644 index 84a9f35..0000000 --- a/src/translations/lxqt-config_sr@ijekavianlatin.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Name[sr@ijekavianlatin]=Centar za podešavanje -Comment[sr@ijekavianlatin]=Podesite Rejzorove module -GenericName[sr@ijekavianlatin]=Podešavanje Rejzora diff --git a/src/translations/lxqt-config_sr@latin.desktop b/src/translations/lxqt-config_sr@latin.desktop deleted file mode 100644 index 2b58f2e..0000000 --- a/src/translations/lxqt-config_sr@latin.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[sr@latin]=Podesite Rejzorove module -GenericName[sr@latin]=Podešavanje Rejzora -Name[sr@latin]=Centar za podešavanje diff --git a/src/translations/lxqt-config_th_TH.desktop b/src/translations/lxqt-config_th_TH.desktop deleted file mode 100644 index cbade56..0000000 --- a/src/translations/lxqt-config_th_TH.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[th_TH]=ปรับแต่งมอดูล LXQt -GenericName[th_TH]=ปรับแต่ง LXQt -Name[th_TH]=ศูนย์การปรับแต่ง LXQt diff --git a/src/translations/lxqt-config_tr.desktop b/src/translations/lxqt-config_tr.desktop deleted file mode 100644 index d388eb3..0000000 --- a/src/translations/lxqt-config_tr.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[tr]=LXQt modüllerini yapılandır -GenericName[tr]=LXQt Yapılandırması -Name[tr]=LXQt Yapılandırma Merkezi diff --git a/src/translations/lxqt-config_uk.desktop b/src/translations/lxqt-config_uk.desktop deleted file mode 100644 index 3cf998b..0000000 --- a/src/translations/lxqt-config_uk.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[uk]=Налаштувати модулі LXQt -GenericName[uk]=Налаштування LXQt -Name[uk]=Центр налаштувань LXQt diff --git a/src/translations/lxqt-config_zh_CN.desktop b/src/translations/lxqt-config_zh_CN.desktop deleted file mode 100644 index 9588629..0000000 --- a/src/translations/lxqt-config_zh_CN.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[zh_CN]=配置 LXQt 模块 -GenericName[zh_CN]=LXQt 配置 -Name[zh_CN]=LXQt 配置中心 diff --git a/src/translations/lxqt-config_zh_TW.desktop b/src/translations/lxqt-config_zh_TW.desktop deleted file mode 100644 index bb7780a..0000000 --- a/src/translations/lxqt-config_zh_TW.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# Translations -Comment[zh_TW]=設定LXQt模組 -GenericName[zh_TW]=LXQt設定 -Name[zh_TW]=LXQt設定中心