summaryrefslogtreecommitdiffstats
path: root/kate/app
diff options
context:
space:
mode:
Diffstat (limited to 'kate/app')
-rw-r--r--kate/app/kateconfigdialog.cpp25
-rw-r--r--kate/app/kateconfigdialog.h2
-rw-r--r--kate/app/katemainwindow.cpp1
3 files changed, 28 insertions, 0 deletions
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(
+ "<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();
diff --git a/kate/app/kateconfigdialog.h b/kate/app/kateconfigdialog.h
index 52b9121b7..b80be2354 100644
--- a/kate/app/kateconfigdialog.h
+++ b/kate/app/kateconfigdialog.h
@@ -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;
diff --git a/kate/app/katemainwindow.cpp b/kate/app/katemainwindow.cpp
index a0cce60d6..4b1b47a5a 100644
--- a/kate/app/katemainwindow.cpp
+++ b/kate/app/katemainwindow.cpp
@@ -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");