Simplify the scrollback setting dialog to avoid potential confusion.

- the change is not saved into profile and only influences current tab
  - remove the 'Save to current profile' checkbox
  - remove the 'Defaults' button
  - change dialog title from "Scrollback Options" to "Adjust Scrollback"
  - change action from "Scrollback Options..." to "Adjust Scrollback..."

The new dialog makes the "Adjust Scrollback..." action more consistent with most
of other actions in the context menu, since they only influence or work in the
context of current tab.

The UI change is not quite satisfactory. Feel free to refine the UI part
to make it more clear and elegant.

BUG: 227144
FIXED-IN : 4.8
REVIEW: 102688
This commit is contained in:
Jekyll Wu
2011-10-25 16:53:44 +08:00
parent 102371bb3a
commit 8f7be18a64
6 changed files with 19 additions and 98 deletions

View File

@@ -528,8 +528,9 @@ void SessionController::setupActions()
action = KStandardAction::saveAs(this, SLOT(saveHistory()), collection);
action->setText(i18n("Save Output &As..."));
action = collection->addAction("configure-history", this, SLOT(showHistoryOptions()));
action->setText(i18n("Configure Scrollback..."));
action = collection->addAction("adjust-history", this, SLOT(showHistoryOptions()));
action->setText(i18n("Adjust Scrollback..."));
// TODO: find a suitable icon which matches the action and not misleading
action->setIcon(KIcon("configure"));
action = collection->addAction("clear-history", this, SLOT(clearHistory()));
@@ -1027,8 +1028,8 @@ void SessionController::showHistoryOptions()
dialog->setMode( HistorySizeDialog::NoHistory );
}
connect( dialog , SIGNAL(optionsChanged(int,int,bool)) ,
this , SLOT(scrollBackOptionsChanged(int,int,bool)) );
connect( dialog , SIGNAL(optionsChanged(int,int)) ,
this , SLOT(scrollBackOptionsChanged(int,int)) );
dialog->show();
}
@@ -1037,7 +1038,7 @@ void SessionController::sessionResizeRequest(const QSize& size)
//kDebug() << "View resize requested to " << size;
_view->setSize(size.width(),size.height());
}
void SessionController::scrollBackOptionsChanged(int mode, int lines, bool saveToCurrentProfile )
void SessionController::scrollBackOptionsChanged(int mode, int lines)
{
switch (mode)
{
@@ -1051,25 +1052,6 @@ void SessionController::scrollBackOptionsChanged(int mode, int lines, bool saveT
_session->setHistoryType( HistoryTypeFile() );
break;
}
if (saveToCurrentProfile)
{
Profile::Ptr profile = SessionManager::instance()->sessionProfile(_session);
switch (mode)
{
case HistorySizeDialog::NoHistory:
profile->setProperty(Profile::HistoryMode , Profile::DisableHistory);
break;
case HistorySizeDialog::FixedSizeHistory:
profile->setProperty(Profile::HistoryMode , Profile::FixedSizeHistory);
profile->setProperty(Profile::HistorySize , lines);
break;
case HistorySizeDialog::UnlimitedHistory:
profile->setProperty(Profile::HistoryMode , Profile::UnlimitedHistory);
break;
}
SessionManager::instance()->changeProfile(profile, profile->setProperties());
}
}
void SessionController::saveHistory()