From d5f119e4308938947666c1e921862b83a5476020 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 7 Jan 2012 23:19:54 -0600 Subject: Restore Kate MRU list number-of-items configuration option This closes Bug 244 --- kate/app/kateconfigdialog.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'kate/app/kateconfigdialog.cpp') diff --git a/kate/app/kateconfigdialog.cpp b/kate/app/kateconfigdialog.cpp index 5e9ec2fb8..1433d95be 100644 --- a/kate/app/kateconfigdialog.cpp +++ b/kate/app/kateconfigdialog.cpp @@ -112,11 +112,32 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, Kate::View *view ) TQWhatsThis::add(cb_fullPath,i18n("If this option is checked, the full document path will be shown in the window caption.")); connect( cb_fullPath, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) ); + // sort filelist if desired + cb_sortFiles = new TQCheckBox(bgStartup); + cb_sortFiles->setText(i18n("Sort &files alphabetically in the file list")); + cb_sortFiles->setChecked(parent->filelist->sortType() == KateFileList::sortByName); + TQWhatsThis::add( cb_sortFiles, i18n( + "If this is checked, the files in the file list will be sorted alphabetically.") ); + connect( cb_sortFiles, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) ); // GROUP with the one below: "Behavior" bgStartup = new TQButtonGroup( 1, Qt::Horizontal, i18n("&Behavior"), frGeneral ); lo->addWidget( bgStartup ); + // number of recent files + TQHBox *hbNrf = new TQHBox( bgStartup ); + TQLabel *lNrf = new TQLabel( i18n("&Number of recent files:"), hbNrf ); + sb_numRecentFiles = new TQSpinBox( 0, 1000, 1, hbNrf ); + sb_numRecentFiles->setValue( mainWindow->fileOpenRecent->maxItems() ); + lNrf->setBuddy( sb_numRecentFiles ); + TQString numRecentFileHelpString ( i18n( + "Sets the number of recent files remembered by Kate.

NOTE: " + "If you set this lower than the current value, the list will be truncated and " + "some items forgotten.") ); + TQWhatsThis::add( lNrf, numRecentFileHelpString ); + TQWhatsThis::add( sb_numRecentFiles, numRecentFileHelpString ); + connect( sb_numRecentFiles, TQT_SIGNAL( valueChanged ( int ) ), this, TQT_SLOT( slotChanged() ) ); + // sync the konsole ? cb_syncKonsole = new TQCheckBox(bgStartup); cb_syncKonsole->setText(i18n("Sync &terminal emulator with active document")); @@ -388,6 +409,10 @@ void KateConfigDialog::slotApply() mainWindow->modNotification = cb_modNotifications->isChecked(); mainWindow->syncKonsole = cb_syncKonsole->isChecked(); + mainWindow->filelist->setSortType(cb_sortFiles->isChecked() ? KateFileList::sortByName : KateFileList::sortByID); + + config->writeEntry( "Number of recent files", sb_numRecentFiles->value() ); + mainWindow->fileOpenRecent->setMaxItems( sb_numRecentFiles->value() ); fileSelConfigPage->apply(); -- cgit v1.2.1