summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/profileeditordialog.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/profileeditordialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index d124067..2dfc0fd 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -50,27 +50,29 @@ Profile ProfileEditorDialog::profile() const
50{ 50{
51 return m_prof; 51 return m_prof;
52} 52}
53 53
54void ProfileEditorDialog::initUI() 54void ProfileEditorDialog::initUI()
55{ 55{
56 m_con = m_term = 0l; 56 m_con = m_term = m_key = 0l;
57 57
58 QVBoxLayout *mainLayout = new QVBoxLayout( this ); 58 QVBoxLayout *mainLayout = new QVBoxLayout( this );
59 tabWidget = new OTabWidget( this ); 59 tabWidget = new OTabWidget( this );
60 tabWidget->setTabStyle(OTabWidget::TextTab); 60 tabWidget->setTabStyle(OTabWidget::TextTab);
61 mainLayout->add(tabWidget); 61 mainLayout->add(tabWidget);
62 62
63 /* base tabs */ 63 /* base tabs */
64 tabprof = new QWidget(this); 64 tabprof = new QWidget(this);
65 m_tabTerm = new QWidget(this); 65 m_tabTerm = new QWidget(this);
66 m_tabCon = new QWidget(this); 66 m_tabCon = new QWidget(this);
67 m_tabKey = new QWidget(this);
67 68
68 /* base layout for tabs */ 69 /* base layout for tabs */
69 m_layCon = new QHBoxLayout( m_tabCon , 2 ); 70 m_layCon = new QHBoxLayout( m_tabCon , 2 );
70 m_layTerm = new QHBoxLayout( m_tabTerm, 2 ); 71 m_layTerm = new QHBoxLayout( m_tabTerm, 2 );
72 m_layKey = new QHBoxLayout( m_tabKey, 2 );
71 73
72 // profile tab 74 // profile tab
73 75
74 QLabel *name = new QLabel(QObject::tr("Profile name"), tabprof); 76 QLabel *name = new QLabel(QObject::tr("Profile name"), tabprof);
75 m_name = new QLineEdit(tabprof); 77 m_name = new QLineEdit(tabprof);
76 QLabel *con = new QLabel(tr("Connection"), tabprof ); 78 QLabel *con = new QLabel(tr("Connection"), tabprof );
@@ -91,12 +93,13 @@ void ProfileEditorDialog::initUI()
91 vbox3->addStretch(1); 93 vbox3->addStretch(1);
92 94
93 m_showconntab = 0; 95 m_showconntab = 0;
94 tabWidget->addTab(tabprof, "", QObject::tr("Profile")); 96 tabWidget->addTab(tabprof, "", QObject::tr("Profile"));
95 //tabWidget->addTab(m_tabCon, "", QObject::tr("Connection")); 97 //tabWidget->addTab(m_tabCon, "", QObject::tr("Connection"));
96 tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal")); 98 tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal"));
99 tabWidget->addTab(m_tabKey, "", QObject::tr("Special Keys"));
97 tabWidget->setCurrentTab( tabprof ); 100 tabWidget->setCurrentTab( tabprof );
98 101
99 102
100 // fill the comboboxes 103 // fill the comboboxes
101 QStringList list = m_fact->connectionWidgets(); 104 QStringList list = m_fact->connectionWidgets();
102 QStringList::Iterator it; 105 QStringList::Iterator it;
@@ -109,12 +112,13 @@ void ProfileEditorDialog::initUI()
109 } 112 }
110 113
111 // load profile values 114 // load profile values
112 m_name->setText(m_prof.name()); 115 m_name->setText(m_prof.name());
113 slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); 116 slotConActivated( m_fact->external(m_prof.ioLayerName() ) );
114 slotTermActivated( m_fact->external(m_prof.terminalName() ) ); 117 slotTermActivated( m_fact->external(m_prof.terminalName() ) );
118 slotKeyActivated( "Default Keyboard" );
115 setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); 119 setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb );
116 setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); 120 setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb );
117 m_autoConnect->setChecked(m_prof.autoConnect()); 121 m_autoConnect->setChecked(m_prof.autoConnect());
118 122
119 123
120 // signal and slots 124 // signal and slots
@@ -147,12 +151,14 @@ void ProfileEditorDialog::accept()
147 m_prof.setAutoConnect( m_autoConnect->isChecked() ); 151 m_prof.setAutoConnect( m_autoConnect->isChecked() );
148 152
149 if (m_con ) 153 if (m_con )
150 m_con->save( m_prof ); 154 m_con->save( m_prof );
151 if (m_term ) 155 if (m_term )
152 m_term->save( m_prof ); 156 m_term->save( m_prof );
157 if (m_key)
158 m_key->save( m_prof );
153 159
154 QDialog::accept(); 160 QDialog::accept();
155} 161}
156 162
157 163
158QString ProfileEditorDialog::profName()const 164QString ProfileEditorDialog::profName()const
@@ -175,12 +181,13 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) {
175 delete m_con; 181 delete m_con;
176 m_con = m_fact->newConnectionPlugin( str, m_tabCon ); 182 m_con = m_fact->newConnectionPlugin( str, m_tabCon );
177 183
178 if ( m_con ) { 184 if ( m_con ) {
179 m_con->load( m_prof ); 185 m_con->load( m_prof );
180 m_layCon->addWidget( m_con ); 186 m_layCon->addWidget( m_con );
187
181 if(!m_showconntab) 188 if(!m_showconntab)
182 { 189 {
183 tabWidget->addTab( m_tabCon, "", QObject::tr("Connection") ); 190 tabWidget->addTab( m_tabCon, "", QObject::tr("Connection") );
184 tabWidget->setCurrentTab( tabprof ); 191 tabWidget->setCurrentTab( tabprof );
185 m_showconntab = 1; 192 m_showconntab = 1;
186 } 193 }
@@ -199,6 +206,17 @@ void ProfileEditorDialog::slotTermActivated( const QString& str ) {
199 if (m_term) { 206 if (m_term) {
200 m_term->load(m_prof ); 207 m_term->load(m_prof );
201 m_layTerm->addWidget( m_term ); 208 m_layTerm->addWidget( m_term );
202 } 209 }
203} 210}
204 211
212void ProfileEditorDialog::slotKeyActivated(const QString &str) {
213 delete m_key;
214 m_key = m_fact->newKeyboardPlugin( str, m_tabKey );
215
216 if (m_key) {
217
218 m_key->load(m_prof);
219 m_layKey->addWidget(m_key);
220 }
221
222}