-rw-r--r-- | noncore/apps/opie-console/metafactory.cpp | 11 | ||||
-rw-r--r-- | noncore/apps/opie-console/metafactory.h | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 52 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.h | 2 |
4 files changed, 52 insertions, 14 deletions
diff --git a/noncore/apps/opie-console/metafactory.cpp b/noncore/apps/opie-console/metafactory.cpp index 04f1cbe..ea7f739 100644 --- a/noncore/apps/opie-console/metafactory.cpp +++ b/noncore/apps/opie-console/metafactory.cpp | |||
@@ -45,4 +45,5 @@ QStringList MetaFactory::fileTransferLayers()const { | |||
45 | return list; | 45 | return list; |
46 | } | 46 | } |
47 | |||
47 | IOLayer* MetaFactory::newIOLayer( const QString& str,const Profile& prof ) { | 48 | IOLayer* MetaFactory::newIOLayer( const QString& str,const Profile& prof ) { |
48 | IOLayer* lay = 0l; | 49 | IOLayer* lay = 0l; |
@@ -60,4 +61,14 @@ IOLayer* MetaFactory::newIOLayer( const QString& str,const Profile& prof ) { | |||
60 | } | 61 | } |
61 | 62 | ||
63 | QWidget *MetaFactory::newConfigWidget ( const QString& str, QWidget* parent) { | ||
64 | QWidget *w = NULL; | ||
65 | configWidget c; | ||
66 | |||
67 | c = m_confFact[str]; | ||
68 | if(c) w = c(parent); | ||
69 | |||
70 | return w; | ||
71 | } | ||
72 | |||
62 | QString MetaFactory::name( const QString& str ) { | 73 | QString MetaFactory::name( const QString& str ) { |
63 | return m_namemap[str]; | 74 | return m_namemap[str]; |
diff --git a/noncore/apps/opie-console/metafactory.h b/noncore/apps/opie-console/metafactory.h index 7fa53c6..2245231 100644 --- a/noncore/apps/opie-console/metafactory.h +++ b/noncore/apps/opie-console/metafactory.h | |||
@@ -36,4 +36,5 @@ public: | |||
36 | QStringList fileTransferLayers()const; | 36 | QStringList fileTransferLayers()const; |
37 | IOLayer* newIOLayer( const QString&,const Profile& ); | 37 | IOLayer* newIOLayer( const QString&,const Profile& ); |
38 | QWidget *newConfigWidget ( const QString&, QWidget* ); | ||
38 | 39 | ||
39 | QString name( const QString& ); | 40 | QString name( const QString& ); |
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index 859abdd..374844e 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -20,16 +20,10 @@ static QWidget *factory_serial(QWidget *parent) | |||
20 | 20 | ||
21 | QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); | 21 | QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); |
22 | QLabel *frame_number = new QLabel(QObject::tr("Phone number"), device_frame); | ||
23 | frame_number->hide(); | ||
24 | 22 | ||
25 | QLineEdit *frame_device_line = new QLineEdit("/dev/ttyS0", device_frame); | 23 | QLineEdit *frame_device_line = new QLineEdit("/dev/ttyS0", device_frame); |
26 | QLineEdit *frame_number_line = new QLineEdit(device_frame); | ||
27 | frame_number_line->hide(); | ||
28 | 24 | ||
29 | QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); | 25 | QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); |
30 | vbox_frame->add(frame_device); | 26 | vbox_frame->add(frame_device); |
31 | vbox_frame->add(frame_device_line); | 27 | vbox_frame->add(frame_device_line); |
32 | vbox_frame->add(frame_number); | ||
33 | vbox_frame->add(frame_number_line); | ||
34 | 28 | ||
35 | return device_frame; | 29 | return device_frame; |
@@ -38,10 +32,36 @@ static QWidget *factory_serial(QWidget *parent) | |||
38 | static QWidget *factory_irda(QWidget *parent) | 32 | static QWidget *factory_irda(QWidget *parent) |
39 | { | 33 | { |
40 | return NULL; | 34 | QFrame *device_frame = new QFrame(parent); |
35 | device_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken); | ||
36 | |||
37 | QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); | ||
38 | |||
39 | QLineEdit *frame_device_line = new QLineEdit("/dev/ircomm0", device_frame); | ||
40 | |||
41 | QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); | ||
42 | vbox_frame->add(frame_device); | ||
43 | vbox_frame->add(frame_device_line); | ||
44 | |||
45 | return device_frame; | ||
41 | } | 46 | } |
42 | 47 | ||
43 | static QWidget *factory_modem(QWidget *parent) | 48 | static QWidget *factory_modem(QWidget *parent) |
44 | { | 49 | { |
45 | return NULL; | 50 | QFrame *device_frame = new QFrame(parent); |
51 | device_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken); | ||
52 | |||
53 | QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); | ||
54 | QLabel *frame_number = new QLabel(QObject::tr("Phone number"), device_frame); | ||
55 | |||
56 | QLineEdit *frame_device_line = new QLineEdit("/dev/ttyS0", device_frame); | ||
57 | QLineEdit *frame_number_line = new QLineEdit(device_frame); | ||
58 | |||
59 | QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); | ||
60 | vbox_frame->add(frame_device); | ||
61 | vbox_frame->add(frame_device_line); | ||
62 | vbox_frame->add(frame_number); | ||
63 | vbox_frame->add(frame_number_line); | ||
64 | |||
65 | return device_frame; | ||
46 | } | 66 | } |
47 | 67 | ||
@@ -87,5 +107,9 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | |||
87 | 107 | ||
88 | // connection tab, factory part | 108 | // connection tab, factory part |
89 | QFrame *device_frame = static_cast<QFrame*>(factory_serial(tabconn)); | 109 | plugin_base = new QWidget(tabconn); |
110 | plugin_layout = new QHBoxLayout(plugin_base, 0); | ||
111 | |||
112 | plugin_plugin = m_fact->newConfigWidget("serial", plugin_base); | ||
113 | plugin_layout->add(plugin_plugin); | ||
90 | 114 | ||
91 | // connection tab, general part | 115 | // connection tab, general part |
@@ -161,5 +185,5 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | |||
161 | vbox->add(device); | 185 | vbox->add(device); |
162 | vbox->add(device_box); | 186 | vbox->add(device_box); |
163 | vbox->add(device_frame); | 187 | vbox->add(plugin_base); |
164 | vbox->add(speed); | 188 | vbox->add(speed); |
165 | vbox->add(speed_box); | 189 | vbox->add(speed_box); |
@@ -215,10 +239,10 @@ ProfileEditorDialog::~ProfileEditorDialog() { | |||
215 | void ProfileEditorDialog::slotDevice(int id) | 239 | void ProfileEditorDialog::slotDevice(int id) |
216 | { | 240 | { |
217 | MetaFactory::configWidget c; | 241 | delete plugin_plugin; |
218 | 242 | ||
219 | //c = m_fact->; | 243 | plugin_plugin = m_fact->newConfigWidget(prof_type(), plugin_base); |
220 | c = factory_serial; | 244 | plugin_layout->add(plugin_plugin); |
221 | 245 | ||
222 | QFrame *device_frame = static_cast<QFrame*>(c(NULL)); | 246 | plugin_plugin->show(); |
223 | } | 247 | } |
224 | 248 | ||
diff --git a/noncore/apps/opie-console/profileeditordialog.h b/noncore/apps/opie-console/profileeditordialog.h index dfe4490..00f3c99 100644 --- a/noncore/apps/opie-console/profileeditordialog.h +++ b/noncore/apps/opie-console/profileeditordialog.h | |||
@@ -53,4 +53,6 @@ private: | |||
53 | //QLineEdit *frame_device_line, *frame_number_line; | 53 | //QLineEdit *frame_device_line, *frame_number_line; |
54 | QComboBox *terminal_box, *speed_box, *device_box; | 54 | QComboBox *terminal_box, *speed_box, *device_box; |
55 | QWidget *plugin_base, *plugin_plugin; | ||
56 | QHBoxLayout *plugin_layout; | ||
55 | }; | 57 | }; |
56 | 58 | ||