Kate: added checkbox to select whether to display the session name on the

window caption or not. This relates to issue #62.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/66/head
Michele Calgaro 5 年前
父節點 027c45db6f
當前提交 9599fe5451
簽署人: MicheleC
GPG 金鑰 ID: 2A75B7CA8ADED5CF

@ -107,18 +107,24 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, Kate::View *view )
// show full path in title
config->setGroup("General");
cb_fullPath = new TQCheckBox( i18n("&Show full path in title"), bgStartup);
cb_fullPath->setChecked( mainWindow->viewManager()->getShowFullPath() );
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() ) );
cb_fullPath = new TQCheckBox(i18n("&Show full path in title"), bgStartup);
cb_fullPath->setChecked(mainWindow->viewManager()->getShowFullPath());
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()));
// show session name in title
cb_showSessionName = new TQCheckBox(i18n("Show s&ession name in title"), bgStartup);
cb_showSessionName->setChecked(parent->showSessionName);
TQWhatsThis::add(cb_showSessionName, i18n("If this option is checked, the session name will be shown in the window caption."));
connect(cb_showSessionName, 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() ) );
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 );
@ -417,6 +423,7 @@ void KateConfigDialog::slotApply()
config->writeEntry("Modified Notification", cb_modNotifications->isChecked());
mainWindow->modNotification = cb_modNotifications->isChecked();
mainWindow->showSessionName = cb_showSessionName->isChecked();
mainWindow->syncKonsole = cb_syncKonsole->isChecked();
mainWindow->useInstance = cb_useInstance->isChecked();
mainWindow->filelist->setSortType(cb_sortFiles->isChecked() ? KateFileList::sortByName : KateFileList::sortByID);
@ -437,7 +444,7 @@ void KateConfigDialog::slotApply()
}
//mainWindow->externalTools->reload();
mainWindow->viewManager()->setShowFullPath( cb_fullPath->isChecked() ); // hm, stored 2 places :(
mainWindow->viewManager()->setShowFullPath(cb_fullPath->isChecked());
mainWindow->saveOptions ();

@ -65,6 +65,7 @@ class KateConfigDialog : public KDialogBase
bool dataChanged;
TQCheckBox *cb_fullPath;
TQCheckBox *cb_showSessionName;
TQCheckBox *cb_syncKonsole;
TQCheckBox *cb_useInstance;
TQCheckBox *cb_sortFiles;

@ -423,8 +423,9 @@ void KateMainWindow::readOptions ()
TDEConfig *config = KateApp::self()->config ();
config->setGroup("General");
syncKonsole = config->readBoolEntry("Sync Konsole", true);
useInstance = config->readBoolEntry("UseInstance", false);
showSessionName = config->readBoolEntry("Show session name", false);
syncKonsole = config->readBoolEntry("Sync Konsole", true);
useInstance = config->readBoolEntry("UseInstance", false);
modNotification = config->readBoolEntry("Modified Notification", false);
KateDocManager::self()->setSaveMetaInfos(config->readBoolEntry("Save Meta Infos", true));
KateDocManager::self()->setDaysMetaInfos(config->readNumEntry("Days Meta Infos", 30));
@ -447,6 +448,7 @@ void KateMainWindow::saveOptions ()
else
config->writeEntry("Show Console", false);
config->writeEntry("Show session name", showSessionName);
config->writeEntry("Save Meta Infos", KateDocManager::self()->getSaveMetaInfos());
config->writeEntry("Days Meta Infos", KateDocManager::self()->getDaysMetaInfos());
config->writeEntry("Show Full Path in Title", m_viewManager->getShowFullPath());
@ -820,7 +822,7 @@ void KateMainWindow::slotNameChanged(Kate::Document *doc)
fileOpenRecent->addURL(doc->url());
}
void KateMainWindow::updateCaption (Kate::Document *doc)
void KateMainWindow::updateCaption(Kate::Document *doc)
{
if (!m_viewManager->activeView())
{
@ -841,12 +843,20 @@ void KateMainWindow::updateCaption (Kate::Document *doc)
c = m_viewManager->activeView()->getDoc()->url().prettyURL();
}
TQString sessName = KateApp::self()->sessionManager()->getActiveSessionName();
if ( !sessName.isEmpty() )
sessName = TQString("%1: ").arg( sessName );
setCaption( sessName + KStringHandler::lsqueeze(c,64),
m_viewManager->activeView()->getDoc()->isModified());
if (showSessionName)
{
TQString sessName = KateApp::self()->sessionManager()->getActiveSessionName();
if (!sessName.isEmpty())
{
sessName = TQString("%1: ").arg(sessName);
}
setCaption(KStringHandler::lsqueeze(sessName,32) + KStringHandler::lsqueeze(c,64),
m_viewManager->activeView()->getDoc()->isModified());
}
else
{
setCaption(KStringHandler::lsqueeze(c,64), m_viewManager->activeView()->getDoc()->isModified());
}
}
void KateMainWindow::saveProperties(TDEConfig *config)

@ -187,6 +187,7 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
Kate::MainWindow *m_mainWindow;
Kate::ToolViewManager *m_toolViewManager;
bool showSessionName;
bool syncKonsole;
bool useInstance;
bool modNotification;

載入中…
取消
儲存