summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/settings/button/button.pro7
-rw-r--r--core/settings/button/buttonsettings.cpp2
-rw-r--r--core/settings/button/buttonsettings.h3
-rw-r--r--core/settings/button/main.cpp14
-rw-r--r--core/settings/citytime/citytime.h2
-rw-r--r--core/settings/citytime/citytime.pro8
-rw-r--r--core/settings/citytime/main.cpp9
-rw-r--r--core/settings/launcher/launcher.pro4
-rw-r--r--core/settings/launcher/launchersettings.cpp3
-rw-r--r--core/settings/launcher/launchersettings.h3
-rw-r--r--core/settings/launcher/main.cpp12
-rw-r--r--core/settings/launcher/menusettings.cpp12
-rw-r--r--core/settings/launcher/menusettings.h2
-rw-r--r--core/settings/launcher/tabssettings.cpp10
-rw-r--r--core/settings/launcher/tabssettings.h2
-rw-r--r--core/settings/light-and-power/light-and-power.pro5
-rw-r--r--core/settings/light-and-power/light.h1
-rw-r--r--core/settings/light-and-power/lightsettingsbase.ui16
-rw-r--r--core/settings/light-and-power/main.cpp13
-rw-r--r--core/settings/security/main.cpp10
-rw-r--r--core/settings/security/security.cpp5
-rw-r--r--core/settings/security/security.h1
-rw-r--r--core/settings/security/security.pro4
-rw-r--r--core/settings/security/securitybase.ui2
24 files changed, 57 insertions, 93 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,40 +1,37 @@
-TEMPLATE = app
-CONFIG += qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
+
HEADERS = buttonsettings.h \
buttonutils.h \
remapdlg.h
SOURCES = main.cpp \
buttonsettings.cpp \
buttonutils.cpp \
remapdlg.cpp
INTERFACES = remapdlgbase.ui
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopie
TARGET = buttonsettings
TRANSLATIONS = ../../../i18n/de/buttonsettings.ts \
../../../i18n/nl/buttonsettings.ts \
../../../i18n/xx/buttonsettings.ts \
../../../i18n/en/buttonsettings.ts \
../../../i18n/es/buttonsettings.ts \
../../../i18n/fr/buttonsettings.ts \
../../../i18n/hu/buttonsettings.ts \
../../../i18n/ja/buttonsettings.ts \
../../../i18n/ko/buttonsettings.ts \
../../../i18n/no/buttonsettings.ts \
../../../i18n/pl/buttonsettings.ts \
../../../i18n/pt/buttonsettings.ts \
../../../i18n/pt_BR/buttonsettings.ts \
../../../i18n/sl/buttonsettings.ts \
../../../i18n/zh_CN/buttonsettings.ts \
../../../i18n/zh_TW/buttonsettings.ts \
../../../i18n/da/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
@@ -1,155 +1,155 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qlayout.h>
#include <qlabel.h>
#include <qtimer.h>
#include <qpe/qpeapplication.h>
#include <opie/odevice.h>
#include "buttonsettings.h"
#include "buttonutils.h"
#include "remapdlg.h"
using namespace Opie;
struct buttoninfo {
const ODeviceButton *m_button;
int m_index;
OQCopMessage m_pmsg;
QLabel *m_picon;
QLabel *m_plabel;
OQCopMessage m_hmsg;
QLabel *m_hicon;
QLabel *m_hlabel;
bool m_pdirty : 1;
bool m_hdirty : 1;
};
-ButtonSettings::ButtonSettings ( )
+ButtonSettings::ButtonSettings ( QWidget *parent , const char *name, bool modal, WFlags f )
: QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp )
{
const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( );
(void) ButtonUtils::inst ( ); // initialise
setCaption ( tr( "Button Settings" ));
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 );
lay-> setMargin ( 0 );
lay-> setColStretch ( 0, 0 );
lay-> setColStretch ( 1, 0 );
lay-> setColStretch ( 2, 0 );
lay-> setColStretch ( 3, 10 );
m_infos. setAutoDelete ( true );
int i = 1;
int index = 0;
for ( QValueList<ODeviceButton>::ConstIterator it = buttons. begin ( ); it != buttons. end ( ); it++ ) {
if ( it != buttons. begin ( )) {
QFrame *f = new QFrame ( this );
f-> setFrameStyle ( QFrame::Sunken | QFrame::VLine );
lay-> addMultiCellWidget ( f, i, i, 0, 3 );
i++;
}
buttoninfo *bi = new buttoninfo ( );
bi-> m_button = &(*it);
bi-> m_index = index++;
bi-> m_pmsg = (*it). pressedAction ( );
bi-> m_hmsg = (*it). heldAction ( );
bi-> m_pdirty = false;
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 );
lay-> addWidget ( l, i, 1, AlignLeft | AlignBottom );
l = new QLabel ( tr( "Hold:" ), this );
lay-> addWidget ( l, i + 1, 1, AlignLeft | AlignTop );
l = new QLabel ( this );
l-> setFixedSize ( 16, 16 );
lay-> addWidget ( l, i, 2, AlignLeft | AlignBottom );
bi-> m_picon = l;
l = new QLabel ( this );
l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine );
lay-> addWidget ( l, i, 3, AlignLeft | AlignBottom );
bi-> m_plabel = l;
l = new QLabel ( this );
l-> setFixedSize ( 16, 16 );
lay-> addWidget ( l, i + 1, 2, AlignLeft | AlignTop );
bi-> m_hicon = l;
l = new QLabel ( this );
l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine );
lay-> addWidget ( l, i + 1, 3, AlignLeft | AlignTop );
bi-> m_hlabel = l;
i += 2;
m_infos. append ( bi );
}
toplay-> addStretch ( 10 );
m_last_button = 0;
m_lock = false;
m_timer = new QTimer ( this );
connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( keyTimeout ( )));
updateLabels ( );
QPEApplication::grabKeyboard ( );
}
ButtonSettings::~ButtonSettings ( )
{
QPEApplication::ungrabKeyboard ( );
}
void ButtonSettings::updateLabels ( )
{
for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) {
qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg );
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
@@ -1,75 +1,76 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __BUTTON_SETTINGS_H__
#define __BUTTON_SETTINGS_H__
#include <qdialog.h>
#include <qlist.h>
#include <opie/odevice.h>
class QTimer;
using namespace Opie;
class buttoninfo;
class ButtonSettings : public QDialog {
Q_OBJECT
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 ( );
virtual void done ( int r );
private slots:
void keyTimeout ( );
void updateLabels ( );
protected:
virtual void keyPressEvent ( QKeyEvent *e );
virtual void keyReleaseEvent ( QKeyEvent *e );
private:
buttoninfo *buttonInfoForKeycode ( ushort key );
void edit ( buttoninfo *bi, bool hold );
QString qcopToString ( const OQCopMessage &c );
private:
QTimer *m_timer;
buttoninfo *m_last_button;
QList <buttoninfo> m_infos;
bool m_lock;
};
#endif
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
@@ -1,43 +1,33 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "buttonsettings.h"
#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> )
diff --git a/core/settings/citytime/citytime.h b/core/settings/citytime/citytime.h
index 63e3102..cc3d487 100644
--- a/core/settings/citytime/citytime.h
+++ b/core/settings/citytime/citytime.h
@@ -1,68 +1,68 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef TIMEWIDGETIMPL_H
#define TIMEWIDGETIMPL_H
#include <qlist.h>
#include <qwidget.h>
#include "citytimebase.h"
const int CITIES = 6; // the number of cities...
class ZoneMap;
class CityTime : public CityTimeBase
{
Q_OBJECT
public:
CityTime(QWidget* parent = 0, const char *name = 0, WFlags fl = 0);
~CityTime();
-
+ static QString appName() { return QString::fromLatin1("citytime"); }
public slots:
void beginNewTz();
void slotNewTz( const QString& strNewCountry, const QString& strNewCity );
void changeClock( bool newClock );
protected:
void timerEvent( QTimerEvent* );
void mousePressEvent( QMouseEvent* event );
private:
void showTime( void ); // get and show the time for various places...
void readInTimes( void ); // a method to get information from the config
QString strRealTz; // save the TZ var
QString nameRealTz; // and what it is called
QString strHome; // the home variable...
bool bAdded; // a flag to indicate things have been added...
bool bWhichClock;
int timerId;
QWidget* selWidget;
// a spot to hold the time zone for each city
QString strCityTz[CITIES];
QList<QToolButton> listCities;
QList<QLabel> listTimes;
bool changed;
};
#endif
diff --git a/core/settings/citytime/citytime.pro b/core/settings/citytime/citytime.pro
index c7f4d08..402bcf6 100644
--- a/core/settings/citytime/citytime.pro
+++ b/core/settings/citytime/citytime.pro
@@ -1,32 +1,30 @@
-CONFIG += qt warn_on release
-TEMPLATE = app
-DESTDIR = $(OPIEDIR)/bin
-#INTERFACES = citytimebase.ui
+CONFIG += qt warn_on release quick-app
HEADERS = citytime.h citytimebase.h zonemap.h sun.h stylusnormalizer.h
SOURCES = citytime.cpp citytimebase.cpp zonemap.cpp main.cpp sun.c stylusnormalizer.cpp
-TARGET = citytime
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
+TARGET = citytime
+
TRANSLATIONS = ../../../i18n/de/citytime.ts \
../../../i18n/nl/citytime.ts \
../../../i18n/xx/citytime.ts \
../../../i18n/en/citytime.ts \
../../../i18n/es/citytime.ts \
../../../i18n/fr/citytime.ts \
../../../i18n/hu/citytime.ts \
../../../i18n/ja/citytime.ts \
../../../i18n/ko/citytime.ts \
../../../i18n/no/citytime.ts \
../../../i18n/pl/citytime.ts \
../../../i18n/pt/citytime.ts \
../../../i18n/pt_BR/citytime.ts \
../../../i18n/sl/citytime.ts \
../../../i18n/zh_CN/citytime.ts \
../../../i18n/zh_TW/citytime.ts \
../../../i18n/da/citytime.ts
include ( $(OPIEDIR)/include.pro )
diff --git a/core/settings/citytime/main.cpp b/core/settings/citytime/main.cpp
index e8664c6..69bfe44 100644
--- a/core/settings/citytime/main.cpp
+++ b/core/settings/citytime/main.cpp
@@ -1,30 +1,25 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "citytime.h"
#include <qpe/qpeapplication.h>
+#include <opie/oapplicationfactory.h>
-int main( int argc, char** argv )
-{
- QPEApplication a( argc, argv );
- CityTime main;
- a.showMainWidget( &main );
- return a.exec();
-}
+OPIE_EXPORT_APP( OApplicationFactory<CityTime> )
diff --git a/core/settings/launcher/launcher.pro b/core/settings/launcher/launcher.pro
index cea268d..9d05832 100644
--- a/core/settings/launcher/launcher.pro
+++ b/core/settings/launcher/launcher.pro
@@ -1,28 +1,26 @@
-TEMPLATE = app
-CONFIG += qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
HEADERS = launchersettings.h \
tabssettings.h \
taskbarsettings.h \
menusettings.h \
inputmethodsettings.h \
tabconfig.h \
tabdialog.h
SOURCES = main.cpp \
launchersettings.cpp \
tabssettings.cpp \
taskbarsettings.cpp \
menusettings.cpp \
inputmethodsettings.cpp \
tabdialog.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopie
TARGET = launchersettings
include ( $(OPIEDIR)/include.pro )
diff --git a/core/settings/launcher/launchersettings.cpp b/core/settings/launcher/launchersettings.cpp
index 3982194..efc4a86 100644
--- a/core/settings/launcher/launchersettings.cpp
+++ b/core/settings/launcher/launchersettings.cpp
@@ -1,76 +1,77 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qlayout.h>
#include <qapplication.h>
#include <opie/otabwidget.h>
#include "launchersettings.h"
#include "tabssettings.h"
#include "menusettings.h"
#include "taskbarsettings.h"
#include "inputmethodsettings.h"
-LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp )
+LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags)
+ : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp )
{
setCaption ( tr( "Launcher Settings" ));
QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
OTabWidget *tw = new OTabWidget ( this, "otab" );
lay-> addWidget ( tw );
m_tabs = new TabsSettings ( tw );
m_taskbar = new TaskbarSettings ( tw );
m_menu = new MenuSettings ( tw );
m_imethods = new InputMethodSettings ( tw );
tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" ));
tw-> addTab ( m_menu, "go", tr( "O-Menu" ));
tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" ));
tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" ));
tw-> setCurrentTab ( m_taskbar );
}
void LauncherSettings::accept ( )
{
m_taskbar-> accept ( );
m_menu-> accept ( );
m_tabs-> accept ( );
m_imethods-> accept ( );
QDialog::accept ( );
}
void LauncherSettings::done ( int r )
{
QDialog::done ( r );
close ( );
}
diff --git a/core/settings/launcher/launchersettings.h b/core/settings/launcher/launchersettings.h
index 71165a3..7458d8b 100644
--- a/core/settings/launcher/launchersettings.h
+++ b/core/settings/launcher/launchersettings.h
@@ -1,54 +1,55 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __LAUNCHER_SETTINGS_H__
#define __LAUNCHER_SETTINGS_H__
#include <qdialog.h>
class TabsSettings;
class TaskbarSettings;
class MenuSettings;
class InputMethodSettings;
class LauncherSettings : public QDialog {
Q_OBJECT
public:
- LauncherSettings ( );
+ static QString appName() { return QString::fromLatin1("launchersettings"); }
+ LauncherSettings (QWidget *parent = 0, const char* name = 0, WFlags fl = 0 );
virtual void accept ( );
virtual void done ( int r );
private:
TabsSettings *m_tabs;
TaskbarSettings *m_taskbar;
MenuSettings *m_menu;
InputMethodSettings* m_imethods;
};
#endif
diff --git a/core/settings/launcher/main.cpp b/core/settings/launcher/main.cpp
index f65dab8..4cc1d35 100644
--- a/core/settings/launcher/main.cpp
+++ b/core/settings/launcher/main.cpp
@@ -1,43 +1,35 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "launchersettings.h"
#include <qpe/qpeapplication.h>
+#include <opie/oapplicationfactory.h>
+OPIE_EXPORT_APP( OApplicationFactory<LauncherSettings> )
-int main ( int argc, char** argv )
-{
- QPEApplication a ( argc,argv );
-
- LauncherSettings dlg;
- a. showMainWidget ( &dlg );
- dlg. showMaximized ( );
-
- return a. exec ( );
-}
diff --git a/core/settings/launcher/menusettings.cpp b/core/settings/launcher/menusettings.cpp
index 6fca621..faa7cf4 100644
--- a/core/settings/launcher/menusettings.cpp
+++ b/core/settings/launcher/menusettings.cpp
@@ -1,163 +1,175 @@
/*
                This file is part of the OPIE Project
=. Copyright (c) 2002 Trolltech AS <info@trolltech.com>
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "menusettings.h"
#include <qpe/config.h>
#include <qpe/qlibrary.h>
#include <qpe/qpeapplication.h>
#include <qpe/menuappletinterface.h>
#include <qpe/qcopenvelope_qws.h>
#include <qdir.h>
#include <qlistview.h>
#include <qcheckbox.h>
#include <qheader.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qwhatsthis.h>
#include <stdlib.h>
MenuSettings::MenuSettings ( QWidget *parent, const char *name )
: QWidget ( parent, name )
{
m_applets_changed = false;
QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this );
lay-> addWidget ( l );
m_list = new QListView ( this );
m_list-> addColumn ( "foobar" );
m_list-> header ( )-> hide ( );
lay-> addWidget ( m_list );
m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this );
lay-> addWidget ( m_menutabs );
+ m_menusubpopup = new QCheckBox ( tr( "Show Applications in subpopups" ), this );
+ lay-> addWidget ( m_menusubpopup );
+
QWhatsThis::add ( m_list, tr( "Check the applets that you want to have included in the O-Menu." ));
QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher Tabs as menus in the O-Menu." ));
connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( )));
init ( );
}
void MenuSettings::init ( )
{
Config cfg ( "StartMenu" );
cfg. setGroup ( "Applets" );
QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' );
QString path = QPEApplication::qpeDir ( ) + "/plugins/applets";
#ifdef Q_OS_MACX
QStringList list = QDir ( path, "lib*.dylib" ). entryList ( );
#else
QStringList list = QDir ( path, "lib*.so" ). entryList ( );
#endif /* Q_OS_MACX */
for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) {
QString name;
QPixmap icon;
MenuAppletInterface *iface = 0;
QLibrary *lib = new QLibrary ( path + "/" + *it );
lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**) &iface );
if ( iface ) {
QString lang = getenv( "LANG" );
QTranslator *trans = new QTranslator ( qApp );
QString type = (*it). left ((*it). find ("."));
QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm";
if ( trans-> load ( tfn ))
qApp-> installTranslator ( trans );
else
delete trans;
name = iface-> name ( );
icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal );
iface-> release ( );
lib-> unload ( );
QCheckListItem *item;
item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
if ( !icon. isNull ( ))
item-> setPixmap ( 0, icon );
item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
m_applets [*it] = item;
} else {
delete lib;
}
}
cfg. setGroup ( "Menu" );
m_menutabs-> setChecked ( cfg. readBoolEntry ( "LauncherTabs", true ));
+ m_menusubpopup-> setChecked ( cfg. readBoolEntry ( "LauncherSubPopup", true ));
}
void MenuSettings::appletChanged()
{
m_applets_changed = true;
}
void MenuSettings::accept ( )
{
bool apps_changed = false;
Config cfg ( "StartMenu" );
cfg. setGroup ( "Applets" );
if ( m_applets_changed ) {
QStringList exclude;
QMap <QString, QCheckListItem *>::Iterator it;
for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) {
if ( !(*it)-> isOn ( ))
exclude << it. key ( );
}
cfg. writeEntry ( "ExcludeApplets", exclude, ',' );
}
cfg. writeEntry ( "SafeMode", false );
cfg. setGroup ( "Menu" );
if ( m_menutabs-> isChecked ( ) != cfg. readBoolEntry ( "LauncherTabs", true )) {
apps_changed = true;
cfg. writeEntry ( "LauncherTabs", m_menutabs-> isChecked ( ));
}
+ if ( m_menusubpopup-> isChecked ( ) != cfg. readBoolEntry ( "LauncherSubPopup", true )) {
+ apps_changed = true;
+ cfg. writeEntry ( "LauncherSubPopup", m_menusubpopup-> isChecked ( ));
+ }
+
cfg. write ( );
if ( m_applets_changed ) {
QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" );
m_applets_changed = false;
}
if ( apps_changed ) {
+ // currently use reloadApplets() since reloadApps is now used exclusive for server
+ // to refresh the tabs. But what we want here is also a refresh of the startmenu entries
QCopEnvelope ( "QPE/TaskBar", "reloadApps()" );
+ QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" );
}
}
diff --git a/core/settings/launcher/menusettings.h b/core/settings/launcher/menusettings.h
index 5986958..5bb7afa 100644
--- a/core/settings/launcher/menusettings.h
+++ b/core/settings/launcher/menusettings.h
@@ -1,60 +1,60 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __MENU_SETTINGS_H__
#define __MENU_SETTINGS_H__
#include <qwidget.h>
#include <qmap.h>
class QListView;
class QCheckListItem;
class QCheckBox;
class MenuSettings : public QWidget {
Q_OBJECT
public:
MenuSettings ( QWidget *parent = 0, const char *name = 0 );
void accept ( );
protected slots:
void appletChanged ( );
protected:
void init ( );
private:
QListView *m_list;
QMap <QString, QCheckListItem *> m_applets;
bool m_applets_changed;
- QCheckBox *m_menutabs;
+ QCheckBox *m_menutabs, *m_menusubpopup;
};
#endif
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp
index 7cd00bd..3d8b456 100644
--- a/core/settings/launcher/tabssettings.cpp
+++ b/core/settings/launcher/tabssettings.cpp
@@ -1,318 +1,318 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "tabssettings.h"
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/applnk.h>
#include <qpe/mimetype.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/config.h>
#include <qlistbox.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qwhatsthis.h>
#include <qcheckbox.h>
#include "tabdialog.h"
#include <stdlib.h>
#include <qmessagebox.h>
#define GLOBALID ".global."
TabsSettings::TabsSettings ( QWidget *parent, const char *name )
: QWidget ( parent, name )
{
QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 );
QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this );
lay-> addMultiCellWidget ( l, 0, 0, 0, 1 );
m_list = new QListBox ( this );
lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 );
QWhatsThis::add ( m_list, tr( "foobar" ));
QPushButton *p1, *p2, *p3;
p1 = new QPushButton ( tr( "New" ), this );
lay-> addWidget ( p1, 1, 1 );
connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( )));
p2 = new QPushButton ( tr( "Edit" ), this );
lay-> addWidget ( p2, 2, 1 );
connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( )));
p3 = new QPushButton ( tr( "Delete" ), this );
lay-> addWidget ( p3, 3, 1 );
connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( )));
lay-> setRowStretch ( 4, 10 );
m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this );
lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 );
- m_busyblink = new QCheckBox ( tr( "Enable blinking busy indicator" ), this );
- lay-> addMultiCellWidget ( m_busyblink, 6, 6, 0, 1 );
+ m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this );
+ lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 );
p1-> setEnabled ( false );
p3-> setEnabled ( false );
init ( );
QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." ));
QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." ));
QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." ));
QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." ));
QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." ));
- QWhatsThis::add ( m_busyblink, tr( "Activate this, if you want a blinking busy indicator for starting applications in the Launcher." ));
+ QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." ));
}
void TabsSettings::init ( )
{
AppLnkSet rootFolder( MimeType::appsFolderName ( ));
QStringList types = rootFolder. types ( );
m_list-> insertItem ( tr( "All Tabs" ));
m_ids << GLOBALID;
for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) {
m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it ));
m_ids << *it;
}
QImage img ( Resource::loadImage ( "DocsIcon" ));
QPixmap pix;
pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( ));
m_list-> insertItem ( pix, tr( "Documents" ));
m_ids += "Documents"; // No tr
Config cfg ( "Launcher" );
readTabSettings ( cfg );
cfg. setGroup ( "GUI" );
- m_busyblink-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "blink" );
+ m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" );
m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) );
}
void TabsSettings::readTabSettings ( Config &cfg )
{
QString grp ( "Tab %1" ); // No tr
m_tabs. clear ( );
TabConfig global_def;
global_def. m_view = TabConfig::Icon;
global_def. m_bg_type = TabConfig::Ruled;
global_def. m_bg_image = "launcher/opie-background";
global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( );
global_def. m_text_color = colorGroup ( ). color ( QColorGroup::Text ). name ( );
global_def. m_font_use = false;
global_def. m_font_family = font ( ). family ( );
global_def. m_font_size = font ( ). pointSize ( );
global_def. m_font_weight = 50;
global_def. m_font_italic = false;
global_def. m_changed = false;
for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
TabConfig tc = ( it != m_ids. begin ( )) ? m_tabs [GLOBALID] : global_def;
cfg. setGroup ( grp. arg ( *it ));
QString view = cfg. readEntry ( "View" );
if ( view == "Icon" ) // No tr
tc. m_view = TabConfig::Icon;
if ( view == "List" ) // No tr
tc. m_view = TabConfig::List;
QString bgType = cfg. readEntry ( "BackgroundType" );
if ( bgType == "Image" )
tc. m_bg_type = TabConfig::Image;
else if ( bgType == "SolidColor" )
tc. m_bg_type = TabConfig::SolidColor;
else if ( bgType == "Image" ) // No tr
tc. m_bg_type = TabConfig::Image;
tc. m_bg_image = cfg. readEntry ( "BackgroundImage", tc. m_bg_image );
tc. m_bg_color = cfg. readEntry ( "BackgroundColor", tc. m_bg_color );
tc. m_text_color = cfg. readEntry ( "TextColor", tc. m_text_color );
QStringList f = cfg. readListEntry ( "Font", ',' );
if ( f. count ( ) == 4 ) {
tc. m_font_use = true;
tc. m_font_family = f [0];
tc. m_font_size = f [1]. toInt ( );
tc. m_font_weight = f [2]. toInt ( );
tc. m_font_italic = ( f [3]. toInt ( ));
}
m_tabs [*it] = tc;
}
// if all tabs have the same config, then initialize the GLOBALID tab to these values
TabConfig *first = 0;
bool same = true;
for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
if ( *it == GLOBALID )
continue;
else if ( !first )
first = &m_tabs [*it];
else
same &= ( *first == m_tabs [*it] );
}
if ( same ) {
m_tabs [GLOBALID] = *first;
m_tabs [GLOBALID]. m_changed = true;
}
}
void TabsSettings::accept ( )
{
Config cfg ( "Launcher" );
// Launcher Tab
QString grp ( "Tab %1" ); // No tr
for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
TabConfig &tc = m_tabs [*it];
if ( !tc. m_changed )
continue;
cfg. setGroup ( grp. arg ( *it ));
switch ( tc. m_view ) {
case TabConfig::Icon:
cfg.writeEntry ( "View", "Icon" );
break;
case TabConfig::List:
cfg.writeEntry ( "View", "List" );
break;
}
QCopEnvelope e ( "QPE/Launcher", "setTabView(QString,int)" );
e << *it << tc. m_view;
cfg. writeEntry ( "BackgroundImage", tc. m_bg_image );
cfg. writeEntry ( "BackgroundColor", tc. m_bg_color );
cfg. writeEntry ( "TextColor", tc. m_text_color );
if ( tc. m_font_use ) {
QString f = tc. m_font_family + "," + QString::number ( tc. m_font_size ) + "," + QString::number ( tc. m_font_weight ) + "," + ( tc. m_font_italic ? "1" : "0" );
cfg. writeEntry ( "Font", f );
}
else
cfg. removeEntry ( "Font" );
QCopEnvelope be ( "QPE/Launcher", "setTabBackground(QString,int,QString)" );
switch ( tc. m_bg_type ) {
case TabConfig::Ruled:
cfg.writeEntry( "BackgroundType", "Ruled" );
be << *it << tc. m_bg_type << QString("");
break;
case TabConfig::SolidColor:
cfg.writeEntry( "BackgroundType", "SolidColor" );
be << *it << tc. m_bg_type << tc. m_bg_color;
break;
case TabConfig::Image:
cfg.writeEntry( "BackgroundType", "Image" );
be << *it << tc. m_bg_type << tc. m_bg_image;
break;
}
QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" );
te << *it << tc. m_text_color;
QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" );
fe << *it;
fe << ( tc. m_font_use ? tc. m_font_family : QString::null );
fe << tc. m_font_size;
fe << tc. m_font_weight;
fe << ( tc. m_font_italic ? 1 : 0 );
tc. m_changed = false;
}
cfg. setGroup ( "GUI" );
- QString busytype = QString ( m_busyblink-> isChecked ( ) ? "blink" : "" );
+ QString busytype = QString ( m_busyani-> isChecked ( ) ? "Animated" : "" );
cfg. writeEntry ( "BusyType", busytype );
cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) );
{
QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" );
e << busytype;
}
}
void TabsSettings::newClicked ( )
{
QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" ));
}
void TabsSettings::deleteClicked ( )
{
int ind = m_list-> currentItem ( );
if ( ind < 0 )
return;
QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" ));
}
void TabsSettings::editClicked ( )
{
int ind = m_list-> currentItem ( );
if ( ind < 0 )
return;
TabConfig tc = m_tabs [m_ids [ind]];
TabDialog *d = new TabDialog ( m_list-> pixmap ( ind ), m_list-> text ( ind ), tc, this, "TabDialog", true );
d-> showMaximized ( );
if ( d-> exec ( ) == QDialog::Accepted ) {
tc. m_changed = true;
m_tabs [m_ids [ind]] = tc;
if ( m_ids [ind] == GLOBALID ) {
for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
if ( *it != GLOBALID )
m_tabs [*it] = tc;
}
}
}
delete d;
}
diff --git a/core/settings/launcher/tabssettings.h b/core/settings/launcher/tabssettings.h
index 439def6..600c65c 100644
--- a/core/settings/launcher/tabssettings.h
+++ b/core/settings/launcher/tabssettings.h
@@ -1,68 +1,68 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __TABS_SETTINGS_H__
#define __TABS_SETTINGS_H__
#include <qwidget.h>
#include <qmap.h>
#include "tabconfig.h"
class QListBox;
class QCheckBox;
class Config;
class TabsSettings : public QWidget {
Q_OBJECT
public:
TabsSettings ( QWidget *parent = 0, const char *name = 0 );
void accept ( );
protected slots:
void newClicked ( );
void deleteClicked ( );
void editClicked ( );
protected:
void init ( );
void readTabSettings ( Config & );
private:
QListBox *m_list;
// QString currentTab;
QStringList m_ids;
QMap <QString, TabConfig> m_tabs;
- QCheckBox *m_busyblink, *m_bigbusy;
+ QCheckBox *m_busyani, *m_bigbusy;
};
#endif
diff --git a/core/settings/light-and-power/light-and-power.pro b/core/settings/light-and-power/light-and-power.pro
index 9304fa8..4972701 100644
--- a/core/settings/light-and-power/light-and-power.pro
+++ b/core/settings/light-and-power/light-and-power.pro
@@ -1,33 +1,32 @@
-TEMPLATE = app
-CONFIG += qt warn_on debug
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
HEADERS = light.h sensor.h calibration.h
SOURCES = light.cpp main.cpp sensor.cpp calibration.cpp
INTERFACES = lightsettingsbase.ui sensorbase.ui
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += ../$(OPIEDIR)/include
LIBS += -lqpe -lopie
+
TARGET = light-and-power
TRANSLATIONS = ../../../i18n/de/light-and-power.ts \
../../../i18n/nl/light-and-power.ts \
../../../i18n/xx/light-and-power.ts \
../../../i18n/en/light-and-power.ts \
../../../i18n/es/light-and-power.ts \
../../../i18n/fr/light-and-power.ts \
../../../i18n/hu/light-and-power.ts \
../../../i18n/ja/light-and-power.ts \
../../../i18n/ko/light-and-power.ts \
../../../i18n/no/light-and-power.ts \
../../../i18n/pl/light-and-power.ts \
../../../i18n/pt/light-and-power.ts \
../../../i18n/pt_BR/light-and-power.ts \
../../../i18n/sl/light-and-power.ts \
../../../i18n/zh_CN/light-and-power.ts \
../../../i18n/zh_TW/light-and-power.ts \
../../../i18n/it/light-and-power.ts \
../../../i18n/da/light-and-power.ts
include ( $(OPIEDIR)/include.pro )
diff --git a/core/settings/light-and-power/light.h b/core/settings/light-and-power/light.h
index c48e5f6..83d5520 100644
--- a/core/settings/light-and-power/light.h
+++ b/core/settings/light-and-power/light.h
@@ -1,70 +1,71 @@
/*
This file is part of the OPIE Project
               =. Copyright (c) 2002 Maximilian Reiss <harlekin@handhelds.org>
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __LIGHT_H__
#define __LIGHT_H__
#include <qstringlist.h>
#include <qlistbox.h>
#include "lightsettingsbase.h"
class QTimer;
class LightSettings : public LightSettingsBase
{
Q_OBJECT
public:
LightSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~LightSettings();
+ static QString appName() { return QString::fromLatin1("light-and-power"); }
protected:
virtual void accept();
virtual void done ( int r );
protected slots:
virtual void calibrateSensor ( );
virtual void calibrateSensorAC ( );
void setBacklight ( int );
void setContrast ( int );
void setFrequency ( int );
void resetBacklight ( );
private:
int m_bres;
int m_cres;
int m_oldcontrast;
int m_oldfreq;
QTimer *m_resettimer;
QStringList m_sensordata;
QStringList m_sensordata_ac;
};
#endif
diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui
index 1f5d594..e4d5f0e 100644
--- a/core/settings/light-and-power/lightsettingsbase.ui
+++ b/core/settings/light-and-power/lightsettingsbase.ui
@@ -1170,140 +1170,140 @@
<property stdset="1">
<name>name</name>
<cstring>criticalSpinBox</cstring>
</property>
<property stdset="1">
<name>prefix</name>
<string></string>
</property>
<property stdset="1">
<name>suffix</name>
<string> %</string>
</property>
<property stdset="1">
<name>buttonSymbols</name>
<enum>PlusMinus</enum>
</property>
<property stdset="1">
<name>maxValue</name>
<number>80</number>
</property>
<property stdset="1">
<name>minValue</name>
<number>2</number>
</property>
<property>
<name>whatsThis</name>
<string>At what battery level should the critical power warning pop up</string>
</property>
</widget>
<widget row="1" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel2</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>5</vsizetype>
</sizepolicy>
</property>
<property stdset="1">
<name>text</name>
<string>very low battery warning at</string>
</property>
</widget>
<widget row="2" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel3</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>5</vsizetype>
</sizepolicy>
</property>
<property stdset="1">
<name>text</name>
<string>critical power warning at</string>
</property>
</widget>
</grid>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer1</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</vbox>
</widget>
</widget>
</vbox>
</widget>
<images>
<image>
<name>image0</name>
- <data format="XPM.GZ" length="680">789c5dd04d6ac3301005e0bd4f21ec5d280931b1c0941ca1a5cb42e962a4194956e2d8f9e9a294debd9e9168ec3cbcd0f72ca1b1372bf5fef6a2569be27a835b67950d70512bfceafbef8fcffd4f516eb59a9e7aabb6e55351ae9555afc389787d9ed6556bdbb6b5cc2b1376d0c08e79115a0090b74326258e4cb333b591cd27a66d6c6d1b669fa9134988162c328f99945831b1c11a65f32153271a2121a0cc1c3329b16392a69a3413327562101201c9669f4989c874dad54e36bb4c9d6885ce8173f2df24158049abff0eec14a479371de1f859573944873e00dd3b8353ba18e3e1de1dbcf7d04d31b3b39033eb8e1052aad9bdc64be262bec0b784e5cc81c78387efe0ae5b767decba785a76c3380cc379d9ad2fe3787df82fb394bfcfc51f5517a686</data>
+ <data format="XPM.GZ" length="1025">789c5dd2cd4ec2401846e13d57d1c08e18a58a20312e44f913419626c6c5cc500a42f92b60c178eff6bc2642fd0e8b79be0d43e945d17b1df4bce2452ede98cdc4796e6cd65e71b88da2fddbfbdd572eef57bcf4532e7b7efe2c973ff79cd75fcc03cefdf45ca859820368aa045f440d7c1287047b6240f0591c11ec425b22d881ce27d8122b0417a22138122dc17b51030f70582258107d821fe225c18d784d702b56092ec51b824eac11dc8b96e0a3e808c6a206b6c580e0270c4a0413d127b8162f09866299a011af095ab142b02e56093e8837049b628d6043d49f04e7a22518898ee04ed46f8013510303382a115c893ec1997845702a96098ec52ac1a168492fa4a660acfb3dfded2c0f37189deec2b16672b2fb98ce66d35934378be36eb94a671dc7f1e6b8dbee263bf39924c9feb83b84260cd3d73b5c1e77f7f587df399c7caf8b348f99fb357836cdec9d1bd374ead99d2e9d6477ad7692b43bd9dd53f7b9d7eb6777e72fddeee0df733999fcf76dee0748aaf77c</data>
</image>
<image>
<name>image1</name>
- <data format="XPM.GZ" length="1220">789c5dd35f53e2301000f0773e4507de981ba4a5443a37f7a028fe41101514bcb987344d0515a8b4a0e0dc77bfee6e36d0dbe121bf4d48361b38aa3ae341cfa91e95d24c6633e5a8a95c39d5683d9f6f7ffff9f55d2abbc2c93fcd63c72dff28956b8e72facb8586f1733eae042a080205f480d2974de903eb4825a5c4d927434d9c30435c3c26861ed105863ef31118692584043e18cae306700ad43af27c9cbd00c622120d2cf8c350d65bc02b66230056984d0f786ea83d9c7d67fab89562d2b92ba2f6e8bb4343d10a81236680579086927a1532a957d7c898b7fa32146e1db865d28d7acc26def7de50b6b0aa3b4b2ce3cc507bb8d58c498b0796b8386252cd1b62ec51199f96d8c95326f5aacfa49d6f99b455db50d0e235935ea1c3a43e279678c14ba6c0e62c99f40a5d4bbcc21b931afbc20c23e0c250d2e21b26d5bcb3c4d913265d21b5c417cc9874d09c49bfd857c358e1b931530ba0b6c4ff510da3224345239b8b74bee6657a989bbd62bc1de4dee7108b65f2b1cfadd22ccdd69bcde7d73eb7dd9dec92d376bb7db6cf9d77924e02b1dde72e2e4d5c1d9c7bddbdc9a3db2bd4d74ff3e8176bbe856206c5dc1d947c5fcc3d0c47a3e16331f7349e4c26cfc55cadeebade7f7d3988f2df9fa57f7da120b4</data>
+ <data format="XPM.GZ" length="1885">789c75d4576fdb301000e077ff0ac17c0b8a8bad49a2e843f61ece4e8a3e481cde198eb3d1ff5eeaeecca675ecb3047cd68922ef282f2f4557c707d1d272e3715a4efb3ad2bd72122d99a7f1f8ede7af1f1f8d663b8ffcb75051dcfcd66876a6918e0eef6e6d0d31f010aaf2a1d1e3da6551077a88c60fdaa14d694b87eea36d692b1c5cf4d88edd45bbaa5525e8516d2f1f685bdb289de7065da28dae8aac36e0f8d69a38add067b55d6cb224470bb6cc52f4153a316582f9c2906d2a255ed7e8d4b882d65791fd7585d79fd199512dac071cb0758cf383db99539a3f8d97d95ca1e1059ddb386ba3713daeb04a61bda0629725adef1a2d6d92517d045b4a346ca295cd12ca3f65e7ec36bbc8b03f60d85a513d24dab74752fd36d0952ddad81f18b0353faf605b89fb037a649756b4fe0cad5dace8f9fb6863754c4ec92e96e4989d48ead7989df2facfd1d66539d5ef929de734bf55b473719bee5f0bc6fec17a30f577979d70bff6d8694ceb599939a1fc437696d2f8c7c1347e2798f28f8269bf3c05d37ed909a67e9fb073beff62e69cfa336517bcdf6f8269be8f6c59d07a5a334baad756308dbf3db3a2fa256c45ef37bcb34b45e3bd06d37cdf662e69fc8799e97d86fb609aff2498ea77174cf5cbd9155d17c0d69aeaa78269ff8e8269bf0e83a91e8e6d2c3dafcbb66c1b2ce9cfee6f8080122ad09f7ffb37070c58703ebad083fe57393080218cfc41e7f17c0edcc21ddcc3034cfcf911a6f004cf73392ff00a6ff0ee8f1558853558878db99c4dd8826d7fecc02eec61eccfe51cc0211cc13174e004a303a7733967700e179fe212aebe58d735dc408be306da0bea1343c2912eac6106b95ffbc49f8b85391294afdf4880108b7244292aa17d186117e638d1153dd1f7315894e3b38662e463fcf9b7ff73be8ae6efef8d3f188ce126</data>
</image>
</images>
<connections>
<connection>
<sender>CalibrateLightSensor</sender>
<signal>clicked()</signal>
<receiver>LightSettingsBase</receiver>
<slot>calibrateSensor()</slot>
</connection>
<connection>
<sender>CalibrateLightSensor_ac</sender>
<signal>clicked()</signal>
<receiver>LightSettingsBase</receiver>
<slot>calibrateSensorAC()</slot>
</connection>
<slot access="public">calibrateSensor()</slot>
<slot access="public">calibrateSensorAC()</slot>
</connections>
<tabstops>
+ <tabstop>brightness</tabstop>
<tabstop>interval_dim</tabstop>
<tabstop>interval_lightoff</tabstop>
<tabstop>interval_suspend</tabstop>
<tabstop>LcdOffOnly</tabstop>
- <tabstop>brightness</tabstop>
<tabstop>auto_brightness</tabstop>
<tabstop>CalibrateLightSensor</tabstop>
+ <tabstop>brightness</tabstop>
<tabstop>tabs</tabstop>
- <tabstop>interval_lightoff_ac</tabstop>
- <tabstop>interval_suspend_ac</tabstop>
- <tabstop>interval_dim_ac</tabstop>
+ <tabstop>interval_lightoff</tabstop>
+ <tabstop>interval_suspend</tabstop>
+ <tabstop>interval_dim</tabstop>
<tabstop>LcdOffOnly_ac</tabstop>
- <tabstop>brightness_ac</tabstop>
- <tabstop>auto_brightness_ac</tabstop>
+ <tabstop>auto_brightness</tabstop>
<tabstop>CalibrateLightSensor_ac</tabstop>
<tabstop>lowSpinBox</tabstop>
<tabstop>warnintervalBox</tabstop>
<tabstop>criticalSpinBox</tabstop>
</tabstops>
</UI>
diff --git a/core/settings/light-and-power/main.cpp b/core/settings/light-and-power/main.cpp
index ecacf69..68d433b 100644
--- a/core/settings/light-and-power/main.cpp
+++ b/core/settings/light-and-power/main.cpp
@@ -1,38 +1,29 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "light.h"
#include <qpe/qpeapplication.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/global.h>
+#include <opie/oapplicationfactory.h>
-int main(int argc, char** argv)
-{
- QPEApplication a(argc,argv);
-
- LightSettings dlg;
-
- a.showMainWidget(&dlg);
-
- return a.exec();
-}
-
+OPIE_EXPORT_APP( OApplicationFactory<LightSettings> )
diff --git a/core/settings/security/main.cpp b/core/settings/security/main.cpp
index c15bb31..3141fb8 100644
--- a/core/settings/security/main.cpp
+++ b/core/settings/security/main.cpp
@@ -1,38 +1,32 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qpe/qpeapplication.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/global.h>
#include "security.h"
+#include <opie/oapplicationfactory.h>
-int main(int argc, char** argv)
-{
- QPEApplication a(argc,argv);
+OPIE_EXPORT_APP( OApplicationFactory<Security> )
- Security dlg;
- a.showMainWidget(&dlg);
-
- return a.exec();
-}
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp
index 42a39c2..81363d2 100644
--- a/core/settings/security/security.cpp
+++ b/core/settings/security/security.cpp
@@ -27,299 +27,294 @@
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <qcombobox.h>
#include <qmessagebox.h>
#include <qfile.h>
#include <qlistview.h>
#include <qtextstream.h>
Security::Security( QWidget* parent, const char* name, WFlags fl )
: SecurityBase( parent, name, TRUE, fl )
{
valid=FALSE;
Config cfg("Security");
cfg.setGroup("Passcode");
passcode = cfg.readEntry("passcode");
passcode_poweron->setChecked(cfg.readBoolEntry("passcode_poweron",FALSE));
cfg.setGroup("Sync");
int auth_peer = cfg.readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24
int auth_peer_bits = cfg.readNumEntry("auth_peer_bits",24);
selectNet(auth_peer,auth_peer_bits);
connect(syncnet, SIGNAL(textChanged(const QString&)),
this, SLOT(setSyncNet(const QString&)));
/*
cfg.setGroup("Remote");
if ( telnetAvailable() )
telnet->setChecked(cfg.readEntry("allow_telnet"));
else
telnet->hide();
if ( sshAvailable() )
ssh->setChecked(cfg.readEntry("allow_ssh"));
else
ssh->hide();
*/
QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf";
Config loginCfg(configFile,Config::File);
loginCfg.setGroup("General");
autoLoginName=loginCfg.readEntry("AutoLogin","");
if (autoLoginName.stripWhiteSpace().isEmpty()) {
autoLogin=false;
} else {
autoLogin=true;
}
cfg.setGroup("SyncMode");
int mode = cfg.readNumEntry("Mode",2); // Default to Sharp
syncModeCombo->setCurrentItem( mode - 1 );
connect(autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool)));
connect(userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int)));
connect(changepasscode,SIGNAL(clicked()), this, SLOT(changePassCode()));
connect(clearpasscode,SIGNAL(clicked()), this, SLOT(clearPassCode()));
loadUsers();
updateGUI();
dl = new QPEDialogListener(this);
showMaximized();
}
Security::~Security()
{
}
void Security::updateGUI()
{
bool empty = passcode.isEmpty();
changepasscode->setText( empty ? tr("Set passcode" )
: tr("Change passcode" ) );
passcode_poweron->setEnabled( !empty );
clearpasscode->setEnabled( !empty );
autologinToggle->setChecked(autoLogin);
userlist->setEnabled(autoLogin);
}
void Security::show()
{
//valid=FALSE;
setEnabled(FALSE);
SecurityBase::show();
if ( passcode.isEmpty() ) {
// could insist...
//changePassCode();
//if ( passcode.isEmpty() )
//reject();
} else {
-
if (!valid) // security passcode was not asked yet, so ask now
{
QString pc = enterPassCode(tr("Enter passcode"));
if ( pc != passcode ) {
QMessageBox::critical(this, tr("Passcode incorrect"),
tr("The passcode entered is incorrect.\nAccess denied"));
reject();
return;
}
}
}
setEnabled(TRUE);
valid=TRUE;
}
void Security::accept()
{
applySecurity();
QDialog::accept();
QCopEnvelope env("QPE/System", "securityChanged()" );
}
void Security::done(int r)
{
QDialog::done(r);
close();
}
void Security::selectNet(int auth_peer,int auth_peer_bits)
{
QString sn;
if ( auth_peer_bits == 0 && auth_peer == 0 ) {
sn = tr("Any");
} else if ( auth_peer_bits == 32 && auth_peer == 0 ) {
sn = tr("None");
} else {
sn =
QString::number((auth_peer>>24)&0xff) + "."
+ QString::number((auth_peer>>16)&0xff) + "."
+ QString::number((auth_peer>>8)&0xff) + "."
+ QString::number((auth_peer>>0)&0xff) + "/"
+ QString::number(auth_peer_bits);
}
for (int i=0; i<syncnet->count(); i++) {
if ( syncnet->text(i).left(sn.length()) == sn ) {
syncnet->setCurrentItem(i);
return;
}
}
qDebug("No match for \"%s\"",sn.latin1());
}
void Security::parseNet(const QString& sn,int& auth_peer,int& auth_peer_bits)
{
auth_peer=0;
if ( sn == tr("Any") ) {
auth_peer = 0;
auth_peer_bits = 0;
} else if ( sn == tr("None") ) {
auth_peer = 0;
auth_peer_bits = 32;
} else {
int x=0;
for (int i=0; i<4; i++) {
int nx = sn.find(QChar(i==3 ? '/' : '.'),x);
auth_peer = (auth_peer<<8)|sn.mid(x,nx-x).toInt();
x = nx+1;
}
uint n = (uint)sn.find(' ',x)-x;
auth_peer_bits = sn.mid(x,n).toInt();
}
}
void Security::loadUsers ( void )
{
QFile passwd("/etc/passwd");
if ( passwd.open(IO_ReadOnly) ) {
QTextStream t( &passwd );
QString s;
QStringList account;
while ( !t.eof() ) {
account = QStringList::split(':',t.readLine());
// Hide disabled accounts
if (*account.at(1)!="*") {
userlist->insertItem(*account.at(0));
// Highlight this item if it is set to autologinToggle
if ( *account.at(0) == autoLoginName)
userlist->setCurrentItem(userlist->count()-1);
}
}
passwd.close();
}
}
void Security::toggleAutoLogin(bool val)
{
autoLogin=val;
userlist->setEnabled(val);
if (!autoLogin)
autoLoginName=userlist->currentText();
}
void Security::setSyncNet(const QString& sn)
{
int auth_peer,auth_peer_bits;
parseNet(sn,auth_peer,auth_peer_bits);
selectNet(auth_peer,auth_peer_bits);
}
void Security::applySecurity()
{
if ( valid ) {
-
Config cfg("Security");
cfg.setGroup("Passcode");
cfg.writeEntry("passcode",passcode);
cfg.writeEntry("passcode_poweron",passcode_poweron->isChecked());
cfg.setGroup("Sync");
int auth_peer=0;
int auth_peer_bits;
QString sn = syncnet->currentText();
parseNet(sn,auth_peer,auth_peer_bits);
cfg.writeEntry("auth_peer",auth_peer);
cfg.writeEntry("auth_peer_bits",auth_peer_bits);
/*
cfg.setGroup("Remote");
if ( telnetAvailable() )
cfg.writeEntry("allow_telnet",telnet->isChecked());
if ( sshAvailable() )
cfg.writeEntry("allow_ssh",ssh->isChecked());
// ### write ssh/telnet sys config files
*/
QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf";
Config loginCfg(configFile,Config::File);
loginCfg.setGroup("General");
if (autoLogin) {
loginCfg.writeEntry("AutoLogin",autoLoginName);
} else {
loginCfg.removeEntry("AutoLogin");
}
- cfg.setGroup("SyncMode");
- cfg.writeEntry("Mode", syncModeCombo->currentItem()+1 );
-
}
}
void Security::changeLoginName( int idx )
{
autoLoginName = userlist->text(idx);;
updateGUI();
}
void Security::changePassCode()
{
QString new1;
QString new2;
do {
new1 = enterPassCode(tr("Enter new passcode"));
if ( new1.isNull() )
return;
new2 = enterPassCode(tr("Re-enter new passcode"));
if ( new2.isNull() )
return;
} while (new1 != new2);
passcode = new1;
updateGUI();
}
void Security::clearPassCode()
{
passcode = QString::null;
updateGUI();
}
QString Security::enterPassCode(const QString& prompt)
{
return Password::getPassword(prompt);
}
bool Security::telnetAvailable() const
{
// ### not implemented
return FALSE;
}
bool Security::sshAvailable() const
{
// ### not implemented
return FALSE;
}
diff --git a/core/settings/security/security.h b/core/settings/security/security.h
index 2f18f91..52d56de 100644
--- a/core/settings/security/security.h
+++ b/core/settings/security/security.h
@@ -1,70 +1,71 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef SECURITY_H
#define SECURITY_H
#include "securitybase.h"
class QPEDialogListener;
class Security : public SecurityBase
{
Q_OBJECT
public:
+ static QString appName() { return QString::fromLatin1("security"); }
Security( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~Security();
void show();
protected:
void accept();
void applySecurity();
void done(int);
private slots:
void changePassCode();
void clearPassCode();
void setSyncNet(const QString&);
void changeLoginName(int);
void toggleAutoLogin(bool);
private:
void loadUsers(void);
bool telnetAvailable() const;
bool sshAvailable() const;
void updateGUI();
static void parseNet(const QString& sn,int& auth_peer,int& auth_peer_bits);
void selectNet(int auth_peer,int auth_peer_bits);
QString enterPassCode(const QString&);
QString passcode;
bool valid;
bool autoLogin;
QString autoLoginName;
QPEDialogListener *dl;
};
#endif // SECURITY_H
diff --git a/core/settings/security/security.pro b/core/settings/security/security.pro
index c359537..67995d4 100644
--- a/core/settings/security/security.pro
+++ b/core/settings/security/security.pro
@@ -1,32 +1,30 @@
-TEMPLATE = app
-CONFIG += qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
HEADERS = security.h
SOURCES = security.cpp main.cpp
INTERFACES = securitybase.ui
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += ../$(OPIEDIR)/include
LIBS += -lqpe
TARGET = security
TRANSLATIONS = ../../../i18n/de/security.ts \
../../../i18n/nl/security.ts \
../../../i18n/xx/security.ts \
../../../i18n/en/security.ts \
../../../i18n/es/security.ts \
../../../i18n/fr/security.ts \
../../../i18n/hu/security.ts \
../../../i18n/ja/security.ts \
../../../i18n/ko/security.ts \
../../../i18n/no/security.ts \
../../../i18n/pl/security.ts \
../../../i18n/pt/security.ts \
../../../i18n/pt_BR/security.ts \
../../../i18n/sl/security.ts \
../../../i18n/zh_CN/security.ts \
../../../i18n/zh_TW/security.ts \
../../../i18n/da/security.ts
include ( $(OPIEDIR)/include.pro )
diff --git a/core/settings/security/securitybase.ui b/core/settings/security/securitybase.ui
index 73290e5..9fb63a8 100644
--- a/core/settings/security/securitybase.ui
+++ b/core/settings/security/securitybase.ui
@@ -1,110 +1,110 @@
<!DOCTYPE UI><UI>
<class>SecurityBase</class>
<widget>
<class>QDialog</class>
<property stdset="1">
<name>name</name>
<cstring>SecurityBase</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>339</width>
+ <width>329</width>
<height>483</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Security Settings</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>0</number>
</property>
<widget>
<class>QTabWidget</class>
<property stdset="1">
<name>name</name>
<cstring>TabWidget2</cstring>
</property>
<property>
<name>layoutMargin</name>
</property>
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>tab</cstring>
</property>
<attribute>
<name>title</name>
<string>Passcode</string>
</attribute>
<vbox>
<property stdset="1">
<name>margin</name>
<number>6</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QGroupBox</class>
<property stdset="1">
<name>name</name>
<cstring>GroupBox4</cstring>
</property>
<property stdset="1">
<name>title</name>
<string>Passcode</string>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout1</cstring>
</property>
<property>
<name>layoutSpacing</name>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>-1</number>
</property>
<widget>
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>changepasscode</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Change passcode</string>