Diffstat (limited to 'noncore/apps/opie-console/profileeditordialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index 2dfc0fd..413e80b 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -10,20 +10,18 @@ | |||
10 | //#include "profileeditorplugins.h" | 10 | //#include "profileeditorplugins.h" |
11 | #include "metafactory.h" | 11 | #include "metafactory.h" |
12 | #include "profileeditordialog.h" | 12 | #include "profileeditordialog.h" |
13 | 13 | ||
14 | namespace { | 14 | namespace { |
15 | void setCurrent( const QString& str, QComboBox* bo ) { | 15 | void setCurrent( const QString& str, QComboBox* bo ) { |
16 | for (uint i = 0; i < bo->count(); i++ ) { | 16 | for (int i = 0; i < bo->count(); i++ ) { |
17 | if ( bo->text(i) == str ) { | 17 | if ( bo->text(i) == str ) { |
18 | bo->setCurrentItem( i ); | 18 | bo->setCurrentItem( i ); |
19 | } | 19 | } |
20 | } | 20 | } |
21 | } | 21 | }; |
22 | |||
23 | |||
24 | } | 22 | } |
25 | 23 | ||
26 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, | 24 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, |
27 | const Profile& prof ) | 25 | const Profile& prof ) |
28 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) | 26 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) |
29 | { | 27 | { |
@@ -45,13 +43,13 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | |||
45 | // Apply current profile | 43 | // Apply current profile |
46 | // plugin_plugin->load(profile); | 44 | // plugin_plugin->load(profile); |
47 | } | 45 | } |
48 | 46 | ||
49 | Profile ProfileEditorDialog::profile() const | 47 | Profile ProfileEditorDialog::profile() const |
50 | { | 48 | { |
51 | return m_prof; | 49 | return m_prof; |
52 | } | 50 | } |
53 | 51 | ||
54 | void ProfileEditorDialog::initUI() | 52 | void ProfileEditorDialog::initUI() |
55 | { | 53 | { |
56 | m_con = m_term = m_key = 0l; | 54 | m_con = m_term = m_key = 0l; |
57 | 55 | ||
@@ -178,26 +176,21 @@ QCString ProfileEditorDialog::profType()const | |||
178 | * we need to switch the widget | 176 | * we need to switch the widget |
179 | */ | 177 | */ |
180 | void ProfileEditorDialog::slotConActivated( const QString& str ) { | 178 | void ProfileEditorDialog::slotConActivated( const QString& str ) { |
181 | delete m_con; | 179 | delete m_con; |
182 | m_con = m_fact->newConnectionPlugin( str, m_tabCon ); | 180 | m_con = m_fact->newConnectionPlugin( str, m_tabCon ); |
183 | 181 | ||
184 | if ( m_con ) { | 182 | if ( !m_con ) { |
185 | m_con->load( m_prof ); | 183 | m_con = new NoOptions( str, m_tabCon, "name"); |
186 | m_layCon->addWidget( m_con ); | ||
187 | |||
188 | if(!m_showconntab) | ||
189 | { | ||
190 | tabWidget->addTab( m_tabCon, "", QObject::tr("Connection") ); | ||
191 | tabWidget->setCurrentTab( tabprof ); | ||
192 | m_showconntab = 1; | ||
193 | } | ||
194 | } else { | ||
195 | tabWidget->removePage( m_tabCon ); | ||
196 | m_showconntab = 0; | ||
197 | } | 184 | } |
185 | m_con->load( m_prof ); | ||
186 | m_layCon->addWidget( m_con ); | ||
187 | |||
188 | tabWidget->addTab( m_tabCon, "", QObject::tr("Connection") ); | ||
189 | tabWidget->setCurrentTab( tabprof ); | ||
190 | |||
198 | } | 191 | } |
199 | /* | 192 | /* |
200 | * we need to switch the widget | 193 | * we need to switch the widget |
201 | */ | 194 | */ |
202 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { | 195 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { |
203 | delete m_term; | 196 | delete m_term; |