summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/profileeditorplugins.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/profileeditorplugins.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/profileeditorplugins.cpp139
1 files changed, 65 insertions, 74 deletions
diff --git a/noncore/apps/opie-console/profileeditorplugins.cpp b/noncore/apps/opie-console/profileeditorplugins.cpp
index b63fa1c..c11c854 100644
--- a/noncore/apps/opie-console/profileeditorplugins.cpp
+++ b/noncore/apps/opie-console/profileeditorplugins.cpp
@@ -10,6 +10,8 @@
10#include "qradiobutton.h" 10#include "qradiobutton.h"
11#include "qcheckbox.h" 11#include "qcheckbox.h"
12#include "qbuttongroup.h" 12#include "qbuttongroup.h"
13#include "qhgroupbox.h"
14#include "qvbox.h"
13 15
14#include "io_serial.h" 16#include "io_serial.h"
15 17
@@ -36,6 +38,7 @@ QWidget *ProfileEditorPlugin::connection_widget()
36 root = new QWidget(); 38 root = new QWidget();
37 39
38 // Build GUI 40 // Build GUI
41 QLabel *speedlabel = new QLabel(QObject::tr("Speed"), root);
39 42
40 QComboBox *speed_box = new QComboBox(root); 43 QComboBox *speed_box = new QComboBox(root);
41 speed_box->insertItem("115200 baud", id_baud_115200); 44 speed_box->insertItem("115200 baud", id_baud_115200);
@@ -44,38 +47,33 @@ QWidget *ProfileEditorPlugin::connection_widget()
44 speed_box->insertItem("19200 baud", id_baud_19200); 47 speed_box->insertItem("19200 baud", id_baud_19200);
45 speed_box->insertItem("9600 baud", id_baud_9600); 48 speed_box->insertItem("9600 baud", id_baud_9600);
46 49
47 QLabel *speedlabel = new QLabel(QObject::tr("Speed"), root); 50 QButtonGroup *group_flow = new QButtonGroup(QObject::tr("Flow control"), root);
48 QLabel *flow = new QLabel(QObject::tr("Flow control"), root);
49 QLabel *parity = new QLabel(QObject::tr("Parity"), root);
50
51 QButtonGroup *group_flow = new QButtonGroup(root);
52 group_flow->hide();
53 QRadioButton *flow_hw = new QRadioButton(QObject::tr("Hardware"), root);
54 QRadioButton *flow_sw = new QRadioButton(QObject::tr("Software"), root);
55 group_flow->insert(flow_hw, id_flow_hw);
56 group_flow->insert(flow_sw, id_flow_sw);
57
58 QButtonGroup *group_parity = new QButtonGroup(root);
59 group_parity->hide();
60 QRadioButton *parity_odd = new QRadioButton(QObject::tr("Odd"), root);
61 QRadioButton *parity_even = new QRadioButton(QObject::tr("Even"), root);
62 group_parity->insert(parity_odd, id_parity_odd);
63 group_parity->insert(parity_even, id_parity_even);
64 51
65 // Build Layout 52 QRadioButton *flow_hw = new QRadioButton(QObject::tr("Hardware"), group_flow);
53 QRadioButton *flow_sw = new QRadioButton(QObject::tr("Software"), group_flow);
54
55 QButtonGroup *group_parity = new QButtonGroup(QObject::tr("Parity"), root);
56 QRadioButton *parity_odd = new QRadioButton(QObject::tr("Odd"), group_parity);
57 QRadioButton *parity_even = new QRadioButton(QObject::tr("Even"), group_parity);
66 58
59 // Build Layout
67 lroot = new QVBoxLayout(root); 60 lroot = new QVBoxLayout(root);
68 lroot->add(speedlabel); 61 lroot->add(speedlabel);
69 lroot->add(speed_box); 62 lroot->add(speed_box);
70 lroot->add(flow); 63 lroot->setStretchFactor(speedlabel, 1);
71 QHBoxLayout *hbox = new QHBoxLayout(lroot, 2); 64 lroot->setStretchFactor(speed_box, 1);
65
66 QHBoxLayout *hbox = new QHBoxLayout(group_flow, 2);
72 hbox->add(flow_hw); 67 hbox->add(flow_hw);
73 hbox->add(flow_sw); 68 hbox->add(flow_sw);
74 lroot->add(parity); 69 lroot->add(group_flow);
75 QHBoxLayout *hbox2 = new QHBoxLayout(lroot, 2); 70 lroot->setStretchFactor(group_flow, 2);
76 hbox2->add(parity_odd); 71
77 hbox2->add(parity_even); 72 QHBoxLayout *hboxPar = new QHBoxLayout( group_parity, 2);
78 73 hboxPar->add(parity_odd);
74 hboxPar->add(parity_even);
75 lroot->add(group_parity);
76 lroot->setStretchFactor(group_parity, 2);
79 // Apply profile settings 77 // Apply profile settings
80 78
81 int rad_flow = m_profile->readNumEntry("Flow"); 79 int rad_flow = m_profile->readNumEntry("Flow");
@@ -110,56 +108,51 @@ QWidget *ProfileEditorPlugin::terminal_widget()
110 108
111 // Build GUI 109 // Build GUI
112 110
111
112 QLabel *terminal = new QLabel(QObject::tr("Terminal type"), root);
113
113 QComboBox *terminal_box = new QComboBox(root); 114 QComboBox *terminal_box = new QComboBox(root);
114 terminal_box->insertItem("VT 100", id_term_vt100); 115 terminal_box->insertItem("VT 100", id_term_vt100);
115 terminal_box->insertItem("VT 220", id_term_vt220); 116 terminal_box->insertItem("VT 220", id_term_vt220);
116 terminal_box->insertItem("ANSI", id_term_ansi); 117 terminal_box->insertItem("ANSI", id_term_ansi);
117 118
118 QLabel *terminal = new QLabel(QObject::tr("Terminal type"), root); 119 QLabel *colourlabel = new QLabel(QObject::tr("Colour scheme"), root);
119 QLabel *colourlabel = new QLabel(QObject::tr("Colour scheme"), root);
120 QLabel *sizelabel = new QLabel(QObject::tr("Font size"), root);
121 QLabel *options = new QLabel(QObject::tr("Options"), root);
122 QLabel *conversions = new QLabel(QObject::tr("Line-break conversions"), root);
123
124 QComboBox *colour_box = new QComboBox(root); 120 QComboBox *colour_box = new QComboBox(root);
125 colour_box->insertItem(QObject::tr("black on white"), id_term_black); 121 colour_box->insertItem(QObject::tr("black on white"), id_term_black);
126 colour_box->insertItem(QObject::tr("white on black"), id_term_white); 122 colour_box->insertItem(QObject::tr("white on black"), id_term_white);
127 123
128 QButtonGroup *group_size = new QButtonGroup(root); 124 QButtonGroup *group_size = new QButtonGroup( QObject::tr("Font size"), root );
129 group_size->hide(); 125 QRadioButton *size_small = new QRadioButton(QObject::tr("small"), group_size );
130 QRadioButton *size_small = new QRadioButton(QObject::tr("small"), root); 126 QRadioButton *size_medium = new QRadioButton(QObject::tr("medium"), group_size );
131 QRadioButton *size_medium = new QRadioButton(QObject::tr("medium"), root); 127 QRadioButton *size_large = new QRadioButton(QObject::tr("large"), group_size );
132 QRadioButton *size_large = new QRadioButton(QObject::tr("large"), root);
133 group_size->insert(size_small);
134 group_size->insert(size_medium);
135 group_size->insert(size_large);
136 128
137 QCheckBox *option_echo = new QCheckBox(QObject::tr("Local echo"), root); 129 QHGroupBox *group_conv = new QHGroupBox( QObject::tr("Line-break conversions"), root );
138 QCheckBox *option_wrap = new QCheckBox(QObject::tr("Line wrap"), root); 130 QCheckBox *conv_inbound = new QCheckBox(QObject::tr("Inbound"), group_conv);
131 QCheckBox *conv_outbound = new QCheckBox(QObject::tr("Outbound"), group_conv);
139 132
140 QCheckBox *conv_inbound = new QCheckBox(QObject::tr("Inbound"), root); 133 QHGroupBox *group_options = new QHGroupBox( QObject::tr("Options"), root );
141 QCheckBox *conv_outbound = new QCheckBox(QObject::tr("Outbound"), root); 134 QCheckBox *option_echo = new QCheckBox(QObject::tr("Local echo"), group_options);
135 QCheckBox *option_wrap = new QCheckBox(QObject::tr("Line wrap"), group_options);
142 136
143 // Build Layout 137 // Build Layout
144
145 lroot = new QVBoxLayout(root, 2); 138 lroot = new QVBoxLayout(root, 2);
146 lroot->add(terminal); 139
147 lroot->add(terminal_box); 140 QVBoxLayout *typeBox = new QVBoxLayout( lroot );
148 lroot->add(sizelabel); 141 typeBox->add(terminal);
149 QHBoxLayout *hbox = new QHBoxLayout(lroot, 2); 142 typeBox->add(terminal_box);
143
144 QHBoxLayout *hbox = new QHBoxLayout( group_size, 2);
150 hbox->add(size_small); 145 hbox->add(size_small);
151 hbox->add(size_medium); 146 hbox->add(size_medium);
152 hbox->add(size_large); 147 hbox->add(size_large);
153 lroot->add(colourlabel); 148 lroot->add( group_size );
154 lroot->add(colour_box); 149
155 lroot->add(conversions); 150 QVBoxLayout *colourBox = new QVBoxLayout( lroot );
156 QHBoxLayout *hbox2 = new QHBoxLayout(lroot, 2); 151 colourBox->add(colourlabel);
157 hbox2->add(conv_inbound); 152 colourBox->add(colour_box);
158 hbox2->add(conv_outbound); 153
159 lroot->add(options); 154 lroot->add(group_conv);
160 QHBoxLayout *hbox3 = new QHBoxLayout(lroot, 2); 155 lroot->add(group_options);
161 hbox3->add(option_wrap);
162 hbox3->add(option_echo);
163 156
164 // Apply profile settings 157 // Apply profile settings
165 158
@@ -318,7 +311,7 @@ void ProfileEditorPlugin::slotTermOutbound(bool on)
318class ProfileEditorPluginSerial : public ProfileEditorPlugin 311class ProfileEditorPluginSerial : public ProfileEditorPlugin
319{ 312{
320 public: 313 public:
321 314
322 ProfileEditorPluginSerial(QWidget *parent, Profile *p) 315 ProfileEditorPluginSerial(QWidget *parent, Profile *p)
323 : ProfileEditorPlugin(parent, p) 316 : ProfileEditorPlugin(parent, p)
324 { 317 {
@@ -332,23 +325,22 @@ class ProfileEditorPluginSerial : public ProfileEditorPlugin
332 { 325 {
333 if(!m_widget) 326 if(!m_widget)
334 { 327 {
335 QFrame *device_frame = new QFrame(m_parent);
336 device_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken);
337 328
338 QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); 329 QWidget *device_frame = new QWidget( m_parent );
330 QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame);
339 331
340 device_line = new QLineEdit("/dev/ttyS0", device_frame); 332 device_line = new QLineEdit("/dev/ttyS0", device_frame);
341 333
342 QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); 334 QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2);
343 vbox_frame->add(frame_device); 335 vbox_frame->add(frame_device);
344 vbox_frame->add(device_line); 336 vbox_frame->add(device_line);
345 337
346 m_widget = device_frame; 338 m_widget = device_frame;
347 339
348 // Load special settings 340 // Load special settings
349 341
350 QString dev = m_profile->readEntry("Device"); 342 QString dev = m_profile->readEntry("Device");
351 if(!dev.isNull()) device_line->setText(dev); 343 if(!dev.isNull()) device_line->setText(dev);
352 } 344 }
353 345
354 return m_widget; 346 return m_widget;
@@ -381,8 +373,8 @@ class ProfileEditorPluginIrda : public ProfileEditorPlugin
381 { 373 {
382 if(!m_widget) 374 if(!m_widget)
383 { 375 {
384 QFrame *device_frame = new QFrame(m_parent); 376 QWidget *device_frame = new QWidget(m_parent);
385 device_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken); 377
386 378
387 QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); 379 QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame);
388 380
@@ -429,8 +421,7 @@ class ProfileEditorPluginModem : public ProfileEditorPlugin
429 { 421 {
430 if(!m_widget) 422 if(!m_widget)
431 { 423 {
432 QFrame *device_frame = new QFrame(m_parent); 424 QWidget *device_frame = new QWidget(m_parent);
433 device_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken);
434 425
435 QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); 426 QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame);
436 QLabel *frame_number = new QLabel(QObject::tr("Phone number"), device_frame); 427 QLabel *frame_number = new QLabel(QObject::tr("Phone number"), device_frame);