summaryrefslogtreecommitdiff
authordrw <drw>2005-05-16 18:56:02 (UTC)
committer drw <drw>2005-05-16 18:56:02 (UTC)
commit348314c7411500e23ca467289ed92e446be9121b (patch) (side-by-side diff)
treef2eea2bec6b6e49f66d4a373b94d2e73f6937c46
parent17b9be61d7de14dea0d662a496e3d08bc9b1662e (diff)
downloadopie-348314c7411500e23ca467289ed92e446be9121b.zip
opie-348314c7411500e23ca467289ed92e446be9121b.tar.gz
opie-348314c7411500e23ca467289ed92e446be9121b.tar.bz2
Resource -> OResource
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/function_keyboard.cpp9
-rw-r--r--noncore/apps/opie-console/function_keyboard.h5
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp42
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
@@ -74,25 +74,25 @@ void FunctionKeyboard::load (const Profile& prof) {
QString h = "r" + QString::number(i) + "c" + QString::number(j);
QString values = prof.readEntry("keb_" + h);
if (!values.isEmpty()) {
QStringList l = QStringList::split(QChar('|'), values, TRUE);
keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt());
// load pixmap if used
if (!l[1].isEmpty()) {
- keys[h].pix = new QPixmap( Resource::loadPixmap( "console/keys/" + l[1] ) );
+ keys[h].pix = new QPixmap( Opie::Core::OResource::loadPixmap( "console/keys/" + l[1] ) );
}
}
}
if (keys.isEmpty()) loadDefaults();
hide();
show();
}
void FunctionKeyboard::paintEvent(QPaintEvent *e) {
@@ -268,26 +268,25 @@ FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* par
m_colBox = new QSpinBox(1, 15, 1, dimentions);
connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int)));
QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this);
l = new QLabel(tr("Label"), editKey);
m_labels = new QComboBox(true, editKey);
m_labels->setInsertionPolicy(QComboBox::AtCurrent);
m_labels->insertItem("");
QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList();
for (uint i = 0; i < files.count(); i++) {
-
- m_labels->insertItem( Resource::loadPixmap("console/keys/" + files[i]), files[i]);
+ m_labels->insertItem( Opie::Core::OResource::loadPixmap("console/keys/" + files[i]), files[i]);
}
connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int)));
connect (m_labels, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeLabelText(const QString&)));
l = new QLabel(tr("Q Keycode", "Qt Key Code for the OnScreen Keyboard"), editKey);
m_qvalues = new QComboBox(true, editKey);
m_qvalues->setInsertionPolicy(QComboBox::AtTop);
m_qvalues->setDuplicatesEnabled(false);
m_qvalues->insertItem("");
connect (m_qvalues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeQCode(const QString&)));
l = new QLabel(tr("Unicode Value", "The Unicode value of the key"), editKey);
@@ -319,25 +318,25 @@ void FunctionKeyboardConfig::load (const Profile& prof) {
QString h = "r" + QString::number(i) + "c" + QString::number(j);
QString values = prof.readEntry("keb_" + h);
if (!values.isEmpty()) {
QStringList l = QStringList::split(QChar('|'), values, TRUE);
kb->keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt());
// load pixmap if used
if (!l[1].isEmpty()) {
- kb->keys[h].pix = new QPixmap( Resource::loadPixmap( "console/keys/" + l[1] ) );
+ kb->keys[h].pix = new QPixmap( Opie::Core::OResource::loadPixmap( "console/keys/" + l[1] ) );
}
}
}
}
void FunctionKeyboardConfig::save (Profile& prof) {
prof.writeEntry("keb_rows", m_rowBox->value());
prof.writeEntry("keb_cols", m_colBox->value());
QMap<QString, FKey>::Iterator it;
for ( it = kb->keys.begin(); it != kb->keys.end(); it++) {
@@ -394,25 +393,25 @@ void FunctionKeyboardConfig::slotChangeIcon(int index) {
m_labels->setEditable(true);
// why tf does the text get erased unless i do this?
m_labels->changeItem(m_labels->text(0), 0);
kb->keys[selectedHandle].pixFile = "";
delete kb->keys[selectedHandle].pix;
} else {
// is a pixmap
m_labels->setEditable(false);
kb->keys[selectedHandle].pixFile = m_labels->currentText();
- kb->keys[selectedHandle].pix = new QPixmap( Resource::loadPixmap( "console/keys/" + m_labels->currentText() ) );
+ kb->keys[selectedHandle].pix = new QPixmap( Opie::Core::OResource::loadPixmap( "console/keys/" + m_labels->currentText() ) );
}
kb->paintKey(selectedRow, selectedCol);
}
void FunctionKeyboardConfig::slotChangeLabelText(const QString &label) {
kb->keys[selectedHandle].label = label;
kb->paintKey(selectedRow, selectedCol);
}
void FunctionKeyboardConfig::slotChangeQCode(const QString& qcode) {
kb->keys[selectedHandle].qcode = qcode.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,37 +1,38 @@
#ifndef OPIE_FUNCTION_KEYBOARD_H
#define OPIE_FUNCTION_KEYBOARD_H
+#include <opie2/oresource.h>
+
#include <qpe/config.h>
-#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#include <qframe.h>
#include <qpainter.h>
#include <qvbox.h>
#include <qgroupbox.h>
#include <qmap.h>
#include <qspinbox.h>
#include <qcombobox.h>
#include "profiledialogwidget.h"
struct FKey {
FKey(): qcode(0), unicode(0) {};
FKey(const QString &l, const QString &f, ushort q, ushort u):
label(l), pixFile(f), qcode(q), unicode(u) {
if (!f.isEmpty()) {
- pix = new QPixmap ( Resource::loadPixmap("console/keys/" + f ) );
+ pix = new QPixmap ( Opie::Core::OResource::loadPixmap("console/keys/" + f ) );
}
};
QString label;
QPixmap *pix;
QString pixFile;
ushort qcode;
ushort unicode;
};
class FunctionKeyboard : public QFrame {
Q_OBJECT
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
@@ -4,24 +4,25 @@
#include "default.h"
#include "profilemanager.h"
#include "mainwindow.h"
#include "tabwidget.h"
#include "transferdialog.h"
#include "function_keyboard.h"
#include "emulation_handler.h"
#include "script.h"
#include "fixit.h"
/* OPIE */
#include <opie2/ofiledialog.h>
+#include <opie2/oresource.h>
#include <qpe/filemanager.h>
using namespace Opie::Ui;
/* QT */
#include <qaction.h>
#include <qmenubar.h>
#include <qtoolbar.h>
#include <qmessagebox.h>
#include <qwhatsthis.h>
#include <qfileinfo.h>
/* STD */
@@ -67,104 +68,107 @@ void MainWindow::initUI() {
m_console = new QPopupMenu( this );
m_scripts = new QPopupMenu( this );
m_sessionsPop= new QPopupMenu( this );
m_scriptsPop = new QPopupMenu( this );
/* add a toolbar for icons */
m_icons = new QToolBar(this);
/*
* the settings action
*/
m_setProfiles = new QAction(tr("Configure Profiles"),
- Resource::loadPixmap( "SettingsIcon" ),
- QString::null, 0, this, 0);
+ Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ),
+ QString::null, 0, this, 0);
m_setProfiles->addTo( m_console );
connect( m_setProfiles, SIGNAL(activated() ),
this, SLOT(slotConfigure() ) );
m_console->insertSeparator();
/*
* new Action for new sessions
*/
QAction* newCon = new QAction(tr("New Profile"),
- Resource::loadPixmap( "new" ),
- QString::null, 0, this, 0);
+ Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ),
+ QString::null, 0, this, 0);
newCon->addTo( m_console );
connect( newCon, SIGNAL(activated() ),
this, SLOT(slotNew() ) );
m_console->insertSeparator();
QAction *saveCon = new QAction( tr("Save Profile" ),
- Resource::loadPixmap( "save" ), QString::null,
- 0, this, 0 );
+ Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ), QString::null,
+ 0, this, 0 );
saveCon->addTo( m_console );
connect( saveCon, SIGNAL(activated() ),
this, SLOT(slotSaveSession() ) );
m_console->insertSeparator();
/*
* connect action
*/
- m_connect = new QAction( tr("Connect"), Resource::loadPixmap("console/connected"),
- QString::null, 0, this, 0 );
+ m_connect = new QAction( tr("Connect"), Opie::Core::OResource::loadPixmap("console/connected",
+ Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
m_connect->addTo( m_console );
connect(m_connect, SIGNAL(activated() ),
this, SLOT(slotConnect() ) );
/*
* disconnect action
*/
- m_disconnect = new QAction( tr("Disconnect"), Resource::loadPixmap("console/notconnected"),
- QString::null, 0, this, 0 );
+ m_disconnect = new QAction( tr("Disconnect"), Opie::Core::OResource::loadPixmap("console/notconnected",
+ Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
m_disconnect->addTo( m_console );
connect(m_disconnect, SIGNAL(activated() ),
this, SLOT(slotDisconnect() ) );
m_console->insertSeparator();
#ifndef EAST
- m_quickLaunch = new QAction( tr("QuickLaunch"), Resource::loadPixmap("console/konsole_mini"), QString::null, 0, this, 0 );
+ m_quickLaunch = new QAction( tr("QuickLaunch"),
+ Opie::Core::OResource::loadPixmap("console/konsole_mini", Opie::Core::OResource::SmallIcon ),
+ QString::null, 0, this, 0 );
m_quickLaunch->addTo( m_icons );
connect( m_quickLaunch, SIGNAL( activated() ),
this, SLOT( slotQuickLaunch() ) );
#endif
QWhatsThis::add( m_icons, tr( "The shell button launches the \"default\" profile. If there is none default values are taken" ) );
- m_transfer = new QAction( tr("Transfer file..."), Resource::loadPixmap("pass") , QString::null,
- 0, this, 0 );
+ m_transfer = new QAction( tr("Transfer file..."), Opie::Core::OResource::loadPixmap("pass", Opie::Core::OResource::SmallIcon ),
+ QString::null, 0, this, 0 );
m_transfer->addTo( m_console );
connect(m_transfer, SIGNAL(activated() ),
this, SLOT(slotTransfer() ) );
/*
* immediate change of line wrap policy
*/
m_isWrapped = true;
- m_wrap = new QAction( tr("Line wrap"), Resource::loadPixmap( "linewrap" ), QString::null, 0, this, 0, true );
+ m_wrap = new QAction( tr("Line wrap"), Opie::Core::OResource::loadPixmap( "linewrap", Opie::Core::OResource::SmallIcon ),
+ QString::null, 0, this, 0, true );
m_wrap->addTo( m_console );
m_wrap->setOn( true );
connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) );
/*
* fullscreen
*/
m_isFullscreen = false;
- m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" )
- , QString::null, 0, this, 0 );
+ m_fullscreen = new QAction( tr("Full screen"), Opie::Core::OResource::loadPixmap( "fullscreen",
+ Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
m_fullscreen->addTo( m_console );
connect( m_fullscreen, SIGNAL( activated() ),
this, SLOT( slotFullscreen() ) );
m_console->insertSeparator();
m_recordLog = new QAction();
m_recordLog->setText( tr("Start log") );
m_recordLog->addTo( m_console );
connect(m_recordLog, SIGNAL(activated() ),
this, SLOT( slotSaveLog() ) );
m_recordingLog = false;
@@ -202,25 +206,25 @@ void MainWindow::initUI() {
m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0);
m_saveScript->addTo(m_scripts);
connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript()));
/*
* action that open/closes the keyboard
*/
m_openKeys = new QAction (tr("Open Keyboard..."),
- Resource::loadPixmap( "console/keys/keyboard_icon" ),
+ Opie::Core::OResource::loadPixmap( "console/keys/keyboard_icon", Opie::Core::OResource::SmallIcon ),
QString::null, 0, this, 0);
m_openKeys->setToggleAction(true);
connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool)));
/* insert the submenu */
m_console->insertItem(tr("New from Profile"), m_sessionsPop,
-1, 0);
/* insert the connection menu */
m_bar->insertItem( tr("Connection"), m_console );
/* the scripts menu */
@@ -235,32 +239,32 @@ void MainWindow::initUI() {
/* and the keyboard */
m_keyBar = new QToolBar(this);
addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE );
m_keyBar->setHorizontalStretchable( TRUE );
m_keyBar->hide();
m_kb = new FunctionKeyboard(m_keyBar);
connect(m_kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)),
this, SLOT(slotKeyReceived(FKey,ushort,ushort,bool)));
a = new QAction(tr("Copy"),
- Resource::loadPixmap("copy"), QString::null,
+ Opie::Core::OResource::loadPixmap("copy", Opie::Core::OResource::SmallIcon ), QString::null,
0, this, 0 );
//a->addTo( m_icons );
connect( a, SIGNAL(activated() ),
this, SLOT(slotCopy() ) );
QAction *paste = new QAction(tr("Paste"),
- Resource::loadPixmap("paste"), QString::null,
+ Opie::Core::OResource::loadPixmap("paste", Opie::Core::OResource::SmallIcon ), QString::null,
0, this, 0 );
connect( paste, SIGNAL(activated() ),
this, SLOT(slotPaste() ) );
newCon->addTo( m_icons );
//m_setProfiles->addTo( m_icons );
paste->addTo( m_icons );
m_openKeys->addTo(m_icons);
m_fullscreen->addTo( m_icons );
m_connect->setEnabled( false );