summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/profileeditorplugins.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/profileeditorplugins.cpp b/noncore/apps/opie-console/profileeditorplugins.cpp
index a0bcab8..b63fa1c 100644
--- a/noncore/apps/opie-console/profileeditorplugins.cpp
+++ b/noncore/apps/opie-console/profileeditorplugins.cpp
@@ -1,402 +1,403 @@
1 1
2#include "profileeditorplugins.h" 2#include "profileeditorplugins.h"
3#include "profile.h" 3#include "profile.h"
4 4
5#include "qframe.h" 5#include "qframe.h"
6#include "qlabel.h" 6#include "qlabel.h"
7#include "qlineedit.h" 7#include "qlineedit.h"
8#include "qlayout.h" 8#include "qlayout.h"
9#include "qcombobox.h" 9#include "qcombobox.h"
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 13
14#include "io_serial.h" 14#include "io_serial.h"
15 15
16// Base class 16// Base class
17 17
18ProfileEditorPlugin::ProfileEditorPlugin(QWidget *parent, Profile *p) 18ProfileEditorPlugin::ProfileEditorPlugin(QWidget *parent, Profile *p)
19: QObject()
19{ 20{
20 m_parent = parent; 21 m_parent = parent;
21 m_profile = p; 22 m_profile = p;
22 m_widget = NULL; 23 m_widget = NULL;
23} 24}
24 25
25ProfileEditorPlugin::~ProfileEditorPlugin() 26ProfileEditorPlugin::~ProfileEditorPlugin()
26{ 27{
27 if(m_widget) delete m_widget; 28 if(m_widget) delete m_widget;
28} 29}
29 30
30QWidget *ProfileEditorPlugin::connection_widget() 31QWidget *ProfileEditorPlugin::connection_widget()
31{ 32{
32 QWidget *root; 33 QWidget *root;
33 QVBoxLayout *lroot; 34 QVBoxLayout *lroot;
34 35
35 root = new QWidget(); 36 root = new QWidget();
36 37
37 // Build GUI 38 // Build GUI
38 39
39 QComboBox *speed_box = new QComboBox(root); 40 QComboBox *speed_box = new QComboBox(root);
40 speed_box->insertItem("115200 baud", id_baud_115200); 41 speed_box->insertItem("115200 baud", id_baud_115200);
41 speed_box->insertItem("57600 baud", id_baud_57600); 42 speed_box->insertItem("57600 baud", id_baud_57600);
42 speed_box->insertItem("38400 baud", id_baud_38400); 43 speed_box->insertItem("38400 baud", id_baud_38400);
43 speed_box->insertItem("19200 baud", id_baud_19200); 44 speed_box->insertItem("19200 baud", id_baud_19200);
44 speed_box->insertItem("9600 baud", id_baud_9600); 45 speed_box->insertItem("9600 baud", id_baud_9600);
45 46
46 QLabel *speedlabel = new QLabel(QObject::tr("Speed"), root); 47 QLabel *speedlabel = new QLabel(QObject::tr("Speed"), root);
47 QLabel *flow = new QLabel(QObject::tr("Flow control"), root); 48 QLabel *flow = new QLabel(QObject::tr("Flow control"), root);
48 QLabel *parity = new QLabel(QObject::tr("Parity"), root); 49 QLabel *parity = new QLabel(QObject::tr("Parity"), root);
49 50
50 QButtonGroup *group_flow = new QButtonGroup(root); 51 QButtonGroup *group_flow = new QButtonGroup(root);
51 group_flow->hide(); 52 group_flow->hide();
52 QRadioButton *flow_hw = new QRadioButton(QObject::tr("Hardware"), root); 53 QRadioButton *flow_hw = new QRadioButton(QObject::tr("Hardware"), root);
53 QRadioButton *flow_sw = new QRadioButton(QObject::tr("Software"), root); 54 QRadioButton *flow_sw = new QRadioButton(QObject::tr("Software"), root);
54 group_flow->insert(flow_hw, id_flow_hw); 55 group_flow->insert(flow_hw, id_flow_hw);
55 group_flow->insert(flow_sw, id_flow_sw); 56 group_flow->insert(flow_sw, id_flow_sw);
56 57
57 QButtonGroup *group_parity = new QButtonGroup(root); 58 QButtonGroup *group_parity = new QButtonGroup(root);
58 group_parity->hide(); 59 group_parity->hide();
59 QRadioButton *parity_odd = new QRadioButton(QObject::tr("Odd"), root); 60 QRadioButton *parity_odd = new QRadioButton(QObject::tr("Odd"), root);
60 QRadioButton *parity_even = new QRadioButton(QObject::tr("Even"), root); 61 QRadioButton *parity_even = new QRadioButton(QObject::tr("Even"), root);
61 group_parity->insert(parity_odd, id_parity_odd); 62 group_parity->insert(parity_odd, id_parity_odd);
62 group_parity->insert(parity_even, id_parity_even); 63 group_parity->insert(parity_even, id_parity_even);
63 64
64 // Build Layout 65 // Build Layout
65 66
66 lroot = new QVBoxLayout(root); 67 lroot = new QVBoxLayout(root);
67 lroot->add(speedlabel); 68 lroot->add(speedlabel);
68 lroot->add(speed_box); 69 lroot->add(speed_box);
69 lroot->add(flow); 70 lroot->add(flow);
70 QHBoxLayout *hbox = new QHBoxLayout(lroot, 2); 71 QHBoxLayout *hbox = new QHBoxLayout(lroot, 2);
71 hbox->add(flow_hw); 72 hbox->add(flow_hw);
72 hbox->add(flow_sw); 73 hbox->add(flow_sw);
73 lroot->add(parity); 74 lroot->add(parity);
74 QHBoxLayout *hbox2 = new QHBoxLayout(lroot, 2); 75 QHBoxLayout *hbox2 = new QHBoxLayout(lroot, 2);
75 hbox2->add(parity_odd); 76 hbox2->add(parity_odd);
76 hbox2->add(parity_even); 77 hbox2->add(parity_even);
77 78
78 // Apply profile settings 79 // Apply profile settings
79 80
80 int rad_flow = m_profile->readNumEntry("Flow"); 81 int rad_flow = m_profile->readNumEntry("Flow");
81 int rad_parity = m_profile->readNumEntry("Parity"); 82 int rad_parity = m_profile->readNumEntry("Parity");
82 int speed = m_profile->readNumEntry("Speed"); 83 int speed = m_profile->readNumEntry("Speed");
83 84
84 if(rad_flow == IOSerial::FlowHW) flow_hw->setChecked(true); 85 if(rad_flow == IOSerial::FlowHW) flow_hw->setChecked(true);
85 else flow_sw->setChecked(true); 86 else flow_sw->setChecked(true);
86 if(rad_parity == IOSerial::ParityEven) parity_even->setChecked(true); 87 if(rad_parity == IOSerial::ParityEven) parity_even->setChecked(true);
87 else parity_odd->setChecked(true); 88 else parity_odd->setChecked(true);
88 if(speed == 115200) speed_box->setCurrentItem(id_baud_115200); 89 if(speed == 115200) speed_box->setCurrentItem(id_baud_115200);
89 if(speed == 57600) speed_box->setCurrentItem(id_baud_57600); 90 if(speed == 57600) speed_box->setCurrentItem(id_baud_57600);
90 if(speed == 38400) speed_box->setCurrentItem(id_baud_38400); 91 if(speed == 38400) speed_box->setCurrentItem(id_baud_38400);
91 if(speed == 19200) speed_box->setCurrentItem(id_baud_19200); 92 if(speed == 19200) speed_box->setCurrentItem(id_baud_19200);
92 if(speed == 9600) speed_box->setCurrentItem(id_baud_9600); 93 if(speed == 9600) speed_box->setCurrentItem(id_baud_9600);
93 94
94 // Signals 95 // Signals
95 96
96 connect(group_flow, SIGNAL(clicked(int)), SLOT(slotConnFlow(int))); 97 connect(group_flow, SIGNAL(clicked(int)), SLOT(slotConnFlow(int)));
97 connect(group_parity, SIGNAL(clicked(int)), SLOT(slotConnParity(int))); 98 connect(group_parity, SIGNAL(clicked(int)), SLOT(slotConnParity(int)));
98 connect(speed_box, SIGNAL(activated(int)), SLOT(slotConnSpeed(int))); 99 connect(speed_box, SIGNAL(activated(int)), SLOT(slotConnSpeed(int)));
99 100
100 return root; 101 return root;
101} 102}
102 103
103QWidget *ProfileEditorPlugin::terminal_widget() 104QWidget *ProfileEditorPlugin::terminal_widget()
104{ 105{
105 QWidget *root; 106 QWidget *root;
106 QVBoxLayout *lroot; 107 QVBoxLayout *lroot;
107 108
108 root = new QWidget(); 109 root = new QWidget();
109 110
110 // Build GUI 111 // Build GUI
111 112
112 QComboBox *terminal_box = new QComboBox(root); 113 QComboBox *terminal_box = new QComboBox(root);
113 terminal_box->insertItem("VT 100", id_term_vt100); 114 terminal_box->insertItem("VT 100", id_term_vt100);
114 terminal_box->insertItem("VT 220", id_term_vt220); 115 terminal_box->insertItem("VT 220", id_term_vt220);
115 terminal_box->insertItem("ANSI", id_term_ansi); 116 terminal_box->insertItem("ANSI", id_term_ansi);
116 117
117 QLabel *terminal = new QLabel(QObject::tr("Terminal type"), root); 118 QLabel *terminal = new QLabel(QObject::tr("Terminal type"), root);
118 QLabel *colourlabel = new QLabel(QObject::tr("Colour scheme"), root); 119 QLabel *colourlabel = new QLabel(QObject::tr("Colour scheme"), root);
119 QLabel *sizelabel = new QLabel(QObject::tr("Font size"), root); 120 QLabel *sizelabel = new QLabel(QObject::tr("Font size"), root);
120 QLabel *options = new QLabel(QObject::tr("Options"), root); 121 QLabel *options = new QLabel(QObject::tr("Options"), root);
121 QLabel *conversions = new QLabel(QObject::tr("Line-break conversions"), root); 122 QLabel *conversions = new QLabel(QObject::tr("Line-break conversions"), root);
122 123
123 QComboBox *colour_box = new QComboBox(root); 124 QComboBox *colour_box = new QComboBox(root);
124 colour_box->insertItem(QObject::tr("black on white"), id_term_black); 125 colour_box->insertItem(QObject::tr("black on white"), id_term_black);
125 colour_box->insertItem(QObject::tr("white on black"), id_term_white); 126 colour_box->insertItem(QObject::tr("white on black"), id_term_white);
126 127
127 QButtonGroup *group_size = new QButtonGroup(root); 128 QButtonGroup *group_size = new QButtonGroup(root);
128 group_size->hide(); 129 group_size->hide();
129 QRadioButton *size_small = new QRadioButton(QObject::tr("small"), root); 130 QRadioButton *size_small = new QRadioButton(QObject::tr("small"), root);
130 QRadioButton *size_medium = new QRadioButton(QObject::tr("medium"), root); 131 QRadioButton *size_medium = new QRadioButton(QObject::tr("medium"), root);
131 QRadioButton *size_large = new QRadioButton(QObject::tr("large"), root); 132 QRadioButton *size_large = new QRadioButton(QObject::tr("large"), root);
132 group_size->insert(size_small); 133 group_size->insert(size_small);
133 group_size->insert(size_medium); 134 group_size->insert(size_medium);
134 group_size->insert(size_large); 135 group_size->insert(size_large);
135 136
136 QCheckBox *option_echo = new QCheckBox(QObject::tr("Local echo"), root); 137 QCheckBox *option_echo = new QCheckBox(QObject::tr("Local echo"), root);
137 QCheckBox *option_wrap = new QCheckBox(QObject::tr("Line wrap"), root); 138 QCheckBox *option_wrap = new QCheckBox(QObject::tr("Line wrap"), root);
138 139
139 QCheckBox *conv_inbound = new QCheckBox(QObject::tr("Inbound"), root); 140 QCheckBox *conv_inbound = new QCheckBox(QObject::tr("Inbound"), root);
140 QCheckBox *conv_outbound = new QCheckBox(QObject::tr("Outbound"), root); 141 QCheckBox *conv_outbound = new QCheckBox(QObject::tr("Outbound"), root);
141 142
142 // Build Layout 143 // Build Layout
143 144
144 lroot = new QVBoxLayout(root, 2); 145 lroot = new QVBoxLayout(root, 2);
145 lroot->add(terminal); 146 lroot->add(terminal);
146 lroot->add(terminal_box); 147 lroot->add(terminal_box);
147 lroot->add(sizelabel); 148 lroot->add(sizelabel);
148 QHBoxLayout *hbox = new QHBoxLayout(lroot, 2); 149 QHBoxLayout *hbox = new QHBoxLayout(lroot, 2);
149 hbox->add(size_small); 150 hbox->add(size_small);
150 hbox->add(size_medium); 151 hbox->add(size_medium);
151 hbox->add(size_large); 152 hbox->add(size_large);
152 lroot->add(colourlabel); 153 lroot->add(colourlabel);
153 lroot->add(colour_box); 154 lroot->add(colour_box);
154 lroot->add(conversions); 155 lroot->add(conversions);
155 QHBoxLayout *hbox2 = new QHBoxLayout(lroot, 2); 156 QHBoxLayout *hbox2 = new QHBoxLayout(lroot, 2);
156 hbox2->add(conv_inbound); 157 hbox2->add(conv_inbound);
157 hbox2->add(conv_outbound); 158 hbox2->add(conv_outbound);
158 lroot->add(options); 159 lroot->add(options);
159 QHBoxLayout *hbox3 = new QHBoxLayout(lroot, 2); 160 QHBoxLayout *hbox3 = new QHBoxLayout(lroot, 2);
160 hbox3->add(option_wrap); 161 hbox3->add(option_wrap);
161 hbox3->add(option_echo); 162 hbox3->add(option_echo);
162 163
163 // Apply profile settings 164 // Apply profile settings
164 165
165 int term = m_profile->readNumEntry("Terminal"); 166 int term = m_profile->readNumEntry("Terminal");
166 int colour = m_profile->readNumEntry("Colour"); 167 int colour = m_profile->readNumEntry("Colour");
167 int fontsize = m_profile->readNumEntry("Font"); 168 int fontsize = m_profile->readNumEntry("Font");
168 int opt_echo = m_profile->readNumEntry("Echo"); 169 int opt_echo = m_profile->readNumEntry("Echo");
169 int opt_wrap = m_profile->readNumEntry("Wrap"); 170 int opt_wrap = m_profile->readNumEntry("Wrap");
170 int opt_inbound = m_profile->readNumEntry("Inbound"); 171 int opt_inbound = m_profile->readNumEntry("Inbound");
171 int opt_outbound = m_profile->readNumEntry("Outbound"); 172 int opt_outbound = m_profile->readNumEntry("Outbound");
172 173
173 if(term == Profile::VT102) terminal_box->setCurrentItem(id_term_vt100); 174 if(term == Profile::VT102) terminal_box->setCurrentItem(id_term_vt100);
174 175
175 if(colour == Profile::Black) colour_box->setCurrentItem(id_term_black); 176 if(colour == Profile::Black) colour_box->setCurrentItem(id_term_black);
176 if(colour == Profile::White) colour_box->setCurrentItem(id_term_white); 177 if(colour == Profile::White) colour_box->setCurrentItem(id_term_white);
177 178
178 if(fontsize == Profile::Micro) size_small->setChecked(true); 179 if(fontsize == Profile::Micro) size_small->setChecked(true);
179 if(fontsize == Profile::Small) size_medium->setChecked(true); 180 if(fontsize == Profile::Small) size_medium->setChecked(true);
180 if(fontsize == Profile::Medium) size_large->setChecked(true); 181 if(fontsize == Profile::Medium) size_large->setChecked(true);
181 182
182 if(opt_echo) option_echo->setChecked(true); 183 if(opt_echo) option_echo->setChecked(true);
183 if(opt_wrap) option_wrap->setChecked(true); 184 if(opt_wrap) option_wrap->setChecked(true);
184 if(opt_inbound) conv_inbound->setChecked(true); 185 if(opt_inbound) conv_inbound->setChecked(true);
185 if(opt_outbound) conv_outbound->setChecked(true); 186 if(opt_outbound) conv_outbound->setChecked(true);
186 187
187 // Signals 188 // Signals
188 189
189 connect(terminal_box, SIGNAL(activated(int)), SLOT(slotTermTerm(int))); 190 connect(terminal_box, SIGNAL(activated(int)), SLOT(slotTermTerm(int)));
190 connect(colour_box, SIGNAL(activated(int)), SLOT(slotTermColour(int))); 191 connect(colour_box, SIGNAL(activated(int)), SLOT(slotTermColour(int)));
191 connect(group_size, SIGNAL(clicked(int)), SLOT(slotTermFont(int))); 192 connect(group_size, SIGNAL(clicked(int)), SLOT(slotTermFont(int)));
192 193
193 connect(option_echo, SIGNAL(toggled(bool)), SLOT(slotTermEcho(bool))); 194 connect(option_echo, SIGNAL(toggled(bool)), SLOT(slotTermEcho(bool)));
194 connect(option_wrap, SIGNAL(toggled(bool)), SLOT(slotTermWrap(bool))); 195 connect(option_wrap, SIGNAL(toggled(bool)), SLOT(slotTermWrap(bool)));
195 connect(conv_inbound, SIGNAL(toggled(bool)), SLOT(slotTermInbound(bool))); 196 connect(conv_inbound, SIGNAL(toggled(bool)), SLOT(slotTermInbound(bool)));
196 connect(conv_outbound, SIGNAL(toggled(bool)), SLOT(slotTermOutbound(bool))); 197 connect(conv_outbound, SIGNAL(toggled(bool)), SLOT(slotTermOutbound(bool)));
197 198
198 return root; 199 return root;
199} 200}
200 201
201void ProfileEditorPlugin::slotConnFlow(int id) 202void ProfileEditorPlugin::slotConnFlow(int id)
202{ 203{
203 switch(id) 204 switch(id)
204 { 205 {
205 case id_flow_hw: 206 case id_flow_hw:
206 m_profile->writeEntry("Flow", IOSerial::FlowHW); 207 m_profile->writeEntry("Flow", IOSerial::FlowHW);
207 break; 208 break;
208 case id_flow_sw: 209 case id_flow_sw:
209 m_profile->writeEntry("Flow", IOSerial::FlowSW); 210 m_profile->writeEntry("Flow", IOSerial::FlowSW);
210 break; 211 break;
211 } 212 }
212} 213}
213 214
214void ProfileEditorPlugin::slotConnParity(int id) 215void ProfileEditorPlugin::slotConnParity(int id)
215{ 216{
216 switch(id) 217 switch(id)
217 { 218 {
218 case id_parity_odd: 219 case id_parity_odd:
219 m_profile->writeEntry("Parity", IOSerial::ParityEven); 220 m_profile->writeEntry("Parity", IOSerial::ParityEven);
220 break; 221 break;
221 case id_parity_even: 222 case id_parity_even:
222 m_profile->writeEntry("Parity", IOSerial::ParityOdd); 223 m_profile->writeEntry("Parity", IOSerial::ParityOdd);
223 break; 224 break;
224 } 225 }
225} 226}
226 227
227void ProfileEditorPlugin::slotConnSpeed(int id) 228void ProfileEditorPlugin::slotConnSpeed(int id)
228{ 229{
229 switch(id) 230 switch(id)
230 { 231 {
231 232
232 case id_baud_115200: 233 case id_baud_115200:
233 m_profile->writeEntry("Speed", 115200); 234 m_profile->writeEntry("Speed", 115200);
234 break; 235 break;
235 case id_baud_57600: 236 case id_baud_57600:
236 m_profile->writeEntry("Speed", 57600); 237 m_profile->writeEntry("Speed", 57600);
237 break; 238 break;
238 case id_baud_38400: 239 case id_baud_38400:
239 m_profile->writeEntry("Speed", 38400); 240 m_profile->writeEntry("Speed", 38400);
240 break; 241 break;
241 case id_baud_19200: 242 case id_baud_19200:
242 m_profile->writeEntry("Speed", 19200); 243 m_profile->writeEntry("Speed", 19200);
243 break; 244 break;
244 case id_baud_9600: 245 case id_baud_9600:
245 m_profile->writeEntry("Speed", 9600); 246 m_profile->writeEntry("Speed", 9600);
246 break; 247 break;
247 } 248 }
248} 249}
249 250
250void ProfileEditorPlugin::slotTermTerm(int id) 251void ProfileEditorPlugin::slotTermTerm(int id)
251{ 252{
252 switch(id) 253 switch(id)
253 { 254 {
254 case id_term_vt100: 255 case id_term_vt100:
255 m_profile->writeEntry("Terminal", Profile::VT102); 256 m_profile->writeEntry("Terminal", Profile::VT102);
256 break; 257 break;
257 case id_term_vt220: 258 case id_term_vt220:
258 m_profile->writeEntry("Terminal", Profile::VT102); 259 m_profile->writeEntry("Terminal", Profile::VT102);
259 break; 260 break;
260 case id_term_ansi: 261 case id_term_ansi:
261 m_profile->writeEntry("Terminal", Profile::VT102); 262 m_profile->writeEntry("Terminal", Profile::VT102);
262 break; 263 break;
263 } 264 }
264} 265}
265 266
266void ProfileEditorPlugin::slotTermColour(int id) 267void ProfileEditorPlugin::slotTermColour(int id)
267{ 268{
268 switch(id) 269 switch(id)
269 { 270 {
270 case id_term_black: 271 case id_term_black:
271 m_profile->writeEntry("Colour", Profile::Black); 272 m_profile->writeEntry("Colour", Profile::Black);
272 break; 273 break;
273 case id_term_white: 274 case id_term_white:
274 m_profile->writeEntry("Colour", Profile::White); 275 m_profile->writeEntry("Colour", Profile::White);
275 break; 276 break;
276 } 277 }
277} 278}
278 279
279void ProfileEditorPlugin::slotTermFont(int id) 280void ProfileEditorPlugin::slotTermFont(int id)
280{ 281{
281 switch(id) 282 switch(id)
282 { 283 {
283 case id_size_small: 284 case id_size_small:
284 m_profile->writeEntry("Font", Profile::Micro); 285 m_profile->writeEntry("Font", Profile::Micro);
285 break; 286 break;
286 case id_size_medium: 287 case id_size_medium:
287 m_profile->writeEntry("Font", Profile::Small); 288 m_profile->writeEntry("Font", Profile::Small);
288 break; 289 break;
289 case id_size_large: 290 case id_size_large:
290 m_profile->writeEntry("Font", Profile::Medium); 291 m_profile->writeEntry("Font", Profile::Medium);
291 break; 292 break;
292 } 293 }
293} 294}
294 295
295void ProfileEditorPlugin::slotTermEcho(bool on) 296void ProfileEditorPlugin::slotTermEcho(bool on)
296{ 297{
297 m_profile->writeEntry("Echo", on ? 1 : 0); 298 m_profile->writeEntry("Echo", on ? 1 : 0);
298} 299}
299 300
300void ProfileEditorPlugin::slotTermWrap(bool on) 301void ProfileEditorPlugin::slotTermWrap(bool on)
301{ 302{
302 m_profile->writeEntry("Wrap", on ? 1 : 0); 303 m_profile->writeEntry("Wrap", on ? 1 : 0);
303} 304}
304 305
305void ProfileEditorPlugin::slotTermInbound(bool on) 306void ProfileEditorPlugin::slotTermInbound(bool on)
306{ 307{
307 m_profile->writeEntry("Inbound", on ? 1 : 0); 308 m_profile->writeEntry("Inbound", on ? 1 : 0);
308} 309}
309 310
310void ProfileEditorPlugin::slotTermOutbound(bool on) 311void ProfileEditorPlugin::slotTermOutbound(bool on)
311{ 312{
312 m_profile->writeEntry("Outbound", on ? 1 : 0); 313 m_profile->writeEntry("Outbound", on ? 1 : 0);
313} 314}
314 315
315// Inherited classes 316// Inherited classes
316 317
317class ProfileEditorPluginSerial : public ProfileEditorPlugin 318class ProfileEditorPluginSerial : public ProfileEditorPlugin
318{ 319{
319 public: 320 public:
320 321
321 ProfileEditorPluginSerial(QWidget *parent, Profile *p) 322 ProfileEditorPluginSerial(QWidget *parent, Profile *p)
322 : ProfileEditorPlugin(parent, p) 323 : ProfileEditorPlugin(parent, p)
323 { 324 {
324 } 325 }
325 326
326 ~ProfileEditorPluginSerial() 327 ~ProfileEditorPluginSerial()
327 { 328 {
328 } 329 }
329 330
330 QWidget *widget() 331 QWidget *widget()
331 { 332 {
332 if(!m_widget) 333 if(!m_widget)
333 { 334 {
334 QFrame *device_frame = new QFrame(m_parent); 335 QFrame *device_frame = new QFrame(m_parent);
335 device_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken); 336 device_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken);
336 337
337 QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); 338 QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame);
338 339
339 device_line = new QLineEdit("/dev/ttyS0", device_frame); 340 device_line = new QLineEdit("/dev/ttyS0", device_frame);
340 341
341 QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); 342 QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2);
342 vbox_frame->add(frame_device); 343 vbox_frame->add(frame_device);
343 vbox_frame->add(device_line); 344 vbox_frame->add(device_line);
344 345
345 m_widget = device_frame; 346 m_widget = device_frame;
346 347
347 // Load special settings 348 // Load special settings
348 349
349 QString dev = m_profile->readEntry("Device"); 350 QString dev = m_profile->readEntry("Device");
350 if(!dev.isNull()) device_line->setText(dev); 351 if(!dev.isNull()) device_line->setText(dev);
351 } 352 }
352 353
353 return m_widget; 354 return m_widget;
354 } 355 }
355 356
356 void save() 357 void save()
357 { 358 {
358 // special settings 359 // special settings
359 m_profile->writeEntry("Device", device_line->text()); 360 m_profile->writeEntry("Device", device_line->text());
360 } 361 }
361 362
362 private: 363 private:
363 QLineEdit *device_line; 364 QLineEdit *device_line;
364}; 365};
365 366
366class ProfileEditorPluginIrda : public ProfileEditorPlugin 367class ProfileEditorPluginIrda : public ProfileEditorPlugin
367{ 368{
368 public: 369 public:
369 370
370 ProfileEditorPluginIrda(QWidget *parent, Profile *p) 371 ProfileEditorPluginIrda(QWidget *parent, Profile *p)
371 : ProfileEditorPlugin(parent, p) 372 : ProfileEditorPlugin(parent, p)
372 { 373 {
373 } 374 }
374 375
375 ~ProfileEditorPluginIrda() 376 ~ProfileEditorPluginIrda()
376 { 377 {
377 } 378 }
378 379
379 QWidget *widget() 380 QWidget *widget()
380 { 381 {
381 if(!m_widget) 382 if(!m_widget)
382 { 383 {
383 QFrame *device_frame = new QFrame(m_parent); 384 QFrame *device_frame = new QFrame(m_parent);
384 device_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken); 385 device_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken);
385 386
386 QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); 387 QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame);
387 388
388 device_line = new QLineEdit("/dev/ircomm0", device_frame); 389 device_line = new QLineEdit("/dev/ircomm0", device_frame);
389 390
390 QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); 391 QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2);
391 vbox_frame->add(frame_device); 392 vbox_frame->add(frame_device);
392 vbox_frame->add(device_line); 393 vbox_frame->add(device_line);
393 394
394 m_widget = device_frame; 395 m_widget = device_frame;
395 396
396 // Load special settings 397 // Load special settings
397 QString dev = m_profile->readEntry("Device"); 398 QString dev = m_profile->readEntry("Device");
398 if(!dev.isNull()) device_line->setText(dev); 399 if(!dev.isNull()) device_line->setText(dev);
399 } 400 }
400 401
401 return m_widget; 402 return m_widget;
402 } 403 }