summaryrefslogtreecommitdiff
authordrw <drw>2005-04-06 22:25:21 (UTC)
committer drw <drw>2005-04-06 22:25:21 (UTC)
commitcd1b15147d372d8786c855764d397553651c358d (patch) (side-by-side diff)
tree643479f1a84698f79227d7c8243921eacc3fe818
parent678c792dd69e42a15d8ac5eaaa9228dfd413ed4c (diff)
downloadopie-cd1b15147d372d8786c855764d397553651c358d.zip
opie-cd1b15147d372d8786c855764d397553651c358d.tar.gz
opie-cd1b15147d372d8786c855764d397553651c358d.tar.bz2
Use OResource for loading images and fix headers
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/main.cpp45
-rw-r--r--core/pim/today/today.cpp46
-rw-r--r--core/pim/today/today.h43
-rw-r--r--core/pim/today/todaybase.cpp54
-rw-r--r--core/pim/today/todaybase.h42
-rw-r--r--core/pim/today/todayconfig.cpp49
-rw-r--r--core/pim/today/todayconfig.h42
7 files changed, 209 insertions, 112 deletions
diff --git a/core/pim/today/main.cpp b/core/pim/today/main.cpp
index d63bc30..44b845c 100644
--- a/core/pim/today/main.cpp
+++ b/core/pim/today/main.cpp
@@ -1,25 +1,36 @@
/*
- * main.cpp
- *
- * ---------------------
- *
- * begin : Sun 10 17:20:00 CEST 2002
- * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß
- * email : max.reiss@gmx.de
- *
- */
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+                 This file is part of the Opie Project
+
+ Copyright (C) Maximilian Reiss <harlekin@handhelds.org>
+ =.
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library 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 program 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,
+ Boston, MA 02111-1307, USA.
+*/
#include "today.h"
#include <opie2/oapplicationfactory.h>
using namespace Opie::Core;
OPIE_EXPORT_APP( OApplicationFactory<Today> )
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 3e895a4..67b23e1 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -1,72 +1,86 @@
/*
- * today.cpp
- *
- * copyright : (c) 2002,2003,2004 by Maximilian Reiß
- * email : harlekin@handhelds.org
- *
- */
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+                 This file is part of the Opie Project
+
+ Copyright (C) Maximilian Reiss <harlekin@handhelds.org>
+ =.
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library 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 program 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,
+ Boston, MA 02111-1307, USA.
+*/
#include "today.h"
#include <opie2/odebug.h>
#include <opie2/opluginloader.h>
#include <opie2/oconfig.h>
+#include <opie2/oresource.h>
#include <qpe/qcopenvelope_qws.h>
-#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#include <qpe/contact.h>
#include <qdir.h>
#include <qtimer.h>
#include <qwhatsthis.h>
#include <qmessagebox.h>
using namespace Opie::Ui;
using Opie::Core::OPluginItem;
using Opie::Core::OPluginLoader;
using Opie::Core::OPluginManager;
using Opie::Core::OConfig;
struct TodayPlugin {
TodayPlugin() : iface( 0 ), guiPart( 0 ), guiBox( 0 ) {}
QInterfacePtr<TodayPluginInterface> iface;
TodayPluginObject *guiPart;
OPluginItem oplugin;
QWidget *guiBox;
QString name;
bool excludeRefresh;
};
static QMap<QString, TodayPlugin> pluginList;
Today::Today( QWidget* parent, const char* name, WFlags fl )
: TodayBase( parent, name, fl | WStyle_ContextHelp) {
setCaption( tr("Today") );
connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) );
connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) );
#if !defined(QT_NO_COP)
QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this );
connect ( todayChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) );
#endif
setOwnerField();
m_big_box = 0l;
m_bblayout = 0l;
layout = new QVBoxLayout( this );
layout->addWidget( Frame );
layout->addWidget( OwnerField );
@@ -173,97 +187,97 @@ void Today::loadShellContent() {
}
void Today::loadPluginWidgets() {
/*
* check if loading of Plugins crashed
*/
if( m_pluginLoader->isInSafeMode() ) {
QMessageBox::information(this, tr("Today Error"),
tr("<qt>The plugin '%1' caused Today to crash."
" It could be that the plugin is not properly"
" installed.<br>Today tries to continue loading"
" plugins.</qt>")
.arg( m_manager->crashedPlugin().name()));
}
OPluginItem::List lst = m_pluginLoader->filtered( true );
/*
* Show or Hide the information of no plugin installed
*/
if ( lst.isEmpty() )
m_informationLabel->show();
else
m_informationLabel->hide();
/*
* Now let us add the plugins
*/
m_big_box = new QWidget( m_sv->viewport() );
m_sv->addChild( m_big_box );
m_bblayout = new QVBoxLayout( m_big_box );
for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) {
TodayPluginInterface* iface = m_pluginLoader->load<TodayPluginInterface>( *it, IID_TodayPluginInterface );
TodayPlugin plugin;
plugin.iface = iface;
plugin.name = (*it).name();
plugin.oplugin = (*it);
plugin.guiPart = plugin.iface->guiPart();
plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh();
// package the whole thing into a qwidget so it can be shown and hidden
plugin.guiBox = new QWidget( m_big_box );
QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox );
QPixmap plugPix;
- plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 );
+ plugPix.convertFromImage( Opie::Core::OResource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 );
OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox );
plugIcon->setPixmap( plugPix );
QWhatsThis::add
( plugIcon, tr("Click here to launch the associated app") );
plugIcon->setName( plugin.guiPart->appName() );
connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) );
QWidget *plugWidget = plugin.guiPart->widget( plugin.guiBox );
boxLayout->addWidget( plugIcon, 0, AlignTop );
boxLayout->addWidget( plugWidget, 0, AlignTop );
boxLayout->setStretchFactor( plugIcon, 1 );
boxLayout->setStretchFactor( plugWidget, 9 );
pluginList.insert( plugin.name, plugin );
m_bblayout->addWidget(plugin.guiBox);
}
m_bblayout->addStretch( 1 );
m_big_box->show();
}
/**
* The method for the configuration dialog.
*/
void Today::startConfig() {
// disconnect timer to prevent problems while being on config dialog
disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
m_refreshTimer->stop( );
TodayConfig conf( this, "dialog", true );
conf.setUpPlugins( m_manager, m_pluginLoader );
if ( QPEApplication::execDialog(&conf) == QDialog::Accepted ) {
conf.writeConfig();
clearPluginWidgets();
loadShellContent();
loadPluginWidgets();
} else {
// since reinitialize is not called in that case , reconnect the signal
m_refreshTimer->start( 15000 ); // get the config value in here later
connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
}
}
/**
* Refresh for the view. Reload all applets
*
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index 8dbe9aa..dd828ac 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -1,63 +1,78 @@
/*
- * today.h
- *
- * copyright : (c) 2002,2003,2004 by Maximilian Reiß
- * email : harlekin@handhelds.org
- *
- */
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+                 This file is part of the Opie Project
+
+ Copyright (C) Maximilian Reiss <harlekin@handhelds.org>
+ =.
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library 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 program 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,
+ Boston, MA 02111-1307, USA.
+*/
+
#ifndef TODAY_H
#define TODAY_H
#include "todayconfig.h"
#include "todaybase.h"
#include <opie2/todayplugininterface.h>
#include <opie2/oclickablelabel.h>
#include <opie2/opluginloader.h>
#include <qpe/qlibrary.h>
#include <qscrollview.h>
#include <qvbox.h>
class QVBoxLayout;
namespace Opie {
namespace Core {
class OPluginManager;
class OPluginLoader;
}
}
class Today : public TodayBase {
Q_OBJECT
public:
Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~Today();
static QString appName() {
return QString::fromLatin1("today");
}
private slots:
void startConfig();
void startApplication();
void editCard();
void refresh();
private:
void setOwnerField();
void setOwnerField(QString &string);
void setRefreshTimer( int );
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index a89f454..931f45a 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -1,110 +1,124 @@
/*
- * todaybase.cpp
- *
- * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß
- * email : harlekin@handhelds.org
- *
- */
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+                 This file is part of the Opie Project
+
+ Copyright (C) Maximilian Reiss <harlekin@handhelds.org>
+ =.
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library 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 program 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,
+ Boston, MA 02111-1307, USA.
+*/
#include "todaybase.h"
+#include <opie2/oresource.h>
+
#include <qpe/applnk.h>
-#include <qpe/resource.h>
#include <qvbox.h>
#include <qwhatsthis.h>
using namespace Opie::Ui;
TodayBase::TodayBase( QWidget* parent, const char* name, WFlags )
: QWidget( parent, name, WStyle_ContextHelp ) {
- QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo
- QImage opiezillaimage = QImage( Resource::loadImage("logo/opielogo" ) );
+ QPixmap logo = Opie::Core::OResource::loadPixmap( "today/today_logo" ); // logo
+ QImage opiezillaimage = QImage( Opie::Core::OResource::loadImage( "logo/opielogo" ) );
opiezillaimage = opiezillaimage.smoothScale( 45, 45 );
QPixmap opiezilla; //the opiezilla
opiezilla.convertFromImage( opiezillaimage );
- QPixmap config;
- config.convertFromImage( Resource::loadImage( "SettingsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ QPixmap config = Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon );
layout = 0L;
QPalette pal = this->palette();
QColor col = pal.color( QPalette::Active, QColorGroup::Background );
pal.setColor( QPalette::Active, QColorGroup::Button, col );
pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
pal.setColor( QPalette::Normal, QColorGroup::Button, col );
pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
this->setPalette( pal );
// --- logo Section ---
QPalette pal2;
QColorGroup cg;
cg.setColor( QColorGroup::Text, white );
cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) );
pal2.setActive( cg );
// today logo
Frame = new QLabel( this, "Frame" );
Frame->setPalette( pal2 );
Frame->setFrameShape( QFrame::StyledPanel );
Frame->setFrameShadow( QFrame::Raised );
Frame->setLineWidth( 0 );
QHBoxLayout *frameLayout = new QHBoxLayout( Frame );
QVBox *box1 = new QVBox( Frame );
// Today text
TodayLabel = new QLabel( box1, "TodayText" );
QFont TodayLabel_font( TodayLabel->font() );
TodayLabel_font.setBold( TRUE );
TodayLabel_font.setPointSize( 40 );
TodayLabel->setFont( TodayLabel_font );
TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin );
TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" );
// date
DateLabel = new QLabel( box1, "TextLabel1" );
QFont DateLabel_font( DateLabel->font() );
DateLabel_font.setBold( TRUE );
DateLabel->setFont( DateLabel_font );
DateLabel->setBackgroundOrigin( QLabel::ParentOrigin );
DateLabel->setTextFormat( RichText );
// Opiezilla
Opiezilla = new QLabel( Frame, "OpieZilla" );
Opiezilla->setPixmap( opiezilla );
- QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) );
+ QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Rei�" ) );
Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin );
// Ownerfield
OwnerField = new OClickableLabel( this , "Owner" );
OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) );
// config
ConfigButton = new OClickableLabel ( Frame, "PushButton1" );
ConfigButton->setPixmap( config );
QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) );
ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin );
frameLayout->addWidget( box1, 1 );
frameLayout->addStretch( 1 );
frameLayout->addWidget( ConfigButton, 0, AlignBottom );
frameLayout->addWidget( Opiezilla );
}
/**
* D' tor
*/
TodayBase::~TodayBase() {
}
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h
index 6ee9bb2..5b34234 100644
--- a/core/pim/today/todaybase.h
+++ b/core/pim/today/todaybase.h
@@ -1,55 +1,69 @@
/*
- * todaybase.h
- *
- * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß
- * email : harlekin@handhelds.org
- *
- */
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+                 This file is part of the Opie Project
+
+ Copyright (C) Maximilian Reiss <harlekin@handhelds.org>
+ =.
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library 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 program 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,
+ Boston, MA 02111-1307, USA.
+*/
#ifndef TODAYBASE_H
#define TODAYBASE_H
#include <opie2/oclickablelabel.h>
#include <qlayout.h>
class QVBox;
class QGridLayout;
class QFrame;
class QLabel;
class QPushButton;
class QBoxLayout;
class TodayBase : public QWidget
{
Q_OBJECT
public:
TodayBase( QWidget* parent = 0, const char* name = 0, WFlags = 0 );
~TodayBase();
QFrame* Frame4;
QPushButton* DatesButton;
QVBoxLayout* layout;
Opie::Ui::OClickableLabel* OwnerField;
QLabel* Frame;
QLabel* DateLabel;
QFrame* Frame15;
QLabel* Opiezilla;
QLabel* TodayLabel;
Opie::Ui::OClickableLabel* ConfigButton;
};
#endif
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index 864c708..04a16e1 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -1,95 +1,110 @@
/*
- * todayconfig.cpp
- *
- * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß
- * email : harlekin@handhelds.org
- *
- */
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+                 This file is part of the Opie Project
+
+ Copyright (C) Maximilian Reiss <harlekin@handhelds.org>
+ =.
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library 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 program 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,
+ Boston, MA 02111-1307, USA.
+*/
#include "todayconfig.h"
#include <opie2/oconfig.h>
#include <opie2/opluginloader.h>
+#include <opie2/oresource.h>
#include <opie2/todayplugininterface.h>
-#include <qpe/resource.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qheader.h>
#include <qvbox.h>
#include <qtoolbutton.h>
#include <qwhatsthis.h>
using namespace Opie::Ui;
using Opie::Core::OConfig;
using Opie::Core::OPluginManager;
using Opie::Core::OPluginLoader;
using Opie::Core::OPluginItem;
class ToolButton : public QToolButton {
public:
ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE )
: QToolButton( parent, name ) {
- setPixmap( Resource::loadPixmap( icon ) );
+ setUsesBigPixmap( true );
+ setPixmap( Opie::Core::OResource::loadPixmap( icon, Opie::Core::OResource::SmallIcon ) );
setAutoRaise( TRUE );
setFocusPolicy( QWidget::NoFocus );
setToggleButton( t );
connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
}
};
/**
* The class has currently quite some duplicate code.
* By that way it would be real easy to have it as seperate app in settings tab
*
*/
TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
: QDialog( parent, name, modal, WStyle_ContextHelp ) {
setCaption( tr( "Today Config" ) );
QVBoxLayout *layout = new QVBoxLayout( this );
TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
layout->addWidget( TabWidget3 );
tab_2 = new QWidget( TabWidget3, "tab_2" );
QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 );
QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 );
tab2Layout->addWidget( l );
QHBox *hbox1 = new QHBox( tab_2 );
m_appletListView = new QListView( hbox1 );
m_appletListView->addColumn( "PluginList" );
m_appletListView->header()->hide();
m_appletListView->setSorting( -1 );
QWhatsThis::add
( m_appletListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the appearance order" ) );
QVBox *vbox1 = new QVBox( hbox1 );
new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) );
new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) );
tab2Layout->addWidget( hbox1 );
TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) );
// Misc tab
tab_3 = new QWidget( TabWidget3, "tab_3" );
QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 );
m_guiMisc = new TodayConfigMiscBase( tab_3 );
tab3Layout->addWidget( m_guiMisc );
TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) );
@@ -197,59 +212,59 @@ void TodayConfig::writeConfig() {
m_autoStart = m_guiMisc->CheckBoxAuto->isChecked();
cfg.writeEntry( "autostart", m_autoStart );
m_autoStartTimer = m_guiMisc->SpinBoxTime->value();
cfg.writeEntry( "autostartdelay", m_autoStartTimer );
m_iconSize = m_guiMisc->SpinBoxIconSize->value();
cfg.setGroup( "General" );
cfg.writeEntry( "IconSize", m_iconSize );
cfg.writeEntry( "HideBanner", m_guiMisc->CheckBoxHide->isChecked() );
cfg.writeEntry( "checkinterval", m_guiMisc->SpinRefresh->value()*1000 );
// set autostart settings
setAutoStart();
OPluginItem::List managedLst = m_pluginManager->managedPlugins();
for ( OPluginItem::List::Iterator it = managedLst.begin(); it != managedLst.end(); ++it ) {
TodayPluginInterface* iface = m_pluginLoader->load<TodayPluginInterface>( *it, IID_TodayPluginInterface );
if ( m_configMap.contains( iface ) )
m_configMap[iface]->writeConfig();
}
}
void TodayConfig::moveSelectedUp() {
QListViewItem *item = m_appletListView->selectedItem();
if ( item && item->itemAbove() ) {
item->itemAbove()->moveItem( item );
}
}
void TodayConfig::moveSelectedDown() {
QListViewItem *item = m_appletListView->selectedItem();
if ( item && item->itemBelow() ) {
item->moveItem( item->itemBelow() );
}
}
/**
* Set up the icons in the order/active tab
*/
void TodayConfig::pluginManagement( OPluginItem plugItem ) {
QCheckListItem *item = new QCheckListItem( m_appletListView, plugItem.name(), QCheckListItem::CheckBox );
TodayPluginInterface* iface = m_pluginLoader->load<TodayPluginInterface>( plugItem, IID_TodayPluginInterface );
- QPixmap icon = Resource::loadPixmap( iface->guiPart()->pixmapNameWidget() );
+ QPixmap icon = Opie::Core::OResource::loadPixmap( iface->guiPart()->pixmapNameWidget(), Opie::Core::OResource::SmallIcon );
if ( !icon.isNull() ) {
item->setPixmap( 0, icon );
}
item->setOn( plugItem.isEnabled() );
previousItem = item;
}
TodayConfig::~TodayConfig() {}
diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h
index 81120d3..d467996 100644
--- a/core/pim/today/todayconfig.h
+++ b/core/pim/today/todayconfig.h
@@ -1,63 +1,77 @@
/*
- * todayconfig.h
- *
- * copyright : (c) 2002,2003, 2004 by Maximilian Reiß
- * email : harlekin@handhelds.org
- *
- */
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+                 This file is part of the Opie Project
+
+ Copyright (C) Maximilian Reiss <harlekin@handhelds.org>
+ =.
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library 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 program 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,
+ Boston, MA 02111-1307, USA.
+*/
#ifndef TODAYCONFIG_H
#define TODAYCONFIG_H
#include "todayconfigmiscbase.h"
#include <opie2/otabwidget.h>
#include <opie2/opluginloader.h>
#include <qvariant.h>
#include <qdialog.h>
#include <qlistview.h>
class QCheckBox;
class QLabel;
class QSpinBox;
class QTabWidget;
class TodayConfigWidget;
class TodayPluginInterface;
namespace Opie {
namespace Core {
class OPluginManager;
class OPluginLoader;
class OPluginItem;
}
}
class TodayConfig : public QDialog {
Q_OBJECT
public:
TodayConfig( QWidget* parent = 0, const char* name = 0, bool modal = FALSE );
~TodayConfig();
Opie::Ui::OTabWidget* TabWidget3;
void writeConfig();
void setUpPlugins( Opie::Core::OPluginManager * plugManager, Opie::Core::OPluginLoader * plugLoader );
protected slots:
void moveSelectedUp();
void moveSelectedDown();
private:
void setAutoStart();
void readConfig();