summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp31
-rw-r--r--noncore/settings/appearance2/appearance.h30
-rw-r--r--noncore/settings/appearance2/colorlistitem.h27
-rw-r--r--noncore/settings/appearance2/decolistitem.h28
-rw-r--r--noncore/settings/appearance2/editScheme.cpp30
-rw-r--r--noncore/settings/appearance2/editScheme.h30
-rw-r--r--noncore/settings/appearance2/main.cpp27
-rw-r--r--noncore/settings/appearance2/sample.cpp27
-rw-r--r--noncore/settings/appearance2/sample.h27
-rw-r--r--noncore/settings/appearance2/stylelistitem.h27
10 files changed, 140 insertions, 144 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 66cf2c3..a5d216c 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -1,120 +1,121 @@
/*
-               =. This file is part of the OPIE Project
+                This file is part of the OPIE Project
+ Copyright (c) 2002 Trolltech AS <info@trolltech.com>
+ =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
- _;:,     .>    :=|. This library is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+ _;:,     .>    :=|. 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 library is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    .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
-..}^=.=       =       ; Library General Public License for more
-++=   -.     .`     .: details.
- :     =  ...= . :.=-
- -.   .:....=;==+<; You should have received a copy of the GNU
-  -_. . .   )=.  = Library General Public License along with
-    --        :-=` this library; see the file COPYING.LIB.
- If not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330,
+  _.=:.       :    :=>`: 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 "appearance.h"
#include "editScheme.h"
#include <opie/ofiledialog.h>
#include <opie/otabwidget.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qpe/global.h>
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
#include <qpe/qcopenvelope_qws.h>
#endif
#include <qaction.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qdialog.h>
#include <qdir.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qlistbox.h>
#include <qmessagebox.h>
#include <qmultilineedit.h>
#include <qpopupmenu.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#if QT_VERSION >= 300
#include <qstylefactory.h>
#else
#include <qwindowsstyle.h>
#include <qpe/qpestyle.h>
#include <qpe/lightstyle.h>
#include <qpe/qlibrary.h>
#include <qpe/styleinterface.h>
#endif
#include <qtabwidget.h>
#include <qtoolbutton.h>
#include <qvgroupbox.h>
#include <qwidget.h>
#include "stylelistitem.h"
#include "decolistitem.h"
#include "colorlistitem.h"
#include "sample.h"
#include <opie/ofontselector.h>
class DefaultWindowDecoration : public WindowDecorationInterface
{
public:
DefaultWindowDecoration() : ref(0) {}
QString name() const {
return "Default";
}
QPixmap icon() const {
return QPixmap();
}
QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) {
*iface = 0;
if ( uuid == IID_QUnknown )
*iface = this;
else if ( uuid == IID_WindowDecoration )
*iface = this;
if ( *iface )
(*iface)->addRef();
return QS_OK;
}
Q_REFCOUNT
private:
ulong ref;
};
void Appearance::loadStyles ( QListBox *list )
{
#if QT_VERSION >= 300
list->insertStringList(QStyleFactory::styles());
#else
list->insertItem( new StyleListItem ( "Windows", new QWindowsStyle ( )));
list->insertItem( new StyleListItem ( "Light", new LightStyle ( )));
#ifndef QT_NO_STYLE_MOTIF
list->insertItem( new StyleListItem ( "Motif", new QMotifStyle ( )));
#endif
diff --git a/noncore/settings/appearance2/appearance.h b/noncore/settings/appearance2/appearance.h
index ddf94f2..a392aa7 100644
--- a/noncore/settings/appearance2/appearance.h
+++ b/noncore/settings/appearance2/appearance.h
@@ -1,113 +1,113 @@
/*
-               =. This file is part of the OPIE Project
+                This file is part of the OPIE Project
+ =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
- _;:,     .>    :=|. This library is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+ _;:,     .>    :=|. 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 library is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    .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
-..}^=.=       =       ; Library General Public License for more
-++=   -.     .`     .: details.
- :     =  ...= . :.=-
- -.   .:....=;==+<; You should have received a copy of the GNU
-  -_. . .   )=.  = Library General Public License along with
-    --        :-=` this library; see the file COPYING.LIB.
- If not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330,
+  _.=:.       :    :=>`: 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 APPEARANCESETTINGS_H
#define APPEARANCESETTINGS_H
#include <qpe/fontdatabase.h>
#include <qmainwindow.h>
#include <qdialog.h>
class QCheckBox;
class QComboBox;
class QLabel;
class QLineEdit;
class QListBox;
class QMultiLineEdit;
class QPushButton;
class QRadioButton;
class QToolButton;
class SampleWindow;
class OFontSelector;
class Appearance : public QDialog
{
Q_OBJECT
public:
Appearance( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~Appearance();
protected:
virtual void accept ( );
virtual void done ( int r );
protected slots:
void styleClicked ( int );
void styleSettingsClicked ( );
void decoClicked ( int );
void fontClicked ( const QFont & );
void colorClicked ( int );
void editSchemeClicked();
void saveSchemeClicked();
void deleteSchemeClicked();
private:
void loadStyles ( QListBox * );
void loadDecos ( QListBox * );
void loadColors ( QListBox * );
void changeText();
QWidget *createStyleTab ( QWidget *parent );
QWidget *createDecoTab ( QWidget *parent );
QWidget *createFontTab ( QWidget *parent );
QWidget *createColorTab ( QWidget *parent );
QWidget *createGuiTab ( QWidget *parent );
private:
bool m_style_changed;
bool m_font_changed;
bool m_scheme_changed;
bool m_deco_changed;
bool m_color_changed;
int m_original_style;
int m_original_deco;
int m_original_tabstyle;
bool m_original_tabpos;
QListBox * m_style_list;
QPushButton * m_style_settings;
QListBox * m_deco_list;
QListBox * m_color_list;
OFontSelector *m_fontselect;
SampleWindow *m_sample;
QComboBox * m_tabstyle_list;
QRadioButton *m_tabstyle_top;
QRadioButton *m_tabstyle_bottom;
};
#endif
diff --git a/noncore/settings/appearance2/colorlistitem.h b/noncore/settings/appearance2/colorlistitem.h
index 1df541b..10e4468 100644
--- a/noncore/settings/appearance2/colorlistitem.h
+++ b/noncore/settings/appearance2/colorlistitem.h
@@ -1,120 +1,119 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
- _;:,     .>    :=|. This library is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+ _;:,     .>    :=|. 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 library is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    .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
-..}^=.=       =       ; Library General Public License for more
-++=   -.     .`     .: details.
- :     =  ...= . :.=-
- -.   .:....=;==+<; You should have received a copy of the GNU
-  -_. . .   )=.  = Library General Public License along with
-    --        :-=` this library; see the file COPYING.LIB.
- If not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330,
+  _.=:.       :    :=>`: 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 COLORLISTITEM_H
#define COLORLISTITEM_H
#include <qlistbox.h>
#include <qpalette.h>
#include <qapplication.h>
#include <qpe/config.h>
class Appearance;
class ColorListItem : public QListBoxText {
public:
ColorListItem ( const QString &t, Config &cfg ) : QListBoxText ( t )
{
m_colors = new QColor [s_colorcount];
load ( cfg );
}
virtual ~ColorListItem ( )
{
delete [] m_colors;
}
QPalette palette ( )
{
return m_palette;
}
bool load ( Config &cfg )
{
for ( int i = 0; i < s_colorcount; i++ )
m_colors [i] = QColor ( cfg. readEntry ( s_colorlut [i]. m_key, s_colorlut [i]. m_def ));
buildPalette ( );
return true;
}
void buildPalette ( )
{
m_palette = QPalette ( m_colors [r2i(QColorGroup::Button)], m_colors [r2i(QColorGroup::Background)] );
m_palette. setColor ( QColorGroup::Highlight, m_colors [r2i(QColorGroup::Highlight)] );
m_palette. setColor ( QColorGroup::HighlightedText, m_colors [r2i(QColorGroup::HighlightedText)] );
m_palette. setColor ( QColorGroup::Text, m_colors [r2i(QColorGroup::Text)] );
m_palette. setColor ( QPalette::Active, QColorGroup::ButtonText, m_colors [r2i(QColorGroup::ButtonText)] );
m_palette. setColor ( QColorGroup::Base, m_colors [r2i(QColorGroup::Base)] );
m_palette. setColor ( QPalette::Disabled, QColorGroup::Text, m_palette. color ( QPalette::Active, QColorGroup::Background ). dark ( ));
}
bool save ( Config &cfg )
{
for ( int i = 0; i < s_colorcount; i++ )
cfg. writeEntry ( s_colorlut [i]. m_key, m_colors [i]. name ( ));
return true;
}
QColor color ( QColorGroup::ColorRole role )
{
int i = r2i ( role );
return i >= 0 ? m_colors [i] : QColor ( );
}
void setColor ( QColorGroup::ColorRole role, QColor c )
{
int i = r2i ( role );
if ( i >= 0 ) {
m_colors [i] = c;
buildPalette ( );
}
}
QString label ( QColorGroup::ColorRole role )
{
int i = r2i ( role );
return i >= 0 ? qApp-> translate ( "Appearance", s_colorlut [i]. m_label ) : QString::null;
}
private:
QPalette m_palette;
QColor *m_colors;
static struct colorlut {
QColorGroup::ColorRole m_role;
const char * m_key;
const char * m_def;
const char * m_label;
} const s_colorlut [];
static const int s_colorcount;
static int r2i ( QColorGroup::ColorRole role )
{
for ( int i = 0; i < s_colorcount; i++ ) {
diff --git a/noncore/settings/appearance2/decolistitem.h b/noncore/settings/appearance2/decolistitem.h
index 953a939..23261b1 100644
--- a/noncore/settings/appearance2/decolistitem.h
+++ b/noncore/settings/appearance2/decolistitem.h
@@ -1,106 +1,106 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
- _;:,     .>    :=|. This library is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+ _;:,     .>    :=|. 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 library is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    .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
-..}^=.=       =       ; Library General Public License for more
-++=   -.     .`     .: details.
- :     =  ...= . :.=-
- -.   .:....=;==+<; You should have received a copy of the GNU
-  -_. . .   )=.  = Library General Public License along with
-    --        :-=` this library; see the file COPYING.LIB.
- If not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330,
+  _.=:.       :    :=>`: 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 DECOLISTITEM_H
#define DECOLISTITEM_H
#include <qpe/windowdecorationinterface.h>
#include <qlistbox.h>
class DecoListItem : public QListBoxText {
public:
DecoListItem ( const QString &t ) : QListBoxText ( t )
{
m_lib = 0;
m_window_if = 0;
// m_settings_if = 0;
}
DecoListItem ( QLibrary *lib, WindowDecorationInterface *iface ) : QListBoxText ( iface-> name ( ))
{
m_lib = lib;
m_window_if = iface;
// iface-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &m_settings_if );
}
virtual ~DecoListItem ( )
{
// if ( m_settings_if )
// m_settings_if-> release ( );
if ( m_window_if )
m_window_if-> release ( );
delete m_lib;
}
bool hasSettings ( ) const
{
// return ( m_settings_if );
return false;
}
QWidget *settings ( QWidget * /*parent*/ )
{
// return m_settings_if ? m_settings_if-> create ( parent ) : 0;
return 0;
}
bool setSettings ( bool /*accepted*/ )
{
// if ( !m_settings_if )
// return false;
// if ( accepted )
// return m_settings_if-> accept ( );
// else {
// m_settings_if-> reject ( );
// return false;
// }
return false;
}
QString key ( )
{
if ( m_window_if )
return QString ( m_window_if-> name ( ));
else
return text ( );
}
WindowDecorationInterface *interface ( )
{
return m_window_if;
}
private:
QLibrary *m_lib;
WindowDecorationInterface *m_window_if;
// WindowDecorationSettingsInterface *m_settings_if;
};
#endif \ No newline at end of file
diff --git a/noncore/settings/appearance2/editScheme.cpp b/noncore/settings/appearance2/editScheme.cpp
index 8cb0f1c..c2e5355 100644
--- a/noncore/settings/appearance2/editScheme.cpp
+++ b/noncore/settings/appearance2/editScheme.cpp
@@ -1,73 +1,73 @@
/*
-               =. This file is part of the OPIE Project
+                This file is part of the OPIE Project
+ =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
- _;:,     .>    :=|. This library is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+ _;:,     .>    :=|. 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 library is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    .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
-..}^=.=       =       ; Library General Public License for more
-++=   -.     .`     .: details.
- :     =  ...= . :.=-
- -.   .:....=;==+<; You should have received a copy of the GNU
-  -_. . .   )=.  = Library General Public License along with
-    --        :-=` this library; see the file COPYING.LIB.
- If not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330,
+  _.=:.       :    :=>`: 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 "editScheme.h"
#include <opie/ocolorbutton.h>
#include <qaction.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpopupmenu.h>
#include <qscrollview.h>
#include <qtoolbutton.h>
EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog ( parent, name, modal, fl )
{
setCaption ( tr( "Edit scheme" ) );
QGridLayout *layout = new QGridLayout ( this, 0, 0, 4, 4 );
m_count = cnt;
m_buttons = new OColorButton * [cnt];
m_colors = colors;
for ( int i = 0; i < cnt; i++ )
{
QLabel *l = new QLabel ( labels [i], this );
layout-> addWidget ( l, i, 0 );
m_buttons [i] = new OColorButton ( this );
m_buttons [i]-> setColor ( colors [i] );
layout-> addWidget ( m_buttons [i], i, 1 );
}
}
EditScheme::~EditScheme ( )
{
delete [] m_buttons;
}
void EditScheme::accept ( )
{
for ( int i = 0; i < m_count; i++ )
m_colors [i] = m_buttons [i]-> color ( );
QDialog::accept ( );
}
diff --git a/noncore/settings/appearance2/editScheme.h b/noncore/settings/appearance2/editScheme.h
index 0a025bd..93dc50d 100644
--- a/noncore/settings/appearance2/editScheme.h
+++ b/noncore/settings/appearance2/editScheme.h
@@ -1,53 +1,53 @@
/*
-               =. This file is part of the OPIE Project
+                This file is part of the OPIE Project
+ =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
- _;:,     .>    :=|. This library is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+ _;:,     .>    :=|. 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 library is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    .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
-..}^=.=       =       ; Library General Public License for more
-++=   -.     .`     .: details.
- :     =  ...= . :.=-
- -.   .:....=;==+<; You should have received a copy of the GNU
-  -_. . .   )=.  = Library General Public License along with
-    --        :-=` this library; see the file COPYING.LIB.
- If not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330,
+  _.=:.       :    :=>`: 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 EDITSCHEME_H
#define EDITSCHEME_H
#include <qdialog.h>
class QColor;
class OColorButton;
class EditScheme : public QDialog {
Q_OBJECT
public:
EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
virtual ~EditScheme ( );
protected slots:
virtual void accept ( );
private:
int m_count;
QColor *m_colors;
OColorButton **m_buttons;
};
#endif
diff --git a/noncore/settings/appearance2/main.cpp b/noncore/settings/appearance2/main.cpp
index 3afec46..ad24cf3 100644
--- a/noncore/settings/appearance2/main.cpp
+++ b/noncore/settings/appearance2/main.cpp
@@ -1,43 +1,42 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
- _;:,     .>    :=|. This library is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+ _;:,     .>    :=|. 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 library is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    .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
-..}^=.=       =       ; Library General Public License for more
-++=   -.     .`     .: details.
- :     =  ...= . :.=-
- -.   .:....=;==+<; You should have received a copy of the GNU
-  -_. . .   )=.  = Library General Public License along with
-    --        :-=` this library; see the file COPYING.LIB.
- If not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330,
+  _.=:.       :    :=>`: 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 "appearance.h"
#include <qpe/qpeapplication.h>
int main ( int argc, char **argv )
{
QPEApplication app ( argc, argv );
Appearance m;
app. showMainDocumentWidget ( &m );
return app. exec ( );
}
diff --git a/noncore/settings/appearance2/sample.cpp b/noncore/settings/appearance2/sample.cpp
index 0d8b003..6bbed4b 100644
--- a/noncore/settings/appearance2/sample.cpp
+++ b/noncore/settings/appearance2/sample.cpp
@@ -1,121 +1,120 @@
/*
                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 library is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+ _;:,     .>    :=|. 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 library is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    .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
-..}^=.=       =       ; Library General Public License for more
-++=   -.     .`     .: details.
- :     =  ...= . :.=-
- -.   .:....=;==+<; You should have received a copy of the GNU
-  -_. . .   )=.  = Library General Public License along with
-    --        :-=` this library; see the file COPYING.LIB.
- If not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330,
+  _.=:.       :    :=>`: 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 <qvbox.h>
#include <qpopupmenu.h>
#include <qpainter.h>
#include <qmenubar.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <qscrollbar.h>
#include <qlayout.h>
#include <qwhatsthis.h>
#include <qpixmapcache.h>
#include <qtimer.h>
#include <qobjectlist.h>
#include <qcommonstyle.h>
#include "sample.h"
class SampleText : public QWidget
{
public:
SampleText( const QString &t, bool h, QWidget *parent )
: QWidget( parent ), hl(h), text(t)
{
if ( hl )
setBackgroundMode( PaletteHighlight );
else
setBackgroundMode( PaletteBase );
}
QSize sizeHint() const
{
QFontMetrics fm(font());
return QSize( fm.width(text)+10, fm.height()+4 );
}
void paintEvent( QPaintEvent * )
{
QPainter p(this);
if ( hl )
p.setPen( colorGroup().highlightedText() );
else
p.setPen( colorGroup().text() );
p.drawText( rect(), AlignCenter, text );
}
private:
bool hl;
QString text;
};
SampleWindow::SampleWindow( QWidget *parent ) : QWidget(parent), iface(0)
{
init();
}
QSize SampleWindow::sizeHint() const
{
return container->sizeHint() + QSize( 10, 35 );
}
void SampleWindow::setFont( const QFont &f )
{
QWidget::setFont( f );
popup->setFont( f );
QTimer::singleShot ( 0, this, SLOT( fixGeometry ( )));
}
static void setStyleRecursive ( QWidget *w, QStyle *s )
{
w->setStyle( s );
QObjectList *childObjects=(QObjectList*)w->children();
if ( childObjects ) {
QObject * o;
for(o=childObjects->first();o!=0;o=childObjects->next()) {
if( o->isWidgetType() ) {
setStyleRecursive((QWidget *)o,s);
}
}
}
}
void SampleWindow::setStyle2 ( QStyle *sty )
{
typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, QColorGroup &, bool, bool);
extern QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl);
QPixmapCache::clear ( );
QPalette p = palette ( );
sty-> polish ( p );
diff --git a/noncore/settings/appearance2/sample.h b/noncore/settings/appearance2/sample.h
index a189f69..c861228 100644
--- a/noncore/settings/appearance2/sample.h
+++ b/noncore/settings/appearance2/sample.h
@@ -1,78 +1,77 @@
/*
                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 library is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+ _;:,     .>    :=|. 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 library is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    .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
-..}^=.=       =       ; Library General Public License for more
-++=   -.     .`     .: details.
- :     =  ...= . :.=-
- -.   .:....=;==+<; You should have received a copy of the GNU
-  -_. . .   )=.  = Library General Public License along with
-    --        :-=` this library; see the file COPYING.LIB.
- If not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330,
+  _.=:.       :    :=>`: 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 __PREVIEW_H__
#define __PREVIEW_H__
#include <qwidget.h>
#include <qpe/windowdecorationinterface.h>
class QVBox;
class QPopupMenu;
class SampleText;
class SampleWindow : public QWidget
{
Q_OBJECT
public:
SampleWindow( QWidget *parent );
QSize sizeHint() const;
virtual void setFont( const QFont &f );
void setStyle2 ( QStyle *sty );
void setDecoration( WindowDecorationInterface *i );
void setPalette ( const QPalette & );
virtual void paintEvent( QPaintEvent * );
void init();
virtual bool eventFilter( QObject *, QEvent *e );
virtual void paletteChange( const QPalette &old );
virtual void resizeEvent( QResizeEvent *re );
public slots:
void fixGeometry();
protected:
WindowDecorationInterface *iface;
WindowDecorationInterface::WindowData wd;
QVBox *container;
QPopupMenu *popup;
int th;
int tb;
int lb;
int rb;
int bb;
};
#endif
diff --git a/noncore/settings/appearance2/stylelistitem.h b/noncore/settings/appearance2/stylelistitem.h
index bbfbd41..c0258e0 100644
--- a/noncore/settings/appearance2/stylelistitem.h
+++ b/noncore/settings/appearance2/stylelistitem.h
@@ -1,113 +1,112 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
- _;:,     .>    :=|. This library is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+ _;:,     .>    :=|. 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 library is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    .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
-..}^=.=       =       ; Library General Public License for more
-++=   -.     .`     .: details.
- :     =  ...= . :.=-
- -.   .:....=;==+<; You should have received a copy of the GNU
-  -_. . .   )=.  = Library General Public License along with
-    --        :-=` this library; see the file COPYING.LIB.
- If not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330,
+  _.=:.       :    :=>`: 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 STYLELISTITEM_H
#define STYLELISTITEM_H
#include <qlistbox.h>
#include <qpe/styleinterface.h>
#include <stdio.h>
class StyleListItem : public QListBoxText {
public:
StyleListItem ( const QString &t, QStyle *sty ) : QListBoxText ( t )
{
m_lib = 0;
m_style_if = 0;
m_settings_if = 0;
m_style = sty;
}
StyleListItem ( QLibrary *lib, StyleInterface *iface ) : QListBoxText ( iface-> name ( ))
{
m_lib = lib;
m_style_if = iface;
m_settings_if = 0;
m_style = iface-> create ( );
iface-> queryInterface ( IID_StyleSettings, (QUnknownInterface **) &m_settings_if );
}
virtual ~StyleListItem ( )
{
delete m_style;
if ( m_settings_if )
m_settings_if-> release ( );
if ( m_style_if )
m_style_if-> release ( );
delete m_lib;
}
bool hasSettings ( ) const
{
return ( m_settings_if );
}
QWidget *settings ( QWidget *parent )
{
return m_settings_if ? m_settings_if-> create ( parent ) : 0;
}
bool setSettings ( bool accepted )
{
if ( !m_settings_if )
return false;
if ( accepted )
return m_settings_if-> accept ( );
else {
m_settings_if-> reject ( );
return false;
}
}
QString key ( )
{
if ( m_style_if )
return QString ( m_style_if-> key ( ));
else
return text ( );
}
QStyle *style ( )
{
return m_style;
}
private:
QLibrary *m_lib;
QStyle *m_style;
StyleInterface *m_style_if;
StyleSettingsInterface *m_settings_if;
};
#endif