author | zecke <zecke> | 2002-06-23 18:48:50 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-23 18:48:50 (UTC) |
commit | a27191487361a43e3240a144176688c75e54b868 (patch) (side-by-side diff) | |
tree | 9ef647b417e522695ebd21234b4c88f0aa4e89c9 | |
parent | 25fbcaaa768b83cf0518aced5a76479617959769 (diff) | |
download | opie-a27191487361a43e3240a144176688c75e54b868.zip opie-a27191487361a43e3240a144176688c75e54b868.tar.gz opie-a27191487361a43e3240a144176688c75e54b868.tar.bz2 |
stupid me II
-rw-r--r-- | core/pim/datebook/datebook.pro | 2 | ||||
-rw-r--r-- | core/pim/datebook/datebookweeklst.cpp | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/core/pim/datebook/datebook.pro b/core/pim/datebook/datebook.pro index 2edbf99..088ae3e 100644 --- a/core/pim/datebook/datebook.pro +++ b/core/pim/datebook/datebook.pro @@ -1,62 +1,60 @@ TEMPLATE = app CONFIG += qt warn_on release DESTDIR = $(OPIEDIR)/bin HEADERS = datebookday.h \ datebook.h \ dateentryimpl.h \ datebookdayheaderimpl.h \ datebooksettings.h \ - datebooksettingsbase.h \ datebookweek.h \ datebookweeklst.h \ datebookweekheaderimpl.h \ repeatentry.h \ timepicker.h \ noteentryimpl.h \ onoteedit.h SOURCES = main.cpp \ datebookday.cpp \ datebook.cpp \ dateentryimpl.cpp \ datebookdayheaderimpl.cpp \ - datebooksettingsbase.cpp \ datebooksettings.cpp \ datebookweek.cpp \ datebookweeklst.cpp \ datebookweekheaderimpl.cpp \ repeatentry.cpp \ timepicker.cpp \ noteentryimpl.cpp \ onoteedit.cpp INTERFACES = dateentry.ui \ datebookdayheader.ui \ datebookweekheader.ui \ datebookweeklstheader.ui \ datebookweeklstdayhdr.ui \ repeatentrybase.ui \ datebooksettingsbase.ui \ noteentry.ui INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopie TARGET = datebook TRANSLATIONS = ../i18n/pt_BR/datebook.ts TRANSLATIONS += ../i18n/pt/datebook.ts TRANSLATIONS += ../i18n/de/datebook.ts TRANSLATIONS += ../i18n/en/datebook.ts TRANSLATIONS += ../i18n/hu/datebook.ts TRANSLATIONS += ../i18n/pl/datebook.ts TRANSLATIONS += ../i18n/sl/datebook.ts TRANSLATIONS += ../i18n/ja/datebook.ts TRANSLATIONS += ../i18n/ko/datebook.ts TRANSLATIONS += ../i18n/no/datebook.ts TRANSLATIONS += ../i18n/zh_CN/datebook.ts TRANSLATIONS += ../i18n/zh_TW/datebook.ts TRANSLATIONS += ../i18n/fr/datebook.ts TRANSLATIONS += ../i18n/es/datebook.ts diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp index 58a9c53..29519c1 100644 --- a/core/pim/datebook/datebookweeklst.cpp +++ b/core/pim/datebook/datebookweeklst.cpp @@ -1,158 +1,158 @@ #include "datebookweeklst.h" #include "datebookweekheaderimpl.h" #include <qpe/calendar.h> #include <qpe/datebookdb.h> #include <qpe/event.h> #include <qpe/qpeapplication.h> #include <qpe/timestring.h> #include <qpe/datebookmonth.h> #include <qpe/config.h> #include <qdatetime.h> #include <qheader.h> #include <qlabel.h> #include <qlayout.h> #include <qpainter.h> #include <qpopupmenu.h> #include <qtimer.h> #include <qstyle.h> #include <qtoolbutton.h> #include <qvbox.h> #include <qsizepolicy.h> #include <qabstractlayout.h> #include <qtl.h> bool calcWeek(const QDate &d, int &week, int &year, bool startOnMonday = false); -DateBookWeekLstHeader::DateBookWeekLstHeader(bool /*onM*/, QWidget* parent, +DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, const char* name, WFlags fl) : DateBookWeekLstHeaderBase(parent, name, fl) { setBackgroundMode( PaletteButton ); labelDate->setBackgroundMode( PaletteButton ); labelWeek->setBackgroundMode( PaletteButton ); forward->setBackgroundMode( PaletteButton ); back->setBackgroundMode( PaletteButton ); DateBookWeekLstHeaderBaseLayout->setSpacing(0); DateBookWeekLstHeaderBaseLayout->setMargin(0); //setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding)); setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); connect(back, SIGNAL(clicked()), this, SLOT(prevWeek())); connect(forward, SIGNAL(clicked()), this, SLOT(nextWeek())); connect(labelWeek, SIGNAL(clicked()), this, SLOT(pickDate())); connect(dbl, SIGNAL(toggled(bool)), this, SIGNAL(setDbl(bool))); onMonday=onM; } DateBookWeekLstHeader::~DateBookWeekLstHeader(){} void DateBookWeekLstHeader::setDate(const QDate &d) { date=d; int year,week; calcWeek(d,week,year,onMonday); labelWeek->setText("W: " + QString::number(week)); QDate start=date; QDate stop=start.addDays(6); labelDate->setText( QString::number(start.day()) + " " + start.monthName(start.month()) + " - " + QString::number(stop.day()) + " " + start.monthName(stop.month()) ); emit dateChanged(year,week); } void DateBookWeekLstHeader::pickDate() { static QPopupMenu *m1 = 0; static DateBookMonth *picker = 0; if ( !m1 ) { m1 = new QPopupMenu( this ); picker = new DateBookMonth( m1, 0, TRUE ); m1->insertItem( picker ); connect( picker, SIGNAL( dateClicked( int, int, int ) ), this, SLOT( setDate( int, int, int ) ) ); //connect( m1, SIGNAL( aboutToHide() ), //this, SLOT( gotHide() ) ); } picker->setDate( date.year(), date.month(), date.day() ); m1->popup(mapToGlobal(labelWeek->pos()+QPoint(0,labelWeek->height()))); picker->setFocus(); } void DateBookWeekLstHeader::setDate(int y, int m, int d) { QDate new_date(y,m,d); setDate(new_date); } void DateBookWeekLstHeader::nextWeek() { setDate(date.addDays(7)); } void DateBookWeekLstHeader::prevWeek() { setDate(date.addDays(-7)); } -DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM, +DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool /*onM*/, QWidget* parent, const char* name, WFlags fl ) : DateBookWeekLstDayHdrBase(parent, name, fl) { date=d; static const char *wdays="MTWTFSS"; char day=wdays[d.dayOfWeek()-1]; label->setText( QString(QChar(day)) + " " + QString::number(d.day()) ); add->setText("+"); if (d == QDate::currentDate()) { QPalette pal=label->palette(); pal.setColor(QColorGroup::Foreground, QColor(0,0,255)); label->setPalette(pal); /* QFont f=label->font(); f.setItalic(true); label->setFont(f); label->setPalette(QPalette(QColor(0,0,255),label->backgroundColor())); */ } else if (d.dayOfWeek() == 7) { // FIXME: Match any holiday QPalette pal=label->palette(); pal.setColor(QColorGroup::Foreground, QColor(255,0,0)); label->setPalette(pal); } connect (label, SIGNAL(clicked()), this, SLOT(showDay())); connect (add, SIGNAL(clicked()), this, SLOT(newEvent())); } void DateBookWeekLstDayHdr::showDay() { emit showDate(date.year(), date.month(), date.day()); } void DateBookWeekLstDayHdr::newEvent() { QDateTime start, stop; start=stop=date; start.setTime(QTime(10,0)); stop.setTime(QTime(12,0)); emit addEvent(start,stop,""); } DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, QWidget* parent, const char* name, WFlags fl) : OClickableLabel(parent,name,fl), event(ev) { char s[10]; if ( ev.startDate() != ev.date() ) { // multiday event (not first day) if ( ev.endDate() == ev.date() ) { // last day strcpy(s, "__|__"); } else { strcpy(s, " |---"); } } else { sprintf(s,"%.2d:%.2d",ev.start().hour(),ev.start().minute()); } |