author | josef <josef> | 2002-10-07 10:02:58 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-07 10:02:58 (UTC) |
commit | 46171dcd991e8c3bfff8e662b3913f454714560a (patch) (unidiff) | |
tree | c596e53f6b308ffef0f2da1ccf538c79693bd5e5 | |
parent | d4c3a54affe5497b84e48f52d411391818790cba (diff) | |
download | opie-46171dcd991e8c3bfff8e662b3913f454714560a.zip opie-46171dcd991e8c3bfff8e662b3913f454714560a.tar.gz opie-46171dcd991e8c3bfff8e662b3913f454714560a.tar.bz2 |
- load profiles correctly when editing them
- save their general values after editing them
- fix compilation of widget_layer (temporary workaround?)
-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 | |||
@@ -57,26 +57,28 @@ Profile::ValueList ConfigDialog::list()const { | |||
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)); |
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 | |||
@@ -13,41 +13,43 @@ HEADERS = io_layer.h io_serial.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 | |||
@@ -20,25 +20,25 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, | |||
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 | ||
@@ -185,26 +185,31 @@ void ProfileEditorDialog::initUI() | |||
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); |
@@ -222,24 +227,27 @@ 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 | } |
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 | |||
@@ -34,25 +34,25 @@ public: | |||
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 | /** |
@@ -134,25 +134,25 @@ 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: |