Diffstat (limited to 'noncore/apps/opie-console/profileeditordialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 188 |
1 files changed, 7 insertions, 181 deletions
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index 78885e1..d98e589 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -6,8 +6,5 @@ | |||
6 | #include "qlabel.h" | 6 | #include "qlabel.h" |
7 | #include "qradiobutton.h" | ||
8 | #include "qcombobox.h" | ||
9 | #include "qcheckbox.h" | ||
10 | #include "qmessagebox.h" | 7 | #include "qmessagebox.h" |
11 | #include "qbuttongroup.h" | ||
12 | #include "qstringlist.h" | 8 | #include "qstringlist.h" |
9 | #include "qcombobox.h" | ||
13 | 10 | ||
@@ -83,29 +80,4 @@ void ProfileEditorDialog::initUI() | |||
83 | 80 | ||
84 | QComboBox *speed_box = new QComboBox(tabconn); | 81 | QWidget *conn_widget = plugin_plugin->connection_widget(); |
85 | speed_box->insertItem("115200 baud", id_baud_115200); | 82 | conn_widget->reparent(tabconn, 0, QPoint(), true); |
86 | speed_box->insertItem("57600 baud", id_baud_57600); | ||
87 | speed_box->insertItem("38400 baud", id_baud_38400); | ||
88 | speed_box->insertItem("19200 baud", id_baud_19200); | ||
89 | speed_box->insertItem("9600 baud", id_baud_9600); | ||
90 | |||
91 | QLabel *speed = new QLabel(QObject::tr("Speed"), tabconn); | ||
92 | QLabel *flow = new QLabel(QObject::tr("Flow control"), tabconn); | ||
93 | QLabel *parity = new QLabel(QObject::tr("Parity"), tabconn); | ||
94 | |||
95 | QButtonGroup *group_flow = new QButtonGroup(tabconn); | ||
96 | group_flow->hide(); | ||
97 | QRadioButton *flow_hw = new QRadioButton(QObject::tr("Hardware"), tabconn); | ||
98 | QRadioButton *flow_sw = new QRadioButton(QObject::tr("Software"), tabconn); | ||
99 | group_flow->insert(flow_hw, id_flow_hw); | ||
100 | group_flow->insert(flow_sw, id_flow_sw); | ||
101 | |||
102 | QButtonGroup *group_parity = new QButtonGroup(tabconn); | ||
103 | group_parity->hide(); | ||
104 | QRadioButton *parity_odd = new QRadioButton(QObject::tr("Odd"), tabconn); | ||
105 | QRadioButton *parity_even = new QRadioButton(QObject::tr("Even"), tabconn); | ||
106 | group_parity->insert(parity_odd, id_parity_odd); | ||
107 | group_parity->insert(parity_even, id_parity_even); | ||
108 | |||
109 | flow_sw->setChecked(true); | ||
110 | parity_odd->setChecked(true); | ||
111 | 83 | ||
@@ -113,33 +85,4 @@ void ProfileEditorDialog::initUI() | |||
113 | 85 | ||
114 | QComboBox *terminal_box = new QComboBox(tabterm); | 86 | QWidget *term_widget = plugin_plugin->terminal_widget(); |
115 | terminal_box->insertItem("VT 100", id_term_vt100); | 87 | term_widget->reparent(tabterm, 0, QPoint(), true); |
116 | terminal_box->insertItem("VT 220", id_term_vt220); | ||
117 | terminal_box->insertItem("ANSI", id_term_ansi); | ||
118 | |||
119 | QLabel *terminal = new QLabel(QObject::tr("Terminal type"), tabterm); | ||
120 | QLabel *colour = new QLabel(QObject::tr("Colour scheme"), tabterm); | ||
121 | QLabel *size = new QLabel(QObject::tr("Font size"), tabterm); | ||
122 | QLabel *options = new QLabel(QObject::tr("Options"), tabterm); | ||
123 | QLabel *conversions = new QLabel(QObject::tr("Line-break conversions"), tabterm); | ||
124 | |||
125 | QComboBox *colour_box = new QComboBox(tabterm); | ||
126 | colour_box->insertItem(QObject::tr("black on white")); | ||
127 | colour_box->insertItem(QObject::tr("white on black")); | ||
128 | |||
129 | QButtonGroup *group_size = new QButtonGroup(tabterm); | ||
130 | group_size->hide(); | ||
131 | QRadioButton *size_small = new QRadioButton(QObject::tr("small"), tabterm); | ||
132 | QRadioButton *size_medium = new QRadioButton(QObject::tr("medium"), tabterm); | ||
133 | QRadioButton *size_large = new QRadioButton(QObject::tr("large"), tabterm); | ||
134 | group_size->insert(size_small); | ||
135 | group_size->insert(size_medium); | ||
136 | group_size->insert(size_large); | ||
137 | |||
138 | QCheckBox *option_echo = new QCheckBox(QObject::tr("Local echo"), tabterm); | ||
139 | QCheckBox *option_wrap = new QCheckBox(QObject::tr("Line wrap"), tabterm); | ||
140 | |||
141 | QCheckBox *conv_inbound = new QCheckBox(QObject::tr("Inbound"), tabterm); | ||
142 | QCheckBox *conv_outbound = new QCheckBox(QObject::tr("Outbound"), tabterm); | ||
143 | |||
144 | size_small->setChecked(true); | ||
145 | 88 | ||
@@ -156,34 +99,6 @@ void ProfileEditorDialog::initUI() | |||
156 | vbox->add(plugin_base); | 99 | vbox->add(plugin_base); |
157 | vbox->add(speed); | 100 | vbox->add(conn_widget); |
158 | vbox->add(speed_box); | ||
159 | vbox->add(flow); | ||
160 | QHBoxLayout *hbox = new QHBoxLayout(vbox, 2); | ||
161 | hbox->add(flow_hw); | ||
162 | hbox->add(flow_sw); | ||
163 | //vbox->add(group_flow); | ||
164 | vbox->add(parity); | ||
165 | QHBoxLayout *hbox2 = new QHBoxLayout(vbox, 2); | ||
166 | hbox2->add(parity_odd); | ||
167 | hbox2->add(parity_even); | ||
168 | //vbox->add(group_parity); | ||
169 | 101 | ||
170 | QVBoxLayout *vbox2 = new QVBoxLayout(tabterm, 2); | 102 | QVBoxLayout *vbox2 = new QVBoxLayout(tabterm, 2); |
171 | vbox2->add(terminal); | 103 | vbox2->add(term_widget); |
172 | vbox2->add(terminal_box); | ||
173 | vbox2->add(size); | ||
174 | QHBoxLayout *hbox3 = new QHBoxLayout(vbox2, 2); | ||
175 | hbox3->add(size_small); | ||
176 | hbox3->add(size_medium); | ||
177 | hbox3->add(size_large); | ||
178 | //vbox2->add(group_size); | ||
179 | vbox2->add(colour); | ||
180 | vbox2->add(colour_box); | ||
181 | vbox2->add(conversions); | ||
182 | QHBoxLayout *hbox5 = new QHBoxLayout(vbox2, 2); | ||
183 | hbox5->add(conv_inbound); | ||
184 | hbox5->add(conv_outbound); | ||
185 | vbox2->add(options); | ||
186 | QHBoxLayout *hbox4 = new QHBoxLayout(vbox2, 2); | ||
187 | hbox4->add(option_wrap); | ||
188 | hbox4->add(option_echo); | ||
189 | 104 | ||
@@ -204,9 +119,2 @@ void ProfileEditorDialog::initUI() | |||
204 | connect(device_box, SIGNAL(activated(int)), SLOT(slotDevice(int))); | 119 | connect(device_box, SIGNAL(activated(int)), SLOT(slotDevice(int))); |
205 | |||
206 | connect(group_flow, SIGNAL(clicked(int)), SLOT(slotConnFlow(int))); | ||
207 | connect(group_parity, SIGNAL(clicked(int)), SLOT(slotConnParity(int))); | ||
208 | connect(speed_box, SIGNAL(activated(int)), SLOT(slotConnSpeed(int))); | ||
209 | |||
210 | connect(terminal_box, SIGNAL(activated(int)), SLOT(slotTermTerm(int))); | ||
211 | connect(group_size, SIGNAL(clicked(int)), SLOT(slotTermFont(int))); | ||
212 | } | 120 | } |
@@ -269,84 +177,2 @@ QString ProfileEditorDialog::prof_type() | |||
269 | 177 | ||
270 | void ProfileEditorDialog::slotConnFlow(int id) | ||
271 | { | ||
272 | switch(id) | ||
273 | { | ||
274 | case id_flow_hw: | ||
275 | m_prof.writeEntry("Flow", 0x01); | ||
276 | break; | ||
277 | case id_flow_sw: | ||
278 | m_prof.writeEntry("Flow", 0x02); | ||
279 | break; | ||
280 | } | ||
281 | } | ||
282 | |||
283 | void ProfileEditorDialog::slotConnParity(int id) | ||
284 | { | ||
285 | switch(id) | ||
286 | { | ||
287 | case id_parity_odd: | ||
288 | m_prof.writeEntry("Parity", 2); | ||
289 | break; | ||
290 | case id_parity_even: | ||
291 | m_prof.writeEntry("Parity", 1); | ||
292 | break; | ||
293 | } | ||
294 | } | ||
295 | |||
296 | void ProfileEditorDialog::slotConnSpeed(int id) | ||
297 | { | ||
298 | switch(id) | ||
299 | { | ||
300 | |||
301 | case id_baud_115200: | ||
302 | m_prof.writeEntry("Speed", 115200); | ||
303 | break; | ||
304 | case id_baud_57600: | ||
305 | m_prof.writeEntry("Speed", 57600); | ||
306 | break; | ||
307 | case id_baud_38400: | ||
308 | m_prof.writeEntry("Speed", 38400); | ||
309 | break; | ||
310 | case id_baud_19200: | ||
311 | m_prof.writeEntry("Speed", 19200); | ||
312 | break; | ||
313 | case id_baud_9600: | ||
314 | m_prof.writeEntry("Speed", 9600); | ||
315 | break; | ||
316 | } | ||
317 | } | ||
318 | |||
319 | void ProfileEditorDialog::slotTermTerm(int id) | ||
320 | { | ||
321 | switch(id) | ||
322 | { | ||
323 | |||
324 | case id_term_vt100: | ||
325 | m_prof.writeEntry("Terminal", 2); | ||
326 | break; | ||
327 | case id_term_vt220: | ||
328 | m_prof.writeEntry("Terminal", 1); | ||
329 | break; | ||
330 | case id_term_ansi: | ||
331 | m_prof.writeEntry("Terminal", 0); | ||
332 | break; | ||
333 | } | ||
334 | } | ||
335 | |||
336 | void ProfileEditorDialog::slotTermFont(int id) | ||
337 | { | ||
338 | switch(id) | ||
339 | { | ||
340 | case id_size_small: | ||
341 | m_prof.writeEntry("Font", 0); | ||
342 | break; | ||
343 | case id_size_medium: | ||
344 | m_prof.writeEntry("Font", 1); | ||
345 | break; | ||
346 | case id_size_large: | ||
347 | m_prof.writeEntry("Font", 2); | ||
348 | break; | ||
349 | } | ||
350 | } | ||
351 | |||
352 | 178 | ||