summaryrefslogtreecommitdiff
authorzecke <zecke>2002-10-12 22:43:12 (UTC)
committer zecke <zecke>2002-10-12 22:43:12 (UTC)
commit9333a4005b30aaa723447a044c9fce5a1e580317 (patch) (unidiff)
tree275ed089a65fd0f38918b812e0b1f68a1f78f980
parent97dc4008b5194ec0aa131fcf9b8753a61fe6fb74 (diff)
downloadopie-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..
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/configdialog.cpp7
-rw-r--r--noncore/apps/opie-console/file_layer.cpp3
-rw-r--r--noncore/apps/opie-console/profileeditorplugins.cpp25
-rw-r--r--noncore/apps/opie-console/profileeditorplugins.h3
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,103 +1,104 @@
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
9class ConfigListItem : public QListViewItem { 10class ConfigListItem : public QListViewItem {
10public: 11public:
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
15private: 16private:
16 Profile m_prof; 17 Profile m_prof;
17}; 18};
18ConfigListItem::ConfigListItem( QListView* item, const Profile& prof ) 19ConfigListItem::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}
23ConfigListItem::~ConfigListItem() { 24ConfigListItem::~ConfigListItem() {
24 25
25} 26}
26Profile ConfigListItem::profile()const { 27Profile ConfigListItem::profile()const {
27 return m_prof; 28 return m_prof;
28} 29}
29 30
30/* Dialog */ 31/* Dialog */
31 32
32ConfigDialog::ConfigDialog( const Profile::ValueList& lis, MetaFactory* fa, 33ConfigDialog::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}
44ConfigDialog::~ConfigDialog() { 45ConfigDialog::~ConfigDialog() {
45 46
46} 47}
47Profile::ValueList ConfigDialog::list()const { 48Profile::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 */
58void ConfigDialog::slotRemove() { 59void 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
67void ConfigDialog::slotEdit() { 68void 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
93void ConfigDialog::slotAdd() { 94void 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
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
5FileTransferLayer::FileTransferLayer(IOLayer *layer) 6FileTransferLayer::FileTransferLayer(IOLayer *layer)
6 : QObject(), m_layer( layer ) 7 : QObject(), m_layer( layer )
7{ 8{
8} 9}
9 10
10FileTransferLayer::~FileTransferLayer() { 11FileTransferLayer::~FileTransferLayer() {
11} 12}
12 13
13void FileTransferLayer::sendFile(const QFile& file) { 14void FileTransferLayer::sendFile(const QFile& file) {
14 15
15} 16}
16 17
17void FileTransferLayer::sendFile(const QString& file) { 18void FileTransferLayer::sendFile(const QString& file) {
18} 19}
19 20
20IOLayer* FileTransferLayer::layer() { 21IOLayer* 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,112 +1,111 @@
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
20ProfileEditorPlugin::ProfileEditorPlugin(QWidget *parent, Profile *p) 19ProfileEditorPlugin::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
28ProfileEditorPlugin::~ProfileEditorPlugin() 27ProfileEditorPlugin::~ProfileEditorPlugin()
29{ 28{
30 if(m_widget) delete m_widget; 29 if(m_widget) delete m_widget;
31} 30}
32 31
33QWidget *ProfileEditorPlugin::connection_widget() 32QWidget *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
102QWidget *ProfileEditorPlugin::terminal_widget() 101QWidget *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);
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
8class QWidget; 7class QWidget;
9 8class Profile;
10class ProfileEditorPlugin : public QObject 9class ProfileEditorPlugin : public QObject
11{ 10{
12 Q_OBJECT 11 Q_OBJECT
13public: 12public:
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
25public slots: 24public 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
37protected: 36protected:
38 QWidget *m_parent, *m_widget; 37 QWidget *m_parent, *m_widget;
39 Profile *m_profile; 38 Profile *m_profile;
40 39
41private: 40private:
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
88ProfileEditorPlugin *factory_serial(QWidget *parent, Profile *p); 87ProfileEditorPlugin *factory_serial(QWidget *parent, Profile *p);
89ProfileEditorPlugin *factory_irda(QWidget *parent, Profile *p); 88ProfileEditorPlugin *factory_irda(QWidget *parent, Profile *p);
90ProfileEditorPlugin *factory_modem(QWidget *parent, Profile *p); 89ProfileEditorPlugin *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