-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 13 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.pro | 8 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 20 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.h | 28 | ||||
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 15 | ||||
-rw-r--r-- | noncore/apps/opie-console/profilemanager.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/settings.ui | 23 |
7 files changed, 104 insertions, 5 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 | |||
@@ -7,2 +7,3 @@ | |||
7 | 7 | ||
8 | #include "configdialog.h" | ||
8 | #include "metafactory.h" | 9 | #include "metafactory.h" |
@@ -16,2 +17,3 @@ MainWindow::MainWindow() { | |||
16 | m_manager = new ProfileManager(m_factory); | 17 | m_manager = new ProfileManager(m_factory); |
18 | m_manager->load(); | ||
17 | 19 | ||
@@ -106,3 +108,3 @@ ProfileManager* MainWindow::manager() { | |||
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(); |
@@ -149,2 +151,11 @@ 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 | } |
diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro index e045a48..9e44ab0 100644 --- a/noncore/apps/opie-console/opie-console.pro +++ b/noncore/apps/opie-console/opie-console.pro | |||
@@ -12,3 +12,4 @@ HEADERS = io_layer.h io_serial.h \ | |||
12 | configwidget.h \ | 12 | configwidget.h \ |
13 | tabwidget.h | 13 | tabwidget.h \ |
14 | configdialog.h | ||
14 | SOURCES = io_layer.cpp io_serial.cpp \ | 15 | SOURCES = io_layer.cpp io_serial.cpp \ |
@@ -21,4 +22,5 @@ SOURCES = io_layer.cpp io_serial.cpp \ | |||
21 | profilemanager.cpp \ | 22 | profilemanager.cpp \ |
22 | tabwidget.cpp | 23 | tabwidget.cpp \ |
23 | INTERFACES = | 24 | configdialog.cpp |
25 | INTERFACES = configurebase.ui editbase.ui | ||
24 | INCLUDEPATH += $(OPIEDIR)/include | 26 | INCLUDEPATH += $(OPIEDIR)/include |
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp new file mode 100644 index 0000000..a4246e1 --- a/dev/null +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -0,0 +1,20 @@ | |||
1 | |||
2 | #include "profileeditordialog.h" | ||
3 | |||
4 | |||
5 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, | ||
6 | const Profile& prof ) | ||
7 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) | ||
8 | { | ||
9 | initUI(); | ||
10 | /* now set the widgets */ | ||
11 | } | ||
12 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | ||
13 | : QDialog(0, 0, TRUE), m_fact( fact ) | ||
14 | { | ||
15 | |||
16 | } | ||
17 | ProfileEditorDialog::~ProfileEditorDialog() { | ||
18 | |||
19 | } | ||
20 | |||
diff --git a/noncore/apps/opie-console/profileeditordialog.h b/noncore/apps/opie-console/profileeditordialog.h new file mode 100644 index 0000000..5ccc691 --- a/dev/null +++ b/noncore/apps/opie-console/profileeditordialog.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifndef PROFILE_EDITOR_DIALOG | ||
2 | #define PROFILE_EDITOR_DIALOG | ||
3 | |||
4 | #include <qdialog.h> | ||
5 | |||
6 | #include "profile.h" | ||
7 | |||
8 | class MetaFactory; | ||
9 | class EditBase; | ||
10 | class QTabWidget; | ||
11 | class QHBoxLayout; | ||
12 | class ProfileEditorDialog : public QDialog { | ||
13 | Q_OBJECT | ||
14 | public: | ||
15 | ProfileEditorDialog(MetaFactory* fact, | ||
16 | const Profile& prof ); | ||
17 | ProfileEditorDialog(MetaFactory* fact ); | ||
18 | Profile profile()const; | ||
19 | private: | ||
20 | void initUI(); | ||
21 | MetaFactory* m_fact; | ||
22 | EditBase* m_base; | ||
23 | QTabWidget* m_tab; | ||
24 | QHBoxLayout* m_lay; | ||
25 | Profile m_prof; | ||
26 | }; | ||
27 | |||
28 | #endif | ||
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp index 24256a5..72a5117 100644 --- a/noncore/apps/opie-console/profilemanager.cpp +++ b/noncore/apps/opie-console/profilemanager.cpp | |||
@@ -78,3 +78,16 @@ void ProfileManager::save( ) { | |||
78 | } | 78 | } |
79 | // FIXME save | 79 | } |
80 | void ProfileManager::setProfiles( const Profile::ValueList& list ) { | ||
81 | m_list = list; | ||
82 | }; | ||
83 | Profile ProfileManager::profile( const QString& name )const { | ||
84 | Profile prof; | ||
85 | Profile::ValueList::ConstIterator it; | ||
86 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { | ||
87 | if ( name == (*it).name() ) { | ||
88 | prof = (*it); | ||
89 | break; | ||
90 | } | ||
91 | } | ||
92 | return prof; | ||
80 | } | 93 | } |
diff --git a/noncore/apps/opie-console/profilemanager.h b/noncore/apps/opie-console/profilemanager.h index d4d0fd0..1387247 100644 --- a/noncore/apps/opie-console/profilemanager.h +++ b/noncore/apps/opie-console/profilemanager.h | |||
@@ -23,3 +23,5 @@ public: | |||
23 | void remove( const Profile& prof ); | 23 | void remove( const Profile& prof ); |
24 | Profile profile(const QString& name )const; | ||
24 | Session* fromProfile( const Profile& ); | 25 | Session* fromProfile( const Profile& ); |
26 | void setProfiles( const Profile::ValueList& ); | ||
25 | void save(); | 27 | void save(); |
diff --git a/noncore/apps/opie-console/settings.ui b/noncore/apps/opie-console/settings.ui new file mode 100644 index 0000000..6944dd0 --- a/dev/null +++ b/noncore/apps/opie-console/settings.ui | |||
@@ -0,0 +1,23 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>Settings</class> | ||
3 | <widget> | ||
4 | <class>QDialog</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>Settings</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>596</width> | ||
15 | <height>480</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>Settings</string> | ||
21 | </property> | ||
22 | </widget> | ||
23 | </UI> | ||