-rw-r--r-- | noncore/apps/opie-console/configdialog.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.pro | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/widget_layer.h | 4 |
4 files changed, 19 insertions, 7 deletions
diff --git a/noncore/apps/opie-console/configdialog.cpp b/noncore/apps/opie-console/configdialog.cpp index 23e94b1..655d649 100644 --- a/noncore/apps/opie-console/configdialog.cpp +++ b/noncore/apps/opie-console/configdialog.cpp | |||
@@ -53,34 +53,36 @@ Profile::ValueList ConfigDialog::list()const { | |||
53 | } | 53 | } |
54 | return lst; | 54 | return lst; |
55 | } | 55 | } |
56 | /* our slots */ | 56 | /* our slots */ |
57 | void ConfigDialog::slotRemove() { | 57 | void ConfigDialog::slotRemove() { |
58 | ConfigListItem* item = (ConfigListItem*)lstView->currentItem(); | 58 | ConfigListItem* item = (ConfigListItem*)lstView->currentItem(); |
59 | if (!item ) | 59 | if (!item ) |
60 | return; | 60 | return; |
61 | 61 | ||
62 | lstView->takeItem( item ); | 62 | lstView->takeItem( item ); |
63 | delete item; | 63 | delete item; |
64 | } | 64 | } |
65 | 65 | ||
66 | void ConfigDialog::slotEdit() { | 66 | void ConfigDialog::slotEdit() { |
67 | Profile p; | 67 | Profile p; |
68 | 68 | ||
69 | if(!lstView->currentItem()) return; | ||
70 | |||
69 | // Load profile | 71 | // Load profile |
70 | // p = currentItem()->profile(); | 72 | p = ((ConfigListItem*)lstView->currentItem())->profile(); |
71 | 73 | ||
72 | ProfileEditorDialog dlg(new MetaFactory(), p); | 74 | ProfileEditorDialog dlg(new MetaFactory(), p); |
73 | 75 | ||
74 | dlg.setCaption("Edit Connection Profile"); | 76 | dlg.setCaption("Edit Connection Profile"); |
75 | dlg.showMaximized(); | 77 | dlg.showMaximized(); |
76 | int ret = dlg.exec(); | 78 | int ret = dlg.exec(); |
77 | 79 | ||
78 | if(ret == QDialog::Accepted) | 80 | if(ret == QDialog::Accepted) |
79 | { | 81 | { |
80 | // if(listView->current()) delete lstView->current(); ... | 82 | // if(listView->current()) delete lstView->current(); ... |
81 | // use dlg.terminal()! | 83 | // use dlg.terminal()! |
82 | new ConfigListItem(lstView, Profile(dlg.prof_name(), dlg.prof_type(), Profile::White, Profile::Black, Profile::VT102)); | 84 | new ConfigListItem(lstView, Profile(dlg.prof_name(), dlg.prof_type(), Profile::White, Profile::Black, Profile::VT102)); |
83 | } | 85 | } |
84 | } | 86 | } |
85 | 87 | ||
86 | 88 | ||
diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro index 6d70dfd..768e453 100644 --- a/noncore/apps/opie-console/opie-console.pro +++ b/noncore/apps/opie-console/opie-console.pro | |||
@@ -9,45 +9,47 @@ HEADERS = io_layer.h io_serial.h \ | |||
9 | mainwindow.h \ | 9 | mainwindow.h \ |
10 | profile.h \ | 10 | profile.h \ |
11 | profileconfig.h \ | 11 | profileconfig.h \ |
12 | profilemanager.h \ | 12 | profilemanager.h \ |
13 | configwidget.h \ | 13 | configwidget.h \ |
14 | tabwidget.h \ | 14 | tabwidget.h \ |
15 | configdialog.h \ | 15 | configdialog.h \ |
16 | profileeditordialog.h \ | 16 | profileeditordialog.h \ |
17 | profileeditorplugins.h \ | 17 | profileeditorplugins.h \ |
18 | emulation_layer.h \ | 18 | emulation_layer.h \ |
19 | widget.h \ | 19 | widget.h \ |
20 | vt102emulation.h \ | 20 | vt102emulation.h \ |
21 | common.h \ | 21 | common.h \ |
22 | history.h \ | 22 | history.h \ |
23 | screen.h \ | 23 | screen.h \ |
24 | keytrans.h \ | 24 | keytrans.h \ |
25 | widget_layer.h | 25 | widget_layer.h \ |
26 | transferdialog.h | ||
26 | 27 | ||
27 | SOURCES = io_layer.cpp io_serial.cpp \ | 28 | SOURCES = io_layer.cpp io_serial.cpp \ |
28 | file_layer.cpp sz_transfer.cpp \ | 29 | file_layer.cpp sz_transfer.cpp \ |
29 | main.cpp \ | 30 | main.cpp \ |
30 | metafactory.cpp \ | 31 | metafactory.cpp \ |
31 | session.cpp \ | 32 | session.cpp \ |
32 | mainwindow.cpp \ | 33 | mainwindow.cpp \ |
33 | profile.cpp \ | 34 | profile.cpp \ |
34 | profileconfig.cpp \ | 35 | profileconfig.cpp \ |
35 | profilemanager.cpp \ | 36 | profilemanager.cpp \ |
36 | tabwidget.cpp \ | 37 | tabwidget.cpp \ |
37 | configdialog.cpp \ | 38 | configdialog.cpp \ |
38 | profileeditordialog.cpp \ | 39 | profileeditordialog.cpp \ |
39 | profileeditorplugins.cpp \ | 40 | profileeditorplugins.cpp \ |
40 | emulation_layer.cpp \ | 41 | emulation_layer.cpp \ |
41 | widget.cpp \ | 42 | widget.cpp \ |
42 | vt102emulation.cpp \ | 43 | vt102emulation.cpp \ |
43 | history.cpp \ | 44 | history.cpp \ |
44 | screen.cpp \ | 45 | screen.cpp \ |
45 | keytrans.cpp \ | 46 | keytrans.cpp \ |
46 | widget_layer.cpp | 47 | widget_layer.cpp \ |
48 | transferdialog.cpp | ||
47 | 49 | ||
48 | INTERFACES = configurebase.ui editbase.ui | 50 | INTERFACES = configurebase.ui editbase.ui |
49 | INCLUDEPATH += $(OPIEDIR)/include | 51 | INCLUDEPATH += $(OPIEDIR)/include |
50 | DEPENDPATH += $(OPIEDIR)/include | 52 | DEPENDPATH += $(OPIEDIR)/include |
51 | LIBS += -lqpe -lopie | 53 | LIBS += -lqpe -lopie |
52 | TARGET = opie-console | 54 | TARGET = opie-console |
53 | 55 | ||
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index fbe0f23..fc95e56 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -16,33 +16,33 @@ | |||
16 | 16 | ||
17 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, | 17 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, |
18 | const Profile& prof ) | 18 | const Profile& prof ) |
19 | : QTabDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) | 19 | : QTabDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) |
20 | { | 20 | { |
21 | initUI(); | 21 | initUI(); |
22 | 22 | ||
23 | // Apply current profile | 23 | // Apply current profile |
24 | // plugin_plugin->load(profile); | 24 | // plugin_plugin->load(profile); |
25 | // ... (reset profile name line edit etc.) | 25 | // ... (reset profile name line edit etc.) |
26 | } | 26 | } |
27 | 27 | ||
28 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | 28 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) |
29 | : QTabDialog(0, 0, TRUE), m_fact( fact ) | 29 | : QTabDialog(0, 0, TRUE), m_fact( fact ) |
30 | { | 30 | { |
31 | // Default profile | 31 | // Default profile |
32 | m_prof = Profile("serial", QString::null, Profile::Black, Profile::White, Profile::VT102); | 32 | m_prof = Profile(QString::null, "serial", Profile::Black, Profile::White, Profile::VT102); |
33 | 33 | ||
34 | initUI(); | 34 | initUI(); |
35 | 35 | ||
36 | // Apply current profile | 36 | // Apply current profile |
37 | // plugin_plugin->load(profile); | 37 | // plugin_plugin->load(profile); |
38 | } | 38 | } |
39 | 39 | ||
40 | Profile ProfileEditorDialog::profile() const | 40 | Profile ProfileEditorDialog::profile() const |
41 | { | 41 | { |
42 | return m_prof; | 42 | return m_prof; |
43 | } | 43 | } |
44 | 44 | ||
45 | void ProfileEditorDialog::initUI() | 45 | void ProfileEditorDialog::initUI() |
46 | { | 46 | { |
47 | QWidget *tabterm, *tabconn, *tabprof; | 47 | QWidget *tabterm, *tabconn, *tabprof; |
48 | 48 | ||
@@ -181,34 +181,39 @@ void ProfileEditorDialog::initUI() | |||
181 | vbox2->add(conversions); | 181 | vbox2->add(conversions); |
182 | QHBoxLayout *hbox5 = new QHBoxLayout(vbox2, 2); | 182 | QHBoxLayout *hbox5 = new QHBoxLayout(vbox2, 2); |
183 | hbox5->add(conv_inbound); | 183 | hbox5->add(conv_inbound); |
184 | hbox5->add(conv_outbound); | 184 | hbox5->add(conv_outbound); |
185 | vbox2->add(options); | 185 | vbox2->add(options); |
186 | QHBoxLayout *hbox4 = new QHBoxLayout(vbox2, 2); | 186 | QHBoxLayout *hbox4 = new QHBoxLayout(vbox2, 2); |
187 | hbox4->add(option_wrap); | 187 | hbox4->add(option_wrap); |
188 | hbox4->add(option_echo); | 188 | hbox4->add(option_echo); |
189 | 189 | ||
190 | addTab(tabprof, QObject::tr("Profile")); | 190 | addTab(tabprof, QObject::tr("Profile")); |
191 | addTab(tabconn, QObject::tr("Connection")); | 191 | addTab(tabconn, QObject::tr("Connection")); |
192 | addTab(tabterm, QObject::tr("Terminal")); | 192 | addTab(tabterm, QObject::tr("Terminal")); |
193 | 193 | ||
194 | setOkButton(QObject::tr("OK")); | 194 | setOkButton(QObject::tr("OK")); |
195 | setCancelButton(QObject::tr("Cancel")); | 195 | setCancelButton(QObject::tr("Cancel")); |
196 | 196 | ||
197 | connect(this, SIGNAL(cancelButtonPressed()), SLOT(slotCancel())); | 197 | // load profile values |
198 | |||
199 | name_line->setText(m_prof.name()); | ||
200 | |||
201 | // signals | ||
198 | 202 | ||
203 | connect(this, SIGNAL(cancelButtonPressed()), SLOT(slotCancel())); | ||
199 | connect(device_box, SIGNAL(activated(int)), SLOT(slotDevice(int))); | 204 | connect(device_box, SIGNAL(activated(int)), SLOT(slotDevice(int))); |
200 | } | 205 | } |
201 | 206 | ||
202 | ProfileEditorDialog::~ProfileEditorDialog() { | 207 | ProfileEditorDialog::~ProfileEditorDialog() { |
203 | 208 | ||
204 | } | 209 | } |
205 | 210 | ||
206 | void ProfileEditorDialog::slotDevice(int id) | 211 | void ProfileEditorDialog::slotDevice(int id) |
207 | { | 212 | { |
208 | delete plugin_plugin; | 213 | delete plugin_plugin; |
209 | 214 | ||
210 | plugin_plugin = m_fact->newConfigPlugin(prof_type(), plugin_base, m_prof); | 215 | plugin_plugin = m_fact->newConfigPlugin(prof_type(), plugin_base, m_prof); |
211 | plugin_layout->add(plugin_plugin->widget()); | 216 | plugin_layout->add(plugin_plugin->widget()); |
212 | 217 | ||
213 | // Reload profile associated to device, including e.g. conn_device() | 218 | // Reload profile associated to device, including e.g. conn_device() |
214 | // m_prof = plugin_plugin->profile() | 219 | // m_prof = plugin_plugin->profile() |
@@ -218,32 +223,35 @@ void ProfileEditorDialog::slotDevice(int id) | |||
218 | plugin_plugin->widget()->show(); | 223 | plugin_plugin->widget()->show(); |
219 | } | 224 | } |
220 | 225 | ||
221 | void ProfileEditorDialog::accept() | 226 | void ProfileEditorDialog::accept() |
222 | { | 227 | { |
223 | if(prof_name().isEmpty()) | 228 | if(prof_name().isEmpty()) |
224 | { | 229 | { |
225 | QMessageBox::information(this, | 230 | QMessageBox::information(this, |
226 | QObject::tr("Invalid profile"), | 231 | QObject::tr("Invalid profile"), |
227 | QObject::tr("Please enter a profile name.")); | 232 | QObject::tr("Please enter a profile name.")); |
228 | return; | 233 | return; |
229 | } | 234 | } |
230 | 235 | ||
231 | // Save profile and plugin profile | 236 | // Save profile and plugin profile |
232 | if(plugin_plugin) plugin_plugin->save(); | 237 | if(plugin_plugin) plugin_plugin->save(); |
233 | 238 | ||
239 | // Save general values | ||
240 | m_prof.setName(prof_name()); | ||
241 | |||
234 | QDialog::accept(); | 242 | QDialog::accept(); |
235 | } | 243 | } |
236 | 244 | ||
237 | void ProfileEditorDialog::slotCancel() | 245 | void ProfileEditorDialog::slotCancel() |
238 | { | 246 | { |
239 | reject(); | 247 | reject(); |
240 | } | 248 | } |
241 | 249 | ||
242 | QString ProfileEditorDialog::prof_name() | 250 | QString ProfileEditorDialog::prof_name() |
243 | { | 251 | { |
244 | return name_line->text(); | 252 | return name_line->text(); |
245 | } | 253 | } |
246 | 254 | ||
247 | QString ProfileEditorDialog::prof_type() | 255 | QString ProfileEditorDialog::prof_type() |
248 | { | 256 | { |
249 | QStringList w = m_fact->configWidgets(); | 257 | QStringList w = m_fact->configWidgets(); |
diff --git a/noncore/apps/opie-console/widget_layer.h b/noncore/apps/opie-console/widget_layer.h index 3cdd6aa..07ec12a 100644 --- a/noncore/apps/opie-console/widget_layer.h +++ b/noncore/apps/opie-console/widget_layer.h | |||
@@ -30,33 +30,33 @@ class WidgetLayer : public QObject | |||
30 | public: | 30 | public: |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * constructor | 33 | * constructor |
34 | */ | 34 | */ |
35 | WidgetLayer( QObject *parent=0, const char *name=0 ); | 35 | WidgetLayer( QObject *parent=0, const char *name=0 ); |
36 | 36 | ||
37 | /** | 37 | /** |
38 | * destructor | 38 | * destructor |
39 | */ | 39 | */ |
40 | virtual ~WidgetLayer(); | 40 | virtual ~WidgetLayer(); |
41 | 41 | ||
42 | public: | 42 | public: |
43 | /** | 43 | /** |
44 | * sets the image | 44 | * sets the image |
45 | */ | 45 | */ |
46 | virtual void setImage( const Character* const newimg, int lines, int colums ); | 46 | virtual void setImage( const Character* const newimg, int lines, int colums ) = 0; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * annoy the user | 49 | * annoy the user |
50 | */ | 50 | */ |
51 | void bell(); | 51 | void bell(); |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * return the lines count | 54 | * return the lines count |
55 | */ | 55 | */ |
56 | int lines(){ return m_lines; } | 56 | int lines(){ return m_lines; } |
57 | 57 | ||
58 | /** | 58 | /** |
59 | * return the columns count | 59 | * return the columns count |
60 | */ | 60 | */ |
61 | int columns(){ return m_columns; } | 61 | int columns(){ return m_columns; } |
62 | 62 | ||
@@ -130,33 +130,33 @@ signals: | |||
130 | 130 | ||
131 | 131 | ||
132 | // protected methods | 132 | // protected methods |
133 | protected: | 133 | protected: |
134 | 134 | ||
135 | // image operations | 135 | // image operations |
136 | 136 | ||
137 | /** | 137 | /** |
138 | * changes image, to suit new size | 138 | * changes image, to suit new size |
139 | * TODO: find meaningful name! | 139 | * TODO: find meaningful name! |
140 | */ | 140 | */ |
141 | void propagateSize(); | 141 | void propagateSize(); |
142 | 142 | ||
143 | /** | 143 | /** |
144 | * | 144 | * |
145 | */ | 145 | */ |
146 | virtual void calcGeometry(); | 146 | virtual void calcGeometry() = 0; |
147 | 147 | ||
148 | /** | 148 | /** |
149 | * makes an empty image | 149 | * makes an empty image |
150 | */ | 150 | */ |
151 | void makeImage(); | 151 | void makeImage(); |
152 | 152 | ||
153 | /** | 153 | /** |
154 | * clears the image | 154 | * clears the image |
155 | */ | 155 | */ |
156 | void clearImage(); | 156 | void clearImage(); |
157 | 157 | ||
158 | protected slots: | 158 | protected slots: |
159 | 159 | ||
160 | /** | 160 | /** |
161 | * clear selection | 161 | * clear selection |
162 | */ | 162 | */ |