author | zecke <zecke> | 2002-09-28 20:45:11 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-28 20:45:11 (UTC) |
commit | 7980189a2cb34e2864c339ef68bfbe7fb4910750 (patch) (side-by-side diff) | |
tree | a14028faccc70982d105c229f84d77e13741e987 | |
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....
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 33 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.h | 10 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileconfig.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 2 |
4 files changed, 46 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 @@ -7,4 +7,5 @@ #include "metafactory.h" +#include "profilemanager.h" #include "mainwindow.h" @@ -13,6 +14,8 @@ MainWindow::MainWindow() { m_sessions.setAutoDelete( TRUE ); m_curSession = 0; + m_manager = new ProfileManager(m_factory); initUI(); + populateProfiles(); } void MainWindow::initUI() { @@ -66,4 +69,10 @@ void MainWindow::initUI() { this, SLOT(slotTerminate() ) ); + a = new QAction(); + a->setText( tr("Close Window") ); + a->addTo( m_console ); + connect(a, SIGNAL(activated() ), + this, SLOT(slotClose() ) ); + /* * the settings action @@ -85,4 +94,22 @@ void MainWindow::initUI() { m_bar->insertItem( tr("Settings"), m_settings ); + /* + * connect to the menu activation + */ + connect( m_sessionsPop, SIGNAL(activated(int) ), + this, SLOT(slotProfile(int) ) ); + +} +ProfileManager* MainWindow::manager() { + return m_manager; +} +void MainWindow::populateProfiles() { + manager()->load(); + Profile::ValueList list = manager()->all(); + for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); + ++it ) { + m_sessionsPop->insertItem( (*it).name() ); + } + } MainWindow::~MainWindow() { @@ -122,2 +149,8 @@ void MainWindow::slotConfigure() { qWarning("configure"); } +void MainWindow::slotClose() { + +} +void MainWindow::slotProfile(int) { + +} diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h index b6a8419..be4b469 100644 --- a/noncore/apps/opie-console/mainwindow.h +++ b/noncore/apps/opie-console/mainwindow.h @@ -17,4 +17,5 @@ class QAction; class MetaFactory; +class ProfileManager; class MainWindow : public QMainWindow { Q_OBJECT @@ -40,4 +41,9 @@ public: QList<Session> sessions(); + /** + * + */ + ProfileManager* manager(); + private slots: void slotNew(); @@ -46,7 +52,10 @@ private slots: void slotTerminate(); void slotConfigure(); + void slotClose(); + void slotProfile(int); private: void initUI(); + void populateProfiles(); /** * the current session @@ -63,4 +72,5 @@ private: */ MetaFactory* m_factory; + ProfileManager* m_manager; QToolBar* m_tool; diff --git a/noncore/apps/opie-console/profileconfig.cpp b/noncore/apps/opie-console/profileconfig.cpp index bd089c8..732fae7 100644 --- a/noncore/apps/opie-console/profileconfig.cpp +++ b/noncore/apps/opie-console/profileconfig.cpp @@ -13,4 +13,5 @@ QStringList ProfileConfig::groups()const { QMap<QString, ConfigGroup>::ConstIterator it; it= Config::groups.begin(); + qWarning("config %d", Config::groups.count() ); for (; it != Config::groups.end(); ++it ) diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp index c8a4db5..24256a5 100644 --- a/noncore/apps/opie-console/profilemanager.cpp +++ b/noncore/apps/opie-console/profilemanager.cpp @@ -16,4 +16,5 @@ ProfileManager::~ProfileManager() { void ProfileManager::load() { m_list.clear(); + qWarning("load"); ProfileConfig conf("opie-console-profiles"); QStringList groups = conf.groups(); @@ -24,4 +25,5 @@ void ProfileManager::load() { */ for ( it = groups.begin(); it != groups.end(); ++it ) { + qWarning("group " + (*it) ); conf.setGroup( (*it) ); Profile prof; |