-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,478 +1,477 @@ | |||
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 | } |
209 | } | 208 | } |
210 | 209 | ||
211 | void ProfileEditorPlugin::slotConnParity(int id) | 210 | void ProfileEditorPlugin::slotConnParity(int id) |
212 | { | 211 | { |
213 | switch(id) | 212 | switch(id) |
214 | { | 213 | { |
215 | case id_parity_odd: | 214 | case id_parity_odd: |
216 | m_profile->writeEntry("Parity", IOSerial::ParityEven); | 215 | m_profile->writeEntry("Parity", IOSerial::ParityEven); |
217 | break; | 216 | break; |
218 | case id_parity_even: | 217 | case id_parity_even: |
219 | m_profile->writeEntry("Parity", IOSerial::ParityOdd); | 218 | m_profile->writeEntry("Parity", IOSerial::ParityOdd); |
220 | break; | 219 | break; |
221 | } | 220 | } |
222 | } | 221 | } |
223 | 222 | ||
224 | void ProfileEditorPlugin::slotConnSpeed(int id) | 223 | void ProfileEditorPlugin::slotConnSpeed(int id) |
225 | { | 224 | { |
226 | switch(id) | 225 | switch(id) |
227 | { | 226 | { |
228 | 227 | ||
229 | case id_baud_115200: | 228 | case id_baud_115200: |
230 | m_profile->writeEntry("Speed", 115200); | 229 | m_profile->writeEntry("Speed", 115200); |
231 | break; | 230 | break; |
232 | case id_baud_57600: | 231 | case id_baud_57600: |
233 | m_profile->writeEntry("Speed", 57600); | 232 | m_profile->writeEntry("Speed", 57600); |
234 | break; | 233 | break; |
235 | case id_baud_38400: | 234 | case id_baud_38400: |
236 | m_profile->writeEntry("Speed", 38400); | 235 | m_profile->writeEntry("Speed", 38400); |
237 | break; | 236 | break; |
238 | case id_baud_19200: | 237 | case id_baud_19200: |
239 | m_profile->writeEntry("Speed", 19200); | 238 | m_profile->writeEntry("Speed", 19200); |
240 | break; | 239 | break; |
241 | case id_baud_9600: | 240 | case id_baud_9600: |
242 | m_profile->writeEntry("Speed", 9600); | 241 | m_profile->writeEntry("Speed", 9600); |
243 | break; | 242 | break; |
244 | } | 243 | } |
245 | } | 244 | } |
246 | 245 | ||
247 | void ProfileEditorPlugin::slotTermTerm(int id) | 246 | void ProfileEditorPlugin::slotTermTerm(int id) |
248 | { | 247 | { |
249 | switch(id) | 248 | switch(id) |
250 | { | 249 | { |
251 | case id_term_vt100: | 250 | case id_term_vt100: |
252 | m_profile->writeEntry("Terminal", Profile::VT102); | 251 | m_profile->writeEntry("Terminal", Profile::VT102); |
253 | break; | 252 | break; |
254 | case id_term_vt220: | 253 | case id_term_vt220: |
255 | m_profile->writeEntry("Terminal", Profile::VT102); | 254 | m_profile->writeEntry("Terminal", Profile::VT102); |
256 | break; | 255 | break; |
257 | case id_term_ansi: | 256 | case id_term_ansi: |
258 | m_profile->writeEntry("Terminal", Profile::VT102); | 257 | m_profile->writeEntry("Terminal", Profile::VT102); |
259 | break; | 258 | break; |
260 | } | 259 | } |
261 | } | 260 | } |
262 | 261 | ||
263 | void ProfileEditorPlugin::slotTermColour(int id) | 262 | void ProfileEditorPlugin::slotTermColour(int id) |
264 | { | 263 | { |
265 | switch(id) | 264 | switch(id) |
266 | { | 265 | { |
267 | case id_term_black: | 266 | case id_term_black: |
268 | m_profile->writeEntry("Colour", Profile::Black); | 267 | m_profile->writeEntry("Colour", Profile::Black); |
269 | break; | 268 | break; |
270 | case id_term_white: | 269 | case id_term_white: |
271 | m_profile->writeEntry("Colour", Profile::White); | 270 | m_profile->writeEntry("Colour", Profile::White); |
272 | break; | 271 | break; |
273 | } | 272 | } |
274 | } | 273 | } |
275 | 274 | ||
276 | void ProfileEditorPlugin::slotTermFont(int id) | 275 | void ProfileEditorPlugin::slotTermFont(int id) |
277 | { | 276 | { |
278 | switch(id) | 277 | switch(id) |
279 | { | 278 | { |
280 | case id_size_small: | 279 | case id_size_small: |
281 | m_profile->writeEntry("Font", Profile::Micro); | 280 | m_profile->writeEntry("Font", Profile::Micro); |
282 | break; | 281 | break; |
283 | case id_size_medium: | 282 | case id_size_medium: |
284 | m_profile->writeEntry("Font", Profile::Small); | 283 | m_profile->writeEntry("Font", Profile::Small); |
285 | break; | 284 | break; |
286 | case id_size_large: | 285 | case id_size_large: |
287 | m_profile->writeEntry("Font", Profile::Medium); | 286 | m_profile->writeEntry("Font", Profile::Medium); |
288 | break; | 287 | break; |
289 | } | 288 | } |
290 | } | 289 | } |
291 | 290 | ||
292 | void ProfileEditorPlugin::slotTermEcho(bool on) | 291 | void ProfileEditorPlugin::slotTermEcho(bool on) |
293 | { | 292 | { |
294 | m_profile->writeEntry("Echo", on ? 1 : 0); | 293 | m_profile->writeEntry("Echo", on ? 1 : 0); |
295 | } | 294 | } |
296 | 295 | ||
297 | void ProfileEditorPlugin::slotTermWrap(bool on) | 296 | void ProfileEditorPlugin::slotTermWrap(bool on) |
298 | { | 297 | { |
299 | m_profile->writeEntry("Wrap", on ? 1 : 0); | 298 | m_profile->writeEntry("Wrap", on ? 1 : 0); |
300 | } | 299 | } |
301 | 300 | ||
302 | void ProfileEditorPlugin::slotTermInbound(bool on) | 301 | void ProfileEditorPlugin::slotTermInbound(bool on) |
303 | { | 302 | { |
304 | m_profile->writeEntry("Inbound", on ? 1 : 0); | 303 | m_profile->writeEntry("Inbound", on ? 1 : 0); |
305 | } | 304 | } |
306 | 305 | ||
307 | void ProfileEditorPlugin::slotTermOutbound(bool on) | 306 | void ProfileEditorPlugin::slotTermOutbound(bool on) |
308 | { | 307 | { |
309 | m_profile->writeEntry("Outbound", on ? 1 : 0); | 308 | m_profile->writeEntry("Outbound", on ? 1 : 0); |
310 | } | 309 | } |
311 | 310 | ||
312 | // Inherited classes | 311 | // Inherited classes |
313 | 312 | ||
314 | class ProfileEditorPluginSerial : public ProfileEditorPlugin | 313 | class ProfileEditorPluginSerial : public ProfileEditorPlugin |
315 | { | 314 | { |
316 | public: | 315 | public: |
317 | 316 | ||
318 | ProfileEditorPluginSerial(QWidget *parent, Profile *p) | 317 | ProfileEditorPluginSerial(QWidget *parent, Profile *p) |
319 | : ProfileEditorPlugin(parent, p) | 318 | : ProfileEditorPlugin(parent, p) |
320 | { | 319 | { |
321 | } | 320 | } |
322 | 321 | ||
323 | ~ProfileEditorPluginSerial() | 322 | ~ProfileEditorPluginSerial() |
324 | { | 323 | { |
325 | } | 324 | } |
326 | 325 | ||
327 | QWidget *widget() | 326 | QWidget *widget() |
328 | { | 327 | { |
329 | if(!m_widget) | 328 | if(!m_widget) |
330 | { | 329 | { |
331 | 330 | ||
332 | QWidget *device_frame = new QWidget( m_parent ); | 331 | QWidget *device_frame = new QWidget( m_parent ); |
333 | QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); | 332 | QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); |
334 | 333 | ||
335 | device_line = new QLineEdit("/dev/ttyS0", device_frame); | 334 | device_line = new QLineEdit("/dev/ttyS0", device_frame); |
336 | 335 | ||
337 | QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); | 336 | QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); |
338 | vbox_frame->add(frame_device); | 337 | vbox_frame->add(frame_device); |
339 | vbox_frame->add(device_line); | 338 | vbox_frame->add(device_line); |
340 | 339 | ||
341 | m_widget = device_frame; | 340 | m_widget = device_frame; |
342 | 341 | ||
343 | // Load special settings | 342 | // Load special settings |
344 | 343 | ||
345 | QString dev = m_profile->readEntry("Device"); | 344 | QString dev = m_profile->readEntry("Device"); |
346 | if(!dev.isNull()) device_line->setText(dev); | 345 | if(!dev.isNull()) device_line->setText(dev); |
347 | } | 346 | } |
348 | 347 | ||
349 | return m_widget; | 348 | return m_widget; |
350 | } | 349 | } |
351 | 350 | ||
352 | void save() | 351 | void save() |
353 | { | 352 | { |
354 | // special settings | 353 | // special settings |
355 | m_profile->writeEntry("Device", device_line->text()); | 354 | m_profile->writeEntry("Device", device_line->text()); |
356 | } | 355 | } |
357 | 356 | ||
358 | private: | 357 | private: |
359 | QLineEdit *device_line; | 358 | QLineEdit *device_line; |
360 | }; | 359 | }; |
361 | 360 | ||
362 | class ProfileEditorPluginIrda : public ProfileEditorPlugin | 361 | class ProfileEditorPluginIrda : public ProfileEditorPlugin |
363 | { | 362 | { |
364 | public: | 363 | public: |
365 | 364 | ||
366 | ProfileEditorPluginIrda(QWidget *parent, Profile *p) | 365 | ProfileEditorPluginIrda(QWidget *parent, Profile *p) |
367 | : ProfileEditorPlugin(parent, p) | 366 | : ProfileEditorPlugin(parent, p) |
368 | { | 367 | { |
369 | } | 368 | } |
370 | 369 | ||
371 | ~ProfileEditorPluginIrda() | 370 | ~ProfileEditorPluginIrda() |
372 | { | 371 | { |
373 | } | 372 | } |
374 | 373 | ||
375 | QWidget *widget() | 374 | QWidget *widget() |
376 | { | 375 | { |
377 | if(!m_widget) | 376 | if(!m_widget) |
378 | { | 377 | { |
379 | QWidget *device_frame = new QWidget(m_parent); | 378 | QWidget *device_frame = new QWidget(m_parent); |
380 | 379 | ||
381 | 380 | ||
382 | QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); | 381 | QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); |
383 | 382 | ||
384 | device_line = new QLineEdit("/dev/ircomm0", device_frame); | 383 | device_line = new QLineEdit("/dev/ircomm0", device_frame); |
385 | 384 | ||
386 | QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); | 385 | QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); |
387 | vbox_frame->add(frame_device); | 386 | vbox_frame->add(frame_device); |
388 | vbox_frame->add(device_line); | 387 | vbox_frame->add(device_line); |
389 | 388 | ||
390 | m_widget = device_frame; | 389 | m_widget = device_frame; |
391 | 390 | ||
392 | // Load special settings | 391 | // Load special settings |
393 | QString dev = m_profile->readEntry("Device"); | 392 | QString dev = m_profile->readEntry("Device"); |
394 | if(!dev.isNull()) device_line->setText(dev); | 393 | if(!dev.isNull()) device_line->setText(dev); |
395 | } | 394 | } |
396 | 395 | ||
397 | return m_widget; | 396 | return m_widget; |
398 | } | 397 | } |
399 | 398 | ||
400 | void save() | 399 | void save() |
401 | { | 400 | { |
402 | // special settings | 401 | // special settings |
403 | m_profile->writeEntry("Device", device_line->text()); | 402 | m_profile->writeEntry("Device", device_line->text()); |
404 | } | 403 | } |
405 | 404 | ||
406 | private: | 405 | private: |
407 | QLineEdit *device_line; | 406 | QLineEdit *device_line; |
408 | }; | 407 | }; |
409 | 408 | ||
410 | class ProfileEditorPluginModem : public ProfileEditorPlugin | 409 | class ProfileEditorPluginModem : public ProfileEditorPlugin |
411 | { | 410 | { |
412 | public: | 411 | public: |
413 | 412 | ||
414 | ProfileEditorPluginModem(QWidget *parent, Profile *p) | 413 | ProfileEditorPluginModem(QWidget *parent, Profile *p) |
415 | : ProfileEditorPlugin(parent, p) | 414 | : ProfileEditorPlugin(parent, p) |
416 | { | 415 | { |
417 | } | 416 | } |
418 | 417 | ||
419 | ~ProfileEditorPluginModem() | 418 | ~ProfileEditorPluginModem() |
420 | { | 419 | { |
421 | } | 420 | } |
422 | 421 | ||
423 | QWidget *widget() | 422 | QWidget *widget() |
424 | { | 423 | { |
425 | if(!m_widget) | 424 | if(!m_widget) |
426 | { | 425 | { |
427 | QWidget *device_frame = new QWidget(m_parent); | 426 | QWidget *device_frame = new QWidget(m_parent); |
428 | 427 | ||
429 | QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); | 428 | QLabel *frame_device = new QLabel(QObject::tr("Device"), device_frame); |
430 | QLabel *frame_number = new QLabel(QObject::tr("Phone number"), device_frame); | 429 | QLabel *frame_number = new QLabel(QObject::tr("Phone number"), device_frame); |
431 | 430 | ||
432 | device_line = new QLineEdit("/dev/ttyS0", device_frame); | 431 | device_line = new QLineEdit("/dev/ttyS0", device_frame); |
433 | number_line = new QLineEdit(device_frame); | 432 | number_line = new QLineEdit(device_frame); |
434 | 433 | ||
435 | QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); | 434 | QVBoxLayout *vbox_frame = new QVBoxLayout(device_frame, 2); |
436 | vbox_frame->add(frame_device); | 435 | vbox_frame->add(frame_device); |
437 | vbox_frame->add(device_line); | 436 | vbox_frame->add(device_line); |
438 | vbox_frame->add(frame_number); | 437 | vbox_frame->add(frame_number); |
439 | vbox_frame->add(number_line); | 438 | vbox_frame->add(number_line); |
440 | 439 | ||
441 | m_widget = device_frame; | 440 | m_widget = device_frame; |
442 | 441 | ||
443 | // Load special settings | 442 | // Load special settings |
444 | QString dev = m_profile->readEntry("Device"); | 443 | QString dev = m_profile->readEntry("Device"); |
445 | QString num = m_profile->readEntry("Number"); | 444 | QString num = m_profile->readEntry("Number"); |
446 | if(!dev.isNull()) device_line->setText(dev); | 445 | if(!dev.isNull()) device_line->setText(dev); |
447 | number_line->setText(num); | 446 | number_line->setText(num); |
448 | } | 447 | } |
449 | 448 | ||
450 | return m_widget; | 449 | return m_widget; |
451 | } | 450 | } |
452 | 451 | ||
453 | void save() | 452 | void save() |
454 | { | 453 | { |
455 | // special settings | 454 | // special settings |
456 | m_profile->writeEntry("Device", device_line->text()); | 455 | m_profile->writeEntry("Device", device_line->text()); |
457 | m_profile->writeEntry("Number", number_line->text()); | 456 | m_profile->writeEntry("Number", number_line->text()); |
458 | } | 457 | } |
459 | 458 | ||
460 | private: | 459 | private: |
461 | QLineEdit *device_line, *number_line; | 460 | QLineEdit *device_line, *number_line; |
462 | }; | 461 | }; |
463 | 462 | ||
464 | ProfileEditorPlugin *factory_serial(QWidget *parent, Profile *p) | 463 | ProfileEditorPlugin *factory_serial(QWidget *parent, Profile *p) |
465 | { | 464 | { |
466 | return new ProfileEditorPluginSerial(parent, p); | 465 | return new ProfileEditorPluginSerial(parent, p); |
467 | } | 466 | } |
468 | 467 | ||
469 | ProfileEditorPlugin *factory_irda(QWidget *parent, Profile *p) | 468 | ProfileEditorPlugin *factory_irda(QWidget *parent, Profile *p) |
470 | { | 469 | { |
471 | return new ProfileEditorPluginIrda(parent, p); | 470 | return new ProfileEditorPluginIrda(parent, p); |
472 | } | 471 | } |
473 | 472 | ||
474 | ProfileEditorPlugin *factory_modem(QWidget *parent, Profile *p) | 473 | ProfileEditorPlugin *factory_modem(QWidget *parent, Profile *p) |
475 | { | 474 | { |
476 | return new ProfileEditorPluginModem(parent, p); | 475 | return new ProfileEditorPluginModem(parent, p); |
477 | } | 476 | } |
478 | 477 | ||
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 | ||