From aab1bb8681505c5d187bbbe873ad3af26fcaab96 Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Sat, 24 Aug 2002 00:32:15 +0000 Subject: [PATCH] Reparse sessions on a reconfigure request svn path=/trunk/kdebase/konsole/; revision=173524 --- konsole/konsole.cpp | 35 ++++++++++++++++++++++++++--------- konsole/konsole.h | 1 + 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/konsole/konsole.cpp b/konsole/konsole.cpp index 148ba100..914fe9a7 100644 --- a/konsole/konsole.cpp +++ b/konsole/konsole.cpp @@ -593,15 +593,8 @@ void Konsole::makeGUI() m_help->insertItem(SmallIcon( "idea" ), i18n("&Tip of the Day..."), this, SLOT(showTip()), 0, -1, 2); - //the different session types - loadSessionCommands(); - loadScreenSessions(); - - m_session->insertSeparator(); - m_closeSession->plug(m_session); - - m_session->insertSeparator(); - m_quit->plug(m_session); + //the different session menus + buildSessionMenus(); connect(m_session, SIGNAL(activated(int)), SLOT(newSession(int))); @@ -1380,6 +1373,7 @@ void Konsole::reparseConfiguration() { KGlobal::config()->reparseConfiguration(); readProperties(KGlobal::config(), QString::null, true); + buildSessionMenus(); } // --| color selection |------------------------------------------------------- @@ -2244,6 +2238,28 @@ void Konsole::clearSessionHistory(TESession & session) } } +void Konsole::buildSessionMenus() +{ + m_session->clear(); + m_toolbarSessionsCommands->clear(); + + no2command.clear(); + no2tempFile.clear(); + no2filename.clear(); + + cmd_serial = 0; + cmd_first_screen = -1; + + loadSessionCommands(); + loadScreenSessions(); + + m_session->insertSeparator(); + m_closeSession->plug(m_session); + + m_session->insertSeparator(); + m_quit->plug(m_session); +} + void Konsole::addSessionCommand(const QString &path) { KSimpleConfig* co; @@ -2277,6 +2293,7 @@ void Konsole::addSessionCommand(const QString &path) no2filename.insert(cmd_serial,new QString(filename)); } + void Konsole::loadSessionCommands() { if (!kapp->authorize("shell_access")) diff --git a/konsole/konsole.h b/konsole/konsole.h index d72e1fe9..7ed2bb0b 100644 --- a/konsole/konsole.h +++ b/konsole/konsole.h @@ -218,6 +218,7 @@ private: void setFont(int fontno); void clearSessionHistory(TESession & session); + void buildSessionMenus(); void addSessionCommand(const QString & path); void loadSessionCommands(); void addScreenSession(const QString & socket);