Diffstat (limited to 'noncore/apps/opie-console/configdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/configdialog.cpp | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/noncore/apps/opie-console/configdialog.cpp b/noncore/apps/opie-console/configdialog.cpp index d09cec3..23e94b1 100644 --- a/noncore/apps/opie-console/configdialog.cpp +++ b/noncore/apps/opie-console/configdialog.cpp | |||
@@ -64,7 +64,12 @@ void ConfigDialog::slotRemove() { | |||
64 | } | 64 | } |
65 | 65 | ||
66 | void ConfigDialog::slotEdit() { | 66 | void ConfigDialog::slotEdit() { |
67 | ProfileEditorDialog dlg(new MetaFactory()); | 67 | Profile p; |
68 | |||
69 | // Load profile | ||
70 | // p = currentItem()->profile(); | ||
71 | |||
72 | ProfileEditorDialog dlg(new MetaFactory(), p); | ||
68 | 73 | ||
69 | dlg.setCaption("Edit Connection Profile"); | 74 | dlg.setCaption("Edit Connection Profile"); |
70 | dlg.showMaximized(); | 75 | dlg.showMaximized(); |
@@ -80,8 +85,6 @@ void ConfigDialog::slotEdit() { | |||
80 | 85 | ||
81 | 86 | ||
82 | void ConfigDialog::slotAdd() { | 87 | void ConfigDialog::slotAdd() { |
83 | qWarning("ConfigDialog::slotAdd"); | ||
84 | |||
85 | ProfileEditorDialog dlg(new MetaFactory()); | 88 | ProfileEditorDialog dlg(new MetaFactory()); |
86 | 89 | ||
87 | dlg.setCaption("New Connection"); | 90 | dlg.setCaption("New Connection"); |
@@ -90,23 +93,13 @@ void ConfigDialog::slotAdd() { | |||
90 | 93 | ||
91 | if(ret == QDialog::Accepted) | 94 | if(ret == QDialog::Accepted) |
92 | { | 95 | { |
93 | // defaults | 96 | // TODO: Move into general profile save part |
94 | int profile = Profile::VT102; | ||
95 | |||
96 | // assignments | 97 | // assignments |
97 | QString type = dlg.term_type(); | 98 | //QString type = dlg.term_type(); |
98 | if(type == "VT102") profile = Profile::VT102; | 99 | //if(type == "VT102") profile = Profile::VT102; |
99 | 100 | ||
100 | // new profile | 101 | // get profile from editor |
101 | Profile p(dlg.prof_name(), dlg.prof_type(), Profile::White, Profile::Black, profile); | 102 | Profile p = dlg.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()); | ||
110 | 103 | ||
111 | new ConfigListItem(lstView, p); | 104 | new ConfigListItem(lstView, p); |
112 | } | 105 | } |