summaryrefslogtreecommitdiff
authorjosef <josef>2002-10-07 16:03:17 (UTC)
committer josef <josef>2002-10-07 16:03:17 (UTC)
commitab5b7ba61580bfd3aa20297e67bd9fa6b6c90d41 (patch) (unidiff)
tree40ae13308e3509ffed90570b22ffbb000fe7cb10
parente68537563c9950654b9a771730f0fc3890803a54 (diff)
downloadopie-ab5b7ba61580bfd3aa20297e67bd9fa6b6c90d41.zip
opie-ab5b7ba61580bfd3aa20297e67bd9fa6b6c90d41.tar.gz
opie-ab5b7ba61580bfd3aa20297e67bd9fa6b6c90d41.tar.bz2
- forgot : QObject()
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,114 +1,115 @@
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);