author | zecke <zecke> | 2002-10-12 22:43:12 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-12 22:43:12 (UTC) |
commit | 9333a4005b30aaa723447a044c9fce5a1e580317 (patch) (unidiff) | |
tree | 275ed089a65fd0f38918b812e0b1f68a1f78f980 | |
parent | 97dc4008b5194ec0aa131fcf9b8753a61fe6fb74 (diff) | |
download | opie-9333a4005b30aaa723447a044c9fce5a1e580317.zip opie-9333a4005b30aaa723447a044c9fce5a1e580317.tar.gz opie-9333a4005b30aaa723447a044c9fce5a1e580317.tar.bz2 |
Header file clean up
use <> for global header
"" for local
1. system header
2. Qt header
3. QPE Header
4. Opie Header
5. local header
6. the class declaration..
-rw-r--r-- | noncore/apps/opie-console/configdialog.cpp | 7 | ||||
-rw-r--r-- | noncore/apps/opie-console/file_layer.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditorplugins.cpp | 25 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditorplugins.h | 3 |
4 files changed, 19 insertions, 19 deletions
diff --git a/noncore/apps/opie-console/configdialog.cpp b/noncore/apps/opie-console/configdialog.cpp index 50512b6..8745305 100644 --- a/noncore/apps/opie-console/configdialog.cpp +++ b/noncore/apps/opie-console/configdialog.cpp | |||
@@ -1,114 +1,115 @@ | |||
1 | #include <qdialog.h> | ||
2 | #include <qlistview.h> | ||
3 | |||
1 | 4 | ||
2 | #include "profile.h" | 5 | #include "profile.h" |
3 | #include "qlistview.h" | ||
4 | #include "configdialog.h" | 6 | #include "configdialog.h" |
5 | #include "profileeditordialog.h" | ||
6 | #include "metafactory.h" | 7 | #include "metafactory.h" |
7 | #include "qdialog.h" | 8 | #include "profileeditordialog.h" |
8 | 9 | ||
9 | class ConfigListItem : public QListViewItem { | 10 | class ConfigListItem : public QListViewItem { |
10 | public: | 11 | public: |
11 | ConfigListItem( QListView* item, const Profile& ); | 12 | ConfigListItem( QListView* item, const Profile& ); |
12 | ~ConfigListItem(); | 13 | ~ConfigListItem(); |
13 | Profile profile()const; | 14 | Profile profile()const; |
14 | 15 | ||
15 | private: | 16 | private: |
16 | Profile m_prof; | 17 | Profile m_prof; |
17 | }; | 18 | }; |
18 | ConfigListItem::ConfigListItem( QListView* item, const Profile& prof ) | 19 | ConfigListItem::ConfigListItem( QListView* item, const Profile& prof ) |
19 | : QListViewItem( item ), m_prof( prof ) | 20 | : QListViewItem( item ), m_prof( prof ) |
20 | { | 21 | { |
21 | setText(0, prof.name() ); | 22 | setText(0, prof.name() ); |
22 | } | 23 | } |
23 | ConfigListItem::~ConfigListItem() { | 24 | ConfigListItem::~ConfigListItem() { |
24 | 25 | ||
25 | } | 26 | } |
26 | Profile ConfigListItem::profile()const { | 27 | Profile ConfigListItem::profile()const { |
27 | return m_prof; | 28 | return m_prof; |
28 | } | 29 | } |
29 | 30 | ||
30 | /* Dialog */ | 31 | /* Dialog */ |
31 | 32 | ||
32 | ConfigDialog::ConfigDialog( const Profile::ValueList& lis, MetaFactory* fa, | 33 | ConfigDialog::ConfigDialog( const Profile::ValueList& lis, MetaFactory* fa, |
33 | QWidget* parent ) | 34 | QWidget* parent ) |
34 | : ConfigureBase( parent, 0, TRUE ), m_fact( fa ) | 35 | : ConfigureBase( parent, 0, TRUE ), m_fact( fa ) |
35 | { | 36 | { |
36 | //init(); | 37 | //init(); |
37 | { | 38 | { |
38 | Profile::ValueList::ConstIterator it; | 39 | Profile::ValueList::ConstIterator it; |
39 | for (it = lis.begin(); it != lis.end(); ++it ) { | 40 | for (it = lis.begin(); it != lis.end(); ++it ) { |
40 | new ConfigListItem( lstView, (*it) ); | 41 | new ConfigListItem( lstView, (*it) ); |
41 | } | 42 | } |
42 | } | 43 | } |
43 | } | 44 | } |
44 | ConfigDialog::~ConfigDialog() { | 45 | ConfigDialog::~ConfigDialog() { |
45 | 46 | ||
46 | } | 47 | } |
47 | Profile::ValueList ConfigDialog::list()const { | 48 | Profile::ValueList ConfigDialog::list()const { |
48 | /* iterate over the list */ | 49 | /* iterate over the list */ |
49 | Profile::ValueList lst; | 50 | Profile::ValueList lst; |
50 | QListViewItemIterator it(lstView); | 51 | QListViewItemIterator it(lstView); |
51 | for ( ; it.current(); ++it ) { | 52 | for ( ; it.current(); ++it ) { |
52 | ConfigListItem* item = (ConfigListItem*)it.current(); | 53 | ConfigListItem* item = (ConfigListItem*)it.current(); |
53 | lst.append( item->profile() ); | 54 | lst.append( item->profile() ); |
54 | } | 55 | } |
55 | return lst; | 56 | return lst; |
56 | } | 57 | } |
57 | /* our slots */ | 58 | /* our slots */ |
58 | void ConfigDialog::slotRemove() { | 59 | void ConfigDialog::slotRemove() { |
59 | ConfigListItem* item = (ConfigListItem*)lstView->currentItem(); | 60 | ConfigListItem* item = (ConfigListItem*)lstView->currentItem(); |
60 | if (!item ) | 61 | if (!item ) |
61 | return; | 62 | return; |
62 | 63 | ||
63 | lstView->takeItem( item ); | 64 | lstView->takeItem( item ); |
64 | delete item; | 65 | delete item; |
65 | } | 66 | } |
66 | 67 | ||
67 | void ConfigDialog::slotEdit() { | 68 | void ConfigDialog::slotEdit() { |
68 | Profile p; | 69 | Profile p; |
69 | 70 | ||
70 | if(!lstView->currentItem()) return; | 71 | if(!lstView->currentItem()) return; |
71 | 72 | ||
72 | // Load profile | 73 | // Load profile |
73 | p = ((ConfigListItem*)lstView->currentItem())->profile(); | 74 | p = ((ConfigListItem*)lstView->currentItem())->profile(); |
74 | 75 | ||
75 | ProfileEditorDialog dlg(m_fact, p); | 76 | ProfileEditorDialog dlg(m_fact, p); |
76 | 77 | ||
77 | dlg.setCaption("Edit Connection Profile"); | 78 | dlg.setCaption("Edit Connection Profile"); |
78 | dlg.showMaximized(); | 79 | dlg.showMaximized(); |
79 | int ret = dlg.exec(); | 80 | int ret = dlg.exec(); |
80 | 81 | ||
81 | if(ret == QDialog::Accepted) | 82 | if(ret == QDialog::Accepted) |
82 | { | 83 | { |
83 | if(lstView->currentItem()) delete lstView->currentItem(); | 84 | if(lstView->currentItem()) delete lstView->currentItem(); |
84 | 85 | ||
85 | // use dlg.terminal()! | 86 | // use dlg.terminal()! |
86 | Profile p = dlg.profile(); | 87 | Profile p = dlg.profile(); |
87 | 88 | ||
88 | new ConfigListItem(lstView, p); | 89 | new ConfigListItem(lstView, p); |
89 | } | 90 | } |
90 | } | 91 | } |
91 | 92 | ||
92 | 93 | ||
93 | void ConfigDialog::slotAdd() { | 94 | void ConfigDialog::slotAdd() { |
94 | qWarning("slotAdd"); | 95 | qWarning("slotAdd"); |
95 | ProfileEditorDialog dlg(m_fact); | 96 | ProfileEditorDialog dlg(m_fact); |
96 | 97 | ||
97 | dlg.setCaption("New Connection"); | 98 | dlg.setCaption("New Connection"); |
98 | dlg.showMaximized(); | 99 | dlg.showMaximized(); |
99 | int ret = dlg.exec(); | 100 | int ret = dlg.exec(); |
100 | 101 | ||
101 | if(ret == QDialog::Accepted) | 102 | if(ret == QDialog::Accepted) |
102 | { | 103 | { |
103 | // TODO: Move into general profile save part | 104 | // TODO: Move into general profile save part |
104 | // assignments | 105 | // assignments |
105 | //QString type = dlg.term_type(); | 106 | //QString type = dlg.term_type(); |
106 | //if(type == "VT102") profile = Profile::VT102; | 107 | //if(type == "VT102") profile = Profile::VT102; |
107 | 108 | ||
108 | // get profile from editor | 109 | // get profile from editor |
109 | Profile p = dlg.profile(); | 110 | Profile p = dlg.profile(); |
110 | 111 | ||
111 | new ConfigListItem(lstView, p); | 112 | new ConfigListItem(lstView, p); |
112 | } | 113 | } |
113 | } | 114 | } |
114 | 115 | ||
diff --git a/noncore/apps/opie-console/file_layer.cpp b/noncore/apps/opie-console/file_layer.cpp index 79caa8a..43e9c8f 100644 --- a/noncore/apps/opie-console/file_layer.cpp +++ b/noncore/apps/opie-console/file_layer.cpp | |||
@@ -1,22 +1,23 @@ | |||
1 | #include "file_layer.h" | ||
2 | #include <qfile.h> | 1 | #include <qfile.h> |
3 | #include <opie/oprocess.h> | 2 | #include <opie/oprocess.h> |
4 | 3 | ||
4 | #include "file_layer.h" | ||
5 | |||
5 | FileTransferLayer::FileTransferLayer(IOLayer *layer) | 6 | FileTransferLayer::FileTransferLayer(IOLayer *layer) |
6 | : QObject(), m_layer( layer ) | 7 | : QObject(), m_layer( layer ) |
7 | { | 8 | { |
8 | } | 9 | } |
9 | 10 | ||
10 | FileTransferLayer::~FileTransferLayer() { | 11 | FileTransferLayer::~FileTransferLayer() { |
11 | } | 12 | } |
12 | 13 | ||
13 | void FileTransferLayer::sendFile(const QFile& file) { | 14 | void FileTransferLayer::sendFile(const QFile& file) { |
14 | 15 | ||
15 | } | 16 | } |
16 | 17 | ||
17 | void FileTransferLayer::sendFile(const QString& file) { | 18 | void FileTransferLayer::sendFile(const QString& file) { |
18 | } | 19 | } |
19 | 20 | ||
20 | IOLayer* FileTransferLayer::layer() { | 21 | IOLayer* FileTransferLayer::layer() { |
21 | return m_layer; | 22 | return m_layer; |
22 | } | 23 | } |
diff --git a/noncore/apps/opie-console/profileeditorplugins.cpp b/noncore/apps/opie-console/profileeditorplugins.cpp index 937516c..45b2148 100644 --- a/noncore/apps/opie-console/profileeditorplugins.cpp +++ b/noncore/apps/opie-console/profileeditorplugins.cpp | |||
@@ -1,208 +1,207 @@ | |||
1 | 1 | ||
2 | #include "profileeditorplugins.h" | 2 | #include <qframe.h> |
3 | #include "profile.h" | 3 | #include <qlabel.h> |
4 | 4 | #include <qlineedit.h> | |
5 | #include "qframe.h" | 5 | #include <qlayout.h> |
6 | #include "qlabel.h" | 6 | #include <qcombobox.h> |
7 | #include "qlineedit.h" | 7 | #include <qradiobutton.h> |
8 | #include "qlayout.h" | 8 | #include <qcheckbox.h> |
9 | #include "qcombobox.h" | 9 | #include <qbuttongroup.h> |
10 | #include "qradiobutton.h" | 10 | #include <qhgroupbox.h> |
11 | #include "qcheckbox.h" | 11 | #include <qvbox.h> |
12 | #include "qbuttongroup.h" | ||
13 | #include "qhgroupbox.h" | ||
14 | #include "qvbox.h" | ||
15 | 12 | ||
16 | #include "io_serial.h" | 13 | #include "io_serial.h" |
14 | #include "profile.h" | ||
15 | #include "profileeditorplugins.h" | ||
17 | 16 | ||
18 | // Base class | 17 | // Base class |
19 | 18 | ||
20 | ProfileEditorPlugin::ProfileEditorPlugin(QWidget *parent, Profile *p) | 19 | ProfileEditorPlugin::ProfileEditorPlugin(QWidget *parent, Profile *p) |
21 | : QObject() | 20 | : QObject() |
22 | { | 21 | { |
23 | m_parent = parent; | 22 | m_parent = parent; |
24 | m_profile = p; | 23 | m_profile = p; |
25 | m_widget = NULL; | 24 | m_widget = NULL; |
26 | } | 25 | } |
27 | 26 | ||
28 | ProfileEditorPlugin::~ProfileEditorPlugin() | 27 | ProfileEditorPlugin::~ProfileEditorPlugin() |
29 | { | 28 | { |
30 | if(m_widget) delete m_widget; | 29 | if(m_widget) delete m_widget; |
31 | } | 30 | } |
32 | 31 | ||
33 | QWidget *ProfileEditorPlugin::connection_widget() | 32 | QWidget *ProfileEditorPlugin::connection_widget() |
34 | { | 33 | { |
35 | QWidget *root; | 34 | QWidget *root; |
36 | QVBoxLayout *lroot; | 35 | QVBoxLayout *lroot; |
37 | 36 | ||
38 | root = new QWidget(); | 37 | root = new QWidget(); |
39 | 38 | ||
40 | // Build GUI | 39 | // Build GUI |
41 | QLabel *speedlabel = new QLabel(QObject::tr("Speed"), root); | 40 | QLabel *speedlabel = new QLabel(QObject::tr("Speed"), root); |
42 | 41 | ||
43 | QComboBox *speed_box = new QComboBox(root); | 42 | QComboBox *speed_box = new QComboBox(root); |
44 | speed_box->insertItem("115200 baud", id_baud_115200); | 43 | speed_box->insertItem("115200 baud", id_baud_115200); |
45 | speed_box->insertItem("57600 baud", id_baud_57600); | 44 | speed_box->insertItem("57600 baud", id_baud_57600); |
46 | speed_box->insertItem("38400 baud", id_baud_38400); | 45 | speed_box->insertItem("38400 baud", id_baud_38400); |
47 | speed_box->insertItem("19200 baud", id_baud_19200); | 46 | speed_box->insertItem("19200 baud", id_baud_19200); |
48 | speed_box->insertItem("9600 baud", id_baud_9600); | 47 | speed_box->insertItem("9600 baud", id_baud_9600); |
49 | 48 | ||
50 | QButtonGroup *group_flow = new QButtonGroup(QObject::tr("Flow control"), root); | 49 | QButtonGroup *group_flow = new QButtonGroup(QObject::tr("Flow control"), root); |
51 | 50 | ||
52 | QRadioButton *flow_hw = new QRadioButton(QObject::tr("Hardware"), group_flow); | 51 | QRadioButton *flow_hw = new QRadioButton(QObject::tr("Hardware"), group_flow); |
53 | QRadioButton *flow_sw = new QRadioButton(QObject::tr("Software"), group_flow); | 52 | QRadioButton *flow_sw = new QRadioButton(QObject::tr("Software"), group_flow); |
54 | 53 | ||
55 | QButtonGroup *group_parity = new QButtonGroup(QObject::tr("Parity"), root); | 54 | QButtonGroup *group_parity = new QButtonGroup(QObject::tr("Parity"), root); |
56 | QRadioButton *parity_odd = new QRadioButton(QObject::tr("Odd"), group_parity); | 55 | QRadioButton *parity_odd = new QRadioButton(QObject::tr("Odd"), group_parity); |
57 | QRadioButton *parity_even = new QRadioButton(QObject::tr("Even"), group_parity); | 56 | QRadioButton *parity_even = new QRadioButton(QObject::tr("Even"), group_parity); |
58 | 57 | ||
59 | // Build Layout | 58 | // Build Layout |
60 | lroot = new QVBoxLayout(root); | 59 | lroot = new QVBoxLayout(root); |
61 | lroot->add(speedlabel); | 60 | lroot->add(speedlabel); |
62 | lroot->add(speed_box); | 61 | lroot->add(speed_box); |
63 | lroot->setStretchFactor(speedlabel, 1); | 62 | lroot->setStretchFactor(speedlabel, 1); |
64 | lroot->setStretchFactor(speed_box, 1); | 63 | lroot->setStretchFactor(speed_box, 1); |
65 | 64 | ||
66 | QHBoxLayout *hbox = new QHBoxLayout(group_flow, 2); | 65 | QHBoxLayout *hbox = new QHBoxLayout(group_flow, 2); |
67 | hbox->add(flow_hw); | 66 | hbox->add(flow_hw); |
68 | hbox->add(flow_sw); | 67 | hbox->add(flow_sw); |
69 | lroot->add(group_flow); | 68 | lroot->add(group_flow); |
70 | lroot->setStretchFactor(group_flow, 2); | 69 | lroot->setStretchFactor(group_flow, 2); |
71 | 70 | ||
72 | QHBoxLayout *hboxPar = new QHBoxLayout( group_parity, 2); | 71 | QHBoxLayout *hboxPar = new QHBoxLayout( group_parity, 2); |
73 | hboxPar->add(parity_odd); | 72 | hboxPar->add(parity_odd); |
74 | hboxPar->add(parity_even); | 73 | hboxPar->add(parity_even); |
75 | lroot->add(group_parity); | 74 | lroot->add(group_parity); |
76 | lroot->setStretchFactor(group_parity, 2); | 75 | lroot->setStretchFactor(group_parity, 2); |
77 | // Apply profile settings | 76 | // Apply profile settings |
78 | 77 | ||
79 | int rad_flow = m_profile->readNumEntry("Flow"); | 78 | int rad_flow = m_profile->readNumEntry("Flow"); |
80 | int rad_parity = m_profile->readNumEntry("Parity"); | 79 | int rad_parity = m_profile->readNumEntry("Parity"); |
81 | int speed = m_profile->readNumEntry("Speed"); | 80 | int speed = m_profile->readNumEntry("Speed"); |
82 | 81 | ||
83 | if(rad_flow == IOSerial::FlowHW) flow_hw->setChecked(true); | 82 | if(rad_flow == IOSerial::FlowHW) flow_hw->setChecked(true); |
84 | else flow_sw->setChecked(true); | 83 | else flow_sw->setChecked(true); |
85 | if(rad_parity == IOSerial::ParityEven) parity_even->setChecked(true); | 84 | if(rad_parity == IOSerial::ParityEven) parity_even->setChecked(true); |
86 | else parity_odd->setChecked(true); | 85 | else parity_odd->setChecked(true); |
87 | if(speed == 115200) speed_box->setCurrentItem(id_baud_115200); | 86 | if(speed == 115200) speed_box->setCurrentItem(id_baud_115200); |
88 | if(speed == 57600) speed_box->setCurrentItem(id_baud_57600); | 87 | if(speed == 57600) speed_box->setCurrentItem(id_baud_57600); |
89 | if(speed == 38400) speed_box->setCurrentItem(id_baud_38400); | 88 | if(speed == 38400) speed_box->setCurrentItem(id_baud_38400); |
90 | if(speed == 19200) speed_box->setCurrentItem(id_baud_19200); | 89 | if(speed == 19200) speed_box->setCurrentItem(id_baud_19200); |
91 | if(speed == 9600) speed_box->setCurrentItem(id_baud_9600); | 90 | if(speed == 9600) speed_box->setCurrentItem(id_baud_9600); |
92 | 91 | ||
93 | // Signals | 92 | // Signals |
94 | 93 | ||
95 | connect(group_flow, SIGNAL(clicked(int)), SLOT(slotConnFlow(int))); | 94 | connect(group_flow, SIGNAL(clicked(int)), SLOT(slotConnFlow(int))); |
96 | connect(group_parity, SIGNAL(clicked(int)), SLOT(slotConnParity(int))); | 95 | connect(group_parity, SIGNAL(clicked(int)), SLOT(slotConnParity(int))); |
97 | connect(speed_box, SIGNAL(activated(int)), SLOT(slotConnSpeed(int))); | 96 | connect(speed_box, SIGNAL(activated(int)), SLOT(slotConnSpeed(int))); |
98 | 97 | ||
99 | return root; | 98 | return root; |
100 | } | 99 | } |
101 | 100 | ||
102 | QWidget *ProfileEditorPlugin::terminal_widget() | 101 | QWidget *ProfileEditorPlugin::terminal_widget() |
103 | { | 102 | { |
104 | QWidget *root; | 103 | QWidget *root; |
105 | QVBoxLayout *lroot; | 104 | QVBoxLayout *lroot; |
106 | 105 | ||
107 | root = new QWidget(); | 106 | root = new QWidget(); |
108 | 107 | ||
109 | // Build GUI | 108 | // Build GUI |
110 | 109 | ||
111 | 110 | ||
112 | QLabel *terminal = new QLabel(QObject::tr("Terminal type"), root); | 111 | QLabel *terminal = new QLabel(QObject::tr("Terminal type"), root); |
113 | 112 | ||
114 | QComboBox *terminal_box = new QComboBox(root); | 113 | QComboBox *terminal_box = new QComboBox(root); |
115 | terminal_box->insertItem("VT 100", id_term_vt100); | 114 | terminal_box->insertItem("VT 100", id_term_vt100); |
116 | terminal_box->insertItem("VT 220", id_term_vt220); | 115 | terminal_box->insertItem("VT 220", id_term_vt220); |
117 | terminal_box->insertItem("ANSI", id_term_ansi); | 116 | terminal_box->insertItem("ANSI", id_term_ansi); |
118 | 117 | ||
119 | QLabel *colourlabel = new QLabel(QObject::tr("Colour scheme"), root); | 118 | QLabel *colourlabel = new QLabel(QObject::tr("Colour scheme"), root); |
120 | QComboBox *colour_box = new QComboBox(root); | 119 | QComboBox *colour_box = new QComboBox(root); |
121 | colour_box->insertItem(QObject::tr("black on white"), id_term_black); | 120 | colour_box->insertItem(QObject::tr("black on white"), id_term_black); |
122 | colour_box->insertItem(QObject::tr("white on black"), id_term_white); | 121 | colour_box->insertItem(QObject::tr("white on black"), id_term_white); |
123 | 122 | ||
124 | QButtonGroup *group_size = new QButtonGroup( QObject::tr("Font size"), root ); | 123 | QButtonGroup *group_size = new QButtonGroup( QObject::tr("Font size"), root ); |
125 | QRadioButton *size_small = new QRadioButton(QObject::tr("small"), group_size ); | 124 | QRadioButton *size_small = new QRadioButton(QObject::tr("small"), group_size ); |
126 | QRadioButton *size_medium = new QRadioButton(QObject::tr("medium"), group_size ); | 125 | QRadioButton *size_medium = new QRadioButton(QObject::tr("medium"), group_size ); |
127 | QRadioButton *size_large = new QRadioButton(QObject::tr("large"), group_size ); | 126 | QRadioButton *size_large = new QRadioButton(QObject::tr("large"), group_size ); |
128 | 127 | ||
129 | QHGroupBox *group_conv = new QHGroupBox( QObject::tr("Line-break conversions"), root ); | 128 | QHGroupBox *group_conv = new QHGroupBox( QObject::tr("Line-break conversions"), root ); |
130 | QCheckBox *conv_inbound = new QCheckBox(QObject::tr("Inbound"), group_conv); | 129 | QCheckBox *conv_inbound = new QCheckBox(QObject::tr("Inbound"), group_conv); |
131 | QCheckBox *conv_outbound = new QCheckBox(QObject::tr("Outbound"), group_conv); | 130 | QCheckBox *conv_outbound = new QCheckBox(QObject::tr("Outbound"), group_conv); |
132 | 131 | ||
133 | QHGroupBox *group_options = new QHGroupBox( QObject::tr("Options"), root ); | 132 | QHGroupBox *group_options = new QHGroupBox( QObject::tr("Options"), root ); |
134 | QCheckBox *option_echo = new QCheckBox(QObject::tr("Local echo"), group_options); | 133 | QCheckBox *option_echo = new QCheckBox(QObject::tr("Local echo"), group_options); |
135 | QCheckBox *option_wrap = new QCheckBox(QObject::tr("Line wrap"), group_options); | 134 | QCheckBox *option_wrap = new QCheckBox(QObject::tr("Line wrap"), group_options); |
136 | 135 | ||
137 | // Build Layout | 136 | // Build Layout |
138 | lroot = new QVBoxLayout(root, 2); | 137 | lroot = new QVBoxLayout(root, 2); |
139 | 138 | ||
140 | QVBoxLayout *typeBox = new QVBoxLayout( lroot ); | 139 | QVBoxLayout *typeBox = new QVBoxLayout( lroot ); |
141 | typeBox->add(terminal); | 140 | typeBox->add(terminal); |
142 | typeBox->add(terminal_box); | 141 | typeBox->add(terminal_box); |
143 | 142 | ||
144 | QHBoxLayout *hbox = new QHBoxLayout( group_size, 2); | 143 | QHBoxLayout *hbox = new QHBoxLayout( group_size, 2); |
145 | hbox->add(size_small); | 144 | hbox->add(size_small); |
146 | hbox->add(size_medium); | 145 | hbox->add(size_medium); |
147 | hbox->add(size_large); | 146 | hbox->add(size_large); |
148 | lroot->add( group_size ); | 147 | lroot->add( group_size ); |
149 | 148 | ||
150 | QVBoxLayout *colourBox = new QVBoxLayout( lroot ); | 149 | QVBoxLayout *colourBox = new QVBoxLayout( lroot ); |
151 | colourBox->add(colourlabel); | 150 | colourBox->add(colourlabel); |
152 | colourBox->add(colour_box); | 151 | colourBox->add(colour_box); |
153 | 152 | ||
154 | lroot->add(group_conv); | 153 | lroot->add(group_conv); |
155 | lroot->add(group_options); | 154 | lroot->add(group_options); |
156 | 155 | ||
157 | // Apply profile settings | 156 | // Apply profile settings |
158 | 157 | ||
159 | int term = m_profile->readNumEntry("Terminal"); | 158 | int term = m_profile->readNumEntry("Terminal"); |
160 | int colour = m_profile->readNumEntry("Colour"); | 159 | int colour = m_profile->readNumEntry("Colour"); |
161 | int fontsize = m_profile->readNumEntry("Font"); | 160 | int fontsize = m_profile->readNumEntry("Font"); |
162 | int opt_echo = m_profile->readNumEntry("Echo"); | 161 | int opt_echo = m_profile->readNumEntry("Echo"); |
163 | int opt_wrap = m_profile->readNumEntry("Wrap"); | 162 | int opt_wrap = m_profile->readNumEntry("Wrap"); |
164 | int opt_inbound = m_profile->readNumEntry("Inbound"); | 163 | int opt_inbound = m_profile->readNumEntry("Inbound"); |
165 | int opt_outbound = m_profile->readNumEntry("Outbound"); | 164 | int opt_outbound = m_profile->readNumEntry("Outbound"); |
166 | 165 | ||
167 | if(term == Profile::VT102) terminal_box->setCurrentItem(id_term_vt100); | 166 | if(term == Profile::VT102) terminal_box->setCurrentItem(id_term_vt100); |
168 | 167 | ||
169 | if(colour == Profile::Black) colour_box->setCurrentItem(id_term_black); | 168 | if(colour == Profile::Black) colour_box->setCurrentItem(id_term_black); |
170 | if(colour == Profile::White) colour_box->setCurrentItem(id_term_white); | 169 | if(colour == Profile::White) colour_box->setCurrentItem(id_term_white); |
171 | 170 | ||
172 | if(fontsize == Profile::Micro) size_small->setChecked(true); | 171 | if(fontsize == Profile::Micro) size_small->setChecked(true); |
173 | if(fontsize == Profile::Small) size_medium->setChecked(true); | 172 | if(fontsize == Profile::Small) size_medium->setChecked(true); |
174 | if(fontsize == Profile::Medium) size_large->setChecked(true); | 173 | if(fontsize == Profile::Medium) size_large->setChecked(true); |
175 | 174 | ||
176 | if(opt_echo) option_echo->setChecked(true); | 175 | if(opt_echo) option_echo->setChecked(true); |
177 | if(opt_wrap) option_wrap->setChecked(true); | 176 | if(opt_wrap) option_wrap->setChecked(true); |
178 | if(opt_inbound) conv_inbound->setChecked(true); | 177 | if(opt_inbound) conv_inbound->setChecked(true); |
179 | if(opt_outbound) conv_outbound->setChecked(true); | 178 | if(opt_outbound) conv_outbound->setChecked(true); |
180 | 179 | ||
181 | // Signals | 180 | // Signals |
182 | 181 | ||
183 | connect(terminal_box, SIGNAL(activated(int)), SLOT(slotTermTerm(int))); | 182 | connect(terminal_box, SIGNAL(activated(int)), SLOT(slotTermTerm(int))); |
184 | connect(colour_box, SIGNAL(activated(int)), SLOT(slotTermColour(int))); | 183 | connect(colour_box, SIGNAL(activated(int)), SLOT(slotTermColour(int))); |
185 | connect(group_size, SIGNAL(clicked(int)), SLOT(slotTermFont(int))); | 184 | connect(group_size, SIGNAL(clicked(int)), SLOT(slotTermFont(int))); |
186 | 185 | ||
187 | connect(option_echo, SIGNAL(toggled(bool)), SLOT(slotTermEcho(bool))); | 186 | connect(option_echo, SIGNAL(toggled(bool)), SLOT(slotTermEcho(bool))); |
188 | connect(option_wrap, SIGNAL(toggled(bool)), SLOT(slotTermWrap(bool))); | 187 | connect(option_wrap, SIGNAL(toggled(bool)), SLOT(slotTermWrap(bool))); |
189 | connect(conv_inbound, SIGNAL(toggled(bool)), SLOT(slotTermInbound(bool))); | 188 | connect(conv_inbound, SIGNAL(toggled(bool)), SLOT(slotTermInbound(bool))); |
190 | connect(conv_outbound, SIGNAL(toggled(bool)), SLOT(slotTermOutbound(bool))); | 189 | connect(conv_outbound, SIGNAL(toggled(bool)), SLOT(slotTermOutbound(bool))); |
191 | 190 | ||
192 | return root; | 191 | return root; |
193 | } | 192 | } |
194 | 193 | ||
195 | void ProfileEditorPlugin::slotConnFlow(int id) | 194 | void ProfileEditorPlugin::slotConnFlow(int id) |
196 | { | 195 | { |
197 | switch(id) | 196 | switch(id) |
198 | { | 197 | { |
199 | case id_flow_hw: | 198 | case id_flow_hw: |
200 | m_profile->writeEntry("Flow", IOSerial::FlowHW); | 199 | m_profile->writeEntry("Flow", IOSerial::FlowHW); |
201 | break; | 200 | break; |
202 | case id_flow_sw: | 201 | case id_flow_sw: |
203 | m_profile->writeEntry("Flow", IOSerial::FlowSW); | 202 | m_profile->writeEntry("Flow", IOSerial::FlowSW); |
204 | break; | 203 | break; |
205 | case id_flow_sw: | 204 | case id_flow_sw: |
206 | m_profile->writeEntry("None", IOSerial::None); | 205 | m_profile->writeEntry("None", IOSerial::None); |
207 | break; | 206 | break; |
208 | } | 207 | } |
diff --git a/noncore/apps/opie-console/profileeditorplugins.h b/noncore/apps/opie-console/profileeditorplugins.h index 4ca780e..f576143 100644 --- a/noncore/apps/opie-console/profileeditorplugins.h +++ b/noncore/apps/opie-console/profileeditorplugins.h | |||
@@ -1,97 +1,96 @@ | |||
1 | #ifndef PROFILE_EDITOR_PLUGINS_H | 1 | #ifndef PROFILE_EDITOR_PLUGINS_H |
2 | #define PROFILE_EDITOR_PLUGINS_H | 2 | #define PROFILE_EDITOR_PLUGINS_H |
3 | 3 | ||
4 | #include "profile.h" | ||
5 | 4 | ||
6 | #include <qobject.h> | 5 | #include <qobject.h> |
7 | 6 | ||
8 | class QWidget; | 7 | class QWidget; |
9 | 8 | class Profile; | |
10 | class ProfileEditorPlugin : public QObject | 9 | class ProfileEditorPlugin : public QObject |
11 | { | 10 | { |
12 | Q_OBJECT | 11 | Q_OBJECT |
13 | public: | 12 | public: |
14 | ProfileEditorPlugin(QWidget *parent); | 13 | ProfileEditorPlugin(QWidget *parent); |
15 | 14 | ||
16 | virtual ~ProfileEditorPlugin(); | 15 | virtual ~ProfileEditorPlugin(); |
17 | 16 | ||
18 | virtual void save() = 0; | 17 | virtual void save() = 0; |
19 | 18 | ||
20 | virtual QWidget *widget() = 0; | 19 | virtual QWidget *widget() = 0; |
21 | 20 | ||
22 | QWidget *connection_widget(); | 21 | QWidget *connection_widget(); |
23 | QWidget *terminal_widget(); | 22 | QWidget *terminal_widget(); |
24 | 23 | ||
25 | public slots: | 24 | public slots: |
26 | void slotConnFlow(int id); | 25 | void slotConnFlow(int id); |
27 | void slotConnParity(int id); | 26 | void slotConnParity(int id); |
28 | void slotConnSpeed(int id); | 27 | void slotConnSpeed(int id); |
29 | void slotTermTerm(int id); | 28 | void slotTermTerm(int id); |
30 | void slotTermColour(int id); | 29 | void slotTermColour(int id); |
31 | void slotTermFont(int id); | 30 | void slotTermFont(int id); |
32 | void slotTermEcho(bool on); | 31 | void slotTermEcho(bool on); |
33 | void slotTermWrap(bool on); | 32 | void slotTermWrap(bool on); |
34 | void slotTermInbound(bool on); | 33 | void slotTermInbound(bool on); |
35 | void slotTermOutbound(bool on); | 34 | void slotTermOutbound(bool on); |
36 | 35 | ||
37 | protected: | 36 | protected: |
38 | QWidget *m_parent, *m_widget; | 37 | QWidget *m_parent, *m_widget; |
39 | Profile *m_profile; | 38 | Profile *m_profile; |
40 | 39 | ||
41 | private: | 40 | private: |
42 | enum ParityIds | 41 | enum ParityIds |
43 | { | 42 | { |
44 | id_parity_odd, | 43 | id_parity_odd, |
45 | id_parity_even | 44 | id_parity_even |
46 | }; | 45 | }; |
47 | 46 | ||
48 | enum FlowIds | 47 | enum FlowIds |
49 | { | 48 | { |
50 | id_flow_hw, | 49 | id_flow_hw, |
51 | id_flow_sw | 50 | id_flow_sw |
52 | }; | 51 | }; |
53 | 52 | ||
54 | enum SpeedIds | 53 | enum SpeedIds |
55 | { | 54 | { |
56 | id_baud_115200, | 55 | id_baud_115200, |
57 | id_baud_57600, | 56 | id_baud_57600, |
58 | id_baud_38400, | 57 | id_baud_38400, |
59 | id_baud_19200, | 58 | id_baud_19200, |
60 | id_baud_9600 | 59 | id_baud_9600 |
61 | }; | 60 | }; |
62 | 61 | ||
63 | enum TermIds | 62 | enum TermIds |
64 | { | 63 | { |
65 | id_term_vt100, | 64 | id_term_vt100, |
66 | id_term_vt220, | 65 | id_term_vt220, |
67 | id_term_ansi | 66 | id_term_ansi |
68 | }; | 67 | }; |
69 | 68 | ||
70 | enum ColourIds | 69 | enum ColourIds |
71 | { | 70 | { |
72 | id_term_black, | 71 | id_term_black, |
73 | id_term_white | 72 | id_term_white |
74 | }; | 73 | }; |
75 | 74 | ||
76 | enum FontIds | 75 | enum FontIds |
77 | { | 76 | { |
78 | id_size_small, | 77 | id_size_small, |
79 | id_size_medium, | 78 | id_size_medium, |
80 | id_size_large | 79 | id_size_large |
81 | }; | 80 | }; |
82 | }; | 81 | }; |
83 | 82 | ||
84 | //#ifdef __cplusplus | 83 | //#ifdef __cplusplus |
85 | //extern "C" { | 84 | //extern "C" { |
86 | //#endif | 85 | //#endif |
87 | 86 | ||
88 | ProfileEditorPlugin *factory_serial(QWidget *parent, Profile *p); | 87 | ProfileEditorPlugin *factory_serial(QWidget *parent, Profile *p); |
89 | ProfileEditorPlugin *factory_irda(QWidget *parent, Profile *p); | 88 | ProfileEditorPlugin *factory_irda(QWidget *parent, Profile *p); |
90 | ProfileEditorPlugin *factory_modem(QWidget *parent, Profile *p); | 89 | ProfileEditorPlugin *factory_modem(QWidget *parent, Profile *p); |
91 | 90 | ||
92 | //#ifdef __cplusplus | 91 | //#ifdef __cplusplus |
93 | //} | 92 | //} |
94 | //#endif | 93 | //#endif |
95 | 94 | ||
96 | #endif | 95 | #endif |
97 | 96 | ||