summaryrefslogtreecommitdiff
path: root/core/settings/button
Side-by-side diff
Diffstat (limited to 'core/settings/button') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/button/button.pro9
-rw-r--r--core/settings/button/buttonsettings.cpp66
-rw-r--r--core/settings/button/buttonsettings.h3
-rw-r--r--core/settings/button/main.cpp16
4 files changed, 41 insertions, 53 deletions
diff --git a/core/settings/button/button.pro b/core/settings/button/button.pro
index b10b619..e1c6724 100644
--- a/core/settings/button/button.pro
+++ b/core/settings/button/button.pro
@@ -1,4 +1,3 @@
-TEMPLATE = app
-CONFIG += qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
+
HEADERS = buttonsettings.h \
@@ -17,3 +16,3 @@ DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopie
-TARGET = buttonsettings
+TARGET = buttonsettings
@@ -37,4 +36,2 @@ TRANSLATIONS = ../../../i18n/de/buttonsettings.ts \
-
-
include ( $(OPIEDIR)/include.pro )
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp
index 942d5e4..b6a07a8 100644
--- a/core/settings/button/buttonsettings.cpp
+++ b/core/settings/button/buttonsettings.cpp
@@ -17,3 +17,3 @@
..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
+++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
@@ -52,3 +52,3 @@ struct buttoninfo {
QLabel *m_hlabel;
-
+
bool m_pdirty : 1;
@@ -58,3 +58,3 @@ struct buttoninfo {
-ButtonSettings::ButtonSettings ( )
+ButtonSettings::ButtonSettings ( QWidget *parent , const char *name, bool modal, WFlags f )
: QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp )
@@ -67,6 +67,6 @@ ButtonSettings::ButtonSettings ( )
QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 );
-
+
QLabel *l = new QLabel ( tr( "<center>Press or hold the button you want to remap.</center>" ), this );
toplay-> addWidget ( l );
-
+
QGridLayout *lay = new QGridLayout ( toplay );
@@ -79,3 +79,3 @@ ButtonSettings::ButtonSettings ( )
m_infos. setAutoDelete ( true );
-
+
int i = 1;
@@ -97,8 +97,8 @@ ButtonSettings::ButtonSettings ( )
bi-> m_hdirty = false;
-
+
l = new QLabel ( this );
l-> setPixmap (( *it ). pixmap ( ));
-
+
lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 );
-
+
l = new QLabel ( tr( "Press:" ), this );
@@ -107,3 +107,3 @@ ButtonSettings::ButtonSettings ( )
lay-> addWidget ( l, i + 1, 1, AlignLeft | AlignTop );
-
+
l = new QLabel ( this );
@@ -117,3 +117,3 @@ ButtonSettings::ButtonSettings ( )
bi-> m_plabel = l;
-
+
l = new QLabel ( this );
@@ -127,7 +127,7 @@ ButtonSettings::ButtonSettings ( )
bi-> m_hlabel = l;
-
+
i += 2;
-
+
m_infos. append ( bi );
- }
+ }
@@ -137,3 +137,3 @@ ButtonSettings::ButtonSettings ( )
m_lock = false;
-
+
m_timer = new QTimer ( this );
@@ -141,4 +141,4 @@ ButtonSettings::ButtonSettings ( )
- updateLabels ( );
-
+ updateLabels ( );
+
QPEApplication::grabKeyboard ( );
@@ -155,3 +155,3 @@ void ButtonSettings::updateLabels ( )
qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg );
-
+
(*it)-> m_picon-> setPixmap ( cip. m_icon );
@@ -170,5 +170,5 @@ buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key )
if ((*it)-> m_button-> keycode ( ) == key )
- return *it;
- }
- return 0;
+ return *it;
+ }
+ return 0;
}
@@ -178,4 +178,4 @@ void ButtonSettings::keyPressEvent ( QKeyEvent *e )
buttoninfo *bi = buttonInfoForKeycode ( e-> key ( ));
-
- if ( bi && !e-> isAutoRepeat ( )) {
+
+ if ( bi && !e-> isAutoRepeat ( )) {
m_timer-> stop ( );
@@ -191,6 +191,6 @@ void ButtonSettings::keyReleaseEvent ( QKeyEvent *e )
buttoninfo *bi = buttonInfoForKeycode ( e-> key ( ));
-
+
if ( bi && !e-> isAutoRepeat ( ) && m_timer-> isActive ( )) {
m_timer-> stop ( );
- edit ( bi, false );
+ edit ( bi, false );
}
@@ -210,3 +210,3 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold )
{
-
+
if ( m_lock )
@@ -214,9 +214,9 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold )
m_lock = true;
-
+
RemapDlg *d = new RemapDlg ( bi-> m_button, hold, this );
- d-> showMaximized ( );
+ d-> showMaximized ( );
if ( d-> exec ( ) == QDialog::Accepted ) {
-
+
if ( hold ) {
@@ -229,8 +229,8 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold )
}
-
+
updateLabels ( );
}
-
+
delete d;
-
+
m_lock = false;
@@ -242,3 +242,3 @@ void ButtonSettings::accept ( )
buttoninfo *bi = *it;
-
+
if ( bi-> m_pdirty )
diff --git a/core/settings/button/buttonsettings.h b/core/settings/button/buttonsettings.h
index d41a209..67694d3 100644
--- a/core/settings/button/buttonsettings.h
+++ b/core/settings/button/buttonsettings.h
@@ -44,5 +44,6 @@ class ButtonSettings : public QDialog {
public:
- ButtonSettings ( );
+ ButtonSettings ( QWidget *parent = 0, const char *name = 0, bool modal = FALSE,WFlags f = 0 );
~ButtonSettings ( );
+ static QString appName() { return QString::fromLatin1("buttonsettings"); }
virtual void accept ( );
diff --git a/core/settings/button/main.cpp b/core/settings/button/main.cpp
index db274f8..c063c3c 100644
--- a/core/settings/button/main.cpp
+++ b/core/settings/button/main.cpp
@@ -17,3 +17,3 @@
..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
+++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
@@ -30,14 +30,4 @@
#include <qpe/qpeapplication.h>
+#include <opie/oapplicationfactory.h>
-
-int main ( int argc, char** argv )
-{
- QPEApplication a ( argc,argv );
-
- ButtonSettings dlg;
- a. showMainWidget ( &dlg );
- dlg. showMaximized ( );
-
- return a. exec ( );
-}
-
+OPIE_EXPORT_APP( OApplicationFactory<ButtonSettings> )