summaryrefslogtreecommitdiff
authorzecke <zecke>2002-09-28 20:45:11 (UTC)
committer zecke <zecke>2002-09-28 20:45:11 (UTC)
commit7980189a2cb34e2864c339ef68bfbe7fb4910750 (patch) (side-by-side diff)
treea14028faccc70982d105c229f84d77e13741e987
parentb6df65ad2ffb50f029b96ebf9d0d78dfa23f3f19 (diff)
downloadopie-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 (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp33
-rw-r--r--noncore/apps/opie-console/mainwindow.h10
-rw-r--r--noncore/apps/opie-console/profileconfig.cpp1
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp2
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
@@ -8,2 +8,3 @@
#include "metafactory.h"
+#include "profilemanager.h"
#include "mainwindow.h"
@@ -14,4 +15,6 @@ MainWindow::MainWindow() {
m_curSession = 0;
+ m_manager = new ProfileManager(m_factory);
initUI();
+ populateProfiles();
}
@@ -67,2 +70,8 @@ void MainWindow::initUI() {
+ a = new QAction();
+ a->setText( tr("Close Window") );
+ a->addTo( m_console );
+ connect(a, SIGNAL(activated() ),
+ this, SLOT(slotClose() ) );
+
/*
@@ -86,2 +95,20 @@ void MainWindow::initUI() {
+ /*
+ * 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() );
+ }
+
}
@@ -123 +150,7 @@ void MainWindow::slotConfigure() {
}
+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
@@ -18,2 +18,3 @@ class MetaFactory;
+class ProfileManager;
class MainWindow : public QMainWindow {
@@ -41,2 +42,7 @@ public:
+ /**
+ *
+ */
+ ProfileManager* manager();
+
private slots:
@@ -47,2 +53,4 @@ private slots:
void slotConfigure();
+ void slotClose();
+ void slotProfile(int);
@@ -50,2 +58,3 @@ private:
void initUI();
+ void populateProfiles();
/**
@@ -64,2 +73,3 @@ private:
MetaFactory* m_factory;
+ ProfileManager* m_manager;
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
@@ -14,2 +14,3 @@ QStringList ProfileConfig::groups()const {
it= Config::groups.begin();
+ qWarning("config %d", Config::groups.count() );
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
@@ -17,2 +17,3 @@ void ProfileManager::load() {
m_list.clear();
+ qWarning("load");
ProfileConfig conf("opie-console-profiles");
@@ -25,2 +26,3 @@ void ProfileManager::load() {
for ( it = groups.begin(); it != groups.end(); ++it ) {
+ qWarning("group " + (*it) );
conf.setGroup( (*it) );