Allow konsole to store terminal size in the profile.

This removes the profile setting to 'Save window size upon exit'.  Now
it is in the Konsole settings; each profile can now set desired column
and row size.

Konsole Settings->Configure Konsole->General->Use current window size
on next startup:
Enabled - ignores all profile size settings - uses previous window size
Disabled - profile size settings are used - set via Edit Current
 Profile 1st tab

Only new windows will use "new" col/row/size settings.

BUG: 152385
REVIEW: 115628
FIXED-IN: 2.13
(cherry picked from commit 931d64df81)
This commit is contained in:
Kurt Hindenburg
2014-02-15 10:49:18 -05:00
parent 12ff89a050
commit 522e4a57ba
12 changed files with 168 additions and 63 deletions

View File

@@ -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<QString, QString> configEntries = group.entryMap();
QMapIterator<QString, QString> 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<ViewProperties*>)),
bookmarkHandler(), SLOT(setViews(QList<ViewProperties*>)));
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();
}