Diffstat (limited to 'noncore/apps/opie-console/configdialog.cpp') (more/less context) (show 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 | |||
@@ -61,13 +61,18 @@ void ConfigDialog::slotRemove() { | |||
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 | 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(); |
71 | int ret = dlg.exec(); | 76 | int ret = dlg.exec(); |
72 | 77 | ||
73 | if(ret == QDialog::Accepted) | 78 | if(ret == QDialog::Accepted) |
@@ -77,38 +82,26 @@ void ConfigDialog::slotEdit() { | |||
77 | new ConfigListItem(lstView, Profile(dlg.prof_name(), dlg.prof_type(), Profile::White, Profile::Black, Profile::VT102)); | 82 | new ConfigListItem(lstView, Profile(dlg.prof_name(), dlg.prof_type(), Profile::White, Profile::Black, Profile::VT102)); |
78 | } | 83 | } |
79 | } | 84 | } |
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"); |
88 | dlg.showMaximized(); | 91 | dlg.showMaximized(); |
89 | int ret = dlg.exec(); | 92 | int ret = dlg.exec(); |
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 | } |
113 | } | 106 | } |
114 | 107 | ||