Diffstat (limited to 'noncore/apps/opie-console/profileeditordialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 20 |
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 @@ -52,9 +52,9 @@ Profile ProfileEditorDialog::profile() const } void ProfileEditorDialog::initUI() { - m_con = m_term = 0l; + m_con = m_term = m_key = 0l; QVBoxLayout *mainLayout = new QVBoxLayout( this ); tabWidget = new OTabWidget( this ); tabWidget->setTabStyle(OTabWidget::TextTab); @@ -63,12 +63,14 @@ void ProfileEditorDialog::initUI() /* base tabs */ tabprof = new QWidget(this); m_tabTerm = new QWidget(this); m_tabCon = new QWidget(this); + m_tabKey = new QWidget(this); /* base layout for tabs */ m_layCon = new QHBoxLayout( m_tabCon , 2 ); m_layTerm = new QHBoxLayout( m_tabTerm, 2 ); + m_layKey = new QHBoxLayout( m_tabKey, 2 ); // profile tab QLabel *name = new QLabel(QObject::tr("Profile name"), tabprof); @@ -93,8 +95,9 @@ void ProfileEditorDialog::initUI() m_showconntab = 0; tabWidget->addTab(tabprof, "", QObject::tr("Profile")); //tabWidget->addTab(m_tabCon, "", QObject::tr("Connection")); tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal")); + tabWidget->addTab(m_tabKey, "", QObject::tr("Special Keys")); tabWidget->setCurrentTab( tabprof ); // fill the comboboxes @@ -111,8 +114,9 @@ void ProfileEditorDialog::initUI() // load profile values m_name->setText(m_prof.name()); slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); slotTermActivated( m_fact->external(m_prof.terminalName() ) ); + slotKeyActivated( "Default Keyboard" ); setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); m_autoConnect->setChecked(m_prof.autoConnect()); @@ -149,8 +153,10 @@ void ProfileEditorDialog::accept() if (m_con ) m_con->save( m_prof ); if (m_term ) m_term->save( m_prof ); + if (m_key) + m_key->save( m_prof ); QDialog::accept(); } @@ -177,8 +183,9 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) { if ( m_con ) { m_con->load( m_prof ); m_layCon->addWidget( m_con ); + if(!m_showconntab) { tabWidget->addTab( m_tabCon, "", QObject::tr("Connection") ); tabWidget->setCurrentTab( tabprof ); @@ -201,4 +208,15 @@ void ProfileEditorDialog::slotTermActivated( const QString& str ) { m_layTerm->addWidget( m_term ); } } +void ProfileEditorDialog::slotKeyActivated(const QString &str) { + delete m_key; + m_key = m_fact->newKeyboardPlugin( str, m_tabKey ); + + if (m_key) { + + m_key->load(m_prof); + m_layKey->addWidget(m_key); + } + +} |