Add the ability to force Kate into MDI mode all the time.

This resolves bug report 1127.
pull/2/head
Darrell Anderson 11 years ago
parent 82958c52cc
commit f3db9433f8

@ -138,6 +138,15 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, Kate::View *view )
TQWhatsThis::add( sb_numRecentFiles, numRecentFileHelpString );
connect( sb_numRecentFiles, TQT_SIGNAL( valueChanged ( int ) ), this, TQT_SLOT( slotChanged() ) );
// Use only one instance of kate (MDI) ?
cb_useInstance = new TQCheckBox(bgStartup);
cb_useInstance->setText(i18n("Always use the current instance of kate to open new files"));
cb_useInstance->setChecked(parent->useInstance);
TQWhatsThis::add( cb_useInstance, i18n(
"When checked, all files opened from outside of Kate will only use the "
"currently opened instance of Kate.") );
connect( cb_useInstance, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) );
// sync the konsole ?
cb_syncKonsole = new TQCheckBox(bgStartup);
cb_syncKonsole->setText(i18n("Sync &terminal emulator with active document"));
@ -161,7 +170,7 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, Kate::View *view )
this, TQT_SLOT( slotChanged() ) );
// GROUP with the one below: "Meta-informations"
bgStartup = new TQButtonGroup( 1, Qt::Horizontal, i18n("Meta-Information"), frGeneral );
bgStartup = new TQButtonGroup( 2, Qt::Horizontal, i18n("Meta-Information"), frGeneral );
lo->addWidget( bgStartup );
// save meta infos
@ -409,6 +418,7 @@ void KateConfigDialog::slotApply()
mainWindow->modNotification = cb_modNotifications->isChecked();
mainWindow->syncKonsole = cb_syncKonsole->isChecked();
mainWindow->useInstance = cb_useInstance->isChecked();
mainWindow->filelist->setSortType(cb_sortFiles->isChecked() ? KateFileList::sortByName : KateFileList::sortByID);
config->writeEntry( "Number of recent files", sb_numRecentFiles->value() );

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

@ -41,6 +41,8 @@ static TDECmdLineOptions options[] =
{ "start <name>", I18N_NOOP("Start Kate with a given session"), 0 },
{ "u", 0, 0 },
{ "use", I18N_NOOP("Use a already running kate instance (if possible)"), 0 },
{ "f", 0, 0 },
{ "force-sdi", I18N_NOOP("Force single document mode if the MDI setting is enabled."), 0 },
{ "p", 0, 0 },
{ "pid <pid>", I18N_NOOP("Only try to reuse kate instance with this pid"), 0 },
{ "e", 0, 0 },
@ -57,6 +59,8 @@ static TDECmdLineOptions options[] =
extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
{
TDEConfig * config = NULL;
bool alwaysUseInstance;
// here we go, construct the Kate version
TQString kateVersion = KateApp::kateVersion();
@ -98,6 +102,8 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
aboutData.setTranslator(I18N_NOOP2("NAME OF TRANSLATORS","Your names"), I18N_NOOP2("EMAIL OF TRANSLATORS","Your emails"));
TDEInstance instance( &aboutData );
// command line args init and co
TDECmdLineArgs::init (argc, argv, &aboutData);
TDECmdLineArgs::addCmdLineOptions (options);
@ -107,8 +113,13 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
// get our command line args ;)
TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs();
// now, first try to contact running kate instance if needed
if ( args->isSet("use") || (::getenv("KATE_PID")!=0) )
config = TDEGlobal::config();
config->setGroup("General");
alwaysUseInstance = config->readBoolEntry("UseInstance");
// now, first try to contact running kate instance if needed
if ( ((args->isSet("use") || alwaysUseInstance) &&
!(args->isSet("force-sdi"))) || (::getenv("KATE_PID")!=0) )
{
DCOPClient client;
client.attach ();

@ -406,6 +406,7 @@ void KateMainWindow::readOptions ()
config->setGroup("General");
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));
@ -437,6 +438,8 @@ void KateMainWindow::saveOptions ()
config->writeEntry("Sync Konsole", syncKonsole);
config->writeEntry("UseInstance", useInstance);
fileOpenRecent->saveEntries(config, "Recent Files");
fileselector->writeConfig(config, "fileselector");

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

Loading…
Cancel
Save