Diffstat (limited to 'noncore/apps/opie-console/profileeditordialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index dc42d8b..8109070 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -1,33 +1,29 @@ | |||
1 | #include "profileeditordialog.h" | ||
2 | #include "metafactory.h" | ||
3 | #include "comboboxhelper.h" | ||
4 | |||
5 | |||
1 | #include <qlayout.h> | 6 | #include <qlayout.h> |
2 | #include <qlineedit.h> | 7 | #include <qlineedit.h> |
3 | #include <qlabel.h> | 8 | #include <qlabel.h> |
4 | #include <qmessagebox.h> | 9 | #include <qmessagebox.h> |
5 | #include <qcombobox.h> | 10 | #include <qcombobox.h> |
6 | #include <qcheckbox.h> | 11 | #include <qcheckbox.h> |
7 | #include <qscrollview.h> | 12 | #include <qscrollview.h> |
8 | 13 | ||
9 | #include "metafactory.h" | 14 | |
10 | #include "profileeditordialog.h" | ||
11 | 15 | ||
12 | using namespace Opie::Ui; | 16 | using namespace Opie::Ui; |
13 | namespace { | 17 | |
14 | void setCurrent( const QString& str, QComboBox* bo ) { | ||
15 | for (int i = 0; i < bo->count(); i++ ) { | ||
16 | if ( bo->text(i) == str ) { | ||
17 | bo->setCurrentItem( i ); | ||
18 | } | ||
19 | } | ||
20 | }; | ||
21 | } | ||
22 | 18 | ||
23 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, | 19 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, |
24 | const Profile& prof ) | 20 | const Profile& prof ) |
25 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) | 21 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) |
26 | { | 22 | { |
27 | initUI(); | 23 | initUI(); |
28 | 24 | ||
29 | // Apply current profile | 25 | // Apply current profile |
30 | // plugin_plugin->load(profile); | 26 | // plugin_plugin->load(profile); |
31 | // ... (reset profile name line edit etc.) | 27 | // ... (reset profile name line edit etc.) |
32 | } | 28 | } |
33 | 29 | ||
@@ -115,26 +111,26 @@ void ProfileEditorDialog::initUI() | |||
115 | QStringList::Iterator it; | 111 | QStringList::Iterator it; |
116 | for (it =list.begin(); it != list.end(); ++it ) { | 112 | for (it =list.begin(); it != list.end(); ++it ) { |
117 | m_conCmb->insertItem( (*it) ); | 113 | m_conCmb->insertItem( (*it) ); |
118 | } | 114 | } |
119 | list = m_fact->terminalWidgets(); | 115 | list = m_fact->terminalWidgets(); |
120 | for (it =list.begin(); it != list.end(); ++it ) { | 116 | for (it =list.begin(); it != list.end(); ++it ) { |
121 | m_termCmb->insertItem( (*it) ); | 117 | m_termCmb->insertItem( (*it) ); |
122 | } | 118 | } |
123 | 119 | ||
124 | // load profile values | 120 | // load profile values |
125 | m_name->setText(m_prof.name()); | 121 | m_name->setText(m_prof.name()); |
126 | slotKeyActivated( "Default Keyboard" ); | 122 | slotKeyActivated( "Default Keyboard" ); |
127 | setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); | 123 | ComboboxHelper::setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); |
128 | setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); | 124 | ComboboxHelper::setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); |
129 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); | 125 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); |
130 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); | 126 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); |
131 | m_autoConnect->setChecked(m_prof.autoConnect()); | 127 | m_autoConnect->setChecked(m_prof.autoConnect()); |
132 | 128 | ||
133 | 129 | ||
134 | // signal and slots | 130 | // signal and slots |
135 | connect(m_conCmb, SIGNAL(activated(const QString&) ), | 131 | connect(m_conCmb, SIGNAL(activated(const QString&) ), |
136 | this, SLOT(slotConActivated(const QString&) ) ); | 132 | this, SLOT(slotConActivated(const QString&) ) ); |
137 | connect(m_termCmb, SIGNAL(activated(const QString&) ), | 133 | connect(m_termCmb, SIGNAL(activated(const QString&) ), |
138 | this, SLOT(slotTermActivated(const QString&) ) ); | 134 | this, SLOT(slotTermActivated(const QString&) ) ); |
139 | 135 | ||
140 | } | 136 | } |