-rw-r--r-- | noncore/apps/opie-console/default.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/opie-console/default.h | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/function_keyboard.cpp | 33 | ||||
-rw-r--r-- | noncore/apps/opie-console/function_keyboard.h | 16 | ||||
-rw-r--r-- | noncore/apps/opie-console/metafactory.cpp | 20 | ||||
-rw-r--r-- | noncore/apps/opie-console/metafactory.h | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/profiledialogwidget.cpp | 11 | ||||
-rw-r--r-- | noncore/apps/opie-console/profiledialogwidget.h | 11 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 20 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.h | 7 |
10 files changed, 123 insertions, 9 deletions
diff --git a/noncore/apps/opie-console/default.cpp b/noncore/apps/opie-console/default.cpp index 8b905e1..0160b56 100644 --- a/noncore/apps/opie-console/default.cpp +++ b/noncore/apps/opie-console/default.cpp @@ -11,2 +11,3 @@ #include "terminalwidget.h" +#include "function_keyboard.h" #include "MyPty.h" @@ -78,2 +79,7 @@ extern "C" { + // Function Keyboard Widget + ProfileDialogWidget* newKeyboardWidget(const QString& na, QWidget *wid) { + return new FunctionKeyboardConfig(na, wid); + } + /* // VT Emulations @@ -107,2 +113,4 @@ Default::Default( MetaFactory* fact ) { fact->addTerminalWidgetFactory( "default", QObject::tr("Default Terminal"), newTerminalWidget ); + fact->addKeyboardWidgetFactory( "defaultKeys", QObject::tr("Default Keyboard"), + newKeyboardWidget ); diff --git a/noncore/apps/opie-console/default.h b/noncore/apps/opie-console/default.h index b8cda03..5b542f5 100644 --- a/noncore/apps/opie-console/default.h +++ b/noncore/apps/opie-console/default.h @@ -27,2 +27,3 @@ extern "C" { ProfileDialogWidget* newTerminalWidget(const QString&, QWidget* ); + ProfileDialogWidget* newKeyboardWidget(const QString&, QWidget* ); diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index 4119ad4..fd20e99 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp @@ -5,2 +5,3 @@ #include <qapplication.h> +#include <qlayout.h> @@ -14,4 +15,4 @@ FunctionKeyboard::FunctionKeyboard(QWidget *parent) : conf.setGroup("keys"); - for (int r = 0; r < numRows; r++) - for (int c = 0; c < numCols; c++) { + for (uint r = 0; r < numRows; r++) + for (uint c = 0; c < numCols; c++) { @@ -61,4 +62,4 @@ void FunctionKeyboard::paintEvent(QPaintEvent *e) { - for (int r = 0; r < numRows; r++) { - for (int c = 0; c < numCols; c++) { + for (uint r = 0; r < numRows; r++) { + for (uint c = 0; c < numCols; c++) { @@ -157 +158,25 @@ void FunctionKeyboard::loadDefaults() { } + + +FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent) : + ProfileDialogKeyWidget(name, parent) { + + + FunctionKeyboard *kb = new FunctionKeyboard(this); + QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimentions"), this); + QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit"), this); + + QVBoxLayout *root = new QVBoxLayout(this, 2); + root->addWidget(kb); + root->addWidget(dimentions); + root->addWidget(editKey); +} +FunctionKeyboardConfig::~FunctionKeyboardConfig() { + +} +void FunctionKeyboardConfig::load (const Profile& prof) { + +} +void FunctionKeyboardConfig::save (Profile& prof) { + +} diff --git a/noncore/apps/opie-console/function_keyboard.h b/noncore/apps/opie-console/function_keyboard.h index 8d05e2b..2be74b4 100644 --- a/noncore/apps/opie-console/function_keyboard.h +++ b/noncore/apps/opie-console/function_keyboard.h @@ -6,3 +6,6 @@ #include <qpainter.h> +#include <qvbox.h> +#include <qgroupbox.h> #include <qmap.h> +#include "profiledialogwidget.h" @@ -66,2 +69,15 @@ private: +class FunctionKeyboardConfig : public ProfileDialogKeyWidget { + Q_OBJECT +public: + FunctionKeyboardConfig(const QString& name, QWidget *wid); + ~FunctionKeyboardConfig(); + + void load(const Profile&); + void save(Profile&); + +private: + +}; + #endif diff --git a/noncore/apps/opie-console/metafactory.cpp b/noncore/apps/opie-console/metafactory.cpp index 04a5dfa..0b43e17 100644 --- a/noncore/apps/opie-console/metafactory.cpp +++ b/noncore/apps/opie-console/metafactory.cpp @@ -20,2 +20,9 @@ void MetaFactory::addTerminalWidgetFactory( const QCString& name, } +void MetaFactory::addKeyboardWidgetFactory( const QCString& name, + const QString & str, + configWidget wid) { + m_strings.insert( str, name ); + m_keyFact.insert( str, wid ); + +} void MetaFactory::addIOLayerFactory( const QCString& name, @@ -130,2 +137,15 @@ ProfileDialogWidget *MetaFactory::newTerminalPlugin( const QString& str, QWidget } +ProfileDialogWidget *MetaFactory::newKeyboardPlugin( const QString& str, QWidget *parent) { + + if (str.isEmpty() ) + return 0l; + ProfileDialogWidget* wid = 0l; + + QMap<QString, configWidget>::Iterator it; + it = m_keyFact.find( str ); + if ( it != m_keyFact.end() ) { + wid = (*(it.data() ) )(str,parent); + } + return wid; +} EmulationLayer* MetaFactory::newEmulationLayer( const QString& str, WidgetLayer* wid) { diff --git a/noncore/apps/opie-console/metafactory.h b/noncore/apps/opie-console/metafactory.h index d6aa5e2..f89136c 100644 --- a/noncore/apps/opie-console/metafactory.h +++ b/noncore/apps/opie-console/metafactory.h @@ -42,2 +42,5 @@ public: configWidget ); + void addKeyboardWidgetFactory ( const QCString& internalName, + const QString& name, + configWidget ); @@ -85,2 +88,3 @@ public: ProfileDialogWidget* newTerminalPlugin( const QString&, QWidget* ); + ProfileDialogWidget* newKeyboardPlugin( const QString&, QWidget* ); EmulationLayer* newEmulationLayer(const QString&, WidgetLayer* ); @@ -107,2 +111,3 @@ private: QMap<QString, configWidget> m_termFact; + QMap<QString, configWidget> m_keyFact; QMap<QString, iolayer> m_layerFact; diff --git a/noncore/apps/opie-console/profiledialogwidget.cpp b/noncore/apps/opie-console/profiledialogwidget.cpp index 24d59bf..caad998 100644 --- a/noncore/apps/opie-console/profiledialogwidget.cpp +++ b/noncore/apps/opie-console/profiledialogwidget.cpp @@ -32 +32,12 @@ ProfileDialogWidget::Type ProfileDialogConnectionWidget::type()const { } +ProfileDialogKeyWidget::ProfileDialogKeyWidget( const QString &na, + QWidget *parent, + const char *name) + : ProfileDialogWidget(na, parent, name ) +{ +} +ProfileDialogKeyWidget::~ProfileDialogKeyWidget() { +} +ProfileDialogWidget::Type ProfileDialogKeyWidget::type() const{ + return Keyboard; +} diff --git a/noncore/apps/opie-console/profiledialogwidget.h b/noncore/apps/opie-console/profiledialogwidget.h index 5d279e6..9d2d5ec 100644 --- a/noncore/apps/opie-console/profiledialogwidget.h +++ b/noncore/apps/opie-console/profiledialogwidget.h @@ -12,3 +12,4 @@ public: Connection, - Terminal + Terminal, + Keyboard }; @@ -48,2 +49,10 @@ public: }; +class ProfileDialogKeyWidget : public ProfileDialogWidget { + Q_OBJECT +public: + ProfileDialogKeyWidget( const QString &name, QWidget* parent, + const char *name =0l); + ~ProfileDialogKeyWidget(); + Type type() const; +}; 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 @@ -55,3 +55,3 @@ void ProfileEditorDialog::initUI() { - m_con = m_term = 0l; + m_con = m_term = m_key = 0l; @@ -66,2 +66,3 @@ void ProfileEditorDialog::initUI() m_tabCon = new QWidget(this); + m_tabKey = new QWidget(this); @@ -70,2 +71,3 @@ void ProfileEditorDialog::initUI() m_layTerm = new QHBoxLayout( m_tabTerm, 2 ); + m_layKey = new QHBoxLayout( m_tabKey, 2 ); @@ -96,2 +98,3 @@ void ProfileEditorDialog::initUI() tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal")); + tabWidget->addTab(m_tabKey, "", QObject::tr("Special Keys")); tabWidget->setCurrentTab( tabprof ); @@ -114,2 +117,3 @@ void ProfileEditorDialog::initUI() slotTermActivated( m_fact->external(m_prof.terminalName() ) ); + slotKeyActivated( "Default Keyboard" ); setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); @@ -152,2 +156,4 @@ void ProfileEditorDialog::accept() m_term->save( m_prof ); + if (m_key) + m_key->save( m_prof ); @@ -180,2 +186,3 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) { m_layCon->addWidget( m_con ); + if(!m_showconntab) @@ -204 +211,12 @@ void ProfileEditorDialog::slotTermActivated( const QString& str ) { +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); + } + +} diff --git a/noncore/apps/opie-console/profileeditordialog.h b/noncore/apps/opie-console/profileeditordialog.h index cbda689..6216660 100644 --- a/noncore/apps/opie-console/profileeditordialog.h +++ b/noncore/apps/opie-console/profileeditordialog.h @@ -35,2 +35,3 @@ private slots: void slotTermActivated( const QString& ); + void slotKeyActivated(const QString&); private: @@ -48,5 +49,5 @@ private: - QWidget *m_tabCon, *m_tabTerm; - ProfileDialogWidget* m_con, *m_term; - QHBoxLayout *m_layCon, *m_layTerm; + QWidget *m_tabCon, *m_tabTerm, *m_tabKey; + ProfileDialogWidget* m_con, *m_term, *m_key; + QHBoxLayout *m_layCon, *m_layTerm, *m_layKey; OTabWidget *tabWidget; |