author | kergoth <kergoth> | 2003-08-09 16:12:19 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 16:12:19 (UTC) |
commit | 1c58d1407f9584fedcdae390a04e2b37e5853361 (patch) (unidiff) | |
tree | 3c6e741c4d382d1a53c182930052b684d6e35b91 /noncore/apps/opie-console/profileeditordialog.cpp | |
parent | e3f4607edd0c1ca1434adb446df1d4a1d27c6a86 (diff) | |
download | opie-1c58d1407f9584fedcdae390a04e2b37e5853361.zip opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.gz opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/apps/opie-console/profileeditordialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index 6b607df..e2501a6 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -25,31 +25,31 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, | |||
25 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) | 25 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) |
26 | { | 26 | { |
27 | initUI(); | 27 | initUI(); |
28 | 28 | ||
29 | // Apply current profile | 29 | // Apply current profile |
30 | // plugin_plugin->load(profile); | 30 | // plugin_plugin->load(profile); |
31 | // ... (reset profile name line edit etc.) | 31 | // ... (reset profile name line edit etc.) |
32 | } | 32 | } |
33 | 33 | ||
34 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | 34 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) |
35 | : QDialog(0, 0, TRUE), m_fact( fact ) | 35 | : QDialog(0, 0, TRUE), m_fact( fact ) |
36 | { | 36 | { |
37 | // Default profile | 37 | // Default profile |
38 | m_prof = Profile("New Profile", "serial", "default", Profile::Black, Profile::White, Profile::VT102); | 38 | m_prof = Profile(tr("New Profile"), "serial", "default", Profile::Black, Profile::White, Profile::VT102); |
39 | 39 | ||
40 | initUI(); | 40 | initUI(); |
41 | 41 | ||
42 | // Apply current profile | 42 | // Apply current profile |
43 | // plugin_plugin->load(profile); | 43 | // plugin_plugin->load(profile); |
44 | } | 44 | } |
45 | 45 | ||
46 | Profile ProfileEditorDialog::profile() const | 46 | Profile ProfileEditorDialog::profile() const |
47 | { | 47 | { |
48 | return m_prof; | 48 | return m_prof; |
49 | } | 49 | } |
50 | 50 | ||
51 | void ProfileEditorDialog::initUI() | 51 | void ProfileEditorDialog::initUI() |
52 | { | 52 | { |
53 | m_con = m_term = m_key = 0l; | 53 | m_con = m_term = m_key = 0l; |
54 | 54 | ||
55 | 55 | ||
@@ -114,29 +114,29 @@ void ProfileEditorDialog::initUI() | |||
114 | QStringList list = m_fact->connectionWidgets(); | 114 | QStringList list = m_fact->connectionWidgets(); |
115 | QStringList::Iterator it; | 115 | QStringList::Iterator it; |
116 | for (it =list.begin(); it != list.end(); ++it ) { | 116 | for (it =list.begin(); it != list.end(); ++it ) { |
117 | m_conCmb->insertItem( (*it) ); | 117 | m_conCmb->insertItem( (*it) ); |
118 | } | 118 | } |
119 | list = m_fact->terminalWidgets(); | 119 | list = m_fact->terminalWidgets(); |
120 | for (it =list.begin(); it != list.end(); ++it ) { | 120 | for (it =list.begin(); it != list.end(); ++it ) { |
121 | m_termCmb->insertItem( (*it) ); | 121 | m_termCmb->insertItem( (*it) ); |
122 | } | 122 | } |
123 | 123 | ||
124 | // load profile values | 124 | // load profile values |
125 | m_name->setText(m_prof.name()); | 125 | m_name->setText(m_prof.name()); |
126 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); | ||
127 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); | ||
128 | slotKeyActivated( "Default Keyboard" ); | 126 | slotKeyActivated( "Default Keyboard" ); |
129 | setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); | 127 | setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); |
130 | setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); | 128 | setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); |
129 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); | ||
130 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); | ||
131 | m_autoConnect->setChecked(m_prof.autoConnect()); | 131 | m_autoConnect->setChecked(m_prof.autoConnect()); |
132 | 132 | ||
133 | 133 | ||
134 | // signal and slots | 134 | // signal and slots |
135 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), | 135 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), |
136 | this, SLOT(slotConActivated(const QString&) ) ); | 136 | this, SLOT(slotConActivated(const QString&) ) ); |
137 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), | 137 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), |
138 | this, SLOT(slotTermActivated(const QString& ) ) ); | 138 | this, SLOT(slotTermActivated(const QString& ) ) ); |
139 | 139 | ||
140 | } | 140 | } |
141 | 141 | ||
142 | ProfileEditorDialog::~ProfileEditorDialog() { | 142 | ProfileEditorDialog::~ProfileEditorDialog() { |
@@ -190,46 +190,49 @@ QCString ProfileEditorDialog::profType()const | |||
190 | void ProfileEditorDialog::slotConActivated( const QString& str ) { | 190 | void ProfileEditorDialog::slotConActivated( const QString& str ) { |
191 | 191 | ||
192 | delete m_con; | 192 | delete m_con; |
193 | 193 | ||
194 | m_con = m_fact->newConnectionPlugin( str, m_svCon->viewport() ); | 194 | m_con = m_fact->newConnectionPlugin( str, m_svCon->viewport() ); |
195 | 195 | ||
196 | if ( !m_con ) { | 196 | if ( !m_con ) { |
197 | m_con = new NoOptions( str, m_svCon->viewport(), "name"); | 197 | m_con = new NoOptions( str, m_svCon->viewport(), "name"); |
198 | } | 198 | } |
199 | 199 | ||
200 | // FIXME ugly hack right. Right solution would be to look into the layer and see if it | 200 | // FIXME ugly hack right. Right solution would be to look into the layer and see if it |
201 | // supports auto connect and then set it as prefered | 201 | // supports auto connect and then set it as prefered |
202 | //if ( ( )->layer()->supports()[0] == 1 ) { | ||
203 | if ( m_conCmb ->currentText() == tr("Local Console") ) { | 202 | if ( m_conCmb ->currentText() == tr("Local Console") ) { |
204 | m_autoConnect->setChecked( true ); | 203 | m_autoConnect->setChecked( true ); |
204 | m_prof.writeEntry("Terminal", Profile::Linux ); | ||
205 | slotTermActivated( m_fact->external (m_prof.terminalName() ) ); | ||
205 | } else { | 206 | } else { |
207 | m_prof.writeEntry("Terminal", Profile::VT102 ); | ||
208 | slotTermActivated( m_fact->external (m_prof.terminalName() ) ); | ||
206 | m_autoConnect->setChecked( false ); | 209 | m_autoConnect->setChecked( false ); |
207 | } | 210 | } |
208 | 211 | ||
209 | m_con->load( m_prof ); | 212 | m_con->load( m_prof ); |
210 | m_svCon->addChild( m_con ); | 213 | m_svCon->addChild( m_con ); |
211 | } | 214 | } |
212 | 215 | ||
213 | 216 | ||
214 | /* | 217 | /* |
215 | * we need to switch the widget | 218 | * we need to switch the widget |
216 | */ | 219 | */ |
217 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { | 220 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { |
218 | 221 | ||
219 | delete m_term; | 222 | delete m_term; |
220 | 223 | ||
221 | m_term = m_fact->newTerminalPlugin( str, m_svTerm->viewport() ); | 224 | m_term = m_fact->newTerminalPlugin( str, m_svTerm->viewport() ); |
222 | 225 | ||
223 | if (m_term) { | 226 | if ( m_term ) { |
224 | m_term->load( m_prof ); | 227 | m_term->load( m_prof ); |
225 | m_svTerm->addChild( m_term ); | 228 | m_svTerm->addChild( m_term ); |
226 | } | 229 | } |
227 | } | 230 | } |
228 | 231 | ||
229 | void ProfileEditorDialog::slotKeyActivated(const QString &str) { | 232 | void ProfileEditorDialog::slotKeyActivated(const QString &str) { |
230 | delete m_key; | 233 | delete m_key; |
231 | m_key = m_fact->newKeyboardPlugin( str, m_tabKey ); | 234 | m_key = m_fact->newKeyboardPlugin( str, m_tabKey ); |
232 | 235 | ||
233 | if (m_key) { | 236 | if (m_key) { |
234 | 237 | ||
235 | m_key->load(m_prof); | 238 | m_key->load(m_prof); |