Commit e3e960ab authored by Jekyll Wu's avatar Jekyll Wu

Move the 'show menubar' option from profiles into global settings

parent 3524588a
......@@ -274,7 +274,6 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr info)
_ui->startInSameDirButton->setChecked(info->property<bool>(Profile::StartInCurrentSessionDir));
// window options
_ui->showMenuBarButton->setChecked(info->property<bool>(Profile::ShowMenuBar));
_ui->showTerminalSizeHintButton->setChecked(info->property<bool>(Profile::ShowTerminalSizeHint));
_ui->saveGeometryOnExitButton->setChecked(info->property<bool>(Profile::SaveGeometryOnExit));
......@@ -292,8 +291,6 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr info)
connect(_ui->environmentEditButton , SIGNAL(clicked()), this,
SLOT(showEnvironmentEditor()));
connect(_ui->showMenuBarButton, SIGNAL(toggled(bool)), this,
SLOT(showMenuBar(bool)));
connect(_ui->saveGeometryOnExitButton, SIGNAL(toggled(bool)), this,
SLOT(saveGeometryOnExit(bool)));
connect(_ui->showTerminalSizeHintButton, SIGNAL(toggled(bool)), this,
......@@ -416,10 +413,6 @@ void EditProfileDialog::insertRemoteTabTitleText(const QString& text)
{
_ui->remoteTabTitleEdit->insert(text);
}
void EditProfileDialog::showMenuBar(bool show)
{
updateTempProfileProperty(Profile::ShowMenuBar, show);
}
void EditProfileDialog::saveGeometryOnExit(bool save)
{
updateTempProfileProperty(Profile::SaveGeometryOnExit, save);
......
......@@ -117,7 +117,6 @@ private slots:
void insertTabTitleText(const QString& text);
void insertRemoteTabTitleText(const QString& text);
void showMenuBar(bool);
void showTerminalSizeHint(bool);
void saveGeometryOnExit(bool);
void showEnvironmentEditor();
......
......@@ -208,22 +208,6 @@
<bool>true</bool>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QCheckBox" name="showMenuBarButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Show or hide the menu bar in terminal windows</string>
</property>
<property name="text">
<string>Show menu bar in new windows</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="saveGeometryOnExitButton">
<property name="sizePolicy">
......
......@@ -73,8 +73,6 @@ MainWindow::MainWindow()
: KXmlGuiWindow() ,
_bookmarkHandler(0),
_pluggedController(0),
_menuBarInitialVisibility(true),
_menuBarInitialVisibilitySet(false),
_menuBarInitialVisibilityApplied(false)
{
if (useTransparency()) {
......@@ -96,8 +94,6 @@ MainWindow::MainWindow()
connect(_viewManager , SIGNAL(viewPropertiesChanged(QList<ViewProperties*>)) ,
bookmarkHandler() , SLOT(setViews(QList<ViewProperties*>)));
connect(_viewManager , SIGNAL(setMenuBarVisibleRequest(bool)) , this ,
SLOT(setMenuBarInitialVisibility(bool)));
connect(_viewManager , SIGNAL(setSaveGeometryOnExitRequest(bool)) , this ,
SLOT(setSaveGeometryOnExit(bool)));
connect(_viewManager , SIGNAL(updateWindowIcon()) , this ,
......@@ -145,16 +141,6 @@ void MainWindow::removeMenuAccelerators()
menuItem->setText(itemText);
}
}
void MainWindow::setMenuBarInitialVisibility(bool visible)
{
// Make sure the 'initial' visibility is set only once.
if (_menuBarInitialVisibilitySet)
return;
// The initial visibility of menubar will not be applied until showEvent(),
_menuBarInitialVisibility = visible ;
_menuBarInitialVisibilitySet = true;
}
void MainWindow::setSaveGeometryOnExit(bool save)
{
......@@ -583,8 +569,8 @@ void MainWindow::showEvent(QShowEvent* event)
// visibility will be determined by what is stored in konsolerc, but not
// by the selected profile.
//
menuBar()->setVisible(_menuBarInitialVisibility);
_toggleMenuBarAction->setChecked(_menuBarInitialVisibility);
menuBar()->setVisible(AppSettings::showMenuBar());
_toggleMenuBarAction->setChecked(AppSettings::showMenuBar());
_menuBarInitialVisibilityApplied = true;
}
......
......@@ -173,10 +173,6 @@ private slots:
void viewFullScreen(bool fullScreen);
void configureNotifications();
// single shot call to set the initial visibility of the menu bar.
// Has no effect if the menu bar is a MacOS-style top-level menu
void setMenuBarInitialVisibility(bool visible);
void setSaveGeometryOnExit(bool visible);
void updateWindowIcon();
......@@ -206,8 +202,6 @@ private:
Profile::Ptr _defaultProfile;
bool _menuBarInitialVisibility;
bool _menuBarInitialVisibilitySet;
bool _menuBarInitialVisibilityApplied;
};
......
......@@ -74,7 +74,6 @@ const Profile::PropertyInfo Profile::DefaultPropertyNames[] = {
, { LocalTabTitleFormat , "LocalTabTitleFormat" , GENERAL_GROUP , QVariant::String }
, { LocalTabTitleFormat , "tabtitle" , 0 , QVariant::String }
, { RemoteTabTitleFormat , "RemoteTabTitleFormat" , GENERAL_GROUP , QVariant::String }
, { ShowMenuBar , "ShowMenuBar" , GENERAL_GROUP , QVariant::Bool }
, { ShowTerminalSizeHint , "ShowTerminalSizeHint" , GENERAL_GROUP , QVariant::Bool }
, { SaveGeometryOnExit , "SaveGeometryOnExit" , GENERAL_GROUP , QVariant::Bool }
, { TabBarMode , "TabBarMode" , GENERAL_GROUP , QVariant::Int }
......@@ -158,7 +157,6 @@ FallbackProfile::FallbackProfile()
setProperty(TabBarMode, AlwaysShowTabBar);
setProperty(TabBarPosition, TabBarBottom);
setProperty(NewTabBehavior, PutNewTabAtTheEnd);
setProperty(ShowMenuBar, true);
setProperty(ShowTerminalSizeHint, true);
setProperty(SaveGeometryOnExit, true);
setProperty(StartInCurrentSessionDir, true);
......
......@@ -107,8 +107,6 @@ public:
/** (QString) The format used for tab titles when the session is running
* a remote command (eg. SSH) */
RemoteTabTitleFormat,
/** (bool) Specifies whether the menu bar should be shown in the main application window. */
ShowMenuBar,
/** (bool) Specifies whether show hint for terminal size after resizing the application window. */
ShowTerminalSizeHint,
/** (bool) Specifies whether the geometry information is saved when window is closed. */
......
......@@ -790,9 +790,6 @@ void ViewManager::applyProfileToView(TerminalDisplay* view , const Profile::Ptr
{
Q_ASSERT(profile);
// menu bar visibility
emit setMenuBarVisibleRequest(profile->property<bool>(Profile::ShowMenuBar));
emit setSaveGeometryOnExitRequest(profile->property<bool>(Profile::SaveGeometryOnExit));
emit updateWindowIcon();
......
......@@ -40,7 +40,7 @@
</sizepolicy>
</property>
<property name="text">
<string>Show menu bar</string>
<string>Show menubar initially in Konsole window</string>
</property>
</widget>
</item>
......
......@@ -6,7 +6,8 @@
<kcfgfile name="konsolerc" />
<group name="Window">
<entry name="ShowMenuBar" type="Bool">
<label>Show menu bar</label>
<label>Show menubar initially in Konsole window</label>
<tooltip>Show menubar initially in each Konsole window</tooltip>
<default>true</default>
</entry>
<entry name="ShowTerminalSizeHint" type="Bool">
......
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