-rw-r--r-- | core/pim/today/plugins/datebook/datebookplugin.h | 3 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginconfig.h | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginimpl.h | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailplugin.h | 4 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailpluginimpl.h | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.h | 3 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginconfig.h | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginimpl.h | 2 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 2 | ||||
-rw-r--r-- | core/pim/today/today.h | 2 | ||||
-rw-r--r-- | libopie/todayconfigwidget.h (renamed from core/pim/today/todayconfigwidget.h) | 0 | ||||
-rw-r--r-- | libopie/todayplugininterface.h (renamed from core/pim/today/todayplugininterface.h) | 0 |
12 files changed, 11 insertions, 13 deletions
diff --git a/core/pim/today/plugins/datebook/datebookplugin.h b/core/pim/today/plugins/datebook/datebookplugin.h index 625c7cd..4d0f8e6 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.h +++ b/core/pim/today/plugins/datebook/datebookplugin.h @@ -1,44 +1,43 @@ /* * datebookplugin.h * * copyright : (c) 2002 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. * * * ***************************************************************************/ #ifndef DATEBOOK_PLUGIN_H #define DATEBOOK_PLUGIN_H #include <qstring.h> #include <qwidget.h> #include <opie/oclickablelabel.h> - -#include "../../todayplugininterface.h" +#include <opie/todayplugininterface.h> class DatebookPlugin : public TodayPluginObject { public: DatebookPlugin(); ~DatebookPlugin(); QString pluginName() const; double versionNumber() const; QString pixmapNameWidget() const; QWidget* widget( QWidget *); QString pixmapNameConfig() const; TodayConfigWidget* configWidget( QWidget *); QString appName() const; }; #endif diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.h b/core/pim/today/plugins/datebook/datebookpluginconfig.h index 99aa76c..feba9ee 100644 --- a/core/pim/today/plugins/datebook/datebookpluginconfig.h +++ b/core/pim/today/plugins/datebook/datebookpluginconfig.h @@ -1,48 +1,48 @@ #ifndef DATEBOOK_PLUGIN_CONFIG_H #define DATEBOOK_PLUGIN_CONFIG_H #include <qcheckbox.h> #include <qspinbox.h> -#include "../../todayconfigwidget.h" +#include <opie/todayconfigwidget.h> class DatebookPluginConfig : public TodayConfigWidget { public: DatebookPluginConfig( QWidget *parent, const char *name ); ~DatebookPluginConfig(); void writeConfig(); private: /** * if changed then save */ bool changed(); void readConfig(); QCheckBox* CheckBox2; QCheckBox* CheckBox1; QCheckBox* CheckBox3; QSpinBox* SpinBox1; // how many lines should be showed in the datebook section int m_max_lines_meet; // If location is to be showed too, 1 to activate it. int m_show_location; // if notes should be shown int m_show_notes; // should only later appointments be shown or all for the current day. int m_only_later; }; #endif diff --git a/core/pim/today/plugins/datebook/datebookpluginimpl.h b/core/pim/today/plugins/datebook/datebookpluginimpl.h index 037dff4..4dbb318 100644 --- a/core/pim/today/plugins/datebook/datebookpluginimpl.h +++ b/core/pim/today/plugins/datebook/datebookpluginimpl.h @@ -1,42 +1,42 @@ /* * datebookpluginimpl.h * * copyright : (c) 2002 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. * * * ***************************************************************************/ #ifndef DATEBOOK_PLUGIN_IMPL_H #define DATEBOOK_PLUGIN_IMPL_H -#include "../../todayplugininterface.h" +#include <opie/todayplugininterface.h> class DatebookPlugin; class DatebookPluginImpl : public TodayPluginInterface{ public: DatebookPluginImpl(); virtual ~DatebookPluginImpl(); QRESULT queryInterface( const QUuid &, QUnknownInterface** ); Q_REFCOUNT virtual TodayPluginObject *guiPart(); private: DatebookPlugin *datebookPlugin; ulong ref; }; #endif diff --git a/core/pim/today/plugins/mail/mailplugin.h b/core/pim/today/plugins/mail/mailplugin.h index a27f4c7..d2a3dcb 100644 --- a/core/pim/today/plugins/mail/mailplugin.h +++ b/core/pim/today/plugins/mail/mailplugin.h @@ -1,47 +1,47 @@ /* * mailplugin.h * * copyright : (c) 2002 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. * * * ***************************************************************************/ #ifndef MAIL_PLUGIN_H #define MAIL_PLUGIN_H #include <qstring.h> #include <qwidget.h> #include <opie/tododb.h> #include <opie/oclickablelabel.h> -#include "../../todayplugininterface.h" -#include "../../todayconfigwidget.h" +#include <opie/todayplugininterface.h> +#include <opie/todayconfigwidget.h> class MailPlugin : public TodayPluginObject { public: MailPlugin(); ~MailPlugin(); QString pluginName() const; double versionNumber() const; QString pixmapNameWidget() const; QWidget* widget(QWidget *); QString pixmapNameConfig() const; TodayConfigWidget* configWidget(QWidget *); QString appName() const; }; #endif diff --git a/core/pim/today/plugins/mail/mailpluginimpl.h b/core/pim/today/plugins/mail/mailpluginimpl.h index 9930e6e..54412b2 100644 --- a/core/pim/today/plugins/mail/mailpluginimpl.h +++ b/core/pim/today/plugins/mail/mailpluginimpl.h @@ -1,40 +1,40 @@ /* * mailpluginimpl.h * * copyright : (c) 2002 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. * * * ***************************************************************************/ #ifndef MAIL_PLUGIN_IMPL_H #define MAIL_PLUGIN_IMPL_H -#include "../../todayplugininterface.h" +#include <opie/todayplugininterface.h> class MailPlugin; class MailPluginImpl : public TodayPluginInterface{ public: MailPluginImpl(); virtual ~MailPluginImpl(); QRESULT queryInterface( const QUuid &, QUnknownInterface** ); Q_REFCOUNT virtual TodayPluginObject *guiPart(); private: MailPlugin *mailPlugin; ulong ref; }; #endif diff --git a/core/pim/today/plugins/todolist/todoplugin.h b/core/pim/today/plugins/todolist/todoplugin.h index 2c03389..0a6669f 100644 --- a/core/pim/today/plugins/todolist/todoplugin.h +++ b/core/pim/today/plugins/todolist/todoplugin.h @@ -1,44 +1,43 @@ /* * todoplugin.h * * copyright : (c) 2002 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. * * * ***************************************************************************/ #ifndef TODOLIST_PLUGIN_H #define TODOLIST_PLUGIN_H #include <qstring.h> #include <qwidget.h> #include <opie/tododb.h> #include <opie/oclickablelabel.h> - -#include "../../todayplugininterface.h" +#include <opie/todayplugininterface.h> class TodolistPlugin : public TodayPluginObject { public: TodolistPlugin(); ~TodolistPlugin(); QString pluginName() const; double versionNumber() const; QString pixmapNameWidget() const; QWidget* widget(QWidget *); QString pixmapNameConfig() const; TodayConfigWidget* configWidget(QWidget *); QString appName() const; }; #endif diff --git a/core/pim/today/plugins/todolist/todopluginconfig.h b/core/pim/today/plugins/todolist/todopluginconfig.h index 26557d5..4584ebe 100644 --- a/core/pim/today/plugins/todolist/todopluginconfig.h +++ b/core/pim/today/plugins/todolist/todopluginconfig.h @@ -1,57 +1,57 @@ /* * todopluginconfig.h * * copyright : (c) 2002 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. * * * ***************************************************************************/ #ifndef TODOLIST_PLUGIN_CONFIG_H #define TODOLIST_PLUGIN_CONFIG_H #include <qwidget.h> #include <qspinbox.h> -#include "../../todayconfigwidget.h" +#include <opie/todayconfigwidget.h> class TodolistPluginConfig : public TodayConfigWidget { public: TodolistPluginConfig( QWidget *parent, const char *name ); ~TodolistPluginConfig(); private: /** * if changed then save */ bool changed(); void readConfig(); void writeConfig(); QSpinBox* SpinBox2; QSpinBox* SpinBoxClip; // how many lines should be showed in the todolist section int m_max_lines_task; // clip the lines after X chars int m_maxCharClip; }; #endif diff --git a/core/pim/today/plugins/todolist/todopluginimpl.h b/core/pim/today/plugins/todolist/todopluginimpl.h index 29e0294..c119be2 100644 --- a/core/pim/today/plugins/todolist/todopluginimpl.h +++ b/core/pim/today/plugins/todolist/todopluginimpl.h @@ -1,40 +1,40 @@ /* * todopluginimpl.h * * copyright : (c) 2002 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. * * * ***************************************************************************/ #ifndef TODOLIST_PLUGIN_IMPL_H #define TODOLIST_PLUGIN_IMPL_H -#include "../../todayplugininterface.h" +#include <opie/todayplugininterface.h> class TodolistPlugin; class TodolistPluginImpl : public TodayPluginInterface{ public: TodolistPluginImpl(); virtual ~TodolistPluginImpl(); QRESULT queryInterface( const QUuid &, QUnknownInterface** ); Q_REFCOUNT virtual TodayPluginObject *guiPart(); private: TodolistPlugin *todolistPlugin; ulong ref; }; #endif diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index f5f88f8..35758d5 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -1,327 +1,327 @@ /* * today.cpp * * copyright : (c) 2002 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. * * * ***************************************************************************/ #include "today.h" -#include "todayconfigwidget.h" +#include <opie/todayconfigwidget.h> #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/resource.h> #include <qpe/global.h> #include <qpe/qpeapplication.h> #include <qpe/contact.h> #include <qdir.h> #include <qfile.h> #include <qpushbutton.h> #include <qlabel.h> #include <qtimer.h> #include <qpixmap.h> #include <qlayout.h> #include <qhbox.h> #include <opie/otabwidget.h> #include <qdialog.h> struct TodayPlugin { QLibrary *library; TodayPluginInterface *iface; TodayPluginObject *guiPart; QWidget *guiBox; QString name; bool active; int pos; }; static QValueList<TodayPlugin> pluginList; Today::Today( QWidget* parent, const char* name, WFlags fl ) : TodayBase( parent, name, fl ) { QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); #if defined(Q_WS_QWS) #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 #endif setOwnerField(); refresh(); showMaximized(); } /** * Qcop receive method. */ void Today::channelReceived( const QCString &msg, const QByteArray & data ) { QDataStream stream( data, IO_ReadOnly ); if ( msg == "message(QString)" ) { QString message; stream >> message; setOwnerField( message ); } } /** * Initialises the owner field with the default value, the username */ void Today::setOwnerField() { QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); if ( QFile::exists( file ) ) { Contact cont = Contact::readVCard( file )[0]; QString returnString = cont.fullName(); OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); } else { OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); } } /** * Set the owner field with a given QString, for example per qcop. */ void Today::setOwnerField( QString &message ) { if ( !message.isEmpty() ) { OwnerField->setText( "<b>" + message + "</b>" ); } } /** * Init stuff needed for today. Reads the config file. */ void Today::init() { // read config Config cfg( "today" ); cfg.setGroup( "Plugins" ); m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); m_allApplets = cfg.readListEntry( "AllApplets", ',' ); } /** * Load the plugins */ void Today::loadPlugins() { QValueList<TodayPlugin>::Iterator tit; for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { (*tit).library->unload(); delete (*tit).library; } pluginList.clear(); QString path = QPEApplication::qpeDir() + "/plugins/today"; QDir dir( path, "lib*.so" ); QStringList list = dir.entryList(); QStringList::Iterator it; QMap<QString, TodayPlugin> tempList; for ( it = list.begin(); it != list.end(); ++it ) { TodayPluginInterface *iface = 0; QLibrary *lib = new QLibrary( path + "/" + *it ); qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); qDebug( QString(*it) ); TodayPlugin plugin; plugin.library = lib; plugin.iface = iface; plugin.name = QString(*it); // find out if plugins should be shown if ( m_excludeApplets.grep( *it ).isEmpty() ) { plugin.active = true; } else { plugin.active = false; } plugin.guiPart = plugin.iface->guiPart(); // package the whole thing into a qwidget so it can be shown and hidden plugin.guiBox = new QWidget( this ); QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); QPixmap plugPix; plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( 18, 18 ), 0 ); OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); plugIcon->setPixmap( plugPix ); // a scrollview for each plugin QScrollView* sv = new QScrollView( plugin.guiBox ); QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); // not sure if that is good .-) sv->setMinimumHeight( 10 ); sv->setResizePolicy( QScrollView::AutoOneFit ); sv->setHScrollBarMode( QScrollView::AlwaysOff ); sv->setFrameShape( QFrame::NoFrame ); sv->addChild( plugWidget ); // make sure the icon is on the top alligned boxLayout->addWidget( plugIcon, 0, AlignTop ); boxLayout->addWidget( sv, 0, AlignTop ); boxLayout->setStretchFactor( plugIcon, 1 ); boxLayout->setStretchFactor( sv, 9 ); // "prebuffer" it in one more list, to get the sorting done tempList.insert( plugin.name, plugin ); // on first start the list is off course empty if ( m_allApplets.isEmpty() ) { layout->addWidget( plugin.guiBox ); pluginList.append( plugin ); } } else { qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); delete lib; } } if ( !m_allApplets.isEmpty() ) { TodayPlugin tempPlugin; QStringList::Iterator stringit; for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { tempPlugin = ( tempList.find( *stringit ) ).data(); if ( !( (tempPlugin.name).isEmpty() ) ) { layout->addWidget( tempPlugin.guiBox ); pluginList.append( tempPlugin ); } } } } /** * Repaint method. Reread all fields. */ void Today::draw() { if ( pluginList.count() == 0 ) { QLabel *noPlugins = new QLabel( this ); noPlugins->setText( tr( "No plugins found" ) ); layout->addWidget( noPlugins ); return; } uint count = 0; TodayPlugin plugin; for ( uint i = 0; i < pluginList.count(); i++ ) { plugin = pluginList[i]; if ( plugin.active ) { // qDebug( plugin.name + " is ACTIVE " ); plugin.guiBox->show(); } else { // qDebug( plugin.name + " is INACTIVE" ); plugin.guiBox->hide(); } count++; } if ( count == 0 ) { QLabel *noPluginsActive = new QLabel( this ); noPluginsActive->setText( tr( "No plugins activated" ) ); layout->addWidget( noPluginsActive ); } layout->addStretch(0); } /** * The method for the configuration dialog. */ void Today::startConfig() { TodayConfig conf( this, "dialog", true ); TodayPlugin plugin; QList<TodayConfigWidget> configWidgetList; for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { plugin = pluginList[i]; // load the config widgets in the tabs if ( plugin.guiPart->configWidget( this ) != 0l ) { TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); configWidgetList.append( widget ); conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() , plugin.guiPart->appName() ); } // set the order/activate tab conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); } if ( conf.exec() == QDialog::Accepted ) { conf.writeConfig(); TodayConfigWidget *confWidget; for ( confWidget = configWidgetList.first(); confWidget != 0; confWidget = configWidgetList.next() ) { confWidget->writeConfig(); } refresh(); } } /** * Refresh for the view. Reload all applets * */ void Today::refresh() { init(); // set the date in top label QDate date = QDate::currentDate(); QString time = ( tr( date.toString() ) ); DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); if ( layout ) { delete layout; } layout = new QVBoxLayout( this ); layout->addWidget( Frame ); layout->addWidget( OwnerField ); loadPlugins(); draw(); } void Today::startAddressbook() { QCopEnvelope e( "QPE/System", "execute(QString)" ); e << QString( "addressbook" ); } /** * launch addressbook (personal card) */ void Today::editCard() { startAddressbook(); while( !QCopChannel::isRegistered( "QPE/Addressbook" ) ) { qApp->processEvents(); } QCopEnvelope v( "QPE/Addressbook", "editPersonalAndClose()" ); } Today::~Today() { } diff --git a/core/pim/today/today.h b/core/pim/today/today.h index b35c9b1..92512b9 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h @@ -1,73 +1,73 @@ /* * today.h * * copyright : (c) 2002 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. * * * ***************************************************************************/ #ifndef TODAY_H #define TODAY_H #include <opie/tododb.h> #include <qdatetime.h> #include <qlist.h> #include <qhbox.h> #include <qpe/qlibrary.h> #include <qpe/event.h> #include "todayconfig.h" #include "todaybase.h" -#include "todayplugininterface.h" +#include <opie/todayplugininterface.h> class QVBoxLayout; class Today : public TodayBase { Q_OBJECT public: Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~Today(); private slots: void startConfig(); void startAddressbook(); void editCard(); void refresh(); private: void init(); void setOwnerField(); void setOwnerField(QString &string); void loadPlugins(); void draw(); private slots: void channelReceived(const QCString &msg, const QByteArray & data); private: TodayConfig *conf; QStringList m_excludeApplets; QStringList m_allApplets; // QString m_autoStartTimer; int m_newStart; // int m_autoStart; int m_maxCharClip; }; #endif diff --git a/core/pim/today/todayconfigwidget.h b/libopie/todayconfigwidget.h index 48cf379..48cf379 100644 --- a/core/pim/today/todayconfigwidget.h +++ b/libopie/todayconfigwidget.h diff --git a/core/pim/today/todayplugininterface.h b/libopie/todayplugininterface.h index becb79c..becb79c 100644 --- a/core/pim/today/todayplugininterface.h +++ b/libopie/todayplugininterface.h |