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