summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp4
-rw-r--r--core/pim/datebook/opie-datebook.control2
2 files changed, 3 insertions, 3 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 76260e2..c0a744a 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -35,213 +35,213 @@
#include <qpe/qpedebug.h>
#include <qpe/event.h>
#include <qpe/finddialog.h>
#include <qpe/ir.h>
#include <qpe/qpemenubar.h>
#include <qpe/qpemessagebox.h>
#include <qpe/resource.h>
#include <qpe/sound.h>
#include <qpe/timestring.h>
#include <qpe/qpetoolbar.h>
#include <qpe/tzselect.h>
#include <qpe/xmlreader.h>
#include <qaction.h>
#include <qcopchannel_qws.h>
#include <qdatetime.h>
#include <qdialog.h>
#include <qfile.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qpushbutton.h>
#include <qregexp.h>
#include <qtextcodec.h>
#include <qtextstream.h>
#include <qtimer.h>
#include <qtl.h>
#include <qwidgetstack.h>
#include <qwindowsystem_qws.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#define DAY 1
#define WEEK 2
#define WEEKLST 4
#define MONTH 3
DateBook::DateBook( QWidget *parent, const char *, WFlags f )
: QMainWindow( parent, "datebook", f ),
aPreset( FALSE ),
presetTime( -1 ),
startTime( 8 ), // an acceptable default
rowStyle( 0 ),
bJumpToCurTime(FALSE),
syncing(FALSE),
inSearch(FALSE),
alarmCounter(0)
{
bool needEvilHack= false; // if we need an Evil Hack
QTime t;
t.start();
db = new DateBookDBHack;
qDebug("loading db t=%d", t.elapsed() );
loadSettings();
setCaption( tr("Calendar") );
setIcon( Resource::loadPixmap( "datebook_icon" ) );
setToolBarsMovable( FALSE );
views = new QWidgetStack( this );
setCentralWidget( views );
dayView = 0;
weekView = 0;
weekLstView = 0;
monthView = 0;
QPEToolBar *bar = new QPEToolBar( this );
bar->setHorizontalStretchable( TRUE );
QPEMenuBar *mb = new QPEMenuBar( bar );
mb->setMargin( 0 );
QPEToolBar *sub_bar = new QPEToolBar(this);
QPopupMenu *view = new QPopupMenu( this );
QPopupMenu *settings = new QPopupMenu( this );
mb->insertItem( tr( "View" ), view );
mb->insertItem( tr( "Settings" ), settings );
QActionGroup *g = new QActionGroup( this );
g->setExclusive( TRUE );
QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
a->addTo( sub_bar );
- a = new QAction( tr( "Today" ), Resource::loadPixmap( "to_day" ), QString::null, 0, g, 0 );
+ a = new QAction( tr( "Today" ), Resource::loadPixmap( "datebook/to_day" ), QString::null, 0, g, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( slotToday() ) );
a->addTo( sub_bar );
a->addTo( view );
a = new QAction( tr( "Day" ), Resource::loadPixmap( "day" ), QString::null, 0, g, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( viewDay() ) );
a->addTo( sub_bar );
a->addTo( view );
a->setToggleAction( TRUE );
a->setOn( TRUE );
dayAction = a;
a = new QAction( tr( "Week" ), Resource::loadPixmap( "week" ), QString::null, 0, g, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( viewWeek() ) );
a->addTo( sub_bar );
a->addTo( view );
a->setToggleAction( TRUE );
weekAction = a;
- a = new QAction( tr( "WeekLst" ), Resource::loadPixmap( "weeklst" ), QString::null, 0, g, 0 );
+ a = new QAction( tr( "WeekLst" ), Resource::loadPixmap( "datebook/weeklst" ), QString::null, 0, g, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( viewWeekLst() ) );
a->addTo( sub_bar );
a->addTo( view );
a->setToggleAction( TRUE );
weekLstAction = a;
a = new QAction( tr( "Month" ), Resource::loadPixmap( "month" ), QString::null, 0, g, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( viewMonth() ) );
a->addTo( sub_bar );
a->addTo( view );
a->setToggleAction( TRUE );
monthAction = a;
a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), QString::null, 0, g, 0 );
connect( a, SIGNAL(activated()), this, SLOT(slotFind()) );
a->addTo( sub_bar );
a = new QAction( tr( "Alarm and Start Time..." ), QString::null, 0, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) );
a->addTo( settings );
QPopupMenu *default_view = new QPopupMenu(this);
settings->insertItem( tr( "Default View" ),default_view );
default_view->setCheckable(TRUE);
Config config("DateBook");
config.setGroup("Main");
int current=config.readNumEntry("defaultview", DAY);
QActionGroup *ag = new QActionGroup(this);
a = new QAction( tr( "Day" ), QString::null, 0, 0, 0, true );
if (current==DAY) a->setOn(true), viewDay();
ag->insert(a);
a = new QAction( tr( "Week" ), QString::null, 0, 0, 0, true );
if (current==WEEK) a->setOn(true), /*viewWeek(),*/ needEvilHack = true;
ag->insert(a);
a = new QAction( tr( "WeekLst" ), QString::null, 0, 0, 0, true );
if (current==WEEKLST) a->setOn(true), viewWeekLst();
ag->insert(a);
a = new QAction( tr( "Month" ), QString::null, 0, 0, 0, true );
if (current==MONTH) a->setOn(true), viewMonth();
ag->insert(a);
ag->addTo(default_view);
connect(ag, SIGNAL( selected ( QAction * ) ),
this, SLOT( newDefaultView(QAction *) )
);
connect( qApp, SIGNAL(clockChanged(bool)),
this, SLOT(changeClock(bool)) );
connect( qApp, SIGNAL(weekChanged(bool)),
this, SLOT(changeWeek(bool)) );
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)),
this, SLOT(appMessage(const QCString&, const QByteArray&)) );
#endif
// listen on QPE/System
#if defined(Q_WS_QWS)
#if !defined(QT_NO_COP)
QCopChannel *channel = new QCopChannel( "QPE/System", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
this, SLOT(receive(const QCString&, const QByteArray&)) );
channel = new QCopChannel( "QPE/Datebook", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
this, SLOT(receive(const QCString&, const QByteArray&)) );
qDebug("olle\n");
#endif
#endif
qDebug("done t=%d", t.elapsed() );
/*
* Here is a problem description:
* When Weekview is the default view
* a DateBookWeekView get's created
* redraw() get's called. So what?
* Remember that we're still in the c'tor
* and no final layout has happened? Ok
* now all Events get arranged. Their x
* position get's determined by a QHeader
* position. But the QHeader isn't layouted or
* at the right position. redraw() is a slot
* so we'll call it then via a singleShot
* from view()
*/
if( needEvilHack ){
QTimer::singleShot( 500, this, SLOT(viewWeek()) );
}
}
void DateBook::receive( const QCString &msg, const QByteArray &data )
{
QDataStream stream( data, IO_ReadOnly );
if ( msg == "timeChange(QString)" ) {
diff --git a/core/pim/datebook/opie-datebook.control b/core/pim/datebook/opie-datebook.control
index 9bef119..6cd96ff 100644
--- a/core/pim/datebook/opie-datebook.control
+++ b/core/pim/datebook/opie-datebook.control
@@ -1,9 +1,9 @@
-Files: bin/datebook apps/Applications/datebook.desktop
+Files: bin/datebook apps/Applications/datebook.desktop pics/datebook
Priority: optional
Section: opie/applications
Maintainer: Warwick Allison <warwick@trolltech.com>
Architecture: arm
Version: $QPE_VERSION-$SUB_VERSION
Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION)
Description: A datebook/appointment manager
A datebook/appointment manager for the Opie environment.