22 #include "katemainwindow.h"
23 #include "katemainwindow.moc"
25 #include "kateconfigdialog.h"
26 #include "kateconsole.h"
27 #include "katedocmanager.h"
28 #include "katepluginmanager.h"
29 #include "kateconfigplugindialogpage.h"
30 #include "kateviewmanager.h"
32 #include "katefileselector.h"
33 #include "katefilelist.h"
34 #include "kategrepdialog.h"
35 #include "katemailfilesdialog.h"
36 #include "katemainwindowiface.h"
37 #include "kateexternaltools.h"
38 #include "katesavemodifieddialog.h"
39 #include "katemwmodonhddialog.h"
40 #include "katesession.h"
41 #include "katetabwidget.h"
43 #include "../interfaces/mainwindow.h"
44 #include "../interfaces/toolviewmanager.h"
46 #include <dcopclient.h>
47 #include <kinstance.h>
48 #include <kaboutdata.h>
50 #include <kcmdlineargs.h>
52 #include <kdialogbase.h>
53 #include <kdiroperator.h>
54 #include <kdockwidget.h>
55 #include <kedittoolbar.h>
56 #include <kfiledialog.h>
57 #include <kglobalaccel.h>
59 #include <kglobalsettings.h>
60 #include <kiconloader.h>
61 #include <kkeydialog.h>
63 #include <kmessagebox.h>
64 #include <kmimetype.h>
65 #include <kopenwith.h>
66 #include <kpopupmenu.h>
67 #include <ksimpleconfig.h>
68 #include <kstatusbar.h>
69 #include <kstdaction.h>
70 #include <kstandarddirs.h>
72 #include <kuniqueapplication.h>
74 #include <kdesktopfile.h>
75 #include <khelpmenu.h>
76 #include <kmultitabbar.h>
79 #include <kstringhandler.h>
81 #include <tqptrvector.h>
87 uint KateMainWindow::uniqueID = 1;
89 KateMainWindow::KateMainWindow (KConfig *sconfig,
const TQString &sgroup)
90 : KateMDI::MainWindow (0,(TQString(TQString(
"__KateMainWindow#%1").arg(uniqueID))).latin1())
102 if (!initialGeometrySet())
104 int scnum = TQApplication::desktop()->screenNumber(parentWidget());
105 TQRect desk = TQApplication::desktop()->screenGeometry(scnum);
112 sconfig->setGroup (sgroup);
113 size.setWidth (sconfig->readNumEntry( TQString::fromLatin1(
"Width %1").arg(desk.width()), 0 ));
114 size.setHeight (sconfig->readNumEntry( TQString::fromLatin1(
"Height %1").arg(desk.height()), 0 ));
134 size.setWidth (
KateApp::self()->config()->readNumEntry( TQString::fromLatin1(
"Width %1").arg(desk.width()), 0 ));
135 size.setHeight (
KateApp::self()->config()->readNumEntry( TQString::fromLatin1(
"Height %1").arg(desk.height()), 0 ));
138 size = TQSize (kMin (700, desk.width()), kMin(480, desk.height()));
146 startRestore (sconfig, sgroup);
148 m_mainWindow =
new Kate::MainWindow (
this);
151 m_dcop =
new KateMainWindowDCOPIface (
this);
159 setStandardToolBarMenuEnabled(
true );
160 setXMLFile(
"kateui.rc" );
161 createShellGUI (
true );
163 KatePluginManager::self()->enableAllPluginsGUI (
this);
166 Kate::Document::registerCommand(KateExternalToolsCommand::self());
169 documentMenu = (TQPopupMenu*)factory()->container(
"documents",
this);
170 connect(documentMenu, TQT_SIGNAL(aboutToShow()),
this, TQT_SLOT(documentMenuAboutToShow()));
173 for (uint i = 0; i < KateDocManager::self()->documents(); i++)
174 slotDocumentCreated (KateDocManager::self()->document(i));
176 connect(KateDocManager::self(),TQT_SIGNAL(documentCreated(Kate::Document *)),
this,TQT_SLOT(slotDocumentCreated(Kate::Document *)));
181 m_viewManager->restoreViewConfiguration (sconfig, sgroup);
185 setAcceptDrops(
true);
188 KateMainWindow::~KateMainWindow()
199 KatePluginManager::self()->disableAllPluginsGUI (
this);
204 void KateMainWindow::setupMainWindow ()
206 setToolViewStyle( KMultiTabBar::KDEV3ICON );
208 m_tabWidget =
new KateTabWidget (centralWidget());
210 m_viewManager =
new KateViewManager (
this);
212 KateMDI::ToolView *ft = createToolView(
"kate_filelist", KMultiTabBar::Left, SmallIcon(
"kmultiple"), i18n(
"Documents"));
213 filelist =
new KateFileList (
this, m_viewManager, ft,
"filelist");
216 KateMDI::ToolView *t = createToolView(
"kate_fileselector", KMultiTabBar::Left, SmallIcon(
"fileopen"), i18n(
"Filesystem Browser"));
217 fileselector =
new KateFileSelector(
this, m_viewManager, t,
"operator");
218 connect(fileselector->dirOperator(),TQT_SIGNAL(fileSelected(
const KFileItem*)),
this,TQT_SLOT(fileSelected(
const KFileItem*)));
223 t = createToolView(
"kate_greptool", KMultiTabBar::Bottom, SmallIcon(
"filefind"), i18n(
"Find in Files") );
224 greptool =
new GrepTool( t,
"greptool" );
225 connect(greptool, TQT_SIGNAL(itemSelected(
const TQString &,
int)),
this, TQT_SLOT(slotGrepToolItemSelected(
const TQString &,
int)));
226 connect(t,TQT_SIGNAL(visibleChanged(
bool)),
this, TQT_SLOT(updateGrepDir (
bool)));
230 t = createToolView(
"kate_console", KMultiTabBar::Bottom, SmallIcon(
"konsole"), i18n(
"Terminal"));
238 void KateMainWindow::setupActions()
242 KStdAction::openNew( TQT_TQOBJECT(m_viewManager), TQT_SLOT( slotDocumentNew() ), actionCollection(),
"file_new" )->setWhatsThis(i18n(
"Create a new document"));
243 KStdAction::open( TQT_TQOBJECT(m_viewManager), TQT_SLOT( slotDocumentOpen() ), actionCollection(),
"file_open" )->setWhatsThis(i18n(
"Open an existing document for editing"));
245 fileOpenRecent = KStdAction::openRecent (TQT_TQOBJECT(m_viewManager), TQT_SLOT(openURL (
const KURL&)), actionCollection());
246 fileOpenRecent->setWhatsThis(i18n(
"This lists files which you have opened recently, and allows you to easily open them again."));
248 a=
new KAction( i18n(
"Save A&ll"),
"save_all", CTRL+Key_L, KateDocManager::self(), TQT_SLOT( saveAll() ), actionCollection(),
"file_save_all" );
249 a->setWhatsThis(i18n(
"Save all open, modified documents to disk."));
251 KStdAction::close( TQT_TQOBJECT(m_viewManager), TQT_SLOT( slotDocumentClose() ), actionCollection(),
"file_close" )->setWhatsThis(i18n(
"Close the current document."));
253 a=
new KAction( i18n(
"Clos&e All" ), 0, TQT_TQOBJECT(
this), TQT_SLOT( slotDocumentCloseAll() ), actionCollection(),
"file_close_all" );
254 a->setWhatsThis(i18n(
"Close all open documents."));
256 KStdAction::mail( TQT_TQOBJECT(
this), TQT_SLOT(slotMail()), actionCollection() )->setWhatsThis(i18n(
"Send one or more of the open documents as email attachments."));
258 KStdAction::quit( TQT_TQOBJECT(
this), TQT_SLOT( slotFileQuit() ), actionCollection(),
"file_quit" )->setWhatsThis(i18n(
"Close this window"));
260 a=
new KAction(i18n(
"&New Window"),
"window_new", 0, TQT_TQOBJECT(
this), TQT_SLOT(newWindow()), actionCollection(),
"view_new_view");
261 a->setWhatsThis(i18n(
"Create a new Kate view (a new window with the same document list)."));
266 externalTools->setWhatsThis( i18n(
"Launch external helper applications") );
269 KToggleAction* showFullScreenAction = KStdAction::fullScreen( 0, 0, actionCollection(),
this);
270 connect( showFullScreenAction,TQT_SIGNAL(toggled(
bool)),
this,TQT_SLOT(slotFullScreen(
bool)));
272 documentOpenWith =
new KActionMenu(i18n(
"Open W&ith"), actionCollection(),
"file_open_with");
273 documentOpenWith->setWhatsThis(i18n(
"Open the current document using another application registered for its file type, or an application of your choice."));
274 connect(documentOpenWith->popupMenu(), TQT_SIGNAL(aboutToShow()),
this, TQT_SLOT(mSlotFixOpenWithMenu()));
275 connect(documentOpenWith->popupMenu(), TQT_SIGNAL(activated(
int)),
this, TQT_SLOT(slotOpenWithMenuAction(
int)));
277 a=KStdAction::keyBindings(TQT_TQOBJECT(
this), TQT_SLOT(editKeys()), actionCollection());
278 a->setWhatsThis(i18n(
"Configure the application's keyboard shortcut assignments."));
280 a=KStdAction::configureToolbars(TQT_TQOBJECT(
this), TQT_SLOT(slotEditToolbars()), actionCollection());
281 a->setWhatsThis(i18n(
"Configure which items should appear in the toolbar(s)."));
283 KAction* settingsConfigure = KStdAction::preferences(TQT_TQOBJECT(
this), TQT_SLOT(slotConfigure()), actionCollection(),
"settings_configure");
284 settingsConfigure->setWhatsThis(i18n(
"Configure various aspects of this application and the editing component."));
288 new KAction(i18n(
"&Pipe to Console"),
"pipe", 0, TQT_TQOBJECT(console), TQT_SLOT(slotPipeToConsole()), actionCollection(),
"tools_pipe_to_terminal");
291 KStdAction::tipOfDay( TQT_TQOBJECT(
this), TQT_SLOT( tipOfTheDay() ), actionCollection() )->setWhatsThis(i18n(
"This shows useful tips on the use of this application."));
293 if (KatePluginManager::self()->pluginList().count() > 0)
295 a=
new KAction(i18n(
"&Plugins Handbook"), 0, TQT_TQOBJECT(
this), TQT_SLOT(pluginHelp()), actionCollection(),
"help_plugins_contents");
296 a->setWhatsThis(i18n(
"This shows help files for various available plugins."));
299 connect(m_viewManager,TQT_SIGNAL(viewChanged()),TQT_TQOBJECT(
this),TQT_SLOT(slotWindowActivated()));
300 connect(m_viewManager,TQT_SIGNAL(viewChanged()),TQT_TQOBJECT(
this),TQT_SLOT(slotUpdateOpenWith()));
302 slotWindowActivated ();
305 new KAction(i18n(
"Menu entry Session->New",
"&New"),
"filenew", 0, TQT_TQOBJECT(KateSessionManager::self()), TQT_SLOT(sessionNew()), actionCollection(),
"sessions_new");
306 new KAction(i18n(
"&Open..."),
"fileopen", 0, TQT_TQOBJECT(KateSessionManager::self()), TQT_SLOT(sessionOpen()), actionCollection(),
"sessions_open");
307 new KAction(i18n(
"&Save"),
"filesave", 0, TQT_TQOBJECT(KateSessionManager::self()), TQT_SLOT(sessionSave()), actionCollection(),
"sessions_save");
308 new KAction(i18n(
"Save &As..."),
"filesaveas", 0, TQT_TQOBJECT(KateSessionManager::self()), TQT_SLOT(sessionSaveAs()), actionCollection(),
"sessions_save_as");
309 new KAction(i18n(
"&Manage..."),
"view_choose", 0, TQT_TQOBJECT(KateSessionManager::self()), TQT_SLOT(sessionManage()), actionCollection(),
"sessions_manage");
312 new KateSessionsAction (i18n(
"&Quick Open"), actionCollection(),
"sessions_list");
315 KateTabWidget *KateMainWindow::tabWidget ()
320 void KateMainWindow::slotDocumentCloseAll() {
321 if (queryClose_internal())
322 KateDocManager::self()->closeAllDocuments(
false);
325 bool KateMainWindow::queryClose_internal() {
326 uint documentCount=KateDocManager::self()->documents();
328 if ( ! showModOnDiskPrompt() )
331 TQPtrList<Kate::Document> modifiedDocuments=KateDocManager::self()->modifiedDocumentList();
332 bool shutdown=(modifiedDocuments.count()==0);
335 shutdown=KateSaveModifiedDialog::queryClose(
this,modifiedDocuments);
338 if ( KateDocManager::self()->documents() > documentCount ) {
339 KMessageBox::information (
this,
340 i18n (
"New file opened while trying to close Kate, closing aborted."),
341 i18n (
"Closing Aborted"));
351 bool KateMainWindow::queryClose()
357 return queryClose_internal ();
367 if ( queryClose_internal () )
380 void KateMainWindow::newWindow ()
385 void KateMainWindow::slotEditToolbars()
387 saveMainWindowSettings(
KateApp::self()->config(),
"MainWindow" );
388 KEditToolbar dlg( factory() );
389 connect( &dlg, TQT_SIGNAL(newToolbarConfig()),
this, TQT_SLOT(slotNewToolbarConfig()) );
393 void KateMainWindow::slotNewToolbarConfig()
395 applyMainWindowSettings(
KateApp::self()->config(),
"MainWindow" );
398 void KateMainWindow::slotFileQuit()
403 void KateMainWindow::readOptions ()
407 config->setGroup(
"General");
408 syncKonsole = config->readBoolEntry(
"Sync Konsole",
true);
409 modNotification = config->readBoolEntry(
"Modified Notification",
false);
410 KateDocManager::self()->setSaveMetaInfos(config->readBoolEntry(
"Save Meta Infos",
true));
411 KateDocManager::self()->setDaysMetaInfos(config->readNumEntry(
"Days Meta Infos", 30));
413 m_viewManager->setShowFullPath(config->readBoolEntry(
"Show Full Path in Title",
false));
415 fileOpenRecent->setMaxItems( config->readNumEntry(
"Number of recent files", fileOpenRecent->maxItems() ) );
416 fileOpenRecent->loadEntries(config,
"Recent Files");
418 fileselector->readConfig(config,
"fileselector");
421 void KateMainWindow::saveOptions ()
425 config->setGroup(
"General");
428 config->writeEntry(
"Show Console", console->isVisible());
430 config->writeEntry(
"Show Console",
false);
432 config->writeEntry(
"Save Meta Infos", KateDocManager::self()->getSaveMetaInfos());
434 config->writeEntry(
"Days Meta Infos", KateDocManager::self()->getDaysMetaInfos());
436 config->writeEntry(
"Show Full Path in Title", m_viewManager->getShowFullPath());
438 config->writeEntry(
"Sync Konsole", syncKonsole);
440 fileOpenRecent->saveEntries(config,
"Recent Files");
442 fileselector->writeConfig(config,
"fileselector");
444 filelist->writeConfig(config,
"Filelist");
447 void KateMainWindow::slotWindowActivated ()
449 if (m_viewManager->activeView())
451 if (console && syncKonsole)
453 static TQString path;
454 TQString newPath = m_viewManager->activeView()->getDoc()->url().directory();
456 if ( newPath != path )
459 console->cd (KURL( path ));
463 updateCaption (m_viewManager->activeView()->getDoc());
467 centralWidget()->setFocusProxy (m_viewManager->activeView());
470 void KateMainWindow::slotUpdateOpenWith()
472 if (m_viewManager->activeView())
473 documentOpenWith->setEnabled(!m_viewManager->activeView()->document()->url().isEmpty());
475 documentOpenWith->setEnabled(
false);
478 void KateMainWindow::documentMenuAboutToShow()
481 while (documentMenu->count() > 3)
482 documentMenu->removeItemAt (3);
484 TQListViewItem * item = filelist->firstChild();
487 TQString name = KStringHandler::rsqueeze( ((KateFileListItem *)item)->document()->docName(), 150 );
488 Kate::Document* doc = ((KateFileListItem *)item)->document();
489 documentMenu->insertItem (
490 doc->isModified() ? i18n(
"'document name [*]', [*] means modified",
"%1 [*]").arg(name) : name,
491 m_viewManager, TQT_SLOT (activateView (
int)), 0,
492 ((KateFileListItem *)item)->documentNumber () );
494 item = item->nextSibling();
496 if (m_viewManager->activeView())
497 documentMenu->setItemChecked ( m_viewManager->activeView()->getDoc()->documentNumber(),
true);
500 void KateMainWindow::slotGrepToolItemSelected(
const TQString &filename,
int linenumber)
503 fileURL.setPath( filename );
504 m_viewManager->openURL( fileURL );
505 if ( m_viewManager->activeView() == 0 )
return;
506 m_viewManager->activeView()->gotoLineNumber( linenumber );
511 void KateMainWindow::dragEnterEvent( TQDragEnterEvent *event )
513 event->accept(KURLDrag::canDecode(event));
516 void KateMainWindow::dropEvent( TQDropEvent *event )
518 slotDropEvent(event);
521 void KateMainWindow::slotDropEvent( TQDropEvent * event )
524 if (!KURLDrag::decode(event, textlist))
return;
526 for (KURL::List::Iterator i=textlist.begin(); i != textlist.end(); ++i)
528 m_viewManager->openURL (*i);
532 void KateMainWindow::editKeys()
534 KKeyDialog dlg (
false,
this );
536 TQPtrList<KXMLGUIClient> clients = guiFactory()->clients();
538 for( TQPtrListIterator<KXMLGUIClient> it( clients ); it.current(); ++it )
539 dlg.insert ( (*it)->actionCollection(), (*it)->instance()->aboutData()->programName() );
541 dlg.insert( externalTools->actionCollection(), i18n(
"External Tools") );
545 TQPtrList<Kate::Document> l=KateDocManager::self()->documentList();
546 for (uint i=0;i<l.count();i++) {
548 l.at(i)->reloadXML();
549 TQPtrList<class KTextEditor::View> l1=l.at(i)->views ();
550 for (uint i1=0;i1<l1.count();i1++) {
551 l1.at(i1)->reloadXML();
556 externalTools->actionCollection()->writeShortcutSettings(
"Shortcuts",
new KConfig(
"externaltools",
false,
false,
"appdata") );
559 void KateMainWindow::openURL (
const TQString &name)
561 m_viewManager->openURL (KURL(name));
564 void KateMainWindow::slotConfigure()
566 if (!m_viewManager->activeView())
569 KateConfigDialog* dlg =
new KateConfigDialog (
this, m_viewManager->activeView());
575 KURL KateMainWindow::activeDocumentUrl()
579 Kate::View *v = m_viewManager->activeView();
581 return v->getDoc()->url();
585 void KateMainWindow::fileSelected(
const KFileItem * )
587 const KFileItemList *list=fileselector->dirOperator()->selectedItems();
589 for (KFileItemListIterator it(*list); (tmp = it.current()); ++it)
591 m_viewManager->openURL(tmp->url());
592 fileselector->dirOperator()->view()->setSelected(tmp,
false);
597 void KateMainWindow::mSlotFixOpenWithMenu()
600 documentOpenWith->popupMenu()->clear();
602 KMimeType::Ptr mime = KMimeType::findByURL( m_viewManager->activeView()->getDoc()->url() );
605 KTrader::OfferList offers = KTrader::self()->query(mime->name(),
"Type == 'Application'");
607 for(KTrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it) {
608 if ((*it)->name() ==
"Kate")
continue;
609 documentOpenWith->popupMenu()->insertItem( SmallIcon( (*it)->icon() ), (*it)->name() );
612 documentOpenWith->popupMenu()->insertItem(i18n(
"&Other..."));
615 void KateMainWindow::slotOpenWithMenuAction(
int idx)
618 list.append( m_viewManager->activeView()->getDoc()->url() );
619 TQString appname = documentOpenWith->popupMenu()->text(idx);
621 appname = appname.remove(
'&');
622 if ( appname.compare(i18n(
"Other...")) == 0 ) {
624 KOpenWithDlg dlg(list);
626 KRun::run(*dlg.service(), list);
630 TQString qry = TQString(
"((Type == 'Application') and (Name == '%1'))").arg( appname.latin1() );
631 KMimeType::Ptr mime = KMimeType::findByURL( m_viewManager->activeView()->getDoc()->url() );
632 KTrader::OfferList offers = KTrader::self()->query(mime->name(), qry);
634 if (!offers.isEmpty()) {
635 KService::Ptr app = offers.first();
636 KRun::run(*app, list);
639 KMessageBox::error(
this, i18n(
"Application '%1' not found!").arg(appname.latin1()), i18n(
"Application Not Found!"));
642 void KateMainWindow::pluginHelp()
644 KateApp::self()->invokeHelp (TQString::null,
"kate-plugins");
647 void KateMainWindow::slotMail()
660 TQPtrListIterator<Kate::Document> it(attDocs);
661 for ( ; it.current(); ++it ) {
664 if ( doc->url().isEmpty() ) {
666 int r = KMessageBox::questionYesNo(
this,
667 i18n(
"<p>The current document has not been saved, and "
668 "cannot be attached to an email message."
669 "<p>Do you want to save it and proceed?"),
670 i18n(
"Cannot Send Unsaved File"),KStdGuiItem::saveAs(),KStdGuiItem::cancel() );
671 if ( r == KMessageBox::Yes ) {
672 Kate::View *v = (Kate::View*)doc->views().first();
673 int sr = v->saveAs();
674 if ( sr == Kate::View::SAVE_OK ) { ;
677 if ( sr != Kate::View::SAVE_CANCEL )
678 KMessageBox::sorry(
this, i18n(
"The file could not be saved. Please check "
679 "if you have write permission.") );
686 if ( doc->isModified() ) {
688 int r = KMessageBox::warningYesNoCancel(
this,
689 i18n(
"<p>The current file:<br><strong>%1</strong><br>has been "
690 "modified. Modifications will not be available in the attachment."
691 "<p>Do you want to save it before sending it?").arg(doc->url().prettyURL()),
692 i18n(
"Save Before Sending?"), KStdGuiItem::save(), i18n(
"Do Not Save") );
694 case KMessageBox::Cancel:
696 case KMessageBox::Yes:
698 if ( doc->isModified() ) {
699 KMessageBox::sorry(
this, i18n(
"The file could not be saved. Please check "
700 "if you have write permission.") );
709 urls << doc->url().url();
711 if ( ! urls.count() )
722 void KateMainWindow::tipOfTheDay()
724 KTipDialog::showTip(
this, TQString::null,
true );
727 void KateMainWindow::slotFullScreen(
bool t)
735 void KateMainWindow::updateGrepDir (
bool visible)
741 if ( m_viewManager->activeView() )
743 if ( m_viewManager->activeView()->getDoc()->url().isLocalFile() )
745 greptool->updateDirName( m_viewManager->activeView()->getDoc()->url().directory() );
750 bool KateMainWindow::event( TQEvent *e )
752 uint type = e->type();
753 if ( type == TQEvent::WindowActivate && modNotification )
755 showModOnDiskPrompt();
757 return KateMDI::MainWindow::event( e );
760 bool KateMainWindow::showModOnDiskPrompt()
764 DocVector list( KateDocManager::self()->documents() );
766 for( doc = KateDocManager::self()->firstDocument(); doc; doc = KateDocManager::self()->nextDocument() )
768 if ( KateDocManager::self()->documentInfo( doc )->modifiedOnDisc )
770 list.insert( cnt, doc );
775 if ( cnt && !m_modignore )
780 bool res = mhdlg.exec();
788 void KateMainWindow::slotDocumentCreated (Kate::Document *doc)
790 connect(doc,TQT_SIGNAL(modStateChanged(Kate::Document *)),
this,TQT_SLOT(updateCaption(Kate::Document *)));
791 connect(doc,TQT_SIGNAL(nameChanged(Kate::Document *)),
this,TQT_SLOT(updateCaption(Kate::Document *)));
792 connect(doc,TQT_SIGNAL(nameChanged(Kate::Document *)),
this,TQT_SLOT(slotUpdateOpenWith()));
797 void KateMainWindow::updateCaption (Kate::Document *doc)
799 if (!m_viewManager->activeView())
801 setCaption (
"",
false);
805 if (!(m_viewManager->activeView()->getDoc() == doc))
809 if (m_viewManager->activeView()->getDoc()->url().isEmpty() || (!m_viewManager->getShowFullPath()))
811 c = m_viewManager->activeView()->getDoc()->docName();
815 c = m_viewManager->activeView()->getDoc()->url().prettyURL();
819 if ( !sessName.isEmpty() )
820 sessName = TQString(
"%1: ").arg( sessName );
822 setCaption( sessName + KStringHandler::lsqueeze(c,64),
823 m_viewManager->activeView()->getDoc()->isModified());
826 void KateMainWindow::saveProperties(KConfig *config)
828 TQString grp=config->group();
830 saveSession(config, grp);
831 m_viewManager->saveViewConfiguration (config, grp);
833 config->setGroup(grp);
836 void KateMainWindow::readProperties(KConfig *config)
838 TQString grp=config->group();
840 startRestore(config, grp);
842 m_viewManager->restoreViewConfiguration (config, grp);
844 config->setGroup(grp);
847 void KateMainWindow::saveGlobalProperties( KConfig* sessionConfig )
849 KateDocManager::self()->saveDocumentList (sessionConfig);
851 sessionConfig->setGroup(
"General");
852 sessionConfig->writeEntry (
"Last Session",
KateApp::self()->sessionManager()->activeSession()->sessionFileRelative());