Diffstat (limited to 'noncore/apps/opie-console/profileeditordialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index 5c5c2b3..c48ea53 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -1,15 +1,16 @@ | |||
1 | #include <qlayout.h> | 1 | #include <qlayout.h> |
2 | #include <qlineedit.h> | 2 | #include <qlineedit.h> |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qmessagebox.h> | 4 | #include <qmessagebox.h> |
5 | #include <qstringlist.h> | 5 | #include <qstringlist.h> |
6 | #include <qcombobox.h> | 6 | #include <qcombobox.h> |
7 | #include <qcheckbox.h> | ||
7 | 8 | ||
8 | 9 | ||
9 | #include "profileeditorplugins.h" | 10 | //#include "profileeditorplugins.h" |
10 | #include "metafactory.h" | 11 | #include "metafactory.h" |
11 | #include "profileeditordialog.h" | 12 | #include "profileeditordialog.h" |
12 | 13 | ||
13 | namespace { | 14 | namespace { |
14 | void setCurrent( const QString& str, QComboBox* bo ) { | 15 | void setCurrent( const QString& str, QComboBox* bo ) { |
15 | for (uint i = 0; i < bo->count(); i++ ) { | 16 | for (uint i = 0; i < bo->count(); i++ ) { |
@@ -75,21 +76,23 @@ void ProfileEditorDialog::initUI() | |||
75 | QLabel *name = new QLabel(QObject::tr("Profile name"), tabprof); | 76 | QLabel *name = new QLabel(QObject::tr("Profile name"), tabprof); |
76 | m_name = new QLineEdit(tabprof); | 77 | m_name = new QLineEdit(tabprof); |
77 | QLabel *con = new QLabel(tr("Connection"), tabprof ); | 78 | QLabel *con = new QLabel(tr("Connection"), tabprof ); |
78 | QLabel *term = new QLabel(tr("Terminal"), tabprof ); | 79 | QLabel *term = new QLabel(tr("Terminal"), tabprof ); |
79 | m_conCmb = new QComboBox( tabprof ); | 80 | m_conCmb = new QComboBox( tabprof ); |
80 | m_termCmb = new QComboBox( tabprof ); | 81 | m_termCmb = new QComboBox( tabprof ); |
82 | m_autoConnect = new QCheckBox(tr("Auto connect after load"), tabprof); | ||
81 | 83 | ||
82 | // layouting | 84 | // layouting |
83 | QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2); | 85 | QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2); |
84 | vbox3->add(name); | 86 | vbox3->add(name); |
85 | vbox3->add(m_name); | 87 | vbox3->add(m_name); |
86 | vbox3->add(con ); | 88 | vbox3->add(con ); |
87 | vbox3->add(m_conCmb ); | 89 | vbox3->add(m_conCmb ); |
88 | vbox3->add(term ); | 90 | vbox3->add(term ); |
89 | vbox3->add(m_termCmb ); | 91 | vbox3->add(m_termCmb ); |
92 | vbox3->add(m_autoConnect); | ||
90 | vbox3->addStretch(1); | 93 | vbox3->addStretch(1); |
91 | 94 | ||
92 | tabWidget->addTab(tabprof, "", QObject::tr("Profile")); | 95 | tabWidget->addTab(tabprof, "", QObject::tr("Profile")); |
93 | tabWidget->addTab(m_tabCon, "", QObject::tr("Connection")); | 96 | tabWidget->addTab(m_tabCon, "", QObject::tr("Connection")); |
94 | tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal")); | 97 | tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal")); |
95 | tabWidget->setCurrentTab( tabprof ); | 98 | tabWidget->setCurrentTab( tabprof ); |
@@ -109,12 +112,13 @@ void ProfileEditorDialog::initUI() | |||
109 | // load profile values | 112 | // load profile values |
110 | m_name->setText(m_prof.name()); | 113 | m_name->setText(m_prof.name()); |
111 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); | 114 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); |
112 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); | 115 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); |
113 | setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); | 116 | setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); |
114 | setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); | 117 | setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); |
118 | m_autoConnect->setChecked(m_prof.autoConnect()); | ||
115 | 119 | ||
116 | 120 | ||
117 | // signal and slots | 121 | // signal and slots |
118 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), | 122 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), |
119 | this, SLOT(slotConActivated(const QString&) ) ); | 123 | this, SLOT(slotConActivated(const QString&) ) ); |
120 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), | 124 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), |
@@ -138,12 +142,13 @@ void ProfileEditorDialog::accept() | |||
138 | //if(plugin_plugin) plugin_plugin->save(); | 142 | //if(plugin_plugin) plugin_plugin->save(); |
139 | 143 | ||
140 | // Save general values | 144 | // Save general values |
141 | m_prof.setName(profName()); | 145 | m_prof.setName(profName()); |
142 | m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) ); | 146 | m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) ); |
143 | m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) ); | 147 | m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) ); |
148 | m_prof.setAutoConnect( m_autoConnect->isChecked() ); | ||
144 | 149 | ||
145 | if (m_con ) | 150 | if (m_con ) |
146 | m_con->save( m_prof ); | 151 | m_con->save( m_prof ); |
147 | if (m_term ) | 152 | if (m_term ) |
148 | m_term->save( m_prof ); | 153 | m_term->save( m_prof ); |
149 | 154 | ||