author | josef <josef> | 2002-10-04 19:44:46 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-04 19:44:46 (UTC) |
commit | dc0344e987ba9b386056dd7bab7c5e34922eff5c (patch) (unidiff) | |
tree | 260ac8afe05e87634088dbae4256315d64481844 /noncore/apps/opie-console/configdialog.cpp | |
parent | 4710de046588f0eab2ea08e74a829c29fe238ed0 (diff) | |
download | opie-dc0344e987ba9b386056dd7bab7c5e34922eff5c.zip opie-dc0344e987ba9b386056dd7bab7c5e34922eff5c.tar.gz opie-dc0344e987ba9b386056dd7bab7c5e34922eff5c.tar.bz2 |
- first stub for configuration dialog
- does not yet use metafactory, this is next on my todo list
Doh! got my account right, finally :)
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 | |||
@@ -4,2 +4,5 @@ | |||
4 | #include "configdialog.h" | 4 | #include "configdialog.h" |
5 | #include "profileeditordialog.h" | ||
6 | #include "metafactory.h" | ||
7 | #include "qdialog.h" | ||
5 | 8 | ||
@@ -61,7 +64,50 @@ void ConfigDialog::slotRemove() { | |||
61 | } | 64 | } |
65 | |||
62 | void ConfigDialog::slotEdit() { | 66 | void ConfigDialog::slotEdit() { |
67 | ProfileEditorDialog dlg(new MetaFactory()); | ||
68 | |||
69 | dlg.setCaption("Edit Connection Profile"); | ||
70 | dlg.showMaximized(); | ||
71 | int ret = dlg.exec(); | ||
63 | 72 | ||
73 | if(ret == QDialog::Accepted) | ||
74 | { | ||
75 | // if(listView->current()) delete lstView->current(); ... | ||
76 | // use dlg.terminal()! | ||
77 | new ConfigListItem(lstView, Profile(dlg.prof_name(), dlg.prof_type(), Profile::White, Profile::Black, Profile::VT102)); | ||
78 | } | ||
64 | } | 79 | } |
80 | |||
81 | |||
65 | void ConfigDialog::slotAdd() { | 82 | void ConfigDialog::slotAdd() { |
83 | qWarning("ConfigDialog::slotAdd"); | ||
84 | |||
85 | ProfileEditorDialog dlg(new MetaFactory()); | ||
86 | |||
87 | dlg.setCaption("New Connection"); | ||
88 | dlg.showMaximized(); | ||
89 | int ret = dlg.exec(); | ||
90 | |||
91 | if(ret == QDialog::Accepted) | ||
92 | { | ||
93 | // defaults | ||
94 | int profile = Profile::VT102; | ||
95 | |||
96 | // assignments | ||
97 | QString type = dlg.term_type(); | ||
98 | if(type == "VT102") profile = Profile::VT102; | ||
99 | |||
100 | // new profile | ||
101 | Profile p(dlg.prof_name(), dlg.prof_type(), Profile::White, Profile::Black, profile); | ||
102 | |||
103 | // special settings | ||
104 | p.writeEntry("Device", dlg.conn_device()); | ||
105 | p.writeEntry("Baud", dlg.conn_baud()); | ||
106 | p.writeEntry("Parity", dlg.conn_parity()); | ||
107 | p.writeEntry("DataBits", dlg.conn_databits()); | ||
108 | p.writeEntry("StopBits", dlg.conn_stopbits()); | ||
109 | p.writeEntry("Flow", dlg.conn_flow()); | ||
66 | 110 | ||
111 | new ConfigListItem(lstView, p); | ||
112 | } | ||
67 | } | 113 | } |