mirror of
https://github.com/KDE/konsole.git
synced 2026-05-05 05:07:06 -04:00
Initial implementation of session management in Konsole.
Patch from Stefan Becker <stefan.becker@nokia.com> Thank-you very much Stefan! CCBUG: 152761 svn path=/trunk/KDE/kdebase/apps/konsole/; revision=867323
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
// Own
|
||||
#include "MainWindow.h"
|
||||
#include "SessionManager.h"
|
||||
|
||||
// Qt
|
||||
#include <QtGui/QBoxLayout>
|
||||
@@ -378,6 +379,33 @@ bool MainWindow::queryClose()
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MainWindow::saveProperties(KConfigGroup& group)
|
||||
{
|
||||
group.writePathEntry("Default Profile", _defaultProfile->path());
|
||||
_viewManager->saveSessions(group);
|
||||
}
|
||||
|
||||
void MainWindow::readProperties(const KConfigGroup& group)
|
||||
{
|
||||
SessionManager *manager = SessionManager::instance();
|
||||
QString profile = group.readPathEntry("Default Profile", QString());
|
||||
Profile::Ptr ptr = manager->defaultProfile();
|
||||
if (!profile.isEmpty()) ptr = manager->loadProfile(profile);
|
||||
setDefaultProfile(ptr);
|
||||
_viewManager->restoreSessions(group);
|
||||
}
|
||||
|
||||
void MainWindow::saveGlobalProperties(KConfig* config)
|
||||
{
|
||||
SessionManager::instance()->saveSessions(config);
|
||||
}
|
||||
|
||||
void MainWindow::readGlobalProperties(KConfig* config)
|
||||
{
|
||||
SessionManager::instance()->restoreSessions(config);
|
||||
}
|
||||
|
||||
void MainWindow::syncActiveShortcuts(KActionCollection* dest, const KActionCollection* source)
|
||||
{
|
||||
foreach(QAction* qAction, source->actions())
|
||||
@@ -456,3 +484,12 @@ void MainWindow::configureNotifications()
|
||||
}
|
||||
|
||||
#include "MainWindow.moc"
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
mode: c++
|
||||
c-file-style: "stroustrup"
|
||||
indent-tabs-mode: nil
|
||||
tab-width: 4
|
||||
End:
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user