summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2017-01-11 12:07:30 +0100
committerKai Uwe Broulik <[email protected]>2017-01-11 12:08:15 +0100
commit856e2edb030f58e9afdd649a6d80a5832a676b8d (patch)
tree9a418f79842596296aae84db886a26b849cbab6c
parent3db456588d0df6c7fe8d227608bde4dcd4255f23 (diff)
Restore Menubar style config in application style
This restores the configuration for whether menus should be shown in the application (no global menu), as title bar button, or as "widget". The notification popup is removed and replaced by a simple KMessageWidget. The option "Application Menu widget" doesn't actually do anything, it just enables global menu but not visible to the user. Perhaps it should show a hint, like "Place the Application Menu widget in a panel" or something like that. Differential Revision: https://phabricator.kde.org/D3216
-rw-r--r--kcms/style/CMakeLists.txt1
-rw-r--r--kcms/style/finetuning.ui69
-rw-r--r--kcms/style/kcmstyle.cpp71
-rw-r--r--kcms/style/kcmstyle.notifyrc194
4 files changed, 54 insertions, 281 deletions
diff --git a/kcms/style/CMakeLists.txt b/kcms/style/CMakeLists.txt
index afd603b..d1922bf 100644
--- a/kcms/style/CMakeLists.txt
+++ b/kcms/style/CMakeLists.txt
@@ -30,5 +30,4 @@ install(TARGETS kcm_style DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
-install( FILES kcmstyle.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR} )
install( FILES style.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
diff --git a/kcms/style/finetuning.ui b/kcms/style/finetuning.ui
index b409d6b..9da7716 100644
--- a/kcms/style/finetuning.ui
+++ b/kcms/style/finetuning.ui
@@ -11,19 +11,6 @@
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Show icons on buttons:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>cbIconsOnButtons</cstring>
- </property>
- </widget>
- </item>
<item row="0" column="1">
<widget class="QCheckBox" name="cbIconsOnButtons">
<property name="text">
@@ -31,20 +18,14 @@
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_5">
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="cbIconsInMenus">
<property name="text">
- <string>Show icons in menus:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>cbIconsInMenus</cstring>
+ <string/>
</property>
</widget>
</item>
- <item row="4" column="0">
+ <item row="5" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -57,10 +38,16 @@
</property>
</spacer>
</item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="cbIconsInMenus">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_3">
<property name="text">
- <string/>
+ <string>Show icons on buttons:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>cbIconsOnButtons</cstring>
</property>
</widget>
</item>
@@ -160,7 +147,7 @@
</layout>
</widget>
</item>
- <item row="3" column="0" colspan="3">
+ <item row="4" column="0" colspan="3">
<widget class="QGroupBox" name="menubarBox">
<property name="title">
<string>Menubar</string>
@@ -193,12 +180,7 @@
</item>
<item>
<property name="text">
- <string>Top screen menubar</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Only export</string>
+ <string>Application Menu widget</string>
</property>
</item>
</widget>
@@ -219,6 +201,22 @@
</layout>
</widget>
</item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Show icons in menus:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>cbIconsInMenus</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="KMessageWidget" name="menuBarMessageWidget" native="true"/>
+ </item>
</layout>
</widget>
<customwidgets>
@@ -227,6 +225,11 @@
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
+ <customwidget>
+ <class>KMessageWidget</class>
+ <extends>QFrame</extends>
+ <header>kmessagewidget.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections/>
diff --git a/kcms/style/kcmstyle.cpp b/kcms/style/kcmstyle.cpp
index 8664309..b0b4cc1 100644
--- a/kcms/style/kcmstyle.cpp
+++ b/kcms/style/kcmstyle.cpp
@@ -41,14 +41,12 @@
#include <kstandarddirs.h>
#include <kautostart.h>
#include <KDebug>
-#include <KNotification>
#include <KLibrary>
#include <KColorScheme>
#include <KStandardDirs>
#include <KNewStuff3/KNS3/DownloadDialog>
#include <KConfigGroup>
-
#include <QFile>
#include <QSettings>
#include <QAbstractItemView>
@@ -248,9 +246,7 @@ KCMStyle::KCMStyle( QWidget* parent, const QVariantList& )
addWhatsThis();
- if (!QFile::exists(QLibraryInfo::location(QLibraryInfo::PluginsPath) + "/menubar/libappmenu-qt.so")) {
- fineTuningUi.menubarBox->hide();
- }
+ fineTuningUi.menuBarMessageWidget->hide();
// Insert the pages into the tabWidget
tabWidget->addTab(page1, i18nc("@title:tab", "&Applications"));
@@ -391,54 +387,27 @@ void KCMStyle::save()
// menubar page
KConfigGroup menuBarStyleGroup(&_config, "Appmenu Style");
- // load kded module if needed
- bool load = false;
- QList<QVariant> args;
-
QString style = menuBarStyleText(fineTuningUi.comboMenubarStyle->currentIndex());
QString previous = menuBarStyleGroup.readEntry("Style", "InApplication");
menuBarStyleGroup.writeEntry("Style", style);
_config.sync();
- QDBusMessage method = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kappmenu"),
- QStringLiteral("/KAppMenu"),
- QStringLiteral("org.kde.kappmenu"),
- QStringLiteral("reconfigure"));
- QDBusConnection::sessionBus().asyncCall(method);
-
- if (previous == QLatin1String("InApplication") && style != QLatin1String("InApplication")) {
- load = true;
- KNotification *notification = new KNotification(QStringLiteral("reload"), 0);
- notification->setComponentName(QStringLiteral("kcmstyle"));
- notification->setText(i18n("Settings changes will take effect only on application restart"));
- notification->sendEvent();
- }
+ QDBusConnection::sessionBus().asyncCall(
+ QDBusMessage::createMethodCall(QStringLiteral("org.kde.kappmenu"),
+ QStringLiteral("/KAppMenu"),
+ QStringLiteral("org.kde.kappmenu"),
+ QStringLiteral("reconfigure")
+ )
+ );
- args = QList<QVariant>() << "appmenu" << (style != QLatin1String("InApplication"));
- method = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kded5"),
- QStringLiteral("/kded"),
- QStringLiteral("org.kde.kded5"),
- QStringLiteral("setModuleAutoloading"));
- method.setArguments(args);
- QDBusConnection::sessionBus().asyncCall(method);
-
- args = QList<QVariant>() << "appmenu";
- if (load) {
- method = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kded5"),
- QStringLiteral("/kded"),
- QStringLiteral("org.kde.kded5"),
- QStringLiteral("loadModule"));
- QDBusMessage method = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kappmenu"), QStringLiteral("/KAppMenu"), QStringLiteral("org.kde.kappmenu"), QStringLiteral("reconfigure"));
- QDBusConnection::sessionBus().asyncCall(method);
- } else if (style == QLatin1String("InApplication")) {
- method = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kded5"),
- QStringLiteral("/kded"),
- QStringLiteral("org.kde.kded5"),
- QStringLiteral("unloadModule"));
+ const bool showMenuInApplication = (style == QLatin1String("InApplication"));
+
+ if (previous == QLatin1String("InApplication") && !showMenuInApplication) {
+ fineTuningUi.menuBarMessageWidget->setMessageType(KMessageWidget::Information);
+ fineTuningUi.menuBarMessageWidget->setText(i18n("Your changes will take effect only on application restart."));
+ fineTuningUi.menuBarMessageWidget->animatedShow();
}
- method.setArguments(args);
- QDBusConnection::sessionBus().asyncCall(method);
// Export the changes we made to qtrc, and update all qt-only
// applications on the fly, ensuring that we still follow the user's
@@ -752,11 +721,9 @@ QString KCMStyle::menuBarStyleText(int index)
{
switch (index) {
case 1:
- return QStringLiteral("ButtonVertical");
+ return QStringLiteral("Decoration");
case 2:
- return QStringLiteral("TopMenuBar");
- case 3:
- return QStringLiteral("Others");
+ return QStringLiteral("Widget");
}
return QStringLiteral("InApplication");
@@ -764,12 +731,10 @@ QString KCMStyle::menuBarStyleText(int index)
int KCMStyle::menuBarStyleIndex(const QString &text)
{
- if (text == QLatin1String("ButtonVertical")) {
+ if (text == QLatin1String("Decoration")) {
return 1;
- } else if (text == QLatin1String("TopMenuBar")) {
+ } else if (text == QLatin1String("Widget")) {
return 2;
- } else if (text == QLatin1String("Others")) {
- return 3;
}
return 0;
diff --git a/kcms/style/kcmstyle.notifyrc b/kcms/style/kcmstyle.notifyrc
deleted file mode 100644
index 3da67b7..0000000
--- a/kcms/style/kcmstyle.notifyrc
+++ /dev/null
@@ -1,194 +0,0 @@
-[Global]
-IconName=show-menu
-Name=Menubar manager
-Name[ar]=مدير شريط القوائم
-Name[bs]=Menadžer menija
-Name[ca]=Gestor de barra de menús
-Name[[email protected]]=Gestor de barra de menús
-Name[cs]=Správce hlavní nabídky
-Name[da]=Håndtering af menulinje
-Name[de]=Menüleistenverwaltung
-Name[el]=Διαχειριστής γραμμής μενού
-Name[en_GB]=Menubar manager
-Name[es]=Gestor de la barra de menú
-Name[et]=Menüüriba haldur
-Name[eu]=Menu-barra kudeatzailea
-Name[fi]=Valikkorivin hallinta
-Name[fr]=Gestionnaire de barre de menus
-Name[gl]=Xestor da barra de menú
-Name[he]=מנהל תפריטים
-Name[hu]=Menüsor kezelő
-Name[ia]=Gerente de barra de menu
-Name[id]=Manajer batang menu
-Name[it]=Gestione della barra dei menu
-Name[ja]=メニューバーマネージャー
-Name[kk]=Мәзір панелінің менеджері
-Name[ko]=메뉴 표시줄 관리자
-Name[lt]=Meniu juostos tvarkyklė
-Name[mr]=मेन्यू पट्टी व्यवस्थापक
-Name[nb]=Menylinjebehandler
-Name[nds]=Menübalkenpleger
-Name[nl]=Beheerder van menubalk
-Name[nn]=Menylinjeoppsett
-Name[pa]=ਮੇਨੂਬਾਰ ਮੈਨੇਜਰ
-Name[pl]=Zarządzanie paskiem menu
-Name[pt]=Gestor do menu
-Name[pt_BR]=Gerenciador da barra de menus
-Name[ro]=Administrator al barei de meniu
-Name[ru]=Диспетчер панели меню
-Name[sk]=Správca panelu ponuky
-Name[sl]=Upravljalnik menijske vrstice
-Name[sr]=Менаџер трака менија
-Name[[email protected]]=Менаџер трака менија
-Name[[email protected]]=Menadžer traka menija
-Name[[email protected]]=Menadžer traka menija
-Name[sv]=Menyradshanterare
-Name[tr]=Menü çubuğu yöneticisi
-Name[uk]=Керування смужкою меню
-Name[x-test]=xxMenubar managerxx
-Name[zh_CN]=Menubar manager,菜单栏管理器
-Name[zh_TW]=選單列管理程式
-Comment=Menubar exporter
-Comment[ar]=مصدّر شريط القوائم
-Comment[bs]=Izvoz menija
-Comment[ca]=Exportador de barra de menús
-Comment[[email protected]]=Exportador de barra de menús
-Comment[cs]=Export hlavní nabídky
-Comment[da]=Menulinje-eksportør
-Comment[de]=Menüleisten-Export
-Comment[el]=Εξαγωγέας γραμμής μενού
-Comment[en_GB]=Menubar exporter
-Comment[es]=Exportador de la barra de menú
-Comment[et]=Menüüriba eksportimine
-Comment[eu]=Menu-barra esportatzailea
-Comment[fi]=Valikkorivin vienti
-Comment[fr]=Exportateur de barre de menus
-Comment[gl]=Exportador da barra de menú
-Comment[he]=מייצא של תפריטים
-Comment[hu]=Menüsor exportáló
-Comment[ia]=Exportator de barra de menu
-Comment[id]=Pengekspor batang menu
-Comment[it]=Esportatore della barra dei menu
-Comment[kk]=Мәзір панелін экспорттағышы
-Comment[ko]=메뉴 표시줄 내보내기
-Comment[lt]=Meniu juostos eksportavimo programa
-Comment[mr]=मेन्यू पट्टी निर्यात करणारा
-Comment[nb]=Menylinje-eksporterer
-Comment[nds]=Menübalken-Export
-Comment[nl]=Exportprogramma van menubalk
-Comment[nn]=Menylinjeeksportering
-Comment[pl]=Eksporter paska menu
-Comment[pt]=Exportador do menu
-Comment[pt_BR]=Exportador da barra de menus
-Comment[ro]=Exportator al barei de meniu
-Comment[ru]=Экспортёр панели меню
-Comment[sk]=Exportovač panelu ponuky
-Comment[sl]=Izvoznik menijske vrstice
-Comment[sr]=Извозник трака менија
-Comment[[email protected]]=Извозник трака менија
-Comment[[email protected]]=Izvoznik traka menija
-Comment[[email protected]]=Izvoznik traka menija
-Comment[sv]=Menyradsexport
-Comment[tr]=Menü çubuğu aktarıcı
-Comment[uk]=Експортування смужки меню
-Comment[x-test]=xxMenubar exporterxx
-Comment[zh_CN]=菜单栏导出器
-Comment[zh_TW]=選單列匯出器
-
-[Event/reload]
-Name=Menubar changed
-Name[ar]=تغيّر شريط القوائم
-Name[bs]=Meni promijenjen
-Name[ca]=La barra de menús ha canviat
-Name[[email protected]]=La barra de menús ha canviat
-Name[cs]=Hlavní nabídka změněna
-Name[da]=Menulinje ændret
-Name[de]=Menüleiste geändert
-Name[el]=Η γραμμή μενού άλλαξε
-Name[en_GB]=Menubar changed
-Name[es]=La barra de menú ha cambiado
-Name[et]=Menüüriba on muudetud
-Name[eu]=Menu-barra aldatu da
-Name[fi]=Valikkorivi muuttui
-Name[fr]=Barre de menus modifiée
-Name[gl]=Cambiouse a barra de menú
-Name[he]=תפריט שונה
-Name[hu]=A menüsor megváltozott
-Name[ia]=Barra de menu cambiava
-Name[id]=Batang menu berubah
-Name[it]=Barra dei menu cambiata
-Name[kk]=Мәзір панелі өзгертілді
-Name[ko]=메뉴 표시줄 변경됨
-Name[lt]=Meniu juosta pakeista
-Name[mr]=मेन्यू पट्टी बदलली आहे
-Name[nb]=Menylinje er endret
-Name[nds]=Menübalken ännert
-Name[nl]=Menubalk is gewijzigd
-Name[nn]=Menylinje er endra
-Name[pa]=ਮੇਨੂਬਾਰ ਬਦਲੀ
-Name[pl]=Pasek menu uległ zmianie
-Name[pt]=O menu foi alterado
-Name[pt_BR]=Barra de menus alterada
-Name[ro]=Bara de meniu s-a schimbat
-Name[ru]=Панель меню изменена
-Name[sk]=Panel ponuky zmenený
-Name[sl]=Menijska vrstica spremenjena
-Name[sr]=Трака менија измењена
-Name[[email protected]]=Трака менија измењена
-Name[[email protected]]=Traka menija izmenjena
-Name[[email protected]]=Traka menija izmenjena
-Name[sv]=Menyrad ändrad
-Name[tr]=Menü çubuğu değiştirildi
-Name[uk]=До смужки меню внесено зміни
-Name[x-test]=xxMenubar changedxx
-Name[zh_CN]=菜单栏设置更改
-Name[zh_TW]=選單列已變更
-Comment=Settings changes will take effect only on application restart
-Comment[ar]=ستتفعّل التّعديلات عند إعادة تشغيل التّطبيق
-Comment[bs]=Postavke će imati efekta samo pri ponovnom startu programa
-Comment[ca]=Els canvis d'arranjament només tindran efecte en reiniciar l'aplicació
-Comment[[email protected]]=Els canvis d'arranjament només tindran efecte en reiniciar l'aplicació
-Comment[cs]=Změny se projeví až po opětovném spuštění aplikace
-Comment[da]=Ændring af indstillinger vil først få virkning efter programmet genstartes
-Comment[de]=Änderungen der Einstellungen werden erst nach dem Neustart der Anwendung wirksam
-Comment[el]=Οι αλλαγές των ρυθμίσεων θα ενεργοποιηθούν μόνο με την επανεκκίνηση της εφαρμογής
-Comment[en_GB]=Settings changes will take effect only on application restart
-Comment[es]=Los cambios en las preferencias solo tendrán efecto cuando se reinicie la aplicación
-Comment[et]=Muudetud seadistused rakenduvad alles rakenduse taaskäivitamise järel
-Comment[eu]=Ezarpen aldaketak gauzatuko dira soilik aplikazioa berrabiarazi ondoren
-Comment[fi]=Asetusten muutokset tulevat voimaan vasta, kun sovellus käynnistetään uudelleen.
-Comment[fr]=Les modifications de paramètres ne prendront effet qu'après le redémarrage de l'application
-Comment[gl]=Os cambios na configuración só se han aplicar ao reiniciar o programa
-Comment[he]=השינויים יחולו רק בהפעלה מחודשת של יישומים
-Comment[hu]=A beállítások változásai csak az alkalmazás újraindításakor lépnek életbe
-Comment[ia]=Modificationes de preferentias habera effectos solmente quando on reinitia le application
-Comment[id]=Perubahan pengaturan akan berlangsung setelah aplikasi dijalankan ulang
-Comment[it]=Le modifiche alla configurazione avranno effetto solo al riavvio delle applicazioni
-Comment[ja]=設定の変更は再起動したアプリケーションにのみ適用されます
-Comment[kk]=Параметр өзгерістері бағдарлама жүмысын жаңадан бастағанда іске асады
-Comment[ko]=프로그램을 다시 시작하면 설정이 적용됩니다
-Comment[lt]=Nuostatų pakeitimai pradės galioti tik iš naujo paleidus programą
-Comment[mr]=संयोजनेतील बदल अनुप्रयोग पुन्हा सुरु केल्यावरच कार्यान्वित होतील
-Comment[nb]=Innstillinger som er endret får bare virkning når programmet startes på nytt
-Comment[nds]=Ännern warrt eerst bi den nakamen Start vun't Programm övernahmen
-Comment[nl]=Wijzigingen in instellingen zullen alleen effectief zijn na het herstarten van de toepassing
-Comment[nn]=Endringar i innstillingane vil berre trå i kraft etter omstart av program
-Comment[pa]=ਸੈਟਿੰਗ ਕੇਵਲ ਐਪਲੀਕੇਸ਼ਨ ਮੁੜ-ਚਾਲੂ ਕਰਨ ਦੇ ਬਾਅਦ ਹੀ ਲਾਗੂ ਹੋਣਗੀਆਂ
-Comment[pl]=Zmiany będą widoczne dopiero po ponownym uruchomieniu programu
-Comment[pt]=As mudanças de configuração farão efeito ao reiniciar a aplicação
-Comment[pt_BR]=As alterações na configuração somente terão efeito ao reiniciar o aplicativo
-Comment[ro]=Modificările opțiunilor vor intra în vigoare după repornirea aplicației
-Comment[ru]=Изменения параметров вступят в силу только после перезапуска приложения
-Comment[sk]=Zmeny nastavení sa prejavia iba pri reštarte aplikácie
-Comment[sl]=Spremembe nastavitev bodo stopile v veljavo po ponovnem zagonu programa
-Comment[sr]=Промене поставки ступиће на снагу по наредном покретању програма
-Comment[[email protected]]=Промене поставки ступиће на снагу по наредном покретању програма
-Comment[[email protected]]=Promene postavki stupiće na snagu po narednom pokretanju programa
-Comment[[email protected]]=Promene postavki stupiće na snagu po narednom pokretanju programa
-Comment[sv]=Ändringar av inställningar får inte någon effekt förrän programmet startas om
-Comment[tr]=Ayar değişiklikleri sadece uygulama yeniden başlatıldıktan sonra uygulanacaktır
-Comment[uk]=Зміни у параметрах набудуть чинності лише після перезапуску програми
-Comment[x-test]=xxSettings changes will take effect only on application restartxx
-Comment[zh_CN]=只有重启程序后一些设置才能生效
-Comment[zh_TW]=設定變更會在下次應用程式啟動時生效
-Action=Popup