author | zecke <zecke> | 2002-09-28 20:45:11 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-28 20:45:11 (UTC) |
commit | 7980189a2cb34e2864c339ef68bfbe7fb4910750 (patch) (unidiff) | |
tree | a14028faccc70982d105c229f84d77e13741e987 /noncore/apps/opie-console/mainwindow.cpp | |
parent | b6df65ad2ffb50f029b96ebf9d0d78dfa23f3f19 (diff) | |
download | opie-7980189a2cb34e2864c339ef68bfbe7fb4910750.zip opie-7980189a2cb34e2864c339ef68bfbe7fb4910750.tar.gz opie-7980189a2cb34e2864c339ef68bfbe7fb4910750.tar.bz2 |
Add profiles and the profilemanager to the mainwindow
if one would have a ConfigureDialog one could see it....
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 1ae4a20..3c1c8ea 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -6,14 +6,17 @@ | |||
6 | #include <qtoolbar.h> | 6 | #include <qtoolbar.h> |
7 | 7 | ||
8 | #include "metafactory.h" | 8 | #include "metafactory.h" |
9 | #include "profilemanager.h" | ||
9 | #include "mainwindow.h" | 10 | #include "mainwindow.h" |
10 | 11 | ||
11 | MainWindow::MainWindow() { | 12 | MainWindow::MainWindow() { |
12 | m_factory = new MetaFactory(); | 13 | m_factory = new MetaFactory(); |
13 | m_sessions.setAutoDelete( TRUE ); | 14 | m_sessions.setAutoDelete( TRUE ); |
14 | m_curSession = 0; | 15 | m_curSession = 0; |
16 | m_manager = new ProfileManager(m_factory); | ||
15 | 17 | ||
16 | initUI(); | 18 | initUI(); |
19 | populateProfiles(); | ||
17 | } | 20 | } |
18 | void MainWindow::initUI() { | 21 | void MainWindow::initUI() { |
19 | setToolBarsMovable( FALSE ); | 22 | setToolBarsMovable( FALSE ); |
@@ -65,6 +68,12 @@ void MainWindow::initUI() { | |||
65 | connect(m_disconnect, SIGNAL(activated() ), | 68 | connect(m_disconnect, SIGNAL(activated() ), |
66 | this, SLOT(slotTerminate() ) ); | 69 | this, SLOT(slotTerminate() ) ); |
67 | 70 | ||
71 | a = new QAction(); | ||
72 | a->setText( tr("Close Window") ); | ||
73 | a->addTo( m_console ); | ||
74 | connect(a, SIGNAL(activated() ), | ||
75 | this, SLOT(slotClose() ) ); | ||
76 | |||
68 | /* | 77 | /* |
69 | * the settings action | 78 | * the settings action |
70 | */ | 79 | */ |
@@ -84,6 +93,24 @@ void MainWindow::initUI() { | |||
84 | /* the settings menu */ | 93 | /* the settings menu */ |
85 | m_bar->insertItem( tr("Settings"), m_settings ); | 94 | m_bar->insertItem( tr("Settings"), m_settings ); |
86 | 95 | ||
96 | /* | ||
97 | * connect to the menu activation | ||
98 | */ | ||
99 | connect( m_sessionsPop, SIGNAL(activated(int) ), | ||
100 | this, SLOT(slotProfile(int) ) ); | ||
101 | |||
102 | } | ||
103 | ProfileManager* MainWindow::manager() { | ||
104 | return m_manager; | ||
105 | } | ||
106 | void MainWindow::populateProfiles() { | ||
107 | manager()->load(); | ||
108 | Profile::ValueList list = manager()->all(); | ||
109 | for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); | ||
110 | ++it ) { | ||
111 | m_sessionsPop->insertItem( (*it).name() ); | ||
112 | } | ||
113 | |||
87 | } | 114 | } |
88 | MainWindow::~MainWindow() { | 115 | MainWindow::~MainWindow() { |
89 | delete m_factory; | 116 | delete m_factory; |
@@ -121,3 +148,9 @@ void MainWindow::slotTerminate() { | |||
121 | void MainWindow::slotConfigure() { | 148 | void MainWindow::slotConfigure() { |
122 | qWarning("configure"); | 149 | qWarning("configure"); |
123 | } | 150 | } |
151 | void MainWindow::slotClose() { | ||
152 | |||
153 | } | ||
154 | void MainWindow::slotProfile(int) { | ||
155 | |||
156 | } | ||