diff --git a/CMakeLists.txt b/CMakeLists.txt index 712b103..57aceae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,82 +1,36 @@ project(kde-gtk-config) set(PROJECT_VERSION "5.17.80") cmake_minimum_required(VERSION 3.10) -find_package(ECM 0.0.9 REQUIRED NO_MODULE) +find_package(ECM REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${ECM_MODULE_PATH}) -find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Widgets DBus) -find_package(KF5 REQUIRED COMPONENTS I18n KIO ConfigWidgets NewStuff Archive KCMUtils IconThemes DBusAddons) +find_package(Qt5 REQUIRED NO_MODULE COMPONENTS DBus) +find_package(KF5CoreAddons REQUIRED) +find_package(KF5Config REQUIRED) +find_package(KF5IconThemes REQUIRED) +find_package(KF5DBusAddons REQUIRED) find_package(GTK3 REQUIRED) find_package(GSettingSchemas REQUIRED) -include_directories( - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src - ${CMAKE_SOURCE_DIR}/src/ui - ${GTK3_INCLUDE_DIRS} -) - include(ECMSetupVersion) include(ECMInstallIcons) include(ECMMarkAsTest) include(GenerateExportHeader) include(FeatureSummary) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDEClangFormat) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake kded/config.h) -# Set KI18n translation domain -add_definitions(-DTRANSLATION_DOMAIN=\"kde-gtk-config\") - -set(kcm_SRCS - src/gtkconfigkcmodule.cpp -) - -ki18n_wrap_ui(kcm_SRCS - src/ui/gui.ui -) - -add_library(kcm_kdegtkconfig MODULE ${kcm_SRCS}) - -target_compile_definitions(kcm_kdegtkconfig - PRIVATE - -DPROJECT_VERSION="${PROJECT_VERSION}" - -DQT_NO_SIGNALS_SLOTS_KEYWORDS -) - -target_link_libraries(kcm_kdegtkconfig - ${GIO2_LIBRARY} - ${GLIB2_LIBRARY} - ${GTK3_LIBRARY} - ${GOBJECT2_LIBRARY} - Qt5::DBus - KF5::ConfigCore - KF5::I18n - KF5::KIOWidgets - KF5::NewStuff - KF5::Archive - KF5::ConfigWidgets - KF5::DBusAddons -) - -kcoreaddons_desktop_to_json(kcm_kdegtkconfig kde-gtk-config.desktop) - -install(TARGETS kcm_kdegtkconfig DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES cgctheme.knsrc cgcgtk3.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR}) -install(FILES kde-gtk-config.desktop DESTINATION ${SERVICES_INSTALL_DIR}) - add_subdirectory(gtkproxies) add_subdirectory(gtk3proxies) -add_subdirectory(icons) add_subdirectory(kded) # add clang-format target for all our real source files file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 8f50c9a..0000000 --- a/ChangeLog +++ /dev/null @@ -1,30 +0,0 @@ -V1.0 -* Port to Module KCM -* change tr() to i18n(), make it translatable, complete translation to english, complete intergation in Apperance module - -V1.1 -* Adding SVG preview suport, add Spanish, Galician and Italian - -v1.2 -* Fix a bug in the layout for some Qt themes - -v1.3 -* Symlink .gtkrc-2.0-kde4 - -v1.4 -* Bug Fixing - -v1.5 -* Add support for the toolbar style - -v1.6 -* Support for GHNS in gtk themes, added Euskara - -v1.7 -* Added Russian - -v1.7 -* Added Gtk3 Support, You can install gtk3 themes through GHNS API and manual installation. - -v2.0 -* Moved to KDE repositories, cleaned up GUI and features. \ No newline at end of file diff --git a/Messages.sh b/Messages.sh deleted file mode 100644 index 68dcb58..0000000 --- a/Messages.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/sh -$EXTRACTRC `find . -name \*.ui` >> rc.cpp -$XGETTEXT rc.cpp src/*.cpp -o $podir/kde-gtk-config.pot - diff --git a/README b/README deleted file mode 100644 index 62775fe..0000000 --- a/README +++ /dev/null @@ -1,24 +0,0 @@ -KDE GTK CONFIG v1.7 ----------------------- - -Copyright (c) 2011 - Jose Antonio Sánchez Reynaga and the Team behind Chakra -Copyright (c) 2011 - Aleix Pol Gonzalez - -This program it's licensed under GPLv3 - -Compilation: -$ mkdir build && cd build -$ cmake -DCMAKE_INSTALL_PREFIX=/usr .. -$ make -# make install - -Features: - -> Themes installation -> Themes uninstallation -> Icon themes selection -> Icon themes fallback selection -> themes selection -> fonts selection - -enjoy ! diff --git a/cgcgtk3.knsrc b/cgcgtk3.knsrc deleted file mode 100644 index d2ce684..0000000 --- a/cgcgtk3.knsrc +++ /dev/null @@ -1,47 +0,0 @@ -[KNewStuff3] -Name=GTK 3.x Themes -Name[ar]=سمات جتك الثّالثة -Name[ast]=Estilos pa GTK 3.x -Name[ca]=Temes GTK 3.x -Name[ca@valencia]=Temes GTK 3.x -Name[cs]=Motivy GTK 3.x -Name[da]=GTK 3.x-temaer -Name[de]=GTK 3.x-Designs -Name[el]=Θέματα GTK 3.x -Name[en_GB]=GTK 3.x Themes -Name[es]=Temas de GTK 3.x -Name[et]=GTK 3.x teemad -Name[eu]=GTK 3.x gaiak -Name[fi]=GTK 3.x -teemat -Name[fr]=Thèmes GTK 3.x -Name[gl]=Temas de GTK 3.x -Name[he]=ערכות נושא של GTK 3.x -Name[hu]=GTK 3.x témák -Name[ia]=Themas de GTK 3.x -Name[id]=Tema GTK 3.x -Name[it]=Temi GTK 3.x -Name[ko]=GTK 3.x 테마 -Name[lt]=GTK 3.x apipavidalinimai -Name[nl]=GTK 3.x thema's -Name[nn]=GTK 3.x-tema -Name[pl]=Wygląd GTK 3.x -Name[pt]=Temas do GTK 3.x -Name[pt_BR]=Temas GTK 3.x -Name[ru]=Темы GTK 3.x -Name[sk]=Témy GTK 3.x -Name[sl]=Teme GTK 3.x -Name[sr]=ГТК 3.x теме -Name[sr@ijekavian]=ГТК 3.x теме -Name[sr@ijekavianlatin]=GTK 3.x teme -Name[sr@latin]=GTK 3.x teme -Name[sv]=GTK 3.x-teman -Name[tg]=Мавзӯъҳои GTK 3.x -Name[tr]=GTK 3.x Temaları -Name[uk]=Теми GTK 3.x -Name[x-test]=xxGTK 3.x Themesxx -Name[zh_CN]=GTK 3.x 主题 -Name[zh_TW]=GTK 3.x 主題 - -Categories=GTK 3.x Theme/Style -Uncompress=always -InstallPath=.themes diff --git a/cgctheme.knsrc b/cgctheme.knsrc deleted file mode 100644 index 3c9e330..0000000 --- a/cgctheme.knsrc +++ /dev/null @@ -1,47 +0,0 @@ -[KNewStuff3] -Name=GTK 2.x Themes -Name[ar]=سمات جتك الثّانية -Name[ast]=Estilos pa GTK 2.x -Name[ca]=Temes GTK 2.x -Name[ca@valencia]=Temes GTK 2.x -Name[cs]=Motivy GTK 2.x -Name[da]=GTK 2.x-temaer -Name[de]=GTK 2.x-Designs -Name[el]=Θέματα GTK 2.x -Name[en_GB]=GTK 2.x Themes -Name[es]=Temas de GTK 2.x -Name[et]=GTK 2.x teemad -Name[eu]=GTK 2.x gaiak -Name[fi]=GTK 2.x -teemat -Name[fr]=Thèmes GTK 2.x -Name[gl]=Temas de GTK 2.x -Name[he]=ערכות נושא של GTK 2.x -Name[hu]=GTK 2.x témák -Name[ia]=Themas de GTK 2.x -Name[id]=Tema GTK 2.x -Name[it]=Temi GTK 2.x -Name[ko]=GTK 2.x 테마 -Name[lt]=GTK 2.x apipavidalinimai -Name[nl]=GTK 2.x thema's -Name[nn]=GTK 2.x-tema -Name[pl]=Wygląd GTK 2.x -Name[pt]=Temas do GTK 2.x -Name[pt_BR]=Temas GTK 2.x -Name[ru]=Темы GTK 2.x -Name[sk]=Témy GTK 2.x -Name[sl]=Teme GTK 2.x -Name[sr]=ГТК 2.x теме -Name[sr@ijekavian]=ГТК 2.x теме -Name[sr@ijekavianlatin]=GTK 2.x teme -Name[sr@latin]=GTK 2.x teme -Name[sv]=GTK 2.x-teman -Name[tg]=Мавзӯъҳои GTK 2.x -Name[tr]=GTK 2.x Temaları -Name[uk]=Теми GTK 2.x -Name[x-test]=xxGTK 2.x Themesxx -Name[zh_CN]=GTK 2.x 主题 -Name[zh_TW]=GTK 2.x 主題 - -Categories=GTK 2.x Theme/Style -Uncompress=always -InstallPath=.themes diff --git a/icons/128-apps-kde-gtk-config.png b/icons/128-apps-kde-gtk-config.png deleted file mode 100644 index 8118673..0000000 Binary files a/icons/128-apps-kde-gtk-config.png and /dev/null differ diff --git a/icons/16-apps-kde-gtk-config.png b/icons/16-apps-kde-gtk-config.png deleted file mode 100644 index 402fe30..0000000 Binary files a/icons/16-apps-kde-gtk-config.png and /dev/null differ diff --git a/icons/22-apps-kde-gtk-config.png b/icons/22-apps-kde-gtk-config.png deleted file mode 100644 index 914b155..0000000 Binary files a/icons/22-apps-kde-gtk-config.png and /dev/null differ diff --git a/icons/24-apps-kde-gtk-config.png b/icons/24-apps-kde-gtk-config.png deleted file mode 100644 index 9b6dda0..0000000 Binary files a/icons/24-apps-kde-gtk-config.png and /dev/null differ diff --git a/icons/256-apps-kde-gtk-config.png b/icons/256-apps-kde-gtk-config.png deleted file mode 100644 index 22c4492..0000000 Binary files a/icons/256-apps-kde-gtk-config.png and /dev/null differ diff --git a/icons/32-apps-kde-gtk-config.png b/icons/32-apps-kde-gtk-config.png deleted file mode 100644 index 320bb72..0000000 Binary files a/icons/32-apps-kde-gtk-config.png and /dev/null differ diff --git a/icons/48-apps-kde-gtk-config.png b/icons/48-apps-kde-gtk-config.png deleted file mode 100644 index c049b50..0000000 Binary files a/icons/48-apps-kde-gtk-config.png and /dev/null differ diff --git a/icons/64-apps-kde-gtk-config.png b/icons/64-apps-kde-gtk-config.png deleted file mode 100644 index 7ffd162..0000000 Binary files a/icons/64-apps-kde-gtk-config.png and /dev/null differ diff --git a/icons/8-apps-kde-gtk-config.png b/icons/8-apps-kde-gtk-config.png deleted file mode 100644 index d816bca..0000000 Binary files a/icons/8-apps-kde-gtk-config.png and /dev/null differ diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt deleted file mode 100644 index 4d1087d..0000000 --- a/icons/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -ecm_install_icons( - ICONS - 128-apps-kde-gtk-config.png - 16-apps-kde-gtk-config.png - 22-apps-kde-gtk-config.png - 24-apps-kde-gtk-config.png - 256-apps-kde-gtk-config.png - 32-apps-kde-gtk-config.png - 48-apps-kde-gtk-config.png - 64-apps-kde-gtk-config.png - 8-apps-kde-gtk-config.png - sc-apps-kde-gtk-config.svgz - THEME hicolor - DESTINATION ${ICON_INSTALL_DIR} -) diff --git a/icons/sc-apps-kde-gtk-config.svgz b/icons/sc-apps-kde-gtk-config.svgz deleted file mode 100644 index a114cb1..0000000 Binary files a/icons/sc-apps-kde-gtk-config.svgz and /dev/null differ diff --git a/kde-gtk-config.desktop b/kde-gtk-config.desktop deleted file mode 100644 index 37a369e..0000000 --- a/kde-gtk-config.desktop +++ /dev/null @@ -1,115 +0,0 @@ -[Desktop Entry] -Exec=kcmshell5 kde-gtk-config -Icon=kde-gtk-config -Type=Service -X-KDE-ServiceTypes=KCModule - -X-KDE-Library=kcm_kdegtkconfig -# X-KDE-ParentApp=kcontrol - -X-KDE-System-Settings-Parent-Category=applicationstyle -X-KDE-Weight=20 - -Name=GNOME/GTK Application Style -Name[ast]=Estilos p'aplicaciones en GTK -Name[ca]=Estil de les aplicacions GNOME/GTK -Name[ca@valencia]=Estil de les aplicacions GNOME/GTK -Name[cs]=Styl aplikací GNOME/GTK -Name[da]=Programstil for GNOME-/GTK-programmer -Name[de]=GNOME/GTK Anwendungs-Stil -Name[en_GB]=GNOME/GTK Application Style -Name[es]=Estilo de las aplicaciones de GNOME/GTK -Name[et]=GNOME/GTK rakenduste stiil -Name[eu]=GNOME/GTK aplikazioen estiloa -Name[fi]=Gnome/GTK-sovellusten tyyli -Name[fr]=Style des applications « GNOME / GTK » -Name[gl]=Estilo das aplicacións de GNOME ou GTK -Name[hu]=GNOME/GTK alkalmazásstílus -Name[ia]=Application de stilo de GNOME/GTK -Name[id]=Gaya Aplikasi GNOME/GTK -Name[it]=Stile delle applicazioni GNOME/GTK -Name[ja]=GNOME/GTK アプリケーションスタイル -Name[ko]=그놈/GTK 프로그램 스타일 -Name[lt]=GNOME/GTK programų stilius -Name[nl]=Stijl van GNOME/GTK-toepassingen -Name[nn]=GNOME/GTK-programstil -Name[pl]=Wygląd aplikacji GNOME/GTK -Name[pt]=Estilo de Aplicações do GNOME/GTK -Name[pt_BR]=Estilo dos aplicativos GNOME/GTK -Name[ru]=Стиль программ GNOME/GTK+ -Name[sk]=Štýl aplikácií GNOME (GTK) -Name[sv]=GNOME/GTK-programstil -Name[tg]=Услуби барномаи GNOME/GTK -Name[uk]=Стиль програм GNOME/GTK -Name[x-test]=xxGNOME/GTK Application Stylexx -Name[zh_CN]=GNOME/GTK 应用程序风格 -Name[zh_TW]=GNOME / GTK 應用程式樣式 -Comment=Configure GNOME/GTK application style and behavior -Comment[ast]=Configura l'estilu y el comportamientu de les aplicaciones en GTK -Comment[ca]=Configuració de l'estil i comportament de les aplicacions GNOME/GTK -Comment[ca@valencia]=Configuració de l'estil i comportament de les aplicacions GNOME/GTK -Comment[cs]=Nastavte styl a chováni aplikací GNOME/GTK -Comment[da]=Indstil stil og opførsel GNOME-/GTK-programmer -Comment[de]=Einrichtung des Stils und Verhaltens von GNOME-/GTK-Anwendungen -Comment[en_GB]=Configure GNOME/GTK application style and behaviour -Comment[es]=Configurar el estilo y el comportamiento de las aplicaciones de GNOME/GTK -Comment[et]=GNOME/GTK rakenduste stiili ja käitumise seadistamine -Comment[eu]=Konfiguratu GNOME/Gtk aplikazioen estiloa eta jokabidea -Comment[fi]=Gnome/GTK-sovellusten tyyli- ja toimintaasetukset -Comment[fr]=Configuration du style et du comportement des applications « GNOME / GTK » -Comment[gl]=Configurar o estilo e comportamento das aplicacións de GNOME ou GTK -Comment[hu]=A GNOME/GTK alkalmazások stílusának és működésének beállítása -Comment[ia]=Configura stilo de application GNOME/GTK e comportamento -Comment[id]=Konfigurasikan perilaku dan gaya aplikasi GTK/GNOME -Comment[it]=Configura lo stile ed il comportamento delle applicazioni GNOME/GTK -Comment[ko]=그놈/GTK 프로그램 스타일과 행동 설정 -Comment[lt]=Konfigūruoti GNOME/GTK programų stilių ir elgseną -Comment[nl]=Stijl en gedrag van GNOME/GTK-toepassingen configureren -Comment[nn]=Set opp utsjånad og åtferd for GNOME/GTK-program -Comment[pl]=Ustawienia wyglądu i zachowania aplikacji GNOME/GTK -Comment[pt]=Configurar o estilo e comportamento das aplicações em GNOME/GTK -Comment[pt_BR]=Configure o estilo e comportamento dos aplicativos GNOME/GTK -Comment[ru]=Настройка стиля и поведения программ на основе GNOME/GTK+ -Comment[sk]=Nastavte správanie a vzhľad GTK/GNOME aplikácií. -Comment[sv]=Anpassa GNOME/GTK-programstil och beteende -Comment[tg]=Танзимоти услуби барномаи ва рафтори GNOME/GTK -Comment[uk]=Налаштовування стилю і поведінки програм на основі GNOME/GTK -Comment[x-test]=xxConfigure GNOME/GTK application style and behaviorxx -Comment[zh_CN]=配置 GNOME/GTK 应用程序风格和行为 -Comment[zh_TW]=設定 GNOME/GTK 應用程式的樣式與行為 - -X-KDE-Keywords=gnome,gtk,style,styles,look,widget,icons,toolbars,apps,theme,menu -X-KDE-Keywords[ast]=gnome,gtk,estilu,estilos,aspeutu,aspeutos,widget,widgets,iconos,aplicaciones,menú,menús,barres de ferramientes -X-KDE-Keywords[ca]=gnome,gtk,estil,estils,aspecte,estri,icones,barres d'eines,apps,aplicacions,tema,menú -X-KDE-Keywords[ca@valencia]=gnome,gtk,estil,estils,aspecte,giny(«widget»),icones,barres d'eines,apps,aplicacions,tema,menú -X-KDE-Keywords[cs]=gnome,gtk,styl,styly,vzhled,widget,ikony,nástrojové lišty,aplikace,motiv,nabídka -X-KDE-Keywords[da]=gnome,gtk,stil,udseende,widget,ikoner,værktøjslinjer,apps,programmer,tema,menu -X-KDE-Keywords[de]=gnome,gtk,style,styles,look,widget,icons,toolbars,apps,theme,menu,Stile,Stile,Design,Themes,Bedienelemente,Elemente,Bildschirmelemente,Werkzeugleisten,Symbole,Anwendungen,Menü -X-KDE-Keywords[en_GB]=gnome,gtk,style,styles,look,widget,icons,toolbars,apps,theme,menu -X-KDE-Keywords[es]=gnome,gtk,estilo,estilos,apariencia,widget,iconos,barras de herramientas,apps,tema,menú -X-KDE-Keywords[et]=gnome,gtk,stiil,stiilid,välimus,vidin,ikoonid,tööriistaribad,rakendused,teema,menüü -X-KDE-Keywords[eu]=gnome,gtk,estiloa,estiloak,itxura,trepeta,ikonoak,tresna-barrak,aplikazioak,gaia,menua -X-KDE-Keywords[fi]=gnome,gtk,tyyli,tyylit,ulkoasu,alkio,kuvakkeet,työkalurivit,sovellukset,teema,valikko -X-KDE-Keywords[fr]=gnome,gtk,style,styles,apparence,widget,composant,icônes,barre d'outils,applis,thème,menu -X-KDE-Keywords[gl]=gnome,gtk,estilo,estilos,aparencia,trebello,iconas,barras de ferramentas,aplicativos,tema,menú -X-KDE-Keywords[hu]=gnome,gtk,stílus,megjelenés,widget,ikonok,eszköztárak,alkalmazások,téma,menü -X-KDE-Keywords[ia]=gnome,gtk,style,styles,look,widget,icons,toolbars,apps,theme,menu -X-KDE-Keywords[id]=gnome,gtk,gaya,style,nuansa,widget,ikon,toolbar,bilah-alat,apl,tema,menu -X-KDE-Keywords[it]=gnome,gtk,stile,stili,aspetto,oggetto,icone,barre degli strumenti,app,tema,menu -X-KDE-Keywords[ko]=gnome,gtk,style,styles,look,widget,icons,toolbars,apps,theme,menu,그놈,스타일,위젯,아이콘,도구 모음,프로그램,테마,메뉴 -X-KDE-Keywords[lt]=gnome,gtk,stilius,stiliai,išvaizda,valdiklis,piktogramos,įrankių juostos,programos,apipavidalinimas,meniu -X-KDE-Keywords[nl]=gnome,gtk,stijl,stijlen,uiterlijk,widget,pictogrammen,werkbalken,apps,thema,menu,toepassingen -X-KDE-Keywords[nn]=gnome,gtk,stil,stilar,utsjånad,skjermelement,skjermkontrollar,ikon,verktøylinjer,appar,program,tema,meny -X-KDE-Keywords[pl]=gnome,gtk,styl,style,wygląd,widżet,elementy interfejsu,ikony,paski narzędzi,aplikacje,programy,wygląd,menu -X-KDE-Keywords[pt]=gnome,gtk,estilo,estilos,aparência,elemento,ícones,barras de ferramentas,aplicações,tema,menu -X-KDE-Keywords[pt_BR]=gnome,gtk,estilo,estilos,visual,widget,ícones,barras de ferramentas,apps,aplicativos,tema,menu -X-KDE-Keywords[ru]=gnome,gtk,style,styles,look,widget,icons,toolbars,apps,theme,menu,стиль,гном,оформление,внешний вид,виджеты,графические элементы,значки,панели инструментов,тема,меню -X-KDE-Keywords[sk]=gnome,gtk,štýl,štýly,vzhľad,widget,ikony,panel nástrojov,applikácie,téma,ponuka -X-KDE-Keywords[sv]=gnome,gtk,stil,stilar,utseende,komponent,ikoner,verktygsrader,program,tema,meny -X-KDE-Keywords[tg]=gnome,gtk,услуб,услубҳо,намуд,виҷет,нишонаҳо,навори абзорҳо,барномаҳо,мавзӯъ,феҳрист -X-KDE-Keywords[uk]=gnome,gtk,style,styles,look,widget,icons,toolbars,apps,theme,menu,гном,гноме,жтк,стиль,стилі,вигляд,віджет,піктограми,панелі,програми,тема,меню -X-KDE-Keywords[x-test]=xxgnomexx,xxgtkxx,xxstylexx,xxstylesxx,xxlookxx,xxwidgetxx,xxiconsxx,xxtoolbarsxx,xxappsxx,xxthemexx,xxmenuxx -X-KDE-Keywords[zh_CN]=gnome,gtk,style,styles,look,widget,icons,toolbars,apps,theme,menu,样式,外观,小部件,图标,工具栏,应用程序,主题,菜单 -X-KDE-Keywords[zh_TW]=gnome,gtk,style,styles,look,widget,icons,toolbars,apps,theme,menu,樣式,樣貌,元件,小工具,圖示,圖標,工具列,應用程式,App,應用,主題,選單,目錄 - -Categories=Qt;KDE;X-KDE-settings-looknfeel; diff --git a/kde-gtk-config.kdev4 b/kde-gtk-config.kdev4 deleted file mode 100644 index e455c33..0000000 --- a/kde-gtk-config.kdev4 +++ /dev/null @@ -1,3 +0,0 @@ -[Project] -Manager=KDevCMakeManager -Name=kde-gtk-config diff --git a/kded/CMakeLists.txt b/kded/CMakeLists.txt index dcfe698..07affc2 100644 --- a/kded/CMakeLists.txt +++ b/kded/CMakeLists.txt @@ -1,32 +1,31 @@ set(kscreen_daemon_SRCS gtkconfig.cpp configeditor.cpp configvalueprovider.cpp themepreviewer.cpp ) add_library(gtkconfig MODULE ${kscreen_daemon_SRCS}) target_compile_definitions(gtkconfig PUBLIC -DQT_NO_SIGNALS_SLOTS_KEYWORDS ) target_include_directories(gtkconfig PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${GTK3_INCLUDE_DIRS} ) target_link_libraries(gtkconfig - Qt5::Gui Qt5::DBus KF5::CoreAddons KF5::ConfigCore KF5::DBusAddons KF5::IconThemes ${GIO2_LIBRARY} ${GOBJECT2_LIBRARY} ) install(TARGETS gtkconfig DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kded) diff --git a/src/gtkconfigkcmodule.cpp b/src/gtkconfigkcmodule.cpp deleted file mode 100644 index 276c76b..0000000 --- a/src/gtkconfigkcmodule.cpp +++ /dev/null @@ -1,392 +0,0 @@ -/* KDE GTK Configuration Module - * - * Copyright 2011 José Antonio Sanchez Reynaga - * Copyright 2011 Aleix Pol Gonzalez - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see . - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "config.h" -#include "ui_gui.h" -#include "gtkconfigkcmodule.h" - -K_PLUGIN_FACTORY_WITH_JSON(GTKConfigKCModuleFactory, "kde-gtk-config.json", registerPlugin();) - -GTKConfigKCModule::GTKConfigKCModule(QWidget* parent, const QVariantList& args ) - : KCModule(parent) - , currentGtk2Theme() - , currentGtk3Theme() - , gtk2ThemesModel() - , gtk3ThemesModel() - , gtkConfigInterface( - QStringLiteral("org.kde.GtkConfig"), - QStringLiteral("/GtkConfig"), - QStringLiteral("org.kde.GtkConfig") - ) - , ui(new Ui::GUI) -{ - Q_UNUSED(args) - auto *about = new KAboutData("cgc", i18n("GTK Application Style"), PROJECT_VERSION, - QString(), KAboutLicense::LGPL_V3, i18n("Copyright 2011 José Antonio Sánchez Reynaga")); - about->addAuthor(i18n("José Antonio Sánchez Reynaga (antonioJASR)"),i18n("Main Developer"), "joanzare@gmail.com"); - about->addAuthor(i18n("Aleix Pol i Gonzalez"), i18n("Feature development. Previews, code refactoring."), "aleixpol@blue-systems.com"); - about->addCredit(i18n("Manuel Tortosa (manutortosa)"), i18n("Ideas, tester, internationalization")); - about->addCredit(i18n("Adrián Chaves Fernández (Gallaecio)"), i18n("Internationalization")); - setAboutData(about); - setButtons(KCModule::Default | KCModule::Apply); - ui->setupUi(this); - - ui->cb_theme->setModel(>k2ThemesModel); - ui->cb_theme_gtk3->setModel(>k3ThemesModel); - - connect(ui->cb_theme, SIGNAL(currentTextChanged(const QString &)), this, SLOT(themesSelectionsChanged())); - connect(ui->cb_theme_gtk3, SIGNAL(currentTextChanged(const QString &)), this, SLOT(themesSelectionsChanged())); - - connect(ui->removeGtk2Theme, &QAbstractButton::clicked, this, >KConfigKCModule::removeGtk2Theme); - connect(ui->removeGtk3Theme, &QAbstractButton::clicked, this, >KConfigKCModule::removeGtk3Theme); - - connect(ui->gtk2Preview, &QAbstractButton::clicked, this, >KConfigKCModule::showGtk2Preview); - connect(ui->gtk3Preview, &QAbstractButton::clicked, this, >KConfigKCModule::showGtk3Preview); - - connect(ui->installFromFile, &QAbstractButton::clicked, this, >KConfigKCModule::installGtkThemeFromFile); - - auto *ghnsMenu = new QMenu(this); - ghnsMenu->addAction(QIcon::fromTheme("get-hot-new-stuff"), i18n("Get New GNOME/GTK2 Application Styles..."), this, >KConfigKCModule::installGtk2ThemeFromGHNS); - ghnsMenu->addAction(QIcon::fromTheme("get-hot-new-stuff"), i18n("Get New GNOME/GTK3 Application Styles..."), this, >KConfigKCModule::installGtk3ThemeFromGHNS); - ui->newThemes->setMenu(ghnsMenu); - ui->newThemes->setIcon(QIcon::fromTheme("get-hot-new-stuff")); -} - -GTKConfigKCModule::~GTKConfigKCModule() -{ - delete ui; -} - -void GTKConfigKCModule::installGtk2ThemeFromGHNS() -{ - KNS3::DownloadDialog downloadDialog("cgctheme.knsrc", this); - if (downloadDialog.exec()) { - updateThemesListsWithoutLoosingSelection(); - } -} - -void GTKConfigKCModule::installGtk3ThemeFromGHNS() -{ - KNS3::DownloadDialog downloadDialog("cgcgtk3.knsrc", this); - if (downloadDialog.exec()) { - updateThemesListsWithoutLoosingSelection(); - } -} - -void GTKConfigKCModule::installGtkThemeFromFile() -{ - QString themeArchivePath = QFileDialog::getOpenFileName( - this, - i18n("Select GTK Theme Archive"), - QDir::home().path(), - i18n("GTK Theme Archive (*.tar.xz *.tar.gz *.tar.bz2)") - ); - - if (themeArchivePath.isEmpty()) { - return; - } - - QString themesInstallDirectoryPath(QDir::homePath() + QStringLiteral("/.themes")); - QDir::home().mkpath(themesInstallDirectoryPath); - KTar themeArchive(themeArchivePath); - themeArchive.open(QIODevice::ReadOnly); - - QStringList archiveSubitems = themeArchive.directory()->entries(); - if (!archiveSubitems.contains(QStringLiteral("gtk-2.0")) && archiveSubitems.indexOf(QRegExp("gtk-3.*")) == -1) { - QMessageBox::warning(this, i18n("Invalid GTK Theme archive"), i18n("%1 is not a valid GTK Theme archive.", QDir(themeArchivePath).dirName())); - return; - } - - themeArchive.directory()->copyTo(themesInstallDirectoryPath); - - updateThemesListsWithoutLoosingSelection(); -} - -void GTKConfigKCModule::removeGtk2Theme() -{ - const QModelIndex index = gtk2ThemesModel.index(ui->cb_theme->currentIndex(), 1); - const QString themePath = gtk2ThemesModel.data(index).value(); - KIO::DeleteJob* deleteJob = KIO::del(QUrl::fromLocalFile(themePath), KIO::HideProgressInfo); - connect(deleteJob, &KJob::finished, this, >KConfigKCModule::updateThemesListsWithoutLoosingSelection); -} - -void GTKConfigKCModule::removeGtk3Theme() -{ - const QModelIndex index = gtk3ThemesModel.index(ui->cb_theme_gtk3->currentIndex(), 1); - const QString themePath = gtk3ThemesModel.data(index).value(); - KIO::del(QUrl::fromLocalFile(themePath), KIO::HideProgressInfo); - KIO::DeleteJob* deleteJob = KIO::del(QUrl::fromLocalFile(themePath), KIO::HideProgressInfo); - connect(deleteJob, &KJob::finished, this, >KConfigKCModule::updateThemesListsWithoutLoosingSelection); -} - -void GTKConfigKCModule::showGtk2Preview() -{ - gtkConfigInterface.call(QStringLiteral("showGtk2ThemePreview"), ui->cb_theme->currentText()); -} - -void GTKConfigKCModule::showGtk3Preview() -{ - gtkConfigInterface.call(QStringLiteral("showGtk3ThemePreview"), ui->cb_theme_gtk3->currentText()); -} - -void GTKConfigKCModule::save() -{ - saveGtk2Theme(); - saveGtk3Theme(); -} - -void GTKConfigKCModule::defaults() -{ - int gtk2DefaultThemeIndex = ui->cb_theme->findText(QStringLiteral("Breeze")); - ui->cb_theme->setCurrentIndex(gtk2DefaultThemeIndex); - - int gtk3DefaultThemeIndex = ui->cb_theme_gtk3->findText(QStringLiteral("Breeze")); - ui->cb_theme_gtk3->setCurrentIndex(gtk3DefaultThemeIndex); -} - -void GTKConfigKCModule::load() -{ - loadGtkThemes(); - - selectCurrentGtk2ThemeInCheckbox(); - selectCurrentGtk3ThemeInCheckbox(); -} - -void GTKConfigKCModule::updateThemesListsWithoutLoosingSelection() -{ - QString currentGtk2ThemeChoice = ui->cb_theme->currentText(); - QString currentGtk3ThemeChoice = ui->cb_theme_gtk3->currentText(); - - loadGtkThemes(); - - // Restore correct gtk configuration, if the theme that was being used is deleted - if (!gtk2ThemesModel.containsTheme(currentGtk2Theme)) { - ui->cb_theme->setCurrentText(QStringLiteral("Breeze")); - saveGtk2Theme(); - } - - if (!gtk3ThemesModel.containsTheme(currentGtk3Theme)) { - ui->cb_theme_gtk3->setCurrentText(QStringLiteral("Breeze")); - saveGtk3Theme(); - } - - // Restore choices, that was before possible themes deletion - if (gtk2ThemesModel.containsTheme(currentGtk2ThemeChoice)) { - ui->cb_theme->setCurrentText(currentGtk2ThemeChoice); - } else { - ui->cb_theme->setCurrentText(QStringLiteral("Breeze")); - } - - if (gtk3ThemesModel.containsTheme(currentGtk3ThemeChoice)) { - ui->cb_theme_gtk3->setCurrentText(currentGtk3ThemeChoice); - } else { - ui->cb_theme_gtk3->setCurrentText(QStringLiteral("Breeze")); - } -} - -void GTKConfigKCModule::themesSelectionsChanged() -{ - if (ui->cb_theme->currentText() == currentGtk2Theme && - ui->cb_theme_gtk3->currentText() == currentGtk3Theme) { - emit changed(false); - } else { - markAsChanged(); - } - updateDeletionPossibilityForSelectedGtk2Theme(); - updateDeletionPossibilityForSelectedGtk3Theme(); -} - -void GTKConfigKCModule::saveGtk2Theme() -{ - currentGtk2Theme = ui->cb_theme->currentText(); - gtkConfigInterface.call(QStringLiteral("setGtk2Theme"), currentGtk2Theme); -} - -void GTKConfigKCModule::saveGtk3Theme() -{ - currentGtk3Theme = ui->cb_theme_gtk3->currentText(); - gtkConfigInterface.call(QStringLiteral("setGtk3Theme"), currentGtk3Theme); -} - -void GTKConfigKCModule::loadGtkThemes() -{ - QStringList possibleThemesPaths = possiblePathsToGtkThemes(); - loadGtk2Themes(possibleThemesPaths); - loadGtk3Themes(possibleThemesPaths); -} - -void GTKConfigKCModule::loadGtk2Themes(const QStringList &possibleThemesPaths) -{ - QMap gtk2ThemesNames; - - for (const QString &possibleThemePath : possibleThemesPaths) { - // If the directory has a gtk-2.0 directory inside, it is the GTK2 theme for sure - QDir possibleThemeDirectory(possibleThemePath); - bool hasGtk2DirectoryInside = possibleThemeDirectory.exists(QStringLiteral("gtk-2.0")); - if (hasGtk2DirectoryInside) { - gtk2ThemesNames.insert(possibleThemeDirectory.dirName(), possibleThemeDirectory.path()); - } - } - - gtk2ThemesModel.setThemesList(gtk2ThemesNames); -} - -void GTKConfigKCModule::loadGtk3Themes(const QStringList &possibleThemesPaths) -{ - QMap gtk3ThemesNames; - - static const QStringList gtk3SubdirPattern(QStringLiteral("gtk-3.*")); - for (const QString &possibleThemePath : possibleThemesPaths) { - // If the directory contains any of gtk-3.X folders, it is the GTK3 theme for sure - QDir possibleThemeDirectory(possibleThemePath); - if (!possibleThemeDirectory.entryList(gtk3SubdirPattern, QDir::Dirs).isEmpty()) { - gtk3ThemesNames.insert(possibleThemeDirectory.dirName(), possibleThemeDirectory.path()); - } - } - - gtk3ThemesModel.setThemesList(gtk3ThemesNames); -} - -QStringList GTKConfigKCModule::possiblePathsToGtkThemes() { - QStringList possibleThemesPaths; - - QStringList themesLocationsPaths = QStandardPaths::locateAll( - QStandardPaths::GenericDataLocation, - QStringLiteral("themes"), - QStandardPaths::LocateDirectory); - themesLocationsPaths << QDir::homePath() + QStringLiteral("/.themes"); - - for (const QString& themesLocationPath : themesLocationsPaths) { - QStringList possibleThemesDirectoriesNames = QDir(themesLocationPath).entryList(QDir::NoDotAndDotDot | QDir::AllDirs); - for (const QString &possibleThemeDirectoryName : possibleThemesDirectoriesNames) { - possibleThemesPaths += themesLocationPath + '/' + possibleThemeDirectoryName; - } - } - - return possibleThemesPaths; -} - -void GTKConfigKCModule::selectCurrentGtk2ThemeInCheckbox() -{ - QDBusReply dbusReply = gtkConfigInterface.call(QStringLiteral("gtk2Theme")); - currentGtk2Theme = dbusReply.value(); - ui->cb_theme->setCurrentText(currentGtk2Theme); -} - -void GTKConfigKCModule::selectCurrentGtk3ThemeInCheckbox() -{ - QDBusReply dbusReply = gtkConfigInterface.call(QStringLiteral("gtk3Theme")); - currentGtk3Theme = dbusReply.value(); - ui->cb_theme_gtk3->setCurrentText(currentGtk3Theme); -} - -void GTKConfigKCModule::updateDeletionPossibilityForSelectedGtk2Theme() -{ - const QModelIndex index = gtk2ThemesModel.index(ui->cb_theme->currentIndex(), 1); - const QString themePath = gtk2ThemesModel.data(index).value(); - if (themePath.contains(QDir::homePath())) { - ui->removeGtk2Theme->setDisabled(false); - } else { - ui->removeGtk2Theme->setDisabled(true); - } -} - -void GTKConfigKCModule::updateDeletionPossibilityForSelectedGtk3Theme() -{ - const QModelIndex index = gtk3ThemesModel.index(ui->cb_theme_gtk3->currentIndex(), 1); - const QString themePath = gtk3ThemesModel.data(index).value(); - if (themePath.contains(QDir::homePath())) { - ui->removeGtk3Theme->setDisabled(false); - } else { - ui->removeGtk3Theme->setDisabled(true); - } -} - - -GtkThemesListModel::GtkThemesListModel(QObject* parent) -: QAbstractTableModel(parent), -themesList() -{ - -} - -QVariant GtkThemesListModel::data(const QModelIndex& index, int role) const -{ - if (role == Qt::DisplayRole) { - if (index.row() < 0 || index.row() > themesList.count()) { - return QVariant(); - } - - if (index.column() == 0) { - return themesList.keys().at(index.row()); - } else { - return themesList.values().at(index.row()); - } - } else { - return QVariant(); - } -} - -int GtkThemesListModel::rowCount(const QModelIndex& parent) const -{ - Q_UNUSED(parent) - return themesList.count(); -} - -int GtkThemesListModel::columnCount(const QModelIndex& parent) const -{ - Q_UNUSED(parent) - return 2; -} - -void GtkThemesListModel::setThemesList(const QMap& themes) -{ - beginResetModel(); - themesList = themes; - endResetModel(); -} - -bool GtkThemesListModel::containsTheme(const QString &themeName) -{ - return themesList.contains(themeName); -} - -#include "gtkconfigkcmodule.moc" diff --git a/src/gtkconfigkcmodule.h b/src/gtkconfigkcmodule.h deleted file mode 100644 index 2481d9f..0000000 --- a/src/gtkconfigkcmodule.h +++ /dev/null @@ -1,99 +0,0 @@ -/* KDE GTK Configuration Module - * - * Copyright 2011 José Antonio Sanchez Reynaga - * Copyright 2011 Aleix Pol Gonzalez - * - * 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) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * 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, see . - */ - -#ifndef GTKCONFIGKCMODULE_H -#define GTKCONFIGKCMODULE_H - -#include - -#include -#include -#include - -class GtkThemesListModel : public QAbstractTableModel { - Q_OBJECT -public: - GtkThemesListModel(QObject *parent = nullptr); - - void setThemesList(const QMap &themes); - bool containsTheme(const QString &themeName); - int rowCount(const QModelIndex &parent) const override; - int columnCount(const QModelIndex &parent) const override; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - -private: - QMap themesList; -}; - -class QStringList; -namespace Ui { class GUI; } - -class GTKConfigKCModule : public KCModule -{ - Q_OBJECT -public: - explicit GTKConfigKCModule(QWidget *parent = nullptr, const QVariantList &args = QVariantList()); - ~GTKConfigKCModule() override; - - void save() override; - void defaults() override; - void load() override; - -private Q_SLOTS: - void updateThemesListsWithoutLoosingSelection(); - - void installGtk2ThemeFromGHNS(); - void installGtk3ThemeFromGHNS(); - void installGtkThemeFromFile(); - void removeGtk2Theme(); - void removeGtk3Theme(); - - void showGtk2Preview(); - void showGtk3Preview(); - - void themesSelectionsChanged(); - -private: - void saveGtk2Theme(); - void saveGtk3Theme(); - - void loadGtkThemes(); - void loadGtk2Themes(const QStringList &possibleThemesPaths); - void loadGtk3Themes(const QStringList &possibleThemesPaths); - - static QStringList possiblePathsToGtkThemes(); - - void selectCurrentGtk2ThemeInCheckbox(); - void selectCurrentGtk3ThemeInCheckbox(); - - void updateDeletionPossibilityForSelectedGtk2Theme(); - void updateDeletionPossibilityForSelectedGtk3Theme(); - - QString currentGtk2Theme; - QString currentGtk3Theme; - GtkThemesListModel gtk2ThemesModel; - GtkThemesListModel gtk3ThemesModel; - QDBusInterface gtkConfigInterface; - Ui::GUI *ui; -}; - -#endif // GTKCONFIGKCMODULE_H diff --git a/src/ui/gui.ui b/src/ui/gui.ui deleted file mode 100644 index 50580f1..0000000 --- a/src/ui/gui.ui +++ /dev/null @@ -1,199 +0,0 @@ - - - GUI - - - - 0 - 0 - 900 - 600 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - GTK2 theme: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - QComboBox::AdjustToContents - - - - - - - - - - - .. - - - - - - - Preview... - - - - .. - - - false - - - - - - - - - GTK3 theme: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - QComboBox::AdjustToContents - - - - - - - - - - - .. - - - - - - - Preview... - - - - .. - - - false - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 0 - 0 - - - - - - - - - - Qt::Horizontal - - - - 0 - 0 - - - - - - - - Install from File... - - - - .. - - - - - - - <html><head/><body><p>Here you can install new GTK themes. Even more are available at <a href="http://gnome-look.org"><span style=" text-decoration: underline;">gnome-look.org</span></a></p></body></html> - - - Get New GNOME/GTK Application Styles... - - - - .. - - - - - - - - - -