summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/profileeditordialog.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/profileeditordialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp21
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
@@ -31,19 +31,19 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact,
31 // ... (reset profile name line edit etc.) 31 // ... (reset profile name line edit etc.)
32} 32}
33 33
34ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) 34ProfileEditorDialog::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
46Profile ProfileEditorDialog::profile() const 46Profile ProfileEditorDialog::profile() const
47{ 47{
48 return m_prof; 48 return m_prof;
49} 49}
@@ -120,17 +120,17 @@ void ProfileEditorDialog::initUI()
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&) ) );
@@ -196,16 +196,19 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) {
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}
@@ -217,13 +220,13 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) {
217void ProfileEditorDialog::slotTermActivated( const QString& str ) { 220void 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
229void ProfileEditorDialog::slotKeyActivated(const QString &str) { 232void ProfileEditorDialog::slotKeyActivated(const QString &str) {