diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp index 842c4ef8b..35a8f9354 100644 --- a/src/EditProfileDialog.cpp +++ b/src/EditProfileDialog.cpp @@ -278,9 +278,12 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr profile) _ui->iconSelectButton->setIcon(KIcon(profile->icon())); _ui->startInSameDirButton->setChecked(profile->startInCurrentSessionDir()); + // terminal options + _ui->terminalColumnsEntry->setValue(profile->terminalColumns()); + _ui->terminalRowsEntry->setValue(profile->terminalRows()); + // window options _ui->showTerminalSizeHintButton->setChecked(profile->showTerminalSizeHint()); - _ui->saveGeometryOnExitButton->setChecked(profile->saveGeometryOnExit()); // signals and slots connect(_ui->dirSelectButton, SIGNAL(clicked()), this, SLOT(selectInitialDir())); @@ -296,8 +299,11 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr profile) connect(_ui->environmentEditButton , SIGNAL(clicked()), this, SLOT(showEnvironmentEditor())); - connect(_ui->saveGeometryOnExitButton, SIGNAL(toggled(bool)), this, - SLOT(saveGeometryOnExit(bool))); + connect(_ui->terminalColumnsEntry, SIGNAL(valueChanged(int)), + this, SLOT(terminalColumnsEntryChanged(int))); + connect(_ui->terminalRowsEntry, SIGNAL(valueChanged(int)), + this, SLOT(terminalRowsEntryChanged(int))); + connect(_ui->showTerminalSizeHintButton, SIGNAL(toggled(bool)), this, SLOT(showTerminalSizeHint(bool))); } @@ -343,9 +349,13 @@ void EditProfileDialog::setupTabsPage(const Profile::Ptr profile) this, SLOT(silenceSecondsChanged(int))); } -void EditProfileDialog::saveGeometryOnExit(bool value) +void EditProfileDialog::terminalColumnsEntryChanged(int value) { - updateTempProfileProperty(Profile::SaveGeometryOnExit, value); + updateTempProfileProperty(Profile::TerminalColumns, value); +} +void EditProfileDialog::terminalRowsEntryChanged(int value) +{ + updateTempProfileProperty(Profile::TerminalRows, value); } void EditProfileDialog::showTerminalSizeHint(bool value) { diff --git a/src/EditProfileDialog.h b/src/EditProfileDialog.h index 97adb93b7..a72c01ed6 100644 --- a/src/EditProfileDialog.h +++ b/src/EditProfileDialog.h @@ -114,8 +114,9 @@ private slots: void tabTitleFormatChanged(const QString& text); void remoteTabTitleFormatChanged(const QString& text); + void terminalColumnsEntryChanged(int); + void terminalRowsEntryChanged(int); void showTerminalSizeHint(bool); - void saveGeometryOnExit(bool); void showEnvironmentEditor(); void silenceSecondsChanged(int); diff --git a/src/EditProfileDialog.ui b/src/EditProfileDialog.ui index 616e345c0..1ca993ec3 100644 --- a/src/EditProfileDialog.ui +++ b/src/EditProfileDialog.ui @@ -32,8 +32,8 @@ General - - + + General @@ -199,7 +199,112 @@ - + + + + Terminal Size + + + true + + + + + + Columns + + + + + + + 1 + + + 500 + + + + + + + Rows + + + + + + + 1 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + This will not alter any open windows. + + + + + + + Qt::Horizontal + + + + 81 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + Configure Konsole->General->Use current window size on next startup must be disabled for these entries to work. + + + true + + + + + + + Window @@ -208,22 +313,6 @@ true - - - - - 0 - 0 - - - - Set the window size and position for this profile when exiting - - - Save window size and position on exit - - - @@ -237,7 +326,7 @@ - + Qt::Vertical @@ -438,7 +527,7 @@ - FONT PREVIEW TEXT + KSqueezedTextLabel Qt::ElideRight @@ -460,17 +549,17 @@ - - + + 4.000000000000000 - + 999.000000000000000 - + 1.000000000000000 - + 1 @@ -607,7 +696,7 @@ true - + diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 3dd5a6463..cf434ad7d 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -80,6 +80,23 @@ MainWindow::MainWindow() , _menuBarInitialVisibility(true) , _menuBarInitialVisibilityApplied(false) { + if (!KonsoleSettings::saveGeometryOnExit()) { + // If we are not using the global Konsole save geometry on exit, + // remove all Height and Width from [MainWindow] from konsolerc + // Each screen resolution will have entries (Width 1280=619) + KSharedConfigPtr konsoleConfig = KSharedConfig::openConfig("konsolerc"); + KConfigGroup group = konsoleConfig->group("MainWindow"); + QMap configEntries = group.entryMap(); + QMapIterator i(configEntries); + while (i.hasNext()) { + i.next(); + if (i.key().startsWith(QLatin1String("Width")) + || i.key().startsWith(QLatin1String("Height"))) { + group.deleteEntry(i.key()); + } + } + } + if (useTransparency()) { // It is useful to have translucent terminal area setAttribute(Qt::WA_TranslucentBackground, true); @@ -100,8 +117,6 @@ MainWindow::MainWindow() connect(_viewManager, SIGNAL(viewPropertiesChanged(QList)), bookmarkHandler(), SLOT(setViews(QList))); - connect(_viewManager, SIGNAL(setSaveGeometryOnExitRequest(bool)), this, - SLOT(setSaveGeometryOnExit(bool))); connect(_viewManager, SIGNAL(updateWindowIcon()), this, SLOT(updateWindowIcon())); connect(_viewManager, SIGNAL(newViewRequest(Profile::Ptr)), @@ -172,12 +187,6 @@ void MainWindow::restoreMenuAccelerators() } } -void MainWindow::setSaveGeometryOnExit(bool save) -{ - // enable save and restore of window size - setAutoSaveSettings("MainWindow", save); -} - void MainWindow::correctStandardShortcuts() { // replace F1 shortcut for help contents @@ -710,7 +719,7 @@ void MainWindow::applyKonsoleSettings() setNavigationStyleSheet(KonsoleSettings::tabBarStyleSheet()); } - // setAutoSaveSettings("MainWindow", KonsoleSettings::saveGeometryOnExit()); + setAutoSaveSettings("MainWindow", KonsoleSettings::saveGeometryOnExit()); updateWindowCaption(); } diff --git a/src/MainWindow.h b/src/MainWindow.h index 133667114..1a84a1a40 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -160,8 +160,6 @@ private slots: void profileListChanged(const QList& actions); void configureNotifications(); - void setSaveGeometryOnExit(bool visible); - void updateWindowIcon(); void updateWindowCaption(); void openUrls(const QList& urls); diff --git a/src/Profile.cpp b/src/Profile.cpp index 4480ed6c9..ec0155d64 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -66,7 +66,6 @@ const Profile::PropertyInfo Profile::DefaultPropertyNames[] = { , { LocalTabTitleFormat , "tabtitle" , 0 , QVariant::String } , { RemoteTabTitleFormat , "RemoteTabTitleFormat" , GENERAL_GROUP , QVariant::String } , { ShowTerminalSizeHint , "ShowTerminalSizeHint" , GENERAL_GROUP , QVariant::Bool } - , { SaveGeometryOnExit , "SaveGeometryOnExit" , GENERAL_GROUP , QVariant::Bool } , { StartInCurrentSessionDir , "StartInCurrentSessionDir" , GENERAL_GROUP , QVariant::Bool } , { SilenceSeconds, "SilenceSeconds" , GENERAL_GROUP , QVariant::Int } , { TerminalColumns, "TerminalColumns" , GENERAL_GROUP , QVariant::Int } @@ -155,7 +154,6 @@ FallbackProfile::FallbackProfile() setProperty(LocalTabTitleFormat, "%d : %n"); setProperty(RemoteTabTitleFormat, "(%u) %H"); setProperty(ShowTerminalSizeHint, true); - setProperty(SaveGeometryOnExit, true); setProperty(StartInCurrentSessionDir, true); setProperty(MenuIndex, "0"); setProperty(SilenceSeconds, 10); diff --git a/src/Profile.h b/src/Profile.h index 596f78acc..97548bd1b 100644 --- a/src/Profile.h +++ b/src/Profile.h @@ -118,10 +118,6 @@ public: * resizing the application window. */ ShowTerminalSizeHint, - /** (bool) Specifies whether the geometry information is saved when - * window is closed. - */ - SaveGeometryOnExit, /** (QFont) The font to use in terminal displays using this profile. */ Font, /** (QString) The name of the color scheme to use in terminal @@ -385,11 +381,6 @@ public: return property(Profile::ShowTerminalSizeHint); } - /** Convenience method for property(Profile::SaveGeometryOnExit) */ - bool saveGeometryOnExit() const { - return property(Profile::SaveGeometryOnExit); - } - /** Convenience method for property(Profile::Font) */ QFont font() const { return property(Profile::Font); @@ -495,6 +486,16 @@ public: return property(Profile::SilenceSeconds); } + /** Convenience method for property(Profile::TerminalColumns) */ + int terminalColumns() const { + return property(Profile::TerminalColumns); + } + + /** Convenience method for property(Profile::TerminalRows) */ + int terminalRows() const { + return property(Profile::TerminalRows); + } + /** Convenience method for property(Profile::MenuIndex) */ QString menuIndex() const { return property(Profile::MenuIndex); diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp index a200cec88..16e4d97eb 100644 --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -790,8 +790,6 @@ void ViewManager::applyProfileToView(TerminalDisplay* view , const Profile::Ptr { Q_ASSERT(profile); - emit setSaveGeometryOnExitRequest(profile->saveGeometryOnExit()); - emit updateWindowIcon(); // load color scheme diff --git a/src/ViewManager.h b/src/ViewManager.h index 2a7f3483f..047b7ee6a 100644 --- a/src/ViewManager.h +++ b/src/ViewManager.h @@ -218,7 +218,6 @@ signals: * activated. */ void setMenuBarVisibleRequest(bool); - void setSaveGeometryOnExitRequest(bool); void updateWindowIcon(); /** Requests creation of a new view with the default profile. */ diff --git a/src/settings/GeneralSettings.cpp b/src/settings/GeneralSettings.cpp index 4a3786268..4fdb9aea2 100644 --- a/src/settings/GeneralSettings.cpp +++ b/src/settings/GeneralSettings.cpp @@ -28,7 +28,6 @@ GeneralSettings::GeneralSettings(QWidget* aParent) : QWidget(aParent) setupUi(this); this->kcfg_ShowTerminalSizeHint->setVisible(false); - this->kcfg_SaveGeometryOnExit->setVisible(false); } GeneralSettings::~GeneralSettings() diff --git a/src/settings/GeneralSettings.ui b/src/settings/GeneralSettings.ui index 20b7a29d8..879e56f6d 100644 --- a/src/settings/GeneralSettings.ui +++ b/src/settings/GeneralSettings.ui @@ -6,8 +6,8 @@ 0 0 - 383 - 156 + 528 + 197 @@ -62,8 +62,11 @@ 0 + + If enabled, profile settings will be ignored + - Save window size and position on exit + Use current window size on next startup diff --git a/src/settings/konsole.kcfg b/src/settings/konsole.kcfg index dbe5ef551..1ba0e2393 100644 --- a/src/settings/konsole.kcfg +++ b/src/settings/konsole.kcfg @@ -31,7 +31,7 @@ true - + The window size will be saved upon exiting Konsole true