author | drw <drw> | 2005-05-16 18:56:02 (UTC) |
---|---|---|
committer | drw <drw> | 2005-05-16 18:56:02 (UTC) |
commit | 348314c7411500e23ca467289ed92e446be9121b (patch) (unidiff) | |
tree | f2eea2bec6b6e49f66d4a373b94d2e73f6937c46 | |
parent | 17b9be61d7de14dea0d662a496e3d08bc9b1662e (diff) | |
download | opie-348314c7411500e23ca467289ed92e446be9121b.zip opie-348314c7411500e23ca467289ed92e446be9121b.tar.gz opie-348314c7411500e23ca467289ed92e446be9121b.tar.bz2 |
Resource -> OResource
-rw-r--r-- | noncore/apps/opie-console/function_keyboard.cpp | 9 | ||||
-rw-r--r-- | noncore/apps/opie-console/function_keyboard.h | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 42 |
3 files changed, 30 insertions, 26 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index 0abe0d9..389618c 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp | |||
@@ -70,33 +70,33 @@ void FunctionKeyboard::load (const Profile& prof) { | |||
70 | 70 | ||
71 | /* load all the keys to the keyboard */ | 71 | /* load all the keys to the keyboard */ |
72 | for (ushort i = 0; i <= numRows - 1; i++) | 72 | for (ushort i = 0; i <= numRows - 1; i++) |
73 | for (ushort j = 0; j <= numCols - 1; j++) { | 73 | for (ushort j = 0; j <= numCols - 1; j++) { |
74 | 74 | ||
75 | QString h = "r" + QString::number(i) + "c" + QString::number(j); | 75 | QString h = "r" + QString::number(i) + "c" + QString::number(j); |
76 | QString values = prof.readEntry("keb_" + h); | 76 | QString values = prof.readEntry("keb_" + h); |
77 | 77 | ||
78 | if (!values.isEmpty()) { | 78 | if (!values.isEmpty()) { |
79 | 79 | ||
80 | QStringList l = QStringList::split(QChar('|'), values, TRUE); | 80 | QStringList l = QStringList::split(QChar('|'), values, TRUE); |
81 | keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt()); | 81 | keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt()); |
82 | 82 | ||
83 | // load pixmap if used | 83 | // load pixmap if used |
84 | if (!l[1].isEmpty()) { | 84 | if (!l[1].isEmpty()) { |
85 | 85 | ||
86 | keys[h].pix = new QPixmap( Resource::loadPixmap( "console/keys/" + l[1] ) ); | 86 | keys[h].pix = new QPixmap( Opie::Core::OResource::loadPixmap( "console/keys/" + l[1] ) ); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | if (keys.isEmpty()) loadDefaults(); | 91 | if (keys.isEmpty()) loadDefaults(); |
92 | 92 | ||
93 | hide(); | 93 | hide(); |
94 | show(); | 94 | show(); |
95 | 95 | ||
96 | } | 96 | } |
97 | 97 | ||
98 | void FunctionKeyboard::paintEvent(QPaintEvent *e) { | 98 | void FunctionKeyboard::paintEvent(QPaintEvent *e) { |
99 | 99 | ||
100 | QPainter p(this); | 100 | QPainter p(this); |
101 | p.setClipRect(e->rect()); | 101 | p.setClipRect(e->rect()); |
102 | p.fillRect(0, 0, width(), height(), QColor(255,255,255)); | 102 | p.fillRect(0, 0, width(), height(), QColor(255,255,255)); |
@@ -264,34 +264,33 @@ FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* par | |||
264 | QLabel *l = new QLabel(tr("Rows"), dimentions); | 264 | QLabel *l = new QLabel(tr("Rows"), dimentions); |
265 | m_rowBox = new QSpinBox(1, 15, 1, dimentions); | 265 | m_rowBox = new QSpinBox(1, 15, 1, dimentions); |
266 | connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int))); | 266 | connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int))); |
267 | l = new QLabel(tr("Columns"), dimentions); | 267 | l = new QLabel(tr("Columns"), dimentions); |
268 | m_colBox = new QSpinBox(1, 15, 1, dimentions); | 268 | m_colBox = new QSpinBox(1, 15, 1, dimentions); |
269 | connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int))); | 269 | connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int))); |
270 | 270 | ||
271 | QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this); | 271 | QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this); |
272 | l = new QLabel(tr("Label"), editKey); | 272 | l = new QLabel(tr("Label"), editKey); |
273 | m_labels = new QComboBox(true, editKey); | 273 | m_labels = new QComboBox(true, editKey); |
274 | m_labels->setInsertionPolicy(QComboBox::AtCurrent); | 274 | m_labels->setInsertionPolicy(QComboBox::AtCurrent); |
275 | m_labels->insertItem(""); | 275 | m_labels->insertItem(""); |
276 | 276 | ||
277 | QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList(); | 277 | QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList(); |
278 | 278 | ||
279 | for (uint i = 0; i < files.count(); i++) { | 279 | for (uint i = 0; i < files.count(); i++) { |
280 | 280 | m_labels->insertItem( Opie::Core::OResource::loadPixmap("console/keys/" + files[i]), files[i]); | |
281 | m_labels->insertItem( Resource::loadPixmap("console/keys/" + files[i]), files[i]); | ||
282 | } | 281 | } |
283 | connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int))); | 282 | connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int))); |
284 | connect (m_labels, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeLabelText(const QString&))); | 283 | connect (m_labels, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeLabelText(const QString&))); |
285 | 284 | ||
286 | l = new QLabel(tr("Q Keycode", "Qt Key Code for the OnScreen Keyboard"), editKey); | 285 | l = new QLabel(tr("Q Keycode", "Qt Key Code for the OnScreen Keyboard"), editKey); |
287 | m_qvalues = new QComboBox(true, editKey); | 286 | m_qvalues = new QComboBox(true, editKey); |
288 | m_qvalues->setInsertionPolicy(QComboBox::AtTop); | 287 | m_qvalues->setInsertionPolicy(QComboBox::AtTop); |
289 | m_qvalues->setDuplicatesEnabled(false); | 288 | m_qvalues->setDuplicatesEnabled(false); |
290 | m_qvalues->insertItem(""); | 289 | m_qvalues->insertItem(""); |
291 | connect (m_qvalues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeQCode(const QString&))); | 290 | connect (m_qvalues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeQCode(const QString&))); |
292 | 291 | ||
293 | l = new QLabel(tr("Unicode Value", "The Unicode value of the key"), editKey); | 292 | l = new QLabel(tr("Unicode Value", "The Unicode value of the key"), editKey); |
294 | m_uniValues = new QComboBox(true, editKey); | 293 | m_uniValues = new QComboBox(true, editKey); |
295 | m_uniValues->setInsertionPolicy(QComboBox::AtTop); | 294 | m_uniValues->setInsertionPolicy(QComboBox::AtTop); |
296 | m_uniValues->setDuplicatesEnabled(false); | 295 | m_uniValues->setDuplicatesEnabled(false); |
297 | m_uniValues->insertItem(""); | 296 | m_uniValues->insertItem(""); |
@@ -315,33 +314,33 @@ void FunctionKeyboardConfig::load (const Profile& prof) { | |||
315 | 314 | ||
316 | /* load all the keys to the keyboard */ | 315 | /* load all the keys to the keyboard */ |
317 | for (int i = 0; i <= m_rowBox->value() -1; i++) | 316 | for (int i = 0; i <= m_rowBox->value() -1; i++) |
318 | for (int j = 0; j <= m_colBox->value() -1; j++) { | 317 | for (int j = 0; j <= m_colBox->value() -1; j++) { |
319 | 318 | ||
320 | QString h = "r" + QString::number(i) + "c" + QString::number(j); | 319 | QString h = "r" + QString::number(i) + "c" + QString::number(j); |
321 | QString values = prof.readEntry("keb_" + h); | 320 | QString values = prof.readEntry("keb_" + h); |
322 | 321 | ||
323 | if (!values.isEmpty()) { | 322 | if (!values.isEmpty()) { |
324 | 323 | ||
325 | QStringList l = QStringList::split(QChar('|'), values, TRUE); | 324 | QStringList l = QStringList::split(QChar('|'), values, TRUE); |
326 | kb->keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt()); | 325 | kb->keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt()); |
327 | 326 | ||
328 | // load pixmap if used | 327 | // load pixmap if used |
329 | if (!l[1].isEmpty()) { | 328 | if (!l[1].isEmpty()) { |
330 | 329 | ||
331 | kb->keys[h].pix = new QPixmap( Resource::loadPixmap( "console/keys/" + l[1] ) ); | 330 | kb->keys[h].pix = new QPixmap( Opie::Core::OResource::loadPixmap( "console/keys/" + l[1] ) ); |
332 | } | 331 | } |
333 | } | 332 | } |
334 | } | 333 | } |
335 | 334 | ||
336 | } | 335 | } |
337 | void FunctionKeyboardConfig::save (Profile& prof) { | 336 | void FunctionKeyboardConfig::save (Profile& prof) { |
338 | 337 | ||
339 | prof.writeEntry("keb_rows", m_rowBox->value()); | 338 | prof.writeEntry("keb_rows", m_rowBox->value()); |
340 | prof.writeEntry("keb_cols", m_colBox->value()); | 339 | prof.writeEntry("keb_cols", m_colBox->value()); |
341 | 340 | ||
342 | QMap<QString, FKey>::Iterator it; | 341 | QMap<QString, FKey>::Iterator it; |
343 | for ( it = kb->keys.begin(); it != kb->keys.end(); it++) { | 342 | for ( it = kb->keys.begin(); it != kb->keys.end(); it++) { |
344 | 343 | ||
345 | FKey k = it.data(); | 344 | FKey k = it.data(); |
346 | QString entry = k.label + "|" | 345 | QString entry = k.label + "|" |
347 | + k.pixFile + "|" | 346 | + k.pixFile + "|" |
@@ -390,33 +389,33 @@ void FunctionKeyboardConfig::slotChangeIcon(int index) { | |||
390 | 389 | ||
391 | if (index == 0) { | 390 | if (index == 0) { |
392 | 391 | ||
393 | // is text | 392 | // is text |
394 | m_labels->setEditable(true); | 393 | m_labels->setEditable(true); |
395 | // why tf does the text get erased unless i do this? | 394 | // why tf does the text get erased unless i do this? |
396 | m_labels->changeItem(m_labels->text(0), 0); | 395 | m_labels->changeItem(m_labels->text(0), 0); |
397 | 396 | ||
398 | kb->keys[selectedHandle].pixFile = ""; | 397 | kb->keys[selectedHandle].pixFile = ""; |
399 | delete kb->keys[selectedHandle].pix; | 398 | delete kb->keys[selectedHandle].pix; |
400 | 399 | ||
401 | } else { | 400 | } else { |
402 | 401 | ||
403 | // is a pixmap | 402 | // is a pixmap |
404 | m_labels->setEditable(false); | 403 | m_labels->setEditable(false); |
405 | kb->keys[selectedHandle].pixFile = m_labels->currentText(); | 404 | kb->keys[selectedHandle].pixFile = m_labels->currentText(); |
406 | kb->keys[selectedHandle].pix = new QPixmap( Resource::loadPixmap( "console/keys/" + m_labels->currentText() ) ); | 405 | kb->keys[selectedHandle].pix = new QPixmap( Opie::Core::OResource::loadPixmap( "console/keys/" + m_labels->currentText() ) ); |
407 | } | 406 | } |
408 | kb->paintKey(selectedRow, selectedCol); | 407 | kb->paintKey(selectedRow, selectedCol); |
409 | } | 408 | } |
410 | void FunctionKeyboardConfig::slotChangeLabelText(const QString &label) { | 409 | void FunctionKeyboardConfig::slotChangeLabelText(const QString &label) { |
411 | 410 | ||
412 | kb->keys[selectedHandle].label = label; | 411 | kb->keys[selectedHandle].label = label; |
413 | 412 | ||
414 | kb->paintKey(selectedRow, selectedCol); | 413 | kb->paintKey(selectedRow, selectedCol); |
415 | } | 414 | } |
416 | void FunctionKeyboardConfig::slotChangeQCode(const QString& qcode) { | 415 | void FunctionKeyboardConfig::slotChangeQCode(const QString& qcode) { |
417 | 416 | ||
418 | kb->keys[selectedHandle].qcode = qcode.toUInt(); | 417 | kb->keys[selectedHandle].qcode = qcode.toUInt(); |
419 | } | 418 | } |
420 | void FunctionKeyboardConfig::slotChangeUnicode(const QString& uni) { | 419 | void FunctionKeyboardConfig::slotChangeUnicode(const QString& uni) { |
421 | 420 | ||
422 | kb->keys[selectedHandle].unicode = uni.toUInt(); | 421 | kb->keys[selectedHandle].unicode = uni.toUInt(); |
diff --git a/noncore/apps/opie-console/function_keyboard.h b/noncore/apps/opie-console/function_keyboard.h index a60ff4b..b7e211c 100644 --- a/noncore/apps/opie-console/function_keyboard.h +++ b/noncore/apps/opie-console/function_keyboard.h | |||
@@ -1,41 +1,42 @@ | |||
1 | #ifndef OPIE_FUNCTION_KEYBOARD_H | 1 | #ifndef OPIE_FUNCTION_KEYBOARD_H |
2 | #define OPIE_FUNCTION_KEYBOARD_H | 2 | #define OPIE_FUNCTION_KEYBOARD_H |
3 | 3 | ||
4 | #include <opie2/oresource.h> | ||
5 | |||
4 | #include <qpe/config.h> | 6 | #include <qpe/config.h> |
5 | #include <qpe/resource.h> | ||
6 | #include <qpe/qpeapplication.h> | 7 | #include <qpe/qpeapplication.h> |
7 | #include <qframe.h> | 8 | #include <qframe.h> |
8 | #include <qpainter.h> | 9 | #include <qpainter.h> |
9 | #include <qvbox.h> | 10 | #include <qvbox.h> |
10 | #include <qgroupbox.h> | 11 | #include <qgroupbox.h> |
11 | #include <qmap.h> | 12 | #include <qmap.h> |
12 | #include <qspinbox.h> | 13 | #include <qspinbox.h> |
13 | #include <qcombobox.h> | 14 | #include <qcombobox.h> |
14 | #include "profiledialogwidget.h" | 15 | #include "profiledialogwidget.h" |
15 | 16 | ||
16 | 17 | ||
17 | struct FKey { | 18 | struct FKey { |
18 | 19 | ||
19 | FKey(): qcode(0), unicode(0) {}; | 20 | FKey(): qcode(0), unicode(0) {}; |
20 | FKey(const QString &l, const QString &f, ushort q, ushort u): | 21 | FKey(const QString &l, const QString &f, ushort q, ushort u): |
21 | label(l), pixFile(f), qcode(q), unicode(u) { | 22 | label(l), pixFile(f), qcode(q), unicode(u) { |
22 | 23 | ||
23 | if (!f.isEmpty()) { | 24 | if (!f.isEmpty()) { |
24 | 25 | ||
25 | pix = new QPixmap ( Resource::loadPixmap("console/keys/" + f ) ); | 26 | pix = new QPixmap ( Opie::Core::OResource::loadPixmap("console/keys/" + f ) ); |
26 | } | 27 | } |
27 | }; | 28 | }; |
28 | 29 | ||
29 | QString label; | 30 | QString label; |
30 | QPixmap *pix; | 31 | QPixmap *pix; |
31 | QString pixFile; | 32 | QString pixFile; |
32 | ushort qcode; | 33 | ushort qcode; |
33 | ushort unicode; | 34 | ushort unicode; |
34 | }; | 35 | }; |
35 | 36 | ||
36 | class FunctionKeyboard : public QFrame { | 37 | class FunctionKeyboard : public QFrame { |
37 | Q_OBJECT | 38 | Q_OBJECT |
38 | 39 | ||
39 | public: | 40 | public: |
40 | FunctionKeyboard(QWidget *parent = 0); | 41 | FunctionKeyboard(QWidget *parent = 0); |
41 | ~FunctionKeyboard(); | 42 | ~FunctionKeyboard(); |
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index eaa78c8..45a662c 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -1,31 +1,32 @@ | |||
1 | #include "TEmulation.h" | 1 | #include "TEmulation.h" |
2 | #include "profileeditordialog.h" | 2 | #include "profileeditordialog.h" |
3 | #include "configdialog.h" | 3 | #include "configdialog.h" |
4 | #include "default.h" | 4 | #include "default.h" |
5 | #include "profilemanager.h" | 5 | #include "profilemanager.h" |
6 | #include "mainwindow.h" | 6 | #include "mainwindow.h" |
7 | #include "tabwidget.h" | 7 | #include "tabwidget.h" |
8 | #include "transferdialog.h" | 8 | #include "transferdialog.h" |
9 | #include "function_keyboard.h" | 9 | #include "function_keyboard.h" |
10 | #include "emulation_handler.h" | 10 | #include "emulation_handler.h" |
11 | #include "script.h" | 11 | #include "script.h" |
12 | #include "fixit.h" | 12 | #include "fixit.h" |
13 | 13 | ||
14 | /* OPIE */ | 14 | /* OPIE */ |
15 | #include <opie2/ofiledialog.h> | 15 | #include <opie2/ofiledialog.h> |
16 | #include <opie2/oresource.h> | ||
16 | #include <qpe/filemanager.h> | 17 | #include <qpe/filemanager.h> |
17 | using namespace Opie::Ui; | 18 | using namespace Opie::Ui; |
18 | 19 | ||
19 | /* QT */ | 20 | /* QT */ |
20 | #include <qaction.h> | 21 | #include <qaction.h> |
21 | #include <qmenubar.h> | 22 | #include <qmenubar.h> |
22 | #include <qtoolbar.h> | 23 | #include <qtoolbar.h> |
23 | #include <qmessagebox.h> | 24 | #include <qmessagebox.h> |
24 | #include <qwhatsthis.h> | 25 | #include <qwhatsthis.h> |
25 | #include <qfileinfo.h> | 26 | #include <qfileinfo.h> |
26 | 27 | ||
27 | /* STD */ | 28 | /* STD */ |
28 | #include <assert.h> | 29 | #include <assert.h> |
29 | 30 | ||
30 | #include <opie2/oconfig.h> | 31 | #include <opie2/oconfig.h> |
31 | 32 | ||
@@ -63,112 +64,115 @@ void MainWindow::initUI() { | |||
63 | m_tool = new QToolBar( this ); | 64 | m_tool = new QToolBar( this ); |
64 | m_tool->setHorizontalStretchable( TRUE ); | 65 | m_tool->setHorizontalStretchable( TRUE ); |
65 | 66 | ||
66 | m_bar = new QMenuBar( m_tool ); | 67 | m_bar = new QMenuBar( m_tool ); |
67 | m_console = new QPopupMenu( this ); | 68 | m_console = new QPopupMenu( this ); |
68 | m_scripts = new QPopupMenu( this ); | 69 | m_scripts = new QPopupMenu( this ); |
69 | m_sessionsPop= new QPopupMenu( this ); | 70 | m_sessionsPop= new QPopupMenu( this ); |
70 | m_scriptsPop = new QPopupMenu( this ); | 71 | m_scriptsPop = new QPopupMenu( this ); |
71 | 72 | ||
72 | /* add a toolbar for icons */ | 73 | /* add a toolbar for icons */ |
73 | m_icons = new QToolBar(this); | 74 | m_icons = new QToolBar(this); |
74 | 75 | ||
75 | /* | 76 | /* |
76 | * the settings action | 77 | * the settings action |
77 | */ | 78 | */ |
78 | m_setProfiles = new QAction(tr("Configure Profiles"), | 79 | m_setProfiles = new QAction(tr("Configure Profiles"), |
79 | Resource::loadPixmap( "SettingsIcon" ), | 80 | Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ), |
80 | QString::null, 0, this, 0); | 81 | QString::null, 0, this, 0); |
81 | m_setProfiles->addTo( m_console ); | 82 | m_setProfiles->addTo( m_console ); |
82 | connect( m_setProfiles, SIGNAL(activated() ), | 83 | connect( m_setProfiles, SIGNAL(activated() ), |
83 | this, SLOT(slotConfigure() ) ); | 84 | this, SLOT(slotConfigure() ) ); |
84 | 85 | ||
85 | m_console->insertSeparator(); | 86 | m_console->insertSeparator(); |
86 | /* | 87 | /* |
87 | * new Action for new sessions | 88 | * new Action for new sessions |
88 | */ | 89 | */ |
89 | QAction* newCon = new QAction(tr("New Profile"), | 90 | QAction* newCon = new QAction(tr("New Profile"), |
90 | Resource::loadPixmap( "new" ), | 91 | Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), |
91 | QString::null, 0, this, 0); | 92 | QString::null, 0, this, 0); |
92 | newCon->addTo( m_console ); | 93 | newCon->addTo( m_console ); |
93 | connect( newCon, SIGNAL(activated() ), | 94 | connect( newCon, SIGNAL(activated() ), |
94 | this, SLOT(slotNew() ) ); | 95 | this, SLOT(slotNew() ) ); |
95 | 96 | ||
96 | m_console->insertSeparator(); | 97 | m_console->insertSeparator(); |
97 | 98 | ||
98 | QAction *saveCon = new QAction( tr("Save Profile" ), | 99 | QAction *saveCon = new QAction( tr("Save Profile" ), |
99 | Resource::loadPixmap( "save" ), QString::null, | 100 | Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ), QString::null, |
100 | 0, this, 0 ); | 101 | 0, this, 0 ); |
101 | saveCon->addTo( m_console ); | 102 | saveCon->addTo( m_console ); |
102 | connect( saveCon, SIGNAL(activated() ), | 103 | connect( saveCon, SIGNAL(activated() ), |
103 | this, SLOT(slotSaveSession() ) ); | 104 | this, SLOT(slotSaveSession() ) ); |
104 | m_console->insertSeparator(); | 105 | m_console->insertSeparator(); |
105 | 106 | ||
106 | /* | 107 | /* |
107 | * connect action | 108 | * connect action |
108 | */ | 109 | */ |
109 | m_connect = new QAction( tr("Connect"), Resource::loadPixmap("console/connected"), | 110 | m_connect = new QAction( tr("Connect"), Opie::Core::OResource::loadPixmap("console/connected", |
110 | QString::null, 0, this, 0 ); | 111 | Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); |
111 | m_connect->addTo( m_console ); | 112 | m_connect->addTo( m_console ); |
112 | connect(m_connect, SIGNAL(activated() ), | 113 | connect(m_connect, SIGNAL(activated() ), |
113 | this, SLOT(slotConnect() ) ); | 114 | this, SLOT(slotConnect() ) ); |
114 | 115 | ||
115 | /* | 116 | /* |
116 | * disconnect action | 117 | * disconnect action |
117 | */ | 118 | */ |
118 | m_disconnect = new QAction( tr("Disconnect"), Resource::loadPixmap("console/notconnected"), | 119 | m_disconnect = new QAction( tr("Disconnect"), Opie::Core::OResource::loadPixmap("console/notconnected", |
119 | QString::null, 0, this, 0 ); | 120 | Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); |
120 | m_disconnect->addTo( m_console ); | 121 | m_disconnect->addTo( m_console ); |
121 | connect(m_disconnect, SIGNAL(activated() ), | 122 | connect(m_disconnect, SIGNAL(activated() ), |
122 | this, SLOT(slotDisconnect() ) ); | 123 | this, SLOT(slotDisconnect() ) ); |
123 | 124 | ||
124 | m_console->insertSeparator(); | 125 | m_console->insertSeparator(); |
125 | 126 | ||
126 | #ifndef EAST | 127 | #ifndef EAST |
127 | m_quickLaunch = new QAction( tr("QuickLaunch"), Resource::loadPixmap("console/konsole_mini"), QString::null, 0, this, 0 ); | 128 | m_quickLaunch = new QAction( tr("QuickLaunch"), |
129 | Opie::Core::OResource::loadPixmap("console/konsole_mini", Opie::Core::OResource::SmallIcon ), | ||
130 | QString::null, 0, this, 0 ); | ||
128 | m_quickLaunch->addTo( m_icons ); | 131 | m_quickLaunch->addTo( m_icons ); |
129 | connect( m_quickLaunch, SIGNAL( activated() ), | 132 | connect( m_quickLaunch, SIGNAL( activated() ), |
130 | this, SLOT( slotQuickLaunch() ) ); | 133 | this, SLOT( slotQuickLaunch() ) ); |
131 | #endif | 134 | #endif |
132 | 135 | ||
133 | QWhatsThis::add( m_icons, tr( "The shell button launches the \"default\" profile. If there is none default values are taken" ) ); | 136 | QWhatsThis::add( m_icons, tr( "The shell button launches the \"default\" profile. If there is none default values are taken" ) ); |
134 | 137 | ||
135 | m_transfer = new QAction( tr("Transfer file..."), Resource::loadPixmap("pass") , QString::null, | 138 | m_transfer = new QAction( tr("Transfer file..."), Opie::Core::OResource::loadPixmap("pass", Opie::Core::OResource::SmallIcon ), |
136 | 0, this, 0 ); | 139 | QString::null, 0, this, 0 ); |
137 | m_transfer->addTo( m_console ); | 140 | m_transfer->addTo( m_console ); |
138 | connect(m_transfer, SIGNAL(activated() ), | 141 | connect(m_transfer, SIGNAL(activated() ), |
139 | this, SLOT(slotTransfer() ) ); | 142 | this, SLOT(slotTransfer() ) ); |
140 | 143 | ||
141 | 144 | ||
142 | 145 | ||
143 | /* | 146 | /* |
144 | * immediate change of line wrap policy | 147 | * immediate change of line wrap policy |
145 | */ | 148 | */ |
146 | m_isWrapped = true; | 149 | m_isWrapped = true; |
147 | m_wrap = new QAction( tr("Line wrap"), Resource::loadPixmap( "linewrap" ), QString::null, 0, this, 0, true ); | 150 | m_wrap = new QAction( tr("Line wrap"), Opie::Core::OResource::loadPixmap( "linewrap", Opie::Core::OResource::SmallIcon ), |
151 | QString::null, 0, this, 0, true ); | ||
148 | m_wrap->addTo( m_console ); | 152 | m_wrap->addTo( m_console ); |
149 | m_wrap->setOn( true ); | 153 | m_wrap->setOn( true ); |
150 | connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) ); | 154 | connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) ); |
151 | 155 | ||
152 | /* | 156 | /* |
153 | * fullscreen | 157 | * fullscreen |
154 | */ | 158 | */ |
155 | m_isFullscreen = false; | 159 | m_isFullscreen = false; |
156 | 160 | ||
157 | m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" ) | 161 | m_fullscreen = new QAction( tr("Full screen"), Opie::Core::OResource::loadPixmap( "fullscreen", |
158 | , QString::null, 0, this, 0 ); | 162 | Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); |
159 | m_fullscreen->addTo( m_console ); | 163 | m_fullscreen->addTo( m_console ); |
160 | connect( m_fullscreen, SIGNAL( activated() ), | 164 | connect( m_fullscreen, SIGNAL( activated() ), |
161 | this, SLOT( slotFullscreen() ) ); | 165 | this, SLOT( slotFullscreen() ) ); |
162 | 166 | ||
163 | m_console->insertSeparator(); | 167 | m_console->insertSeparator(); |
164 | 168 | ||
165 | m_recordLog = new QAction(); | 169 | m_recordLog = new QAction(); |
166 | m_recordLog->setText( tr("Start log") ); | 170 | m_recordLog->setText( tr("Start log") ); |
167 | m_recordLog->addTo( m_console ); | 171 | m_recordLog->addTo( m_console ); |
168 | connect(m_recordLog, SIGNAL(activated() ), | 172 | connect(m_recordLog, SIGNAL(activated() ), |
169 | this, SLOT( slotSaveLog() ) ); | 173 | this, SLOT( slotSaveLog() ) ); |
170 | m_recordingLog = false; | 174 | m_recordingLog = false; |
171 | 175 | ||
172 | QAction *a = new QAction(); | 176 | QAction *a = new QAction(); |
173 | a->setText( tr("Save history") ); | 177 | a->setText( tr("Save history") ); |
174 | a->addTo( m_console ); | 178 | a->addTo( m_console ); |
@@ -198,73 +202,73 @@ void MainWindow::initUI() { | |||
198 | 202 | ||
199 | m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); | 203 | m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); |
200 | m_recordScript->addTo(m_scripts); | 204 | m_recordScript->addTo(m_scripts); |
201 | connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); | 205 | connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); |
202 | 206 | ||
203 | m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); | 207 | m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); |
204 | m_saveScript->addTo(m_scripts); | 208 | m_saveScript->addTo(m_scripts); |
205 | connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); | 209 | connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); |
206 | 210 | ||
207 | 211 | ||
208 | 212 | ||
209 | 213 | ||
210 | /* | 214 | /* |
211 | * action that open/closes the keyboard | 215 | * action that open/closes the keyboard |
212 | */ | 216 | */ |
213 | m_openKeys = new QAction (tr("Open Keyboard..."), | 217 | m_openKeys = new QAction (tr("Open Keyboard..."), |
214 | Resource::loadPixmap( "console/keys/keyboard_icon" ), | 218 | Opie::Core::OResource::loadPixmap( "console/keys/keyboard_icon", Opie::Core::OResource::SmallIcon ), |
215 | QString::null, 0, this, 0); | 219 | QString::null, 0, this, 0); |
216 | m_openKeys->setToggleAction(true); | 220 | m_openKeys->setToggleAction(true); |
217 | connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); | 221 | connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); |
218 | 222 | ||
219 | /* insert the submenu */ | 223 | /* insert the submenu */ |
220 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, | 224 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, |
221 | -1, 0); | 225 | -1, 0); |
222 | 226 | ||
223 | /* insert the connection menu */ | 227 | /* insert the connection menu */ |
224 | m_bar->insertItem( tr("Connection"), m_console ); | 228 | m_bar->insertItem( tr("Connection"), m_console ); |
225 | 229 | ||
226 | /* the scripts menu */ | 230 | /* the scripts menu */ |
227 | #ifdef EAST | 231 | #ifdef EAST |
228 | Opie::Core::OConfig cfg("opie-console"); | 232 | Opie::Core::OConfig cfg("opie-console"); |
229 | cfg.setGroup("10east"); | 233 | cfg.setGroup("10east"); |
230 | if( !cfg.readEntry("scripthide",0) ) { | 234 | if( !cfg.readEntry("scripthide",0) ) { |
231 | m_bar->insertItem( tr("Scripts"), m_scripts ); | 235 | m_bar->insertItem( tr("Scripts"), m_scripts ); |
232 | } | 236 | } |
233 | #endif | 237 | #endif |
234 | 238 | ||
235 | /* and the keyboard */ | 239 | /* and the keyboard */ |
236 | m_keyBar = new QToolBar(this); | 240 | m_keyBar = new QToolBar(this); |
237 | addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); | 241 | addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); |
238 | m_keyBar->setHorizontalStretchable( TRUE ); | 242 | m_keyBar->setHorizontalStretchable( TRUE ); |
239 | m_keyBar->hide(); | 243 | m_keyBar->hide(); |
240 | 244 | ||
241 | m_kb = new FunctionKeyboard(m_keyBar); | 245 | m_kb = new FunctionKeyboard(m_keyBar); |
242 | connect(m_kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), | 246 | connect(m_kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), |
243 | this, SLOT(slotKeyReceived(FKey,ushort,ushort,bool))); | 247 | this, SLOT(slotKeyReceived(FKey,ushort,ushort,bool))); |
244 | 248 | ||
245 | 249 | ||
246 | a = new QAction(tr("Copy"), | 250 | a = new QAction(tr("Copy"), |
247 | Resource::loadPixmap("copy"), QString::null, | 251 | Opie::Core::OResource::loadPixmap("copy", Opie::Core::OResource::SmallIcon ), QString::null, |
248 | 0, this, 0 ); | 252 | 0, this, 0 ); |
249 | //a->addTo( m_icons ); | 253 | //a->addTo( m_icons ); |
250 | connect( a, SIGNAL(activated() ), | 254 | connect( a, SIGNAL(activated() ), |
251 | this, SLOT(slotCopy() ) ); | 255 | this, SLOT(slotCopy() ) ); |
252 | 256 | ||
253 | QAction *paste = new QAction(tr("Paste"), | 257 | QAction *paste = new QAction(tr("Paste"), |
254 | Resource::loadPixmap("paste"), QString::null, | 258 | Opie::Core::OResource::loadPixmap("paste", Opie::Core::OResource::SmallIcon ), QString::null, |
255 | 0, this, 0 ); | 259 | 0, this, 0 ); |
256 | connect( paste, SIGNAL(activated() ), | 260 | connect( paste, SIGNAL(activated() ), |
257 | this, SLOT(slotPaste() ) ); | 261 | this, SLOT(slotPaste() ) ); |
258 | 262 | ||
259 | 263 | ||
260 | newCon->addTo( m_icons ); | 264 | newCon->addTo( m_icons ); |
261 | //m_setProfiles->addTo( m_icons ); | 265 | //m_setProfiles->addTo( m_icons ); |
262 | paste->addTo( m_icons ); | 266 | paste->addTo( m_icons ); |
263 | m_openKeys->addTo(m_icons); | 267 | m_openKeys->addTo(m_icons); |
264 | m_fullscreen->addTo( m_icons ); | 268 | m_fullscreen->addTo( m_icons ); |
265 | 269 | ||
266 | m_connect->setEnabled( false ); | 270 | m_connect->setEnabled( false ); |
267 | m_disconnect->setEnabled( false ); | 271 | m_disconnect->setEnabled( false ); |
268 | m_terminate->setEnabled( false ); | 272 | m_terminate->setEnabled( false ); |
269 | m_transfer->setEnabled( false ); | 273 | m_transfer->setEnabled( false ); |
270 | m_scripts->setItemEnabled(m_runScript_id, false); | 274 | m_scripts->setItemEnabled(m_runScript_id, false); |