summaryrefslogtreecommitdiff
path: root/noncore/settings/appearance2/appearance.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/appearance2/appearance.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp162
1 files changed, 98 insertions, 64 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 9e5eede..ba12e55 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -29,2 +29,26 @@
+#include "appearance.h"
+#include "editScheme.h"
+#include "stylelistitem.h"
+#include "decolistitem.h"
+#include "colorlistitem.h"
+#include "exceptlistitem.h"
+#include "sample.h"
+
+/* OPIE */
+#include <opie/ofontselector.h>
+#include <opie/odevice.h>
+#include <opie/ofiledialog.h>
+#include <opie/otabwidget.h>
+
+#include <qpe/config.h>
+#include <qpe/global.h>
+#include <qpe/qpeapplication.h>
+#include <qpe/qpemessagebox.h>
+#include <qpe/qcopenvelope_qws.h>
+#include <qpe/qpestyle.h>
+#include <qpe/lightstyle.h>
+#include <qpe/styleinterface.h>
+
+/* QT */
#include <qbuttongroup.h>
@@ -51,27 +75,2 @@
-#include <qpe/config.h>
-#include <qpe/global.h>
-#include <qpe/resource.h>
-#include <qpe/qpeapplication.h>
-#include <qpe/qpemessagebox.h>
-#include <qpe/qcopenvelope_qws.h>
-#include <qpe/qpestyle.h>
-#include <qpe/lightstyle.h>
-#include <qpe/qlibrary.h>
-#include <qpe/styleinterface.h>
-
-#include <opie/ofontselector.h>
-#include <opie/odevice.h>
-#include <opie/ofiledialog.h>
-#include <opie/otabwidget.h>
-
-#include "appearance.h"
-#include "editScheme.h"
-#include "stylelistitem.h"
-#include "decolistitem.h"
-#include "colorlistitem.h"
-#include "exceptlistitem.h"
-#include "sample.h"
-
-
using namespace Opie;
@@ -83,9 +82,12 @@ public:
DefaultWindowDecoration() : ref(0) {}
- QString name() const {
+ QString name() const
+ {
return "Default";
}
-QPixmap icon() const {
+ QPixmap icon() const
+ {
return QPixmap();
}
- QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) {
+ QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface )
+ {
*iface = 0;
@@ -136,2 +138,3 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
#endif
+
{
@@ -141,3 +144,4 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
- for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
+ for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
+ {
QString libstr = path;
@@ -148,3 +152,4 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
- if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface ) {
+ if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface )
+ {
StyleListItem *slit = new StyleListItem ( lib, iface );
@@ -186,3 +191,4 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
- for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
+ for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
+ {
QString libstr = path;
@@ -193,3 +199,4 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
- if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK ) {
+ if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK )
+ {
DecoListItem *dlit = new DecoListItem ( lib, iface );
@@ -248,3 +255,4 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
- for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
+ for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
+ {
QString name = (*it). left ((*it). find ( ".scheme" ));
@@ -350,3 +358,4 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
QListViewItem *lvit = 0;
- for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
+ for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
+ {
int fl = ( *it ). left ( 1 ). toInt ( 0, 32 );
@@ -434,5 +443,8 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
- if (rotDirection == -1) {
+ if (rotDirection == -1)
+ {
rot = ODevice::inst ( )-> direction ( );
- } else {
+ }
+ else
+ {
rot = (ODirection)rotDirection;
@@ -484,4 +496,3 @@ Appearance::Appearance( QWidget* parent, const char* name, WFlags )
Appearance::~Appearance()
-{
-}
+{}
@@ -489,3 +500,4 @@ void Appearance::tabChanged ( QWidget *w )
{
- if ( w == m_advtab ) {
+ if ( w == m_advtab )
+ {
m_sample-> hide ( );
@@ -505,3 +517,4 @@ void Appearance::accept ( )
- if ( m_style_changed ) {
+ if ( m_style_changed )
+ {
StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( ));
@@ -511,3 +524,4 @@ void Appearance::accept ( )
- if ( m_deco_changed ) {
+ if ( m_deco_changed )
+ {
DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( ));
@@ -517,3 +531,4 @@ void Appearance::accept ( )
- if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) {
+ if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos ))
+ {
config. writeEntry ( "TabStyle", newtabstyle + 1 );
@@ -522,3 +537,4 @@ void Appearance::accept ( )
- if ( m_font_changed ) {
+ if ( m_font_changed )
+ {
config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( ));
@@ -538,7 +554,12 @@ void Appearance::accept ( )
ODirection rot;
- if (m_rotdir_ccw-> isChecked ( )) {
+ if (m_rotdir_ccw-> isChecked ( ))
+ {
rot = CCW;
- } else if (m_rotdir_cw-> isChecked ( )) {
+ }
+ else if (m_rotdir_cw-> isChecked ( ))
+ {
rot = CW;
- } else {
+ }
+ else
+ {
rot = Flip;
@@ -551,3 +572,4 @@ void Appearance::accept ( )
QString exceptstr;
- for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) {
+ for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( ))
+ {
int fl = 0;
@@ -581,3 +603,4 @@ void Appearance::styleClicked ( int index )
- if ( m_sample && sli && sli-> style ( )) {
+ if ( m_sample && sli && sli-> style ( ))
+ {
int ci = m_color_list ? m_color_list-> currentItem ( ) : -1;
@@ -594,3 +617,4 @@ void Appearance::styleSettingsClicked ( )
- if ( item && item-> hasSettings ( )) {
+ if ( item && item-> hasSettings ( ))
+ {
QDialog *d = new QDialog ( this, "SETTINGS-DLG", true );
@@ -600,3 +624,4 @@ void Appearance::styleSettingsClicked ( )
- if ( w ) {
+ if ( w )
+ {
vbox-> addWidget ( w );
@@ -605,4 +630,3 @@ void Appearance::styleSettingsClicked ( )
- d-> showMaximized ( );
- bool accepted = ( d-> exec ( ) == QDialog::Accepted );
+ bool accepted = ( QPEApplication::execDialog ( d ) == QDialog::Accepted );
@@ -619,3 +643,4 @@ void Appearance::decoClicked ( int index )
- if ( m_sample ) {
+ if ( m_sample )
+ {
if ( dli && dli-> interface ( ))
@@ -654,6 +679,8 @@ void Appearance::editSchemeClicked ( )
- for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ ) {
+ for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ )
+ {
QColor col = item-> color ( role );
- if ( col. isValid ( )) {
+ if ( col. isValid ( ))
+ {
labels [cnt] = item-> label ( role );
@@ -666,4 +693,4 @@ void Appearance::editSchemeClicked ( )
EditScheme* editdlg = new EditScheme( cnt, labels, colors, this, "editScheme", true );
- editdlg-> showMaximized ( );
- if ( editdlg-> exec ( ) == QDialog::Accepted ) {
+ if ( QPEApplication::execDialog( editdlg ) == QDialog::Accepted )
+ {
ColorListItem *citem = (ColorListItem *) m_color_list-> item ( 0 );
@@ -671,4 +698,6 @@ void Appearance::editSchemeClicked ( )
- for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ ) {
- if ( item-> color ( role ). isValid ( )) {
+ for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ )
+ {
+ if ( item-> color ( role ). isValid ( ))
+ {
citem-> setColor ( role, colors [cnt] );
@@ -700,3 +729,4 @@ void Appearance::saveSchemeClicked()
- if ( d-> exec ( ) == QDialog::Accepted ) {
+ if ( d-> exec ( ) == QDialog::Accepted )
+ {
QString schemename = ed-> text ( );
@@ -763,3 +793,4 @@ void Appearance::delExcept ( )
{
- if ( m_except-> selectedItem ( )) {
+ if ( m_except-> selectedItem ( ))
+ {
m_except-> setFocus ( );
@@ -785,3 +816,4 @@ void Appearance::downExcept ( )
-class ExEdit : public QLineEdit {
+class ExEdit : public QLineEdit
+{
public:
@@ -824,3 +856,4 @@ public:
it-> listView ( )-> setFocus ( );
- else if ( e-> key ( ) == Key_Escape ) {
+ else if ( e-> key ( ) == Key_Escape )
+ {
m_out = false;
@@ -850,3 +883,4 @@ void Appearance::clickedExcept ( QListViewItem *item, const QPoint &, int c )
it-> setNoDeco ( !it-> noDeco ( ));
- else if ( c == 3 ) {
+ else if ( c == 3 )
+ {
m_except-> ensureItemVisible ( it );