author | harlekin <harlekin> | 2002-10-24 13:49:31 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-24 13:49:31 (UTC) |
commit | 9de347605b9457a0d5b56e1f951c143a71acf6ac (patch) (unidiff) | |
tree | a1a319840af28728154c6363b5d81fb7e4a87d23 | |
parent | 549a3104fe5213797d98487e470ce5c86ee62e10 (diff) | |
download | opie-9de347605b9457a0d5b56e1f951c143a71acf6ac.zip opie-9de347605b9457a0d5b56e1f951c143a71acf6ac.tar.gz opie-9de347605b9457a0d5b56e1f951c143a71acf6ac.tar.bz2 |
forgot tr()
-rw-r--r-- | noncore/apps/opie-console/BUGS | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/BUGS b/noncore/apps/opie-console/BUGS index e6339e1..8195dc5 100644 --- a/noncore/apps/opie-console/BUGS +++ b/noncore/apps/opie-console/BUGS | |||
@@ -1,31 +1,32 @@ | |||
1 | Ok we all know we write perfect code | 1 | Ok we all know we write perfect code |
2 | but sometimes the compiler produces bad code | 2 | but sometimes the compiler produces bad code |
3 | and we need to work around some compiler bugs!! -zecke | 3 | and we need to work around some compiler bugs!! -zecke |
4 | 4 | ||
5 | 5 | ||
6 | Send/receive: lrzsz behaves strange when trying to use | 6 | Send/receive: lrzsz behaves strange when trying to use |
7 | --overwrite or --rename. | 7 | --overwrite or --rename. |
8 | 8 | ||
9 | - transfer dialog is still a top dialog instead on the widgetstack of of the | 9 | - transfer dialog is still a top dialog instead on the widgetstack of of the |
10 | connection its used on | 10 | connection its used on |
11 | 11 | ||
12 | - keys and buttonbar merge | 12 | - keys and buttonbar merge |
13 | 13 | ||
14 | - keys really working | 14 | - keys really working |
15 | mc is working | 15 | mc is working |
16 | but F11 on bar seems to be the F10 key and so on | 16 | but F11 on bar seems to be the F10 key and so on |
17 | F9 is F8... -zecke | 17 | F9 is F8... -zecke |
18 | Should be fixed -zecke | 18 | Should be fixed -zecke |
19 | 19 | ||
20 | - scripting with "direct subpopup" | 20 | - scripting with "direct subpopup" |
21 | also: | 21 | also: |
22 | - an indication that it is currently recording, also change menu entry to | 22 | - an indication that it is currently recording, also change menu entry to |
23 | "cancel recording" then | 23 | "cancel recording" then |
24 | 24 | ||
25 | - scripts need an extension and also an icon | 25 | - scripts need an extension and also an icon |
26 | 26 | ||
27 | - help documentation needs to be extended | 27 | - help documentation needs to be extended |
28 | - new connection and save connection | 28 | - new connection and save connection |
29 | - paste button | 29 | - paste button |
30 | - keys button | 30 | - keys button |
31 | 31 | ||
32 | - exit / strg + d does not close conection / tab \ No newline at end of file | ||
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index 127009b..36daaef 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -1,240 +1,239 @@ | |||
1 | #include <qlayout.h> | 1 | #include <qlayout.h> |
2 | #include <qlineedit.h> | 2 | #include <qlineedit.h> |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qmessagebox.h> | 4 | #include <qmessagebox.h> |
5 | #include <qstringlist.h> | 5 | #include <qstringlist.h> |
6 | #include <qcombobox.h> | 6 | #include <qcombobox.h> |
7 | #include <qcheckbox.h> | 7 | #include <qcheckbox.h> |
8 | #include <qscrollview.h> | 8 | #include <qscrollview.h> |
9 | 9 | ||
10 | //#include "profileeditorplugins.h" | ||
11 | #include "metafactory.h" | 10 | #include "metafactory.h" |
12 | #include "profileeditordialog.h" | 11 | #include "profileeditordialog.h" |
13 | 12 | ||
14 | namespace { | 13 | namespace { |
15 | void setCurrent( const QString& str, QComboBox* bo ) { | 14 | void setCurrent( const QString& str, QComboBox* bo ) { |
16 | for (int i = 0; i < bo->count(); i++ ) { | 15 | for (int i = 0; i < bo->count(); i++ ) { |
17 | if ( bo->text(i) == str ) { | 16 | if ( bo->text(i) == str ) { |
18 | bo->setCurrentItem( i ); | 17 | bo->setCurrentItem( i ); |
19 | } | 18 | } |
20 | } | 19 | } |
21 | }; | 20 | }; |
22 | } | 21 | } |
23 | 22 | ||
24 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, | 23 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, |
25 | const Profile& prof ) | 24 | const Profile& prof ) |
26 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) | 25 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) |
27 | { | 26 | { |
28 | initUI(); | 27 | initUI(); |
29 | 28 | ||
30 | // Apply current profile | 29 | // Apply current profile |
31 | // plugin_plugin->load(profile); | 30 | // plugin_plugin->load(profile); |
32 | // ... (reset profile name line edit etc.) | 31 | // ... (reset profile name line edit etc.) |
33 | } | 32 | } |
34 | 33 | ||
35 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | 34 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) |
36 | : QDialog(0, 0, TRUE), m_fact( fact ) | 35 | : QDialog(0, 0, TRUE), m_fact( fact ) |
37 | { | 36 | { |
38 | // Default profile | 37 | // Default profile |
39 | m_prof = Profile("New Profile", "serial", "default", Profile::Black, Profile::White, Profile::VT102); | 38 | m_prof = Profile("New Profile", "serial", "default", Profile::Black, Profile::White, Profile::VT102); |
40 | 39 | ||
41 | initUI(); | 40 | initUI(); |
42 | 41 | ||
43 | // Apply current profile | 42 | // Apply current profile |
44 | // plugin_plugin->load(profile); | 43 | // plugin_plugin->load(profile); |
45 | } | 44 | } |
46 | 45 | ||
47 | Profile ProfileEditorDialog::profile() const | 46 | Profile ProfileEditorDialog::profile() const |
48 | { | 47 | { |
49 | return m_prof; | 48 | return m_prof; |
50 | } | 49 | } |
51 | 50 | ||
52 | void ProfileEditorDialog::initUI() | 51 | void ProfileEditorDialog::initUI() |
53 | { | 52 | { |
54 | m_con = m_term = m_key = 0l; | 53 | m_con = m_term = m_key = 0l; |
55 | 54 | ||
56 | 55 | ||
57 | QVBoxLayout *mainLayout = new QVBoxLayout( this ); | 56 | QVBoxLayout *mainLayout = new QVBoxLayout( this ); |
58 | tabWidget = new OTabWidget( this ); | 57 | tabWidget = new OTabWidget( this ); |
59 | tabWidget->setTabStyle(OTabWidget::TextTab); | 58 | tabWidget->setTabStyle(OTabWidget::TextTab); |
60 | mainLayout->add(tabWidget); | 59 | mainLayout->add(tabWidget); |
61 | 60 | ||
62 | /* base tabs */ | 61 | /* base tabs */ |
63 | tabprof = new QWidget(this); | 62 | tabprof = new QWidget(this); |
64 | m_tabTerm = new QWidget(this); | 63 | m_tabTerm = new QWidget(this); |
65 | m_tabCon = new QWidget(this); | 64 | m_tabCon = new QWidget(this); |
66 | m_tabKey = new QWidget(this); | 65 | m_tabKey = new QWidget(this); |
67 | 66 | ||
68 | m_svCon = new QScrollView( m_tabCon ); | 67 | m_svCon = new QScrollView( m_tabCon ); |
69 | m_svCon->setResizePolicy( QScrollView::AutoOneFit ); | 68 | m_svCon->setResizePolicy( QScrollView::AutoOneFit ); |
70 | m_svCon->setHScrollBarMode( QScrollView::AlwaysOff ); | 69 | m_svCon->setHScrollBarMode( QScrollView::AlwaysOff ); |
71 | m_svCon->setFrameShape( QFrame::NoFrame ); | 70 | m_svCon->setFrameShape( QFrame::NoFrame ); |
72 | m_svTerm = new QScrollView( m_tabTerm ); | 71 | m_svTerm = new QScrollView( m_tabTerm ); |
73 | m_svTerm->setResizePolicy( QScrollView::AutoOneFit ); | 72 | m_svTerm->setResizePolicy( QScrollView::AutoOneFit ); |
74 | m_svTerm->setHScrollBarMode( QScrollView::AlwaysOff ); | 73 | m_svTerm->setHScrollBarMode( QScrollView::AlwaysOff ); |
75 | m_svTerm->setFrameShape( QFrame::NoFrame ); | 74 | m_svTerm->setFrameShape( QFrame::NoFrame ); |
76 | 75 | ||
77 | /* base layout for tabs */ | 76 | /* base layout for tabs */ |
78 | m_layCon = new QHBoxLayout( m_tabCon , 2 ); | 77 | m_layCon = new QHBoxLayout( m_tabCon , 2 ); |
79 | m_layTerm = new QHBoxLayout( m_tabTerm, 2 ); | 78 | m_layTerm = new QHBoxLayout( m_tabTerm, 2 ); |
80 | m_layKey = new QHBoxLayout( m_tabKey, 2 ); | 79 | m_layKey = new QHBoxLayout( m_tabKey, 2 ); |
81 | 80 | ||
82 | m_layCon->addWidget( m_svCon ); | 81 | m_layCon->addWidget( m_svCon ); |
83 | m_layTerm->addWidget( m_svTerm ); | 82 | m_layTerm->addWidget( m_svTerm ); |
84 | 83 | ||
85 | // profile tab | 84 | // profile tab |
86 | 85 | ||
87 | QLabel *name = new QLabel(QObject::tr("Profile name"), tabprof); | 86 | QLabel *name = new QLabel(QObject::tr("Profile name"), tabprof); |
88 | m_name = new QLineEdit(tabprof); | 87 | m_name = new QLineEdit(tabprof); |
89 | QLabel *con = new QLabel(tr("Connection"), tabprof ); | 88 | QLabel *con = new QLabel(tr("Connection"), tabprof ); |
90 | QLabel *term = new QLabel(tr("Terminal"), tabprof ); | 89 | QLabel *term = new QLabel(tr("Terminal"), tabprof ); |
91 | m_conCmb = new QComboBox( tabprof ); | 90 | m_conCmb = new QComboBox( tabprof ); |
92 | m_termCmb = new QComboBox( tabprof ); | 91 | m_termCmb = new QComboBox( tabprof ); |
93 | m_autoConnect = new QCheckBox(tr("Auto connect after load"), tabprof); | 92 | m_autoConnect = new QCheckBox(tr("Auto connect after load"), tabprof); |
94 | 93 | ||
95 | // layouting | 94 | // layouting |
96 | QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2); | 95 | QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2); |
97 | vbox3->add(name); | 96 | vbox3->add(name); |
98 | vbox3->add(m_name); | 97 | vbox3->add(m_name); |
99 | vbox3->add(con ); | 98 | vbox3->add(con ); |
100 | vbox3->add(m_conCmb ); | 99 | vbox3->add(m_conCmb ); |
101 | vbox3->add(term ); | 100 | vbox3->add(term ); |
102 | vbox3->add(m_termCmb ); | 101 | vbox3->add(m_termCmb ); |
103 | vbox3->add(m_autoConnect); | 102 | vbox3->add(m_autoConnect); |
104 | vbox3->addStretch(1); | 103 | vbox3->addStretch(1); |
105 | 104 | ||
106 | m_showconntab = 0; | 105 | m_showconntab = 0; |
107 | tabWidget->addTab(tabprof, "", QObject::tr("Profile")); | 106 | tabWidget->addTab(tabprof, "", QObject::tr("Profile")); |
108 | tabWidget->addTab(m_tabCon, "", QObject::tr("Connection")); | 107 | tabWidget->addTab(m_tabCon, "", QObject::tr("Connection")); |
109 | tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal")); | 108 | tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal")); |
110 | tabWidget->addTab(m_tabKey, "", QObject::tr("Special Keys")); | 109 | tabWidget->addTab(m_tabKey, "", QObject::tr("Special Keys")); |
111 | tabWidget->setCurrentTab( tabprof ); | 110 | tabWidget->setCurrentTab( tabprof ); |
112 | 111 | ||
113 | 112 | ||
114 | // fill the comboboxes | 113 | // fill the comboboxes |
115 | QStringList list = m_fact->connectionWidgets(); | 114 | QStringList list = m_fact->connectionWidgets(); |
116 | QStringList::Iterator it; | 115 | QStringList::Iterator it; |
117 | for (it =list.begin(); it != list.end(); ++it ) { | 116 | for (it =list.begin(); it != list.end(); ++it ) { |
118 | m_conCmb->insertItem( (*it) ); | 117 | m_conCmb->insertItem( (*it) ); |
119 | } | 118 | } |
120 | list = m_fact->terminalWidgets(); | 119 | list = m_fact->terminalWidgets(); |
121 | for (it =list.begin(); it != list.end(); ++it ) { | 120 | for (it =list.begin(); it != list.end(); ++it ) { |
122 | m_termCmb->insertItem( (*it) ); | 121 | m_termCmb->insertItem( (*it) ); |
123 | } | 122 | } |
124 | 123 | ||
125 | // load profile values | 124 | // load profile values |
126 | m_name->setText(m_prof.name()); | 125 | m_name->setText(m_prof.name()); |
127 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); | 126 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); |
128 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); | 127 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); |
129 | slotKeyActivated( "Default Keyboard" ); | 128 | slotKeyActivated( "Default Keyboard" ); |
130 | setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); | 129 | setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); |
131 | setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); | 130 | setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); |
132 | m_autoConnect->setChecked(m_prof.autoConnect()); | 131 | m_autoConnect->setChecked(m_prof.autoConnect()); |
133 | 132 | ||
134 | 133 | ||
135 | // signal and slots | 134 | // signal and slots |
136 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), | 135 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), |
137 | this, SLOT(slotConActivated(const QString&) ) ); | 136 | this, SLOT(slotConActivated(const QString&) ) ); |
138 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), | 137 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), |
139 | this, SLOT(slotTermActivated(const QString& ) ) ); | 138 | this, SLOT(slotTermActivated(const QString& ) ) ); |
140 | 139 | ||
141 | } | 140 | } |
142 | 141 | ||
143 | ProfileEditorDialog::~ProfileEditorDialog() { | 142 | ProfileEditorDialog::~ProfileEditorDialog() { |
144 | 143 | ||
145 | } | 144 | } |
146 | void ProfileEditorDialog::accept() | 145 | void ProfileEditorDialog::accept() |
147 | { | 146 | { |
148 | if(profName().isEmpty()) | 147 | if(profName().isEmpty()) |
149 | { | 148 | { |
150 | QMessageBox::information(this, | 149 | QMessageBox::information(this, |
151 | QObject::tr("Invalid profile"), | 150 | QObject::tr("Invalid profile"), |
152 | QObject::tr("Please enter a profile name.")); | 151 | QObject::tr("Please enter a profile name.")); |
153 | return; | 152 | return; |
154 | } | 153 | } |
155 | // Save profile and plugin profile | 154 | // Save profile and plugin profile |
156 | //if(plugin_plugin) plugin_plugin->save(); | 155 | //if(plugin_plugin) plugin_plugin->save(); |
157 | 156 | ||
158 | // Save general values | 157 | // Save general values |
159 | m_prof.setName( profName() ); | 158 | m_prof.setName( profName() ); |
160 | m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) ); | 159 | m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) ); |
161 | m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) ); | 160 | m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) ); |
162 | m_prof.setAutoConnect( m_autoConnect->isChecked() ); | 161 | m_prof.setAutoConnect( m_autoConnect->isChecked() ); |
163 | 162 | ||
164 | if (m_con ) | 163 | if (m_con ) |
165 | m_con->save( m_prof ); | 164 | m_con->save( m_prof ); |
166 | if (m_term ) | 165 | if (m_term ) |
167 | m_term->save( m_prof ); | 166 | m_term->save( m_prof ); |
168 | if (m_key) | 167 | if (m_key) |
169 | m_key->save( m_prof ); | 168 | m_key->save( m_prof ); |
170 | 169 | ||
171 | QDialog::accept(); | 170 | QDialog::accept(); |
172 | } | 171 | } |
173 | 172 | ||
174 | 173 | ||
175 | QString ProfileEditorDialog::profName()const | 174 | QString ProfileEditorDialog::profName()const |
176 | { | 175 | { |
177 | return m_name->text(); | 176 | return m_name->text(); |
178 | } | 177 | } |
179 | 178 | ||
180 | QCString ProfileEditorDialog::profType()const | 179 | QCString ProfileEditorDialog::profType()const |
181 | { | 180 | { |
182 | /*QStringList w = m_fact->configWidgets(); | 181 | /*QStringList w = m_fact->configWidgets(); |
183 | for(QStringList::Iterator it = w.begin(); it != w.end(); it++) | 182 | for(QStringList::Iterator it = w.begin(); it != w.end(); it++) |
184 | if(device_box->currentText() == m_fact->name((*it))) return (*it); | 183 | if(device_box->currentText() == m_fact->name((*it))) return (*it); |
185 | */ | 184 | */ |
186 | return QCString(); | 185 | return QCString(); |
187 | } | 186 | } |
188 | /* | 187 | /* |
189 | * we need to switch the widget | 188 | * we need to switch the widget |
190 | */ | 189 | */ |
191 | void ProfileEditorDialog::slotConActivated( const QString& str ) { | 190 | void ProfileEditorDialog::slotConActivated( const QString& str ) { |
192 | 191 | ||
193 | delete m_con; | 192 | delete m_con; |
194 | 193 | ||
195 | m_con = m_fact->newConnectionPlugin( str, m_svCon->viewport() ); | 194 | m_con = m_fact->newConnectionPlugin( str, m_svCon->viewport() ); |
196 | 195 | ||
197 | if ( !m_con ) { | 196 | if ( !m_con ) { |
198 | m_con = new NoOptions( str, m_svCon->viewport(), "name"); | 197 | m_con = new NoOptions( str, m_svCon->viewport(), "name"); |
199 | } | 198 | } |
200 | 199 | ||
201 | // FIXME ugly hack right. Right solution would be to look into the layer and see if it | 200 | // FIXME ugly hack right. Right solution would be to look into the layer and see if it |
202 | // supports auto connect and then set it as prefered | 201 | // supports auto connect and then set it as prefered |
203 | //if ( ( )->layer()->supports()[0] == 1 ) { | 202 | //if ( ( )->layer()->supports()[0] == 1 ) { |
204 | if ( m_conCmb ->currentText() == "local Console" ) { | 203 | if ( m_conCmb ->currentText() == tr("local Console") ) { |
205 | m_autoConnect->setChecked( true ); | 204 | m_autoConnect->setChecked( true ); |
206 | } else { | 205 | } else { |
207 | m_autoConnect->setChecked( false ); | 206 | m_autoConnect->setChecked( false ); |
208 | } | 207 | } |
209 | 208 | ||
210 | m_con->load( m_prof ); | 209 | m_con->load( m_prof ); |
211 | m_svCon->addChild( m_con ); | 210 | m_svCon->addChild( m_con ); |
212 | } | 211 | } |
213 | 212 | ||
214 | 213 | ||
215 | /* | 214 | /* |
216 | * we need to switch the widget | 215 | * we need to switch the widget |
217 | */ | 216 | */ |
218 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { | 217 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { |
219 | 218 | ||
220 | delete m_term; | 219 | delete m_term; |
221 | 220 | ||
222 | m_term = m_fact->newTerminalPlugin( str, m_svTerm->viewport() ); | 221 | m_term = m_fact->newTerminalPlugin( str, m_svTerm->viewport() ); |
223 | 222 | ||
224 | if (m_term) { | 223 | if (m_term) { |
225 | m_term->load( m_prof ); | 224 | m_term->load( m_prof ); |
226 | m_svTerm->addChild( m_term ); | 225 | m_svTerm->addChild( m_term ); |
227 | } | 226 | } |
228 | } | 227 | } |
229 | 228 | ||
230 | void ProfileEditorDialog::slotKeyActivated(const QString &str) { | 229 | void ProfileEditorDialog::slotKeyActivated(const QString &str) { |
231 | delete m_key; | 230 | delete m_key; |
232 | m_key = m_fact->newKeyboardPlugin( str, m_tabKey ); | 231 | m_key = m_fact->newKeyboardPlugin( str, m_tabKey ); |
233 | 232 | ||
234 | if (m_key) { | 233 | if (m_key) { |
235 | 234 | ||
236 | m_key->load(m_prof); | 235 | m_key->load(m_prof); |
237 | m_layKey->addWidget(m_key); | 236 | m_layKey->addWidget(m_key); |
238 | } | 237 | } |
239 | 238 | ||
240 | } | 239 | } |