summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/metafactory.cpp2
-rw-r--r--noncore/apps/opie-console/metafactory.h4
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp14
-rw-r--r--noncore/apps/opie-console/profileeditorplugins.cpp102
-rw-r--r--noncore/apps/opie-console/profileeditorplugins.h10
5 files changed, 73 insertions, 59 deletions
diff --git a/noncore/apps/opie-console/metafactory.cpp b/noncore/apps/opie-console/metafactory.cpp
index c5e614d..b69d6da 100644
--- a/noncore/apps/opie-console/metafactory.cpp
+++ b/noncore/apps/opie-console/metafactory.cpp
@@ -62,3 +62,3 @@ IOLayer* MetaFactory::newIOLayer( const QString& str,const Profile& prof ) {
62 62
63ProfileEditorPlugin *MetaFactory::newConfigPlugin ( const QString& str, QWidget *parent, const Profile& prof) { 63ProfileEditorPlugin *MetaFactory::newConfigPlugin ( const QString& str, QWidget *parent, Profile *prof) {
64 ProfileEditorPlugin *p = NULL; 64 ProfileEditorPlugin *p = NULL;
diff --git a/noncore/apps/opie-console/metafactory.h b/noncore/apps/opie-console/metafactory.h
index 8c714b3..216de03 100644
--- a/noncore/apps/opie-console/metafactory.h
+++ b/noncore/apps/opie-console/metafactory.h
@@ -20,3 +20,3 @@ class MetaFactory {
20public: 20public:
21 typedef ProfileEditorPlugin* (*configWidget)(QWidget* parent, const Profile&); 21 typedef ProfileEditorPlugin* (*configWidget)(QWidget* parent, Profile* prof);
22 typedef IOLayer* (*iolayer)(const Profile& ); 22 typedef IOLayer* (*iolayer)(const Profile& );
@@ -38,3 +38,3 @@ public:
38 IOLayer* newIOLayer( const QString&,const Profile& ); 38 IOLayer* newIOLayer( const QString&,const Profile& );
39 ProfileEditorPlugin *newConfigPlugin ( const QString&, QWidget*, const Profile& ); 39 ProfileEditorPlugin *newConfigPlugin ( const QString&, QWidget*, Profile* );
40 40
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index d98e589..8e63429 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -75,3 +75,3 @@ void ProfileEditorDialog::initUI()
75 75
76 plugin_plugin = m_fact->newConfigPlugin("serial", plugin_base, m_prof); 76 plugin_plugin = m_fact->newConfigPlugin("serial", plugin_base, &m_prof);
77 plugin_layout->add(plugin_plugin->widget()); 77 plugin_layout->add(plugin_plugin->widget());
@@ -114,2 +114,11 @@ void ProfileEditorDialog::initUI()
114 name_line->setText(m_prof.name()); 114 name_line->setText(m_prof.name());
115 for(int i = 0; i < device_box->count(); i++)
116 {
117 device_box->setCurrentItem(i);
118 if(prof_type() == m_prof.ioLayerName())
119 {
120 slotDevice(i);
121 break;
122 }
123 }
115 124
@@ -129,3 +138,3 @@ void ProfileEditorDialog::slotDevice(int id)
129 138
130 plugin_plugin = m_fact->newConfigPlugin(prof_type(), plugin_base, m_prof); 139 plugin_plugin = m_fact->newConfigPlugin(prof_type(), plugin_base, &m_prof);
131 plugin_layout->add(plugin_plugin->widget()); 140 plugin_layout->add(plugin_plugin->widget());
@@ -154,2 +163,3 @@ void ProfileEditorDialog::accept()
154 m_prof.setName(prof_name()); 163 m_prof.setName(prof_name());
164 m_prof.setIOLayer(prof_type());
155 165
diff --git a/noncore/apps/opie-console/profileeditorplugins.cpp b/noncore/apps/opie-console/profileeditorplugins.cpp
index 32e8235..a0bcab8 100644
--- a/noncore/apps/opie-console/profileeditorplugins.cpp
+++ b/noncore/apps/opie-console/profileeditorplugins.cpp
@@ -17,3 +17,3 @@
17 17
18ProfileEditorPlugin::ProfileEditorPlugin(QWidget *parent, Profile p) 18ProfileEditorPlugin::ProfileEditorPlugin(QWidget *parent, Profile *p)
19{ 19{
@@ -78,5 +78,6 @@ QWidget *ProfileEditorPlugin::connection_widget()
78 // Apply profile settings 78 // Apply profile settings
79 int rad_flow = m_profile.readNumEntry("Flow"); 79
80 int rad_parity = m_profile.readNumEntry("Parity"); 80 int rad_flow = m_profile->readNumEntry("Flow");
81 int speed = m_profile.readNumEntry("Speed"); 81 int rad_parity = m_profile->readNumEntry("Parity");
82 int speed = m_profile->readNumEntry("Speed");
82 83
@@ -162,9 +163,10 @@ QWidget *ProfileEditorPlugin::terminal_widget()
162 // Apply profile settings 163 // Apply profile settings
163 int term = m_profile.readNumEntry("Terminal"); 164
164 int colour = m_profile.readNumEntry("Colour"); 165 int term = m_profile->readNumEntry("Terminal");
165 int fontsize = m_profile.readNumEntry("Font"); 166 int colour = m_profile->readNumEntry("Colour");
166 int opt_echo = m_profile.readNumEntry("Echo"); 167 int fontsize = m_profile->readNumEntry("Font");
167 int opt_wrap = m_profile.readNumEntry("Wrap"); 168 int opt_echo = m_profile->readNumEntry("Echo");
168 int opt_inbound = m_profile.readNumEntry("Inbound"); 169 int opt_wrap = m_profile->readNumEntry("Wrap");
169 int opt_outbound = m_profile.readNumEntry("Outbound"); 170 int opt_inbound = m_profile->readNumEntry("Inbound");
171 int opt_outbound = m_profile->readNumEntry("Outbound");
170 172
@@ -203,6 +205,6 @@ void ProfileEditorPlugin::slotConnFlow(int id)
203 case id_flow_hw: 205 case id_flow_hw:
204 m_profile.writeEntry("Flow", IOSerial::FlowHW); 206 m_profile->writeEntry("Flow", IOSerial::FlowHW);
205 break; 207 break;
206 case id_flow_sw: 208 case id_flow_sw:
207 m_profile.writeEntry("Flow", IOSerial::FlowSW); 209 m_profile->writeEntry("Flow", IOSerial::FlowSW);
208 break; 210 break;
@@ -216,6 +218,6 @@ void ProfileEditorPlugin::slotConnParity(int id)
216 case id_parity_odd: 218 case id_parity_odd:
217 m_profile.writeEntry("Parity", IOSerial::ParityEven); 219 m_profile->writeEntry("Parity", IOSerial::ParityEven);
218 break; 220 break;
219 case id_parity_even: 221 case id_parity_even:
220 m_profile.writeEntry("Parity", IOSerial::ParityOdd); 222 m_profile->writeEntry("Parity", IOSerial::ParityOdd);
221 break; 223 break;
@@ -230,15 +232,15 @@ void ProfileEditorPlugin::slotConnSpeed(int id)
230 case id_baud_115200: 232 case id_baud_115200:
231 m_profile.writeEntry("Speed", 115200); 233 m_profile->writeEntry("Speed", 115200);
232 break; 234 break;
233 case id_baud_57600: 235 case id_baud_57600:
234 m_profile.writeEntry("Speed", 57600); 236 m_profile->writeEntry("Speed", 57600);
235 break; 237 break;
236 case id_baud_38400: 238 case id_baud_38400:
237 m_profile.writeEntry("Speed", 38400); 239 m_profile->writeEntry("Speed", 38400);
238 break; 240 break;
239 case id_baud_19200: 241 case id_baud_19200:
240 m_profile.writeEntry("Speed", 19200); 242 m_profile->writeEntry("Speed", 19200);
241 break; 243 break;
242 case id_baud_9600: 244 case id_baud_9600:
243 m_profile.writeEntry("Speed", 9600); 245 m_profile->writeEntry("Speed", 9600);
244 break; 246 break;
@@ -252,9 +254,9 @@ void ProfileEditorPlugin::slotTermTerm(int id)
252 case id_term_vt100: 254 case id_term_vt100:
253 m_profile.writeEntry("Terminal", Profile::VT102); 255 m_profile->writeEntry("Terminal", Profile::VT102);
254 break; 256 break;
255 case id_term_vt220: 257 case id_term_vt220:
256 m_profile.writeEntry("Terminal", Profile::VT102); 258 m_profile->writeEntry("Terminal", Profile::VT102);
257 break; 259 break;
258 case id_term_ansi: 260 case id_term_ansi:
259 m_profile.writeEntry("Terminal", Profile::VT102); 261 m_profile->writeEntry("Terminal", Profile::VT102);
260 break; 262 break;
@@ -268,6 +270,6 @@ void ProfileEditorPlugin::slotTermColour(int id)
268 case id_term_black: 270 case id_term_black:
269 m_profile.writeEntry("Colour", Profile::Black); 271 m_profile->writeEntry("Colour", Profile::Black);
270 break; 272 break;
271 case id_term_white: 273 case id_term_white:
272 m_profile.writeEntry("Colour", Profile::White); 274 m_profile->writeEntry("Colour", Profile::White);
273 break; 275 break;
@@ -281,9 +283,9 @@ void ProfileEditorPlugin::slotTermFont(int id)
281 case id_size_small: 283 case id_size_small:
282 m_profile.writeEntry("Font", Profile::Micro); 284 m_profile->writeEntry("Font", Profile::Micro);
283 break; 285 break;
284 case id_size_medium: 286 case id_size_medium:
285 m_profile.writeEntry("Font", Profile::Small); 287 m_profile->writeEntry("Font", Profile::Small);
286 break; 288 break;
287 case id_size_large: 289 case id_size_large:
288 m_profile.writeEntry("Font", Profile::Medium); 290 m_profile->writeEntry("Font", Profile::Medium);
289 break; 291 break;
@@ -294,3 +296,3 @@ void ProfileEditorPlugin::slotTermEcho(bool on)
294{ 296{
295 m_profile.writeEntry("Echo", on ? 1 : 0); 297 m_profile->writeEntry("Echo", on ? 1 : 0);
296} 298}
@@ -299,3 +301,3 @@ void ProfileEditorPlugin::slotTermWrap(bool on)
299{ 301{
300 m_profile.writeEntry("Wrap", on ? 1 : 0); 302 m_profile->writeEntry("Wrap", on ? 1 : 0);
301} 303}
@@ -304,3 +306,3 @@ void ProfileEditorPlugin::slotTermInbound(bool on)
304{ 306{
305 m_profile.writeEntry("Inbound", on ? 1 : 0); 307 m_profile->writeEntry("Inbound", on ? 1 : 0);
306} 308}
@@ -309,3 +311,3 @@ void ProfileEditorPlugin::slotTermOutbound(bool on)
309{ 311{
310 m_profile.writeEntry("Outbound", on ? 1 : 0); 312 m_profile->writeEntry("Outbound", on ? 1 : 0);
311} 313}
@@ -318,3 +320,3 @@ class ProfileEditorPluginSerial : public ProfileEditorPlugin
318 320
319 ProfileEditorPluginSerial(QWidget *parent, Profile p) 321 ProfileEditorPluginSerial(QWidget *parent, Profile *p)
320 : ProfileEditorPlugin(parent, p) 322 : ProfileEditorPlugin(parent, p)
@@ -345,3 +347,5 @@ class ProfileEditorPluginSerial : public ProfileEditorPlugin
345 // Load special settings 347 // Load special settings
346 device_line->setText(m_profile.readEntry("Device")); 348
349 QString dev = m_profile->readEntry("Device");
350 if(!dev.isNull()) device_line->setText(dev);
347 } 351 }
@@ -354,4 +358,3 @@ class ProfileEditorPluginSerial : public ProfileEditorPlugin
354 // special settings 358 // special settings
355 Profile p = m_profile; 359 m_profile->writeEntry("Device", device_line->text());
356 p.writeEntry("Device", device_line->text());
357 } 360 }
@@ -366,3 +369,3 @@ class ProfileEditorPluginIrda : public ProfileEditorPlugin
366 369
367 ProfileEditorPluginIrda(QWidget *parent, Profile p) 370 ProfileEditorPluginIrda(QWidget *parent, Profile *p)
368 : ProfileEditorPlugin(parent, p) 371 : ProfileEditorPlugin(parent, p)
@@ -393,3 +396,4 @@ class ProfileEditorPluginIrda : public ProfileEditorPlugin
393 // Load special settings 396 // Load special settings
394 device_line->setText(m_profile.readEntry("Device")); 397 QString dev = m_profile->readEntry("Device");
398 if(!dev.isNull()) device_line->setText(dev);
395 } 399 }
@@ -402,4 +406,3 @@ class ProfileEditorPluginIrda : public ProfileEditorPlugin
402 // special settings 406 // special settings
403 Profile p = m_profile; 407 m_profile->writeEntry("Device", device_line->text());
404 p.writeEntry("Device", device_line->text());
405 } 408 }
@@ -414,3 +417,3 @@ class ProfileEditorPluginModem : public ProfileEditorPlugin
414 417
415 ProfileEditorPluginModem(QWidget *parent, Profile p) 418 ProfileEditorPluginModem(QWidget *parent, Profile *p)
416 : ProfileEditorPlugin(parent, p) 419 : ProfileEditorPlugin(parent, p)
@@ -445,4 +448,6 @@ class ProfileEditorPluginModem : public ProfileEditorPlugin
445 // Load special settings 448 // Load special settings
446 device_line->setText(m_profile.readEntry("Device")); 449 QString dev = m_profile->readEntry("Device");
447 number_line->setText(m_profile.readEntry("Number")); 450 QString num = m_profile->readEntry("Number");
451 if(!dev.isNull()) device_line->setText(dev);
452 number_line->setText(num);
448 } 453 }
@@ -455,5 +460,4 @@ class ProfileEditorPluginModem : public ProfileEditorPlugin
455 // special settings 460 // special settings
456 Profile p = m_profile; 461 m_profile->writeEntry("Device", device_line->text());
457 p.writeEntry("Device", device_line->text()); 462 m_profile->writeEntry("Number", number_line->text());
458 p.writeEntry("Number", number_line->text());
459 } 463 }
@@ -464,3 +468,3 @@ class ProfileEditorPluginModem : public ProfileEditorPlugin
464 468
465ProfileEditorPlugin *factory_serial(QWidget *parent, const Profile& p) 469ProfileEditorPlugin *factory_serial(QWidget *parent, Profile *p)
466{ 470{
@@ -469,3 +473,3 @@ ProfileEditorPlugin *factory_serial(QWidget *parent, const Profile& p)
469 473
470ProfileEditorPlugin *factory_irda(QWidget *parent, const Profile& p) 474ProfileEditorPlugin *factory_irda(QWidget *parent, Profile *p)
471{ 475{
@@ -474,3 +478,3 @@ ProfileEditorPlugin *factory_irda(QWidget *parent, const Profile& p)
474 478
475ProfileEditorPlugin *factory_modem(QWidget *parent, const Profile& p) 479ProfileEditorPlugin *factory_modem(QWidget *parent, Profile *p)
476{ 480{
diff --git a/noncore/apps/opie-console/profileeditorplugins.h b/noncore/apps/opie-console/profileeditorplugins.h
index caec7ba..591163a 100644
--- a/noncore/apps/opie-console/profileeditorplugins.h
+++ b/noncore/apps/opie-console/profileeditorplugins.h
@@ -13,3 +13,3 @@ class ProfileEditorPlugin : public QObject
13 public: 13 public:
14 ProfileEditorPlugin(QWidget *parent, Profile p); 14 ProfileEditorPlugin(QWidget *parent, Profile *p);
15 15
@@ -38,3 +38,3 @@ class ProfileEditorPlugin : public QObject
38 QWidget *m_parent, *m_widget; 38 QWidget *m_parent, *m_widget;
39 Profile m_profile; 39 Profile *m_profile;
40 40
@@ -87,5 +87,5 @@ class ProfileEditorPlugin : public QObject
87 87
88ProfileEditorPlugin *factory_serial(QWidget *parent, const Profile& p); 88ProfileEditorPlugin *factory_serial(QWidget *parent, Profile *p);
89ProfileEditorPlugin *factory_irda(QWidget *parent, const Profile& p); 89ProfileEditorPlugin *factory_irda(QWidget *parent, Profile *p);
90ProfileEditorPlugin *factory_modem(QWidget *parent, const Profile& p); 90ProfileEditorPlugin *factory_modem(QWidget *parent, Profile *p);
91 91