Commit ae09827c authored by Marco Martin's avatar Marco Martin

remove menubar settings

Summary:
global menu automatically enables itself when there is a visualization present
drop the settings kcm altogether
Depends on D9215 and D9216

Test Plan: kcm loads and works correctly without the setting visible anymore

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9267
parent 311bfe73
......@@ -25,7 +25,7 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -41,7 +41,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Show icons in buttons:</string>
<string>Show icons in b&amp;uttons:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -60,7 +60,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Main toolbar text location:</string>
<string>Main &amp;toolbar text location:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -97,7 +97,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Secondary toolbar text location:</string>
<string>Secondary toolbar text &amp;location:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -147,60 +147,6 @@
</layout>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QGroupBox" name="menubarBox">
<property name="title">
<string>Menubar</string>
</property>
<layout class="QGridLayout" name="gridLayout1">
<item row="0" column="0">
<widget class="QLabel" name="labelMenubarStyle">
<property name="text">
<string>Menubar style:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>comboMenubarStyle</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="comboMenubarStyle">
<item>
<property name="text">
<string>In application</string>
</property>
</item>
<item>
<property name="text">
<string>Title bar button</string>
</property>
</item>
<item>
<property name="text">
<string>Global Menu widget</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
......@@ -214,9 +160,6 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="KMessageWidget" name="menuBarMessageWidget" native="true"/>
</item>
</layout>
</widget>
<customwidgets>
......@@ -225,11 +168,6 @@
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KMessageWidget</class>
<extends>QFrame</extends>
<header>kmessagewidget.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
......
......@@ -242,12 +242,9 @@ KCMStyle::KCMStyle( QWidget* parent, const QVariantList& )
connect(fineTuningUi.cbIconsInMenus, &QAbstractButton::toggled, this, &KCMStyle::setEffectsDirty);
connect(fineTuningUi.comboToolbarIcons, SIGNAL(activated(int)), this, SLOT(setEffectsDirty()));
connect(fineTuningUi.comboSecondaryToolbarIcons, SIGNAL(activated(int)), this, SLOT(setEffectsDirty()));
connect(fineTuningUi.comboMenubarStyle, SIGNAL(activated(int)), this, SLOT(setEffectsDirty()));
addWhatsThis();
fineTuningUi.menuBarMessageWidget->hide();
// Insert the pages into the tabWidget
tabWidget->addTab(page1, i18nc("@title:tab", "&Applications"));
tabWidget->addTab(page2, i18nc("@title:tab", "&Fine Tuning"));
......@@ -377,50 +374,6 @@ void KCMStyle::save()
toolbarStyleGroup.writeEntry("ToolButtonStyleOtherToolbars",
toolbarButtonText(fineTuningUi.comboSecondaryToolbarIcons->currentIndex()));
// menubar page
KConfigGroup menuBarStyleGroup(&_config, "Appmenu Style");
QString style = menuBarStyleText(fineTuningUi.comboMenubarStyle->currentIndex());
QString previous = menuBarStyleGroup.readEntry("Style", "InApplication");
menuBarStyleGroup.writeEntry("Style", style);
_config.sync();
// The old KCM used to mess with autoloading depending on whether menu was enabled or not
// since it was always disabled, the kded module would never autoload breaking global menu
// for users without an obvious reason why it won't work.
QDBusMessage method = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kded5"),
QStringLiteral("/kded"),
QStringLiteral("org.kde.kded5"),
QStringLiteral("setModuleAutoloading"));
method.setArguments({QStringLiteral("appmenu"), true});
QDBusConnection::sessionBus().asyncCall(method);
method = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kded5"),
QStringLiteral("/kded"),
QStringLiteral("org.kde.kded5"),
QStringLiteral("loadModule"));
method.setArguments({QStringLiteral("appmenu")});
QDBusConnection::sessionBus().asyncCall(method);
// since we load the module async, this call will fail if the module wasn't loaded
// but since it will init itself when it loads, this isn't too bad
QDBusConnection::sessionBus().asyncCall(
QDBusMessage::createMethodCall(QStringLiteral("org.kde.kappmenu"),
QStringLiteral("/KAppMenu"),
QStringLiteral("org.kde.kappmenu"),
QStringLiteral("reconfigure")
)
);
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();
}
// Export the changes we made to qtrc, and update all qt-only
// applications on the fly, ensuring that we still follow the user's
// export fonts/colors settings.
......@@ -508,7 +461,6 @@ void KCMStyle::defaults()
// Effects
fineTuningUi.comboToolbarIcons->setCurrentIndex(toolbarButtonIndex(QStringLiteral("TextBesideIcon")));
fineTuningUi.comboSecondaryToolbarIcons->setCurrentIndex(toolbarButtonIndex(QStringLiteral("TextBesideIcon")));
fineTuningUi.comboMenubarStyle->setCurrentIndex(menuBarStyleIndex(QStringLiteral("InApplication")));
fineTuningUi.cbIconsOnButtons->setChecked(true);
fineTuningUi.cbIconsInMenus->setChecked(true);
emit changed(true);
......@@ -762,10 +714,6 @@ void KCMStyle::loadEffects( KConfig& config )
tbIcon = configGroup.readEntry("ToolButtonStyleOtherToolbars", "TextBesideIcon");
fineTuningUi.comboSecondaryToolbarIcons->setCurrentIndex(toolbarButtonIndex(tbIcon));
configGroup = config.group("Appmenu Style");
QString menuBarStyle = configGroup.readEntry("Style", "InApplication");
fineTuningUi.comboMenubarStyle->setCurrentIndex(menuBarStyleIndex(menuBarStyle));
configGroup = config.group("KDE");
fineTuningUi.cbIconsOnButtons->setChecked(configGroup.readEntry("ShowIconsOnPushButtons", true));
fineTuningUi.cbIconsInMenus->setChecked(configGroup.readEntry("ShowIconsInMenuItems", true));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment