author | hash <hash> | 2002-10-20 14:04:33 (UTC) |
---|---|---|
committer | hash <hash> | 2002-10-20 14:04:33 (UTC) |
commit | 6924185b50abfa448daa16a9f7cb6e532ec77ff9 (patch) (unidiff) | |
tree | cd00862fc27c3739e7658e6dfaa39624197d8452 /noncore | |
parent | 97be4ef8e0579791095b2383e942cc53dd1e7fba (diff) | |
download | opie-6924185b50abfa448daa16a9f7cb6e532ec77ff9.zip opie-6924185b50abfa448daa16a9f7cb6e532ec77ff9.tar.gz opie-6924185b50abfa448daa16a9f7cb6e532ec77ff9.tar.bz2 |
added preliminary support for configuring the keyboard for each profile.
-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 | |||
@@ -1,23 +1,24 @@ | |||
1 | #include "io_serial.h" | 1 | #include "io_serial.h" |
2 | #include "io_irda.h" | 2 | #include "io_irda.h" |
3 | #include "io_bt.h" | 3 | #include "io_bt.h" |
4 | #include "io_modem.h" | 4 | #include "io_modem.h" |
5 | #include "filetransfer.h" | 5 | #include "filetransfer.h" |
6 | #include "filereceive.h" | 6 | #include "filereceive.h" |
7 | #include "serialconfigwidget.h" | 7 | #include "serialconfigwidget.h" |
8 | #include "irdaconfigwidget.h" | 8 | #include "irdaconfigwidget.h" |
9 | #include "btconfigwidget.h" | 9 | #include "btconfigwidget.h" |
10 | #include "modemconfigwidget.h" | 10 | #include "modemconfigwidget.h" |
11 | #include "terminalwidget.h" | 11 | #include "terminalwidget.h" |
12 | #include "function_keyboard.h" | ||
12 | #include "MyPty.h" | 13 | #include "MyPty.h" |
13 | 14 | ||
14 | #include "default.h" | 15 | #include "default.h" |
15 | 16 | ||
16 | extern "C" { | 17 | extern "C" { |
17 | // FILE Transfer Stuff | 18 | // FILE Transfer Stuff |
18 | FileTransferLayer* newSZTransfer(IOLayer* lay) { | 19 | FileTransferLayer* newSZTransfer(IOLayer* lay) { |
19 | return new FileTransfer( FileTransfer::SZ, lay ); | 20 | return new FileTransfer( FileTransfer::SZ, lay ); |
20 | } | 21 | } |
21 | FileTransferLayer* newSYTransfer(IOLayer* lay) { | 22 | FileTransferLayer* newSYTransfer(IOLayer* lay) { |
22 | return new FileTransfer( FileTransfer::SY, lay ); | 23 | return new FileTransfer( FileTransfer::SY, lay ); |
23 | } | 24 | } |
@@ -67,24 +68,29 @@ extern "C" { | |||
67 | return new BTConfigWidget(str, wid ); | 68 | return new BTConfigWidget(str, wid ); |
68 | } | 69 | } |
69 | ProfileDialogWidget* newConsoleWid( const QString& str, QWidget* wid ) { | 70 | ProfileDialogWidget* newConsoleWid( const QString& str, QWidget* wid ) { |
70 | return 0l; | 71 | return 0l; |
71 | } | 72 | } |
72 | 73 | ||
73 | 74 | ||
74 | // Terminal Widget(s) | 75 | // Terminal Widget(s) |
75 | ProfileDialogWidget* newTerminalWidget(const QString& na, QWidget* wid) { | 76 | ProfileDialogWidget* newTerminalWidget(const QString& na, QWidget* wid) { |
76 | return new TerminalWidget(na, wid,0 ); | 77 | return new TerminalWidget(na, wid,0 ); |
77 | } | 78 | } |
78 | 79 | ||
80 | // Function Keyboard Widget | ||
81 | ProfileDialogWidget* newKeyboardWidget(const QString& na, QWidget *wid) { | ||
82 | return new FunctionKeyboardConfig(na, wid); | ||
83 | } | ||
84 | |||
79 | /* // VT Emulations | 85 | /* // VT Emulations |
80 | EmulationLayer* newVT102( WidgetLayer* wid ) { | 86 | EmulationLayer* newVT102( WidgetLayer* wid ) { |
81 | return new Vt102Emulation( wid ); | 87 | return new Vt102Emulation( wid ); |
82 | } | 88 | } |
83 | */ | 89 | */ |
84 | }; | 90 | }; |
85 | 91 | ||
86 | Default::Default( MetaFactory* fact ) { | 92 | Default::Default( MetaFactory* fact ) { |
87 | fact->addFileTransferLayer( "SZ", QObject::tr("Z-Modem"), newSZTransfer ); | 93 | fact->addFileTransferLayer( "SZ", QObject::tr("Z-Modem"), newSZTransfer ); |
88 | fact->addFileTransferLayer( "SY", QObject::tr("Y-Modem"), newSYTransfer ); | 94 | fact->addFileTransferLayer( "SY", QObject::tr("Y-Modem"), newSYTransfer ); |
89 | fact->addFileTransferLayer( "SX", QObject::tr("X-Modem"), newSXTransfer ); | 95 | fact->addFileTransferLayer( "SX", QObject::tr("X-Modem"), newSXTransfer ); |
90 | 96 | ||
@@ -96,18 +102,20 @@ Default::Default( MetaFactory* fact ) { | |||
96 | fact->addIOLayerFactory( "irda", QObject::tr("Infrared"), newIrDaLayer ); | 102 | fact->addIOLayerFactory( "irda", QObject::tr("Infrared"), newIrDaLayer ); |
97 | fact->addIOLayerFactory( "bt", QObject::tr("Bluetooth"), newBTLayer ); | 103 | fact->addIOLayerFactory( "bt", QObject::tr("Bluetooth"), newBTLayer ); |
98 | fact->addIOLayerFactory( "modem", QObject::tr("Modem"), newModemLayer ); | 104 | fact->addIOLayerFactory( "modem", QObject::tr("Modem"), newModemLayer ); |
99 | fact->addIOLayerFactory( "console", QObject::tr("Console"), newConsole ); | 105 | fact->addIOLayerFactory( "console", QObject::tr("Console"), newConsole ); |
100 | 106 | ||
101 | fact->addConnectionWidgetFactory( "serial", QObject::tr("Serial"), newSerialWidget ); | 107 | fact->addConnectionWidgetFactory( "serial", QObject::tr("Serial"), newSerialWidget ); |
102 | fact->addConnectionWidgetFactory( "irda", QObject::tr("Infrared"), newIrDaWidget ); | 108 | fact->addConnectionWidgetFactory( "irda", QObject::tr("Infrared"), newIrDaWidget ); |
103 | fact->addConnectionWidgetFactory( "modem", QObject::tr("Modem"), newModemWidget ); | 109 | fact->addConnectionWidgetFactory( "modem", QObject::tr("Modem"), newModemWidget ); |
104 | fact->addConnectionWidgetFactory( "bt", QObject::tr("Bluetooth"), newBTWidget ); | 110 | fact->addConnectionWidgetFactory( "bt", QObject::tr("Bluetooth"), newBTWidget ); |
105 | fact->addConnectionWidgetFactory( "console", QObject::tr("Console"), newConsoleWid ); | 111 | fact->addConnectionWidgetFactory( "console", QObject::tr("Console"), newConsoleWid ); |
106 | 112 | ||
107 | fact->addTerminalWidgetFactory( "default", QObject::tr("Default Terminal"), newTerminalWidget ); | 113 | fact->addTerminalWidgetFactory( "default", QObject::tr("Default Terminal"), newTerminalWidget ); |
114 | fact->addKeyboardWidgetFactory( "defaultKeys", QObject::tr("Default Keyboard"), | ||
115 | newKeyboardWidget ); | ||
108 | 116 | ||
109 | // fact->addEmulationLayer( "default", QObject::tr("Default Terminal"), newVT102 ); | 117 | // fact->addEmulationLayer( "default", QObject::tr("Default Terminal"), newVT102 ); |
110 | } | 118 | } |
111 | Default::~Default() { | 119 | Default::~Default() { |
112 | 120 | ||
113 | } | 121 | } |
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 | |||
@@ -16,24 +16,25 @@ extern "C" { | |||
16 | 16 | ||
17 | IOLayer* newSerialLayer(const Profile&); | 17 | IOLayer* newSerialLayer(const Profile&); |
18 | IOLayer* newBTLayer(const Profile& ); | 18 | IOLayer* newBTLayer(const Profile& ); |
19 | IOLayer* newIrDaLayer(const Profile& ); | 19 | IOLayer* newIrDaLayer(const Profile& ); |
20 | IOLayer* newConsole(const Profile& ); | 20 | IOLayer* newConsole(const Profile& ); |
21 | 21 | ||
22 | ProfileDialogWidget* newSerialWidget(const QString&, QWidget* ); | 22 | ProfileDialogWidget* newSerialWidget(const QString&, QWidget* ); |
23 | ProfileDialogWidget* newIrDaWidget (const QString&, QWidget* ); | 23 | ProfileDialogWidget* newIrDaWidget (const QString&, QWidget* ); |
24 | ProfileDialogWidget* newBTWidget (const QString&, QWidget* ); | 24 | ProfileDialogWidget* newBTWidget (const QString&, QWidget* ); |
25 | ProfileDialogWidget* newConsoleWid (const QString&, QWidget* ); | 25 | ProfileDialogWidget* newConsoleWid (const QString&, QWidget* ); |
26 | 26 | ||
27 | ProfileDialogWidget* newTerminalWidget(const QString&, QWidget* ); | 27 | ProfileDialogWidget* newTerminalWidget(const QString&, QWidget* ); |
28 | ProfileDialogWidget* newKeyboardWidget(const QString&, QWidget* ); | ||
28 | 29 | ||
29 | // EmulationLayer* newVT102( WidgetLayer* ); | 30 | // EmulationLayer* newVT102( WidgetLayer* ); |
30 | }; | 31 | }; |
31 | 32 | ||
32 | class MetaFactory; | 33 | class MetaFactory; |
33 | struct Default { | 34 | struct Default { |
34 | public: | 35 | public: |
35 | Default(MetaFactory* ); | 36 | Default(MetaFactory* ); |
36 | ~Default(); | 37 | ~Default(); |
37 | }; | 38 | }; |
38 | 39 | ||
39 | 40 | ||
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 | |||
@@ -1,28 +1,29 @@ | |||
1 | #include "function_keyboard.h" | 1 | #include "function_keyboard.h" |
2 | #include <qsizepolicy.h> | 2 | #include <qsizepolicy.h> |
3 | #include <qevent.h> | 3 | #include <qevent.h> |
4 | #include <qwindowsystem_qws.h> | 4 | #include <qwindowsystem_qws.h> |
5 | #include <qapplication.h> | 5 | #include <qapplication.h> |
6 | #include <qlayout.h> | ||
6 | 7 | ||
7 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : | 8 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : |
8 | QFrame(parent), numRows(2), numCols(11), | 9 | QFrame(parent), numRows(2), numCols(11), |
9 | pressedRow(0), pressedCol(0) { | 10 | pressedRow(0), pressedCol(0) { |
10 | 11 | ||
11 | setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); | 12 | setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); |
12 | 13 | ||
13 | Config conf("opie-console-keys"); | 14 | Config conf("opie-console-keys"); |
14 | conf.setGroup("keys"); | 15 | conf.setGroup("keys"); |
15 | for (int r = 0; r < numRows; r++) | 16 | for (uint r = 0; r < numRows; r++) |
16 | for (int c = 0; c < numCols; c++) { | 17 | for (uint c = 0; c < numCols; c++) { |
17 | 18 | ||
18 | QString handle = "r" + QString::number(r) + "c" + QString::number(c); | 19 | QString handle = "r" + QString::number(r) + "c" + QString::number(c); |
19 | QStringList value_list = conf.readListEntry( handle, '|'); | 20 | QStringList value_list = conf.readListEntry( handle, '|'); |
20 | 21 | ||
21 | if (value_list.isEmpty()) continue; | 22 | if (value_list.isEmpty()) continue; |
22 | 23 | ||
23 | keys.insert( | 24 | keys.insert( |
24 | 25 | ||
25 | handle, | 26 | handle, |
26 | FKey (value_list[0], value_list[1].toUShort(), value_list[2].toUShort()) | 27 | FKey (value_list[0], value_list[1].toUShort(), value_list[2].toUShort()) |
27 | ); | 28 | ); |
28 | } | 29 | } |
@@ -50,26 +51,26 @@ void FunctionKeyboard::paintEvent(QPaintEvent *e) { | |||
50 | 51 | ||
51 | p.drawLine((int)i, 0, (int)i, height()); | 52 | p.drawLine((int)i, 0, (int)i, height()); |
52 | } | 53 | } |
53 | 54 | ||
54 | // sometimes the last line doesnt get drawn | 55 | // sometimes the last line doesnt get drawn |
55 | p.drawLine(width() -1, 0, width() -1, height()); | 56 | p.drawLine(width() -1, 0, width() -1, height()); |
56 | 57 | ||
57 | for (int i = 0; i <= height(); i += keyHeight) { | 58 | for (int i = 0; i <= height(); i += keyHeight) { |
58 | 59 | ||
59 | p.drawLine(0, i, width(), i); | 60 | p.drawLine(0, i, width(), i); |
60 | } | 61 | } |
61 | 62 | ||
62 | for (int r = 0; r < numRows; r++) { | 63 | for (uint r = 0; r < numRows; r++) { |
63 | for (int c = 0; c < numCols; c++) { | 64 | for (uint c = 0; c < numCols; c++) { |
64 | 65 | ||
65 | QString handle = "r" + QString::number(r) + "c" + QString::number(c); | 66 | QString handle = "r" + QString::number(r) + "c" + QString::number(c); |
66 | if (keys.contains(handle)) { | 67 | if (keys.contains(handle)) { |
67 | 68 | ||
68 | p.drawText( | 69 | p.drawText( |
69 | c * keyWidth + 1, r * keyHeight + 1, | 70 | c * keyWidth + 1, r * keyHeight + 1, |
70 | keyWidth, keyHeight, | 71 | keyWidth, keyHeight, |
71 | Qt::AlignHCenter | Qt::AlignVCenter, | 72 | Qt::AlignHCenter | Qt::AlignVCenter, |
72 | keys[handle].getL() | 73 | keys[handle].getL() |
73 | ); | 74 | ); |
74 | } | 75 | } |
75 | } | 76 | } |
@@ -146,12 +147,36 @@ void FunctionKeyboard::loadDefaults() { | |||
146 | keys.insert( "r0c6", FKey ("F7", 4149, 0)); | 147 | keys.insert( "r0c6", FKey ("F7", 4149, 0)); |
147 | keys.insert( "r0c7", FKey ("F8", 4150, 0)); | 148 | keys.insert( "r0c7", FKey ("F8", 4150, 0)); |
148 | keys.insert( "r0c8", FKey ("F9", 4151, 0)); | 149 | keys.insert( "r0c8", FKey ("F9", 4151, 0)); |
149 | keys.insert( "r0c9", FKey ("F10", 4152, 0)); | 150 | keys.insert( "r0c9", FKey ("F10", 4152, 0)); |
150 | keys.insert( "r0c10", FKey ("F11", 4153, 0)); | 151 | keys.insert( "r0c10", FKey ("F11", 4153, 0)); |
151 | 152 | ||
152 | keys.insert( "r1c7", FKey ("Ho", 4112, 0)); | 153 | keys.insert( "r1c7", FKey ("Ho", 4112, 0)); |
153 | keys.insert( "r1c8", FKey ("End", 4113, 0)); | 154 | keys.insert( "r1c8", FKey ("End", 4113, 0)); |
154 | keys.insert( "r1c9", FKey ("PU", 4118, 0)); | 155 | keys.insert( "r1c9", FKey ("PU", 4118, 0)); |
155 | keys.insert( "r1c10", FKey ("PD", 4119, 0)); | 156 | keys.insert( "r1c10", FKey ("PD", 4119, 0)); |
156 | 157 | ||
157 | } | 158 | } |
159 | |||
160 | |||
161 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent) : | ||
162 | ProfileDialogKeyWidget(name, parent) { | ||
163 | |||
164 | |||
165 | FunctionKeyboard *kb = new FunctionKeyboard(this); | ||
166 | QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimentions"), this); | ||
167 | QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit"), this); | ||
168 | |||
169 | QVBoxLayout *root = new QVBoxLayout(this, 2); | ||
170 | root->addWidget(kb); | ||
171 | root->addWidget(dimentions); | ||
172 | root->addWidget(editKey); | ||
173 | } | ||
174 | FunctionKeyboardConfig::~FunctionKeyboardConfig() { | ||
175 | |||
176 | } | ||
177 | void FunctionKeyboardConfig::load (const Profile& prof) { | ||
178 | |||
179 | } | ||
180 | void FunctionKeyboardConfig::save (Profile& prof) { | ||
181 | |||
182 | } | ||
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 | |||
@@ -1,19 +1,22 @@ | |||
1 | #ifndef OPIE_FUNCTION_KEYBOARD_H | 1 | #ifndef OPIE_FUNCTION_KEYBOARD_H |
2 | #define OPIE_FUNCTION_KEYBOARD_H | 2 | #define OPIE_FUNCTION_KEYBOARD_H |
3 | 3 | ||
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | #include <qframe.h> | 5 | #include <qframe.h> |
6 | #include <qpainter.h> | 6 | #include <qpainter.h> |
7 | #include <qvbox.h> | ||
8 | #include <qgroupbox.h> | ||
7 | #include <qmap.h> | 9 | #include <qmap.h> |
10 | #include "profiledialogwidget.h" | ||
8 | 11 | ||
9 | class FKey { | 12 | class FKey { |
10 | 13 | ||
11 | public: | 14 | public: |
12 | 15 | ||
13 | FKey(): qcode(0), unicode(0) {}; | 16 | FKey(): qcode(0), unicode(0) {}; |
14 | FKey(const QString &l, ushort q, ushort u): label(l), qcode(q), unicode(u) {}; | 17 | FKey(const QString &l, ushort q, ushort u): label(l), qcode(q), unicode(u) {}; |
15 | 18 | ||
16 | QString getL() { return label; } | 19 | QString getL() { return label; } |
17 | ushort getQ() { return qcode; } | 20 | ushort getQ() { return qcode; } |
18 | ushort getU() { return unicode; } | 21 | ushort getU() { return unicode; } |
19 | 22 | ||
@@ -55,13 +58,26 @@ private: | |||
55 | 58 | ||
56 | uint numRows; | 59 | uint numRows; |
57 | uint numCols; | 60 | uint numCols; |
58 | uint keyHeight; | 61 | uint keyHeight; |
59 | double keyWidth; // decimal point matters! | 62 | double keyWidth; // decimal point matters! |
60 | 63 | ||
61 | int pressedRow, pressedCol; | 64 | int pressedRow, pressedCol; |
62 | 65 | ||
63 | QObject *parent; | 66 | QObject *parent; |
64 | 67 | ||
65 | }; | 68 | }; |
66 | 69 | ||
70 | class FunctionKeyboardConfig : public ProfileDialogKeyWidget { | ||
71 | Q_OBJECT | ||
72 | public: | ||
73 | FunctionKeyboardConfig(const QString& name, QWidget *wid); | ||
74 | ~FunctionKeyboardConfig(); | ||
75 | |||
76 | void load(const Profile&); | ||
77 | void save(Profile&); | ||
78 | |||
79 | private: | ||
80 | |||
81 | }; | ||
82 | |||
67 | #endif | 83 | #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 | |||
@@ -9,24 +9,31 @@ MetaFactory::~MetaFactory() { | |||
9 | void MetaFactory::addConnectionWidgetFactory( const QCString& name, | 9 | void MetaFactory::addConnectionWidgetFactory( const QCString& name, |
10 | const QString& str, | 10 | const QString& str, |
11 | configWidget wid) { | 11 | configWidget wid) { |
12 | m_strings.insert( str, name ); | 12 | m_strings.insert( str, name ); |
13 | m_conFact.insert( str, wid ); | 13 | m_conFact.insert( str, wid ); |
14 | } | 14 | } |
15 | void MetaFactory::addTerminalWidgetFactory( const QCString& name, | 15 | void MetaFactory::addTerminalWidgetFactory( const QCString& name, |
16 | const QString& str, | 16 | const QString& str, |
17 | configWidget wid ) { | 17 | configWidget wid ) { |
18 | m_strings.insert( str, name ); | 18 | m_strings.insert( str, name ); |
19 | m_termFact.insert( str, wid ); | 19 | m_termFact.insert( str, wid ); |
20 | } | 20 | } |
21 | void MetaFactory::addKeyboardWidgetFactory( const QCString& name, | ||
22 | const QString & str, | ||
23 | configWidget wid) { | ||
24 | m_strings.insert( str, name ); | ||
25 | m_keyFact.insert( str, wid ); | ||
26 | |||
27 | } | ||
21 | void MetaFactory::addIOLayerFactory( const QCString& name, | 28 | void MetaFactory::addIOLayerFactory( const QCString& name, |
22 | const QString& str, | 29 | const QString& str, |
23 | iolayer lay) { | 30 | iolayer lay) { |
24 | m_strings.insert( str, name ); | 31 | m_strings.insert( str, name ); |
25 | m_layerFact.insert( str, lay ); | 32 | m_layerFact.insert( str, lay ); |
26 | } | 33 | } |
27 | void MetaFactory::addFileTransferLayer( const QCString& name, | 34 | void MetaFactory::addFileTransferLayer( const QCString& name, |
28 | const QString& str, | 35 | const QString& str, |
29 | filelayer lay) { | 36 | filelayer lay) { |
30 | m_strings.insert(str, name ); | 37 | m_strings.insert(str, name ); |
31 | m_fileFact.insert( str, lay ); | 38 | m_fileFact.insert( str, lay ); |
32 | } | 39 | } |
@@ -119,24 +126,37 @@ ProfileDialogWidget *MetaFactory::newConnectionPlugin ( const QString& str, QWid | |||
119 | ProfileDialogWidget *MetaFactory::newTerminalPlugin( const QString& str, QWidget *parent) { | 126 | ProfileDialogWidget *MetaFactory::newTerminalPlugin( const QString& str, QWidget *parent) { |
120 | if (str.isEmpty() ) | 127 | if (str.isEmpty() ) |
121 | return 0l; | 128 | return 0l; |
122 | ProfileDialogWidget* wid = 0l; | 129 | ProfileDialogWidget* wid = 0l; |
123 | 130 | ||
124 | QMap<QString, configWidget>::Iterator it; | 131 | QMap<QString, configWidget>::Iterator it; |
125 | it = m_termFact.find( str ); | 132 | it = m_termFact.find( str ); |
126 | if ( it != m_termFact.end() ) { | 133 | if ( it != m_termFact.end() ) { |
127 | wid = (*(it.data() ) )(str,parent); | 134 | wid = (*(it.data() ) )(str,parent); |
128 | } | 135 | } |
129 | return wid; | 136 | return wid; |
130 | } | 137 | } |
138 | ProfileDialogWidget *MetaFactory::newKeyboardPlugin( const QString& str, QWidget *parent) { | ||
139 | |||
140 | if (str.isEmpty() ) | ||
141 | return 0l; | ||
142 | ProfileDialogWidget* wid = 0l; | ||
143 | |||
144 | QMap<QString, configWidget>::Iterator it; | ||
145 | it = m_keyFact.find( str ); | ||
146 | if ( it != m_keyFact.end() ) { | ||
147 | wid = (*(it.data() ) )(str,parent); | ||
148 | } | ||
149 | return wid; | ||
150 | } | ||
131 | EmulationLayer* MetaFactory::newEmulationLayer( const QString& str, WidgetLayer* wid) { | 151 | EmulationLayer* MetaFactory::newEmulationLayer( const QString& str, WidgetLayer* wid) { |
132 | EmulationLayer* lay = 0l; | 152 | EmulationLayer* lay = 0l; |
133 | 153 | ||
134 | QMap<QString, emulationLayer>::Iterator it; | 154 | QMap<QString, emulationLayer>::Iterator it; |
135 | it = m_emu.find( str ); | 155 | it = m_emu.find( str ); |
136 | if ( it != m_emu.end() ) { | 156 | if ( it != m_emu.end() ) { |
137 | lay = (*(it.data() ) )(wid); | 157 | lay = (*(it.data() ) )(wid); |
138 | } | 158 | } |
139 | 159 | ||
140 | return lay; | 160 | return lay; |
141 | } | 161 | } |
142 | FileTransferLayer* MetaFactory::newFileTransfer(const QString& str, IOLayer* lay ) { | 162 | FileTransferLayer* MetaFactory::newFileTransfer(const QString& str, IOLayer* lay ) { |
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 | |||
@@ -31,24 +31,27 @@ public: | |||
31 | ~MetaFactory(); | 31 | ~MetaFactory(); |
32 | 32 | ||
33 | /** | 33 | /** |
34 | * add a ProfileDialogWidget to the factory | 34 | * add a ProfileDialogWidget to the factory |
35 | * name is the name shown to the user | 35 | * name is the name shown to the user |
36 | */ | 36 | */ |
37 | void addConnectionWidgetFactory( const QCString& internalName, | 37 | void addConnectionWidgetFactory( const QCString& internalName, |
38 | const QString& uiString, | 38 | const QString& uiString, |
39 | configWidget ); | 39 | configWidget ); |
40 | void addTerminalWidgetFactory ( const QCString& internalName, | 40 | void addTerminalWidgetFactory ( const QCString& internalName, |
41 | const QString& name, | 41 | const QString& name, |
42 | configWidget ); | 42 | configWidget ); |
43 | void addKeyboardWidgetFactory ( const QCString& internalName, | ||
44 | const QString& name, | ||
45 | configWidget ); | ||
43 | 46 | ||
44 | /** | 47 | /** |
45 | * adds an IOLayer factory | 48 | * adds an IOLayer factory |
46 | */ | 49 | */ |
47 | void addIOLayerFactory( const QCString&, | 50 | void addIOLayerFactory( const QCString&, |
48 | const QString&, | 51 | const QString&, |
49 | iolayer ); | 52 | iolayer ); |
50 | 53 | ||
51 | /** | 54 | /** |
52 | * adds a FileTransfer Layer | 55 | * adds a FileTransfer Layer |
53 | */ | 56 | */ |
54 | void addFileTransferLayer( const QCString& name, | 57 | void addFileTransferLayer( const QCString& name, |
@@ -74,42 +77,44 @@ public: | |||
74 | */ | 77 | */ |
75 | QStringList terminalWidgets()const; | 78 | QStringList terminalWidgets()const; |
76 | QStringList fileTransferLayers()const; | 79 | QStringList fileTransferLayers()const; |
77 | QStringList receiveLayers()const; | 80 | QStringList receiveLayers()const; |
78 | QStringList emulationLayers()const; | 81 | QStringList emulationLayers()const; |
79 | 82 | ||
80 | /** | 83 | /** |
81 | * the generation... | 84 | * the generation... |
82 | */ | 85 | */ |
83 | IOLayer* newIOLayer( const QString&,const Profile& ); | 86 | IOLayer* newIOLayer( const QString&,const Profile& ); |
84 | ProfileDialogWidget *newConnectionPlugin ( const QString&, QWidget* ); | 87 | ProfileDialogWidget *newConnectionPlugin ( const QString&, QWidget* ); |
85 | ProfileDialogWidget* newTerminalPlugin( const QString&, QWidget* ); | 88 | ProfileDialogWidget* newTerminalPlugin( const QString&, QWidget* ); |
89 | ProfileDialogWidget* newKeyboardPlugin( const QString&, QWidget* ); | ||
86 | EmulationLayer* newEmulationLayer(const QString&, WidgetLayer* ); | 90 | EmulationLayer* newEmulationLayer(const QString&, WidgetLayer* ); |
87 | FileTransferLayer* newFileTransfer(const QString&, IOLayer* ); | 91 | FileTransferLayer* newFileTransfer(const QString&, IOLayer* ); |
88 | ReceiveLayer* newReceive(const QString&, IOLayer* ); | 92 | ReceiveLayer* newReceive(const QString&, IOLayer* ); |
89 | 93 | ||
90 | /* | 94 | /* |
91 | * internal takes the maybe translated | 95 | * internal takes the maybe translated |
92 | * public QString and maps it to the internal | 96 | * public QString and maps it to the internal |
93 | * not translatable QCString | 97 | * not translatable QCString |
94 | */ | 98 | */ |
95 | QCString internal( const QString& )const; | 99 | QCString internal( const QString& )const; |
96 | 100 | ||
97 | /* | 101 | /* |
98 | * external takes the internal name | 102 | * external takes the internal name |
99 | * it returns a translated name | 103 | * it returns a translated name |
100 | */ | 104 | */ |
101 | QString external( const QCString& )const; | 105 | QString external( const QCString& )const; |
102 | 106 | ||
103 | 107 | ||
104 | private: | 108 | private: |
105 | QMap<QString, QCString> m_strings; | 109 | QMap<QString, QCString> m_strings; |
106 | QMap<QString, configWidget> m_conFact; | 110 | QMap<QString, configWidget> m_conFact; |
107 | QMap<QString, configWidget> m_termFact; | 111 | QMap<QString, configWidget> m_termFact; |
112 | QMap<QString, configWidget> m_keyFact; | ||
108 | QMap<QString, iolayer> m_layerFact; | 113 | QMap<QString, iolayer> m_layerFact; |
109 | QMap<QString, filelayer> m_fileFact; | 114 | QMap<QString, filelayer> m_fileFact; |
110 | QMap<QString, receivelayer> m_receiveFact; | 115 | QMap<QString, receivelayer> m_receiveFact; |
111 | QMap<QString, emulationLayer> m_emu; | 116 | QMap<QString, emulationLayer> m_emu; |
112 | }; | 117 | }; |
113 | 118 | ||
114 | 119 | ||
115 | #endif | 120 | #endif |
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 | |||
@@ -21,12 +21,23 @@ ProfileDialogWidget::Type ProfileDialogTerminalWidget::type()const { | |||
21 | 21 | ||
22 | ProfileDialogConnectionWidget::ProfileDialogConnectionWidget( const QString& na, | 22 | ProfileDialogConnectionWidget::ProfileDialogConnectionWidget( const QString& na, |
23 | QWidget* parent, | 23 | QWidget* parent, |
24 | const char* name ) | 24 | const char* name ) |
25 | : ProfileDialogWidget(na, parent, name ) | 25 | : ProfileDialogWidget(na, parent, name ) |
26 | { | 26 | { |
27 | } | 27 | } |
28 | ProfileDialogConnectionWidget::~ProfileDialogConnectionWidget() { | 28 | ProfileDialogConnectionWidget::~ProfileDialogConnectionWidget() { |
29 | } | 29 | } |
30 | ProfileDialogWidget::Type ProfileDialogConnectionWidget::type()const { | 30 | ProfileDialogWidget::Type ProfileDialogConnectionWidget::type()const { |
31 | return Connection; | 31 | return Connection; |
32 | } | 32 | } |
33 | ProfileDialogKeyWidget::ProfileDialogKeyWidget( const QString &na, | ||
34 | QWidget *parent, | ||
35 | const char *name) | ||
36 | : ProfileDialogWidget(na, parent, name ) | ||
37 | { | ||
38 | } | ||
39 | ProfileDialogKeyWidget::~ProfileDialogKeyWidget() { | ||
40 | } | ||
41 | ProfileDialogWidget::Type ProfileDialogKeyWidget::type() const{ | ||
42 | return Keyboard; | ||
43 | } | ||
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 | |||
@@ -1,25 +1,26 @@ | |||
1 | #ifndef OPIE_PROFILE_DIALOG_WIDGET_H | 1 | #ifndef OPIE_PROFILE_DIALOG_WIDGET_H |
2 | #define OPIE_PROFILE_DIALOG_WIDGET_H | 2 | #define OPIE_PROFILE_DIALOG_WIDGET_H |
3 | 3 | ||
4 | #include <qwidget.h> | 4 | #include <qwidget.h> |
5 | 5 | ||
6 | #include "profile.h" | 6 | #include "profile.h" |
7 | 7 | ||
8 | class ProfileDialogWidget : public QWidget { | 8 | class ProfileDialogWidget : public QWidget { |
9 | Q_OBJECT | 9 | Q_OBJECT |
10 | public: | 10 | public: |
11 | enum Type { | 11 | enum Type { |
12 | Connection, | 12 | Connection, |
13 | Terminal | 13 | Terminal, |
14 | Keyboard | ||
14 | }; | 15 | }; |
15 | ProfileDialogWidget( const QString& name, QWidget* parent, const char* name = 0l); | 16 | ProfileDialogWidget( const QString& name, QWidget* parent, const char* name = 0l); |
16 | ~ProfileDialogWidget(); | 17 | ~ProfileDialogWidget(); |
17 | 18 | ||
18 | /* | 19 | /* |
19 | * load data from a Profile into | 20 | * load data from a Profile into |
20 | * the DialogWidget | 21 | * the DialogWidget |
21 | */ | 22 | */ |
22 | virtual void load( const Profile& ) = 0; | 23 | virtual void load( const Profile& ) = 0; |
23 | 24 | ||
24 | /* | 25 | /* |
25 | * save data into a profile | 26 | * save data into a profile |
@@ -37,14 +38,22 @@ public: | |||
37 | ~ProfileDialogTerminalWidget(); | 38 | ~ProfileDialogTerminalWidget(); |
38 | Type type()const; | 39 | Type type()const; |
39 | }; | 40 | }; |
40 | class ProfileDialogConnectionWidget : public ProfileDialogWidget { | 41 | class ProfileDialogConnectionWidget : public ProfileDialogWidget { |
41 | Q_OBJECT | 42 | Q_OBJECT |
42 | public: | 43 | public: |
43 | ProfileDialogConnectionWidget( const QString& name, QWidget* parent, | 44 | ProfileDialogConnectionWidget( const QString& name, QWidget* parent, |
44 | const char* name =0l); | 45 | const char* name =0l); |
45 | ~ProfileDialogConnectionWidget(); | 46 | ~ProfileDialogConnectionWidget(); |
46 | Type type() const; | 47 | Type type() const; |
47 | 48 | ||
48 | }; | 49 | }; |
50 | class ProfileDialogKeyWidget : public ProfileDialogWidget { | ||
51 | Q_OBJECT | ||
52 | public: | ||
53 | ProfileDialogKeyWidget( const QString &name, QWidget* parent, | ||
54 | const char *name =0l); | ||
55 | ~ProfileDialogKeyWidget(); | ||
56 | Type type() const; | ||
57 | }; | ||
49 | 58 | ||
50 | #endif | 59 | #endif |
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 | |||
@@ -44,39 +44,41 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | |||
44 | 44 | ||
45 | // Apply current profile | 45 | // Apply current profile |
46 | // plugin_plugin->load(profile); | 46 | // plugin_plugin->load(profile); |
47 | } | 47 | } |
48 | 48 | ||
49 | Profile ProfileEditorDialog::profile() const | 49 | Profile ProfileEditorDialog::profile() const |
50 | { | 50 | { |
51 | return m_prof; | 51 | return m_prof; |
52 | } | 52 | } |
53 | 53 | ||
54 | void ProfileEditorDialog::initUI() | 54 | void 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 ); |
77 | QLabel *term = new QLabel(tr("Terminal"), tabprof ); | 79 | QLabel *term = new QLabel(tr("Terminal"), tabprof ); |
78 | m_conCmb = new QComboBox( tabprof ); | 80 | m_conCmb = new QComboBox( tabprof ); |
79 | m_termCmb = new QComboBox( tabprof ); | 81 | m_termCmb = new QComboBox( tabprof ); |
80 | m_autoConnect = new QCheckBox(tr("Auto connect after load"), tabprof); | 82 | m_autoConnect = new QCheckBox(tr("Auto connect after load"), tabprof); |
81 | 83 | ||
82 | // layouting | 84 | // layouting |
@@ -85,42 +87,44 @@ void ProfileEditorDialog::initUI() | |||
85 | vbox3->add(m_name); | 87 | vbox3->add(m_name); |
86 | vbox3->add(con ); | 88 | vbox3->add(con ); |
87 | vbox3->add(m_conCmb ); | 89 | vbox3->add(m_conCmb ); |
88 | vbox3->add(term ); | 90 | vbox3->add(term ); |
89 | vbox3->add(m_termCmb ); | 91 | vbox3->add(m_termCmb ); |
90 | vbox3->add(m_autoConnect); | 92 | vbox3->add(m_autoConnect); |
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; |
103 | for (it =list.begin(); it != list.end(); ++it ) { | 106 | for (it =list.begin(); it != list.end(); ++it ) { |
104 | m_conCmb->insertItem( (*it) ); | 107 | m_conCmb->insertItem( (*it) ); |
105 | } | 108 | } |
106 | list = m_fact->terminalWidgets(); | 109 | list = m_fact->terminalWidgets(); |
107 | for (it =list.begin(); it != list.end(); ++it ) { | 110 | for (it =list.begin(); it != list.end(); ++it ) { |
108 | m_termCmb->insertItem( (*it) ); | 111 | m_termCmb->insertItem( (*it) ); |
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 |
121 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), | 125 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), |
122 | this, SLOT(slotConActivated(const QString&) ) ); | 126 | this, SLOT(slotConActivated(const QString&) ) ); |
123 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), | 127 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), |
124 | this, SLOT(slotTermActivated(const QString& ) ) ); | 128 | this, SLOT(slotTermActivated(const QString& ) ) ); |
125 | 129 | ||
126 | } | 130 | } |
@@ -141,24 +145,26 @@ void ProfileEditorDialog::accept() | |||
141 | //if(plugin_plugin) plugin_plugin->save(); | 145 | //if(plugin_plugin) plugin_plugin->save(); |
142 | 146 | ||
143 | // Save general values | 147 | // Save general values |
144 | m_prof.setName(profName()); | 148 | m_prof.setName(profName()); |
145 | m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) ); | 149 | m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) ); |
146 | m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) ); | 150 | m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) ); |
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 | ||
158 | QString ProfileEditorDialog::profName()const | 164 | QString ProfileEditorDialog::profName()const |
159 | { | 165 | { |
160 | return m_name->text(); | 166 | return m_name->text(); |
161 | } | 167 | } |
162 | 168 | ||
163 | QCString ProfileEditorDialog::profType()const | 169 | QCString ProfileEditorDialog::profType()const |
164 | { | 170 | { |
@@ -169,36 +175,48 @@ QCString ProfileEditorDialog::profType()const | |||
169 | return QCString(); | 175 | return QCString(); |
170 | } | 176 | } |
171 | /* | 177 | /* |
172 | * we need to switch the widget | 178 | * we need to switch the widget |
173 | */ | 179 | */ |
174 | void ProfileEditorDialog::slotConActivated( const QString& str ) { | 180 | 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 | } |
187 | } else { | 194 | } else { |
188 | tabWidget->removePage( m_tabCon ); | 195 | tabWidget->removePage( m_tabCon ); |
189 | m_showconntab = 0; | 196 | m_showconntab = 0; |
190 | } | 197 | } |
191 | } | 198 | } |
192 | /* | 199 | /* |
193 | * we need to switch the widget | 200 | * we need to switch the widget |
194 | */ | 201 | */ |
195 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { | 202 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { |
196 | delete m_term; | 203 | delete m_term; |
197 | m_term = m_fact->newTerminalPlugin( str, m_tabTerm ); | 204 | m_term = m_fact->newTerminalPlugin( str, m_tabTerm ); |
198 | 205 | ||
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 | ||
212 | void 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 | } | ||
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 | |||
@@ -24,34 +24,35 @@ public: | |||
24 | ProfileEditorDialog(MetaFactory* fact ); | 24 | ProfileEditorDialog(MetaFactory* fact ); |
25 | ~ProfileEditorDialog(); | 25 | ~ProfileEditorDialog(); |
26 | Profile profile()const; | 26 | Profile profile()const; |
27 | 27 | ||
28 | 28 | ||
29 | 29 | ||
30 | public slots: | 30 | public slots: |
31 | void accept(); | 31 | void accept(); |
32 | 32 | ||
33 | private slots: | 33 | private slots: |
34 | void slotConActivated(const QString& ); | 34 | void slotConActivated(const QString& ); |
35 | void slotTermActivated( const QString& ); | 35 | void slotTermActivated( const QString& ); |
36 | void slotKeyActivated(const QString&); | ||
36 | private: | 37 | private: |
37 | void initUI(); | 38 | void initUI(); |
38 | QString profName()const; | 39 | QString profName()const; |
39 | QCString profType()const; | 40 | QCString profType()const; |
40 | 41 | ||
41 | MetaFactory* m_fact; | 42 | MetaFactory* m_fact; |
42 | QHBoxLayout* m_lay; | 43 | QHBoxLayout* m_lay; |
43 | Profile m_prof; | 44 | Profile m_prof; |
44 | 45 | ||
45 | QLineEdit *m_name; | 46 | QLineEdit *m_name; |
46 | QComboBox *m_conCmb, *m_termCmb; | 47 | QComboBox *m_conCmb, *m_termCmb; |
47 | QCheckBox *m_autoConnect; | 48 | QCheckBox *m_autoConnect; |
48 | 49 | ||
49 | QWidget *m_tabCon, *m_tabTerm; | 50 | QWidget *m_tabCon, *m_tabTerm, *m_tabKey; |
50 | ProfileDialogWidget* m_con, *m_term; | 51 | ProfileDialogWidget* m_con, *m_term, *m_key; |
51 | QHBoxLayout *m_layCon, *m_layTerm; | 52 | QHBoxLayout *m_layCon, *m_layTerm, *m_layKey; |
52 | OTabWidget *tabWidget; | 53 | OTabWidget *tabWidget; |
53 | QWidget *tabprof; | 54 | QWidget *tabprof; |
54 | int m_showconntab; | 55 | int m_showconntab; |
55 | }; | 56 | }; |
56 | 57 | ||
57 | #endif | 58 | #endif |