Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 3c1c8ea..88d5823 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -2,21 +2,23 @@ | |||
2 | #include <qaction.h> | 2 | #include <qaction.h> |
3 | #include <qmenubar.h> | 3 | #include <qmenubar.h> |
4 | #include <qlabel.h> | 4 | #include <qlabel.h> |
5 | #include <qpopupmenu.h> | 5 | #include <qpopupmenu.h> |
6 | #include <qtoolbar.h> | 6 | #include <qtoolbar.h> |
7 | 7 | ||
8 | #include "configdialog.h" | ||
8 | #include "metafactory.h" | 9 | #include "metafactory.h" |
9 | #include "profilemanager.h" | 10 | #include "profilemanager.h" |
10 | #include "mainwindow.h" | 11 | #include "mainwindow.h" |
11 | 12 | ||
12 | MainWindow::MainWindow() { | 13 | MainWindow::MainWindow() { |
13 | m_factory = new MetaFactory(); | 14 | m_factory = new MetaFactory(); |
14 | m_sessions.setAutoDelete( TRUE ); | 15 | m_sessions.setAutoDelete( TRUE ); |
15 | m_curSession = 0; | 16 | m_curSession = 0; |
16 | m_manager = new ProfileManager(m_factory); | 17 | m_manager = new ProfileManager(m_factory); |
18 | m_manager->load(); | ||
17 | 19 | ||
18 | initUI(); | 20 | initUI(); |
19 | populateProfiles(); | 21 | populateProfiles(); |
20 | } | 22 | } |
21 | void MainWindow::initUI() { | 23 | void MainWindow::initUI() { |
22 | setToolBarsMovable( FALSE ); | 24 | setToolBarsMovable( FALSE ); |
@@ -101,13 +103,13 @@ void MainWindow::initUI() { | |||
101 | 103 | ||
102 | } | 104 | } |
103 | ProfileManager* MainWindow::manager() { | 105 | ProfileManager* MainWindow::manager() { |
104 | return m_manager; | 106 | return m_manager; |
105 | } | 107 | } |
106 | void MainWindow::populateProfiles() { | 108 | void MainWindow::populateProfiles() { |
107 | manager()->load(); | 109 | m_sessionsPop->clear(); |
108 | Profile::ValueList list = manager()->all(); | 110 | Profile::ValueList list = manager()->all(); |
109 | for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); | 111 | for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); |
110 | ++it ) { | 112 | ++it ) { |
111 | m_sessionsPop->insertItem( (*it).name() ); | 113 | m_sessionsPop->insertItem( (*it).name() ); |
112 | } | 114 | } |
113 | 115 | ||
@@ -144,12 +146,21 @@ void MainWindow::slotTerminate() { | |||
144 | delete m_curSession; | 146 | delete m_curSession; |
145 | m_curSession = 0l; | 147 | m_curSession = 0l; |
146 | /* FIXME move to the next session */ | 148 | /* FIXME move to the next session */ |
147 | } | 149 | } |
148 | void MainWindow::slotConfigure() { | 150 | void MainWindow::slotConfigure() { |
149 | qWarning("configure"); | 151 | qWarning("configure"); |
152 | ConfigDialog conf( manager()->all() ); | ||
153 | conf.showMaximized(); | ||
154 | |||
155 | int ret = conf.exec(); | ||
156 | |||
157 | if ( QDialog::Accepted == ret ) { | ||
158 | manager()->setProfiles( conf.list() ); | ||
159 | populateProfiles(); | ||
160 | } | ||
150 | } | 161 | } |
151 | void MainWindow::slotClose() { | 162 | void MainWindow::slotClose() { |
152 | 163 | ||
153 | } | 164 | } |
154 | void MainWindow::slotProfile(int) { | 165 | void MainWindow::slotProfile(int) { |
155 | 166 | ||