Restore Kate MRU list number-of-items configuration option

This closes Bug 244
pull/2/head
Timothy Pearson 12 years ago
parent f2ef0ca599
commit d5f119e430

@ -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(
"<qt>Sets the number of recent files remembered by Kate.<p><strong>NOTE: </strong>"
"If you set this lower than the current value, the list will be truncated and "
"some items forgotten.</qt>") );
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();

@ -66,6 +66,8 @@ class KateConfigDialog : public KDialogBase
TQCheckBox *cb_fullPath;
TQCheckBox *cb_syncKonsole;
TQCheckBox *cb_sortFiles;
TQSpinBox *sb_numRecentFiles;
TQCheckBox *cb_modNotifications;
TQCheckBox *cb_saveMetaInfos;
TQSpinBox *sb_daysMetaInfos;

@ -412,6 +412,7 @@ void KateMainWindow::readOptions ()
m_viewManager->setShowFullPath(config->readBoolEntry("Show Full Path in Title", false));
fileOpenRecent->setMaxItems( config->readNumEntry("Number of recent files", fileOpenRecent->maxItems() ) );
fileOpenRecent->loadEntries(config, "Recent Files");
fileselector->readConfig(config, "fileselector");

Loading…
Cancel
Save