author | zecke <zecke> | 2002-10-02 12:25:01 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-02 12:25:01 (UTC) |
commit | 6d20f295c578281b043073a5c0dd668fe754581a (patch) (side-by-side diff) | |
tree | b34f24c6ad01589dca15eb4ef40640b5e9e57013 /noncore/apps | |
parent | ff02919c1d2e83c3cb0dc1c726bf1eb636d1eb38 (diff) | |
download | opie-6d20f295c578281b043073a5c0dd668fe754581a.zip opie-6d20f295c578281b043073a5c0dd668fe754581a.tar.gz opie-6d20f295c578281b043073a5c0dd668fe754581a.tar.bz2 |
Commit my files so other people can play with them
-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 @@ -6,4 +6,5 @@ #include <qtoolbar.h> +#include "configdialog.h" #include "metafactory.h" #include "profilemanager.h" @@ -15,4 +16,5 @@ MainWindow::MainWindow() { m_curSession = 0; m_manager = new ProfileManager(m_factory); + m_manager->load(); initUI(); @@ -105,5 +107,5 @@ ProfileManager* MainWindow::manager() { } void MainWindow::populateProfiles() { - manager()->load(); + m_sessionsPop->clear(); Profile::ValueList list = manager()->all(); for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); @@ -148,4 +150,13 @@ void MainWindow::slotTerminate() { void MainWindow::slotConfigure() { qWarning("configure"); + ConfigDialog conf( manager()->all() ); + conf.showMaximized(); + + int ret = conf.exec(); + + if ( QDialog::Accepted == ret ) { + manager()->setProfiles( conf.list() ); + populateProfiles(); + } } void MainWindow::slotClose() { 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 @@ -11,5 +11,6 @@ HEADERS = io_layer.h io_serial.h \ profilemanager.h \ configwidget.h \ - tabwidget.h + tabwidget.h \ + configdialog.h SOURCES = io_layer.cpp io_serial.cpp \ file_layer.cpp main.cpp \ @@ -20,6 +21,7 @@ SOURCES = io_layer.cpp io_serial.cpp \ profileconfig.cpp \ profilemanager.cpp \ - tabwidget.cpp -INTERFACES = + tabwidget.cpp \ + configdialog.cpp +INTERFACES = configurebase.ui editbase.ui INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(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 @@ + +#include "profileeditordialog.h" + + +ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, + const Profile& prof ) + : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) +{ + initUI(); + /* now set the widgets */ +} +ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) + : QDialog(0, 0, TRUE), m_fact( fact ) +{ + +} +ProfileEditorDialog::~ProfileEditorDialog() { + +} + 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 @@ +#ifndef PROFILE_EDITOR_DIALOG +#define PROFILE_EDITOR_DIALOG + +#include <qdialog.h> + +#include "profile.h" + +class MetaFactory; +class EditBase; +class QTabWidget; +class QHBoxLayout; +class ProfileEditorDialog : public QDialog { + Q_OBJECT +public: + ProfileEditorDialog(MetaFactory* fact, + const Profile& prof ); + ProfileEditorDialog(MetaFactory* fact ); + Profile profile()const; +private: + void initUI(); + MetaFactory* m_fact; + EditBase* m_base; + QTabWidget* m_tab; + QHBoxLayout* m_lay; + Profile m_prof; +}; + +#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 @@ -77,4 +77,17 @@ void ProfileManager::save( ) { } } - // FIXME save +} +void ProfileManager::setProfiles( const Profile::ValueList& list ) { + m_list = list; +}; +Profile ProfileManager::profile( const QString& name )const { + Profile prof; + Profile::ValueList::ConstIterator it; + for ( it = m_list.begin(); it != m_list.end(); ++it ) { + if ( name == (*it).name() ) { + prof = (*it); + break; + } + } + return prof; } 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 @@ -22,5 +22,7 @@ public: void add( const Profile& prof ); void remove( const Profile& prof ); + Profile profile(const QString& name )const; Session* fromProfile( const Profile& ); + void setProfiles( const Profile::ValueList& ); void save(); private: 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 @@ +<!DOCTYPE UI><UI> +<class>Settings</class> +<widget> + <class>QDialog</class> + <property stdset="1"> + <name>name</name> + <cstring>Settings</cstring> + </property> + <property stdset="1"> + <name>geometry</name> + <rect> + <x>0</x> + <y>0</y> + <width>596</width> + <height>480</height> + </rect> + </property> + <property stdset="1"> + <name>caption</name> + <string>Settings</string> + </property> +</widget> +</UI> |