Diffstat (limited to 'noncore/apps/opie-console/configdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/configdialog.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/configdialog.cpp b/noncore/apps/opie-console/configdialog.cpp index ba3cd31..d09cec3 100644 --- a/noncore/apps/opie-console/configdialog.cpp +++ b/noncore/apps/opie-console/configdialog.cpp @@ -3,4 +3,7 @@ #include "qlistview.h" #include "configdialog.h" +#include "profileeditordialog.h" +#include "metafactory.h" +#include "qdialog.h" class ConfigListItem : public QListViewItem { @@ -60,9 +63,52 @@ void ConfigDialog::slotRemove() { delete item; } + void ConfigDialog::slotEdit() { + ProfileEditorDialog dlg(new MetaFactory()); + + dlg.setCaption("Edit Connection Profile"); + dlg.showMaximized(); + int ret = dlg.exec(); + if(ret == QDialog::Accepted) + { + // if(listView->current()) delete lstView->current(); ... + // use dlg.terminal()! + new ConfigListItem(lstView, Profile(dlg.prof_name(), dlg.prof_type(), Profile::White, Profile::Black, Profile::VT102)); + } } + + void ConfigDialog::slotAdd() { + qWarning("ConfigDialog::slotAdd"); + + ProfileEditorDialog dlg(new MetaFactory()); + + dlg.setCaption("New Connection"); + dlg.showMaximized(); + int ret = dlg.exec(); + + if(ret == QDialog::Accepted) + { + // defaults + int profile = Profile::VT102; + + // assignments + QString type = dlg.term_type(); + if(type == "VT102") profile = Profile::VT102; + + // new profile + Profile p(dlg.prof_name(), dlg.prof_type(), Profile::White, Profile::Black, profile); + + // special settings + p.writeEntry("Device", dlg.conn_device()); + p.writeEntry("Baud", dlg.conn_baud()); + p.writeEntry("Parity", dlg.conn_parity()); + p.writeEntry("DataBits", dlg.conn_databits()); + p.writeEntry("StopBits", dlg.conn_stopbits()); + p.writeEntry("Flow", dlg.conn_flow()); + new ConfigListItem(lstView, p); + } } |