summaryrefslogtreecommitdiff
path: root/core
authormickeyl <mickeyl>2004-04-04 17:05:29 (UTC)
committer mickeyl <mickeyl>2004-04-04 17:05:29 (UTC)
commit77185b587adfa158dadab204f3c78db94af3e099 (patch) (side-by-side diff)
treed0d7a2d3e756784ea259199d218b73c4770cdfd1 /core
parentdaef74a7e852855f781765fad7969b6c83e2e9c6 (diff)
downloadopie-77185b587adfa158dadab204f3c78db94af3e099.zip
opie-77185b587adfa158dadab204f3c78db94af3e099.tar.gz
opie-77185b587adfa158dadab204f3c78db94af3e099.tar.bz2
fix debugging stuff (see addressbook)
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp6
-rw-r--r--core/pim/datebook/datebookweekheaderimpl.cpp8
-rw-r--r--core/pim/datebook/datebookweeklst.cpp4
-rw-r--r--core/pim/datebook/dateentryimpl.cpp6
4 files changed, 12 insertions, 12 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 3d1bc0c..0a47bb8 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -27,97 +27,97 @@
#include "datebooksettings.h"
#include "datebookweek.h"
#include "datebookweeklst.h"
#include "dateentryimpl.h"
#include <opie2/odebug.h>
#include <qpe/datebookmonth.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/finddialog.h>
#include <qpe/ir.h>
#include <qpe/qpemessagebox.h>
#include <qpe/resource.h>
#include <qpe/sound.h>
#include <qpe/tzselect.h>
#include <qaction.h>
#include <qcopchannel_qws.h>
#include <qlayout.h>
#include <qmessagebox.h>
#include <qtimer.h>
#include <qtl.h>
#include <qtoolbar.h>
#include <qwidgetstack.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
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;
- Opie::Core::odebug << "loading db t=" << t.elapsed() << oendl;
+ odebug << "loading db t=" << t.elapsed() << oendl;
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;
// QToolBar *bar = new QToolBar( this );
// bar->setHorizontalStretchable( TRUE );
// QMenuBar *mb = new QMenuBar( bar );
// mb->setMargin( 0 );
// QPopupMenu *view = new QPopupMenu( this );
// mb->insertItem( tr( "View" ), view );
QToolBar *sub_bar = new QToolBar(this);
sub_bar->setHorizontalStretchable(TRUE);
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 );
sub_bar->addSeparator();
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 );
sub_bar->addSeparator();
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 );
@@ -131,97 +131,97 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
weekAction = a;
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;
sub_bar->addSeparator();
a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), QString::null, 0, this, 0 );
connect( a, SIGNAL(activated()), this, SLOT(slotFind()) );
a->addTo( sub_bar );
a = new QAction( tr( "Edit..." ), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) );
a->addTo( sub_bar );
if(defaultView==DAY) viewDay();
if(defaultView==WEEK) needEvilHack=true; // viewWeek();
if(defaultView==WEEKLST) viewWeekLst();
if(defaultView==MONTH) viewMonth();
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&)) );
#endif
#endif
- Opie::Core::odebug << "done t=" << t.elapsed() << oendl;
+ odebug << "done t=" << t.elapsed() << oendl;
connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) );
connect( qApp, SIGNAL( reload()), this, SLOT( reload() ) );
/*
* 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)" ) {
// update active view!
if ( dayAction->isOn() )
viewDay();
else if ( weekAction->isOn() )
viewWeek();
else if ( monthAction->isOn() )
viewMonth();
}
else if (msg == "editEvent(int)") {
int uid;
stream >> uid;
Event e=db->eventByUID(uid);
editEvent(e);
}else if (msg == "viewDefault(QDate)"){
QDate day;
stream >> day;
viewDefault(day);
}
}
DateBook::~DateBook()
{
@@ -857,97 +857,97 @@ void DateBook::slotNewEntry(const QDateTime &start, const QDateTime &end, const
Event ev;
ev.setDescription( str );
// When the new gui comes in, change this...
if(location==0) {
if(defaultLocation.isEmpty()) {
ev.setLocation(tr("(Unknown)"));
} else {
ev.setLocation( defaultLocation );
}
} else {
ev.setLocation(location);
}
ev.setCategories(defaultCategories);
ev.setStart( start );
ev.setEnd( end );
e = new DateEntry( onMonday, ev, ampm, &newDlg );
e->setAlarmEnabled( aPreset, presetTime, Event::Loud );
sv->addChild( e );
while ( QPEApplication::execDialog( &newDlg ) ) {
ev = e->event();
ev.assignUid();
QString error = checkEvent( ev );
if ( !error.isNull() ) {
if ( QMessageBox::warning( this, tr("Error!"), error, tr("Fix it"), tr("Continue"), 0, 0, 1 ) == 0 )
continue;
}
db->addEvent( ev );
emit newEvent();
break;
}
}
void DateBook::setDocument( const QString &filename )
{
if ( filename.find(".vcs") != int(filename.length()) - 4 ) return;
QValueList<Event> tl = Event::readVCalendar( filename );
for( QValueList<Event>::Iterator it = tl.begin(); it != tl.end(); ++it ) {
db->addEvent( *it );
}
}
static const char * beamfile = "/tmp/obex/event.vcs";
void DateBook::beamEvent( const Event &e )
{
- Opie::Core::odebug << "trying to beam" << oendl;
+ odebug << "trying to beam" << oendl;
unlink( beamfile ); // delete if exists
mkdir("/tmp/obex/", 0755);
Event::writeVCalendar( beamfile, e );
Ir *ir = new Ir( this );
connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
QString description = e.description();
ir->send( beamfile, description, "text/x-vCalendar" );
}
void DateBook::beamDone( Ir *ir )
{
delete ir;
unlink( beamfile );
}
void DateBook::slotFind()
{
// move it to the day view...
viewDay();
FindDialog frmFind( "Calendar", this ); // no tr needed
frmFind.setUseDate( true );
frmFind.setDate( currentDate() );
QObject::connect( &frmFind,
SIGNAL(signalFindClicked(const QString&,const QDate&,bool,bool,int)),
this,
SLOT(slotDoFind(const QString&,const QDate&,bool,bool,int)) );
QObject::connect( this,
SIGNAL(signalNotFound()),
&frmFind,
SLOT(slotNotFound()) );
QObject::connect( this,
SIGNAL(signalWrapAround()),
&frmFind,
SLOT(slotWrapAround()) );
frmFind.move(0,0);
frmFind.exec();
inSearch = false;
}
bool catComp( QArray<int> cats, int category )
{
bool returnMe;
int i,
count;
count = int(cats.count());
returnMe = false;
if ( (category == -1 && count == 0) || category == -2 )
diff --git a/core/pim/datebook/datebookweekheaderimpl.cpp b/core/pim/datebook/datebookweekheaderimpl.cpp
index 123a478..7462de7 100644
--- a/core/pim/datebook/datebookweekheaderimpl.cpp
+++ b/core/pim/datebook/datebookweekheaderimpl.cpp
@@ -24,100 +24,100 @@
#include <qpe/resource.h>
#include <qpe/datebookmonth.h>
#include <qtoolbutton.h>
/*
* Constructs a DateBookWeekHeader which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
DateBookWeekHeader::DateBookWeekHeader( bool startOnMonday, QWidget* parent, const char* name, WFlags fl )
: DateBookWeekHeaderBase( parent, name, fl ),
bStartOnMonday( startOnMonday )
{
setBackgroundMode( PaletteButton );
labelDate->setBackgroundMode( PaletteButton );
backmonth->setPixmap( Resource::loadPixmap("fastback") );
backweek->setPixmap( Resource::loadPixmap("back") );
forwardweek->setPixmap( Resource::loadPixmap("forward") );
forwardmonth->setPixmap( Resource::loadPixmap("fastforward") );
}
/*
* Destroys the object and frees any allocated resources
*/
DateBookWeekHeader::~DateBookWeekHeader()
{
// no need to delete child widgets, Qt does it all for us
}
void DateBookWeekHeader::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(labelDate->pos()+QPoint(0,labelDate->height())));
picker->setFocus();
}
void DateBookWeekHeader::nextMonth()
{
- Opie::Core::owarn << "nextMonth()" << oendl;
+ owarn << "nextMonth()" << oendl;
setDate(date.addDays(28));
}
void DateBookWeekHeader::prevMonth()
{
- Opie::Core::owarn << "prevMonth()" << oendl;
+ owarn << "prevMonth()" << oendl;
setDate(date.addDays(-28));
}
void DateBookWeekHeader::nextWeek()
{
- Opie::Core::owarn << "nextWeek()" << oendl;
+ owarn << "nextWeek()" << oendl;
setDate(date.addDays(7));
}
void DateBookWeekHeader::prevWeek()
{
- Opie::Core::owarn << "prevWeek()" << oendl;
+ owarn << "prevWeek()" << oendl;
setDate(date.addDays(-7));
}
void DateBookWeekHeader::setDate( int y, int m, int d )
{
setDate(QDate(y,m,d));
}
void DateBookWeekHeader::setDate(const QDate &d) {
int year,week,dayofweek;
date=d;
dayofweek=d.dayOfWeek();
if(bStartOnMonday)
dayofweek--;
else if( dayofweek == 7 )
// we already have the right day -7 would lead to the current week..
dayofweek = 0;
date=date.addDays(-dayofweek);
calcWeek(date,week,year,bStartOnMonday);
QDate start=date;
QDate stop=start.addDays(6);
labelDate->setText( QString::number(start.day()) + "." +
Calendar::nameOfMonth( start.month()) + "-" +
QString::number(stop.day()) + "." +
Calendar::nameOfMonth( stop.month()) +" ("+
tr("w")+":"+QString::number( week ) +")");
date = d; // bugfix: 0001126 - date has to be the selected date, not monday!
emit dateChanged(date);
}
void DateBookWeekHeader::setStartOfWeek( bool onMonday )
{
bStartOnMonday = onMonday;
setDate( date );
}
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index de74d46..fe2ab51 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -115,146 +115,146 @@ DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool /* onM */,
//dont use dayOfWeek() to save space !
label->setText( QString(QObject::tr(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,"",0);
}
DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev,
int weeklistviewconfig,
QWidget* parent,
const char* name,
WFlags fl ) : OClickableLabel(parent,name,fl), event(ev)
{
// old values... lastday = "__|__", middle=" |---", Firstday="00:00",
QString s,start,middle,end,day;
- Opie::Core::odebug << "weeklistviewconfig=" << weeklistviewconfig << oendl;
+ odebug << "weeklistviewconfig=" << weeklistviewconfig << oendl;
if(weeklistviewconfig==NONE) { // No times displayed.
// start.sprintf("%.2d:%.2d-",ev.start().hour(),ev.start().minute());
// middle.sprintf("<--->");
// end.sprintf("-%.2d:%.2d",ev.end().hour(),ev.end().minute());
// day.sprintf("%.2d:%.2d-%.2d:%.2d",ev.start().hour(),ev.start().minute(),ev.end().hour(),ev.end().minute());
} else if(weeklistviewconfig==NORMAL) { // "Normal", only display start time.
start.sprintf("%.2d:%.2d",ev.start().hour(),ev.start().minute());
middle.sprintf(" |---");
end.sprintf("__|__");
day.sprintf("%.2d:%.2d",ev.start().hour(),ev.start().minute());
} else if(weeklistviewconfig==EXTENDED) { // Extended mode, display start and end times.
start.sprintf("%.2d:%.2d-",ev.start().hour(),ev.start().minute());
middle.sprintf("<--->");
end.sprintf("-%.2d:%.2d",ev.end().hour(),ev.end().minute());
day.sprintf("%.2d:%.2d-%.2d:%.2d",ev.start().hour(),ev.start().minute(),ev.end().hour(),ev.end().minute());
}
if(ev.event().type() == Event::Normal) {
if(ev.startDate()==ev.date() && ev.endDate()==ev.date()) { // day event.
s=day;
} else if(ev.startDate()==ev.date()) { // start event.
s=start;
} else if(ev.endDate()==ev.date()) { // end event.
s=end;
} else { // middle day.
s=middle;
}
} else {
s="";
}
setText(QString(s) + " " + ev.description());
connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) );
}
void DateBookWeekLstEvent::editMe() {
emit editEvent(event.event());
}
DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
const QDate &d, bool onM,
QWidget* parent,
const char* name, WFlags fl)
: QWidget( parent, name, fl )
{
Config config("DateBook");
config.setGroup("Main");
int weeklistviewconfig=config.readNumEntry("weeklistviewconfig", NORMAL);
- Opie::Core::odebug << "weeklistviewconfig: " << weeklistviewconfig << oendl;
+ odebug << "weeklistviewconfig: " << weeklistviewconfig << oendl;
bStartOnMonday=onM;
setPalette(white);
setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
QVBoxLayout *layout = new QVBoxLayout( this );
qBubbleSort(ev);
QValueListIterator<EffectiveEvent> it;
it=ev.begin();
int dayOrder[7];
if (bStartOnMonday) {
for (int d=0; d<7; d++) dayOrder[d]=d+1;
} else {
for (int d=0; d<7; d++) dayOrder[d]=d;
dayOrder[0]=7;
}
// Calculate offset to first day of week.
int dayoffset=d.dayOfWeek();
if(bStartOnMonday) dayoffset--;
else if( dayoffset == 7 ) dayoffset = 0;
for (int i=0; i<7; i++) {
// Header
DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i-dayoffset), bStartOnMonday,this);
connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
connect(hdr, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)),
this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)));
layout->addWidget(hdr);
// Events
while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) {
if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) { // Skip events ending at 00:00 starting at another day.
DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,weeklistviewconfig,this);
layout->addWidget(l);
connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
}
it++;
}
layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding));
}
}
DateBookWeekLstView::~DateBookWeekLstView(){}
void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();}
DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp
index 42bdbe2..297da94 100644
--- a/core/pim/datebook/dateentryimpl.cpp
+++ b/core/pim/datebook/dateentryimpl.cpp
@@ -386,115 +386,115 @@ void DateEntry::slotRepeat()
if ( QPEApplication::execDialog( e ) ) {
rp = e->repeatPattern();
setRepeatLabel();
}
// deleting sounds like a nice idea...
delete e;
}
void DateEntry::slotChangeStartOfWeek( bool onMonday )
{
startWeekOnMonday = onMonday;
}
Event DateEntry::event()
{
Event ev;
Event::SoundTypeChoice st;
ev.setDescription( comboDescription->currentText() );
ev.setLocation( comboLocation->currentText() );
ev.setCategories( comboCategory->currentCategories() );
ev.setType( checkAllDay->isChecked() ? Event::AllDay : Event::Normal );
if ( startDate > endDate ) {
QDate tmp = endDate;
endDate = startDate;
startDate = tmp;
}
// This is now done in the changed slots
// startTime = parseTime( comboStart->text(), ampm );
//endTime = parseTime( comboEnd->text(), ampm );
if ( startTime > endTime && endDate == startDate ) {
QTime tmp = endTime;
endTime = startTime;
startTime = tmp;
}
// don't set the time if theres no need too
if ( ev.type() == Event::AllDay ) {
startTime.setHMS( 0, 0, 0 );
endTime.setHMS( 23, 59, 59 );
}
// adjust start and end times based on timezone
QDateTime start( startDate, startTime );
QDateTime end( endDate, endTime );
time_t start_utc, end_utc;
-// Opie::Core::odebug << "tz: " << timezone->currentZone() << oendl;
+// odebug << "tz: " << timezone->currentZone() << oendl;
// get real timezone
QString realTZ;
realTZ = QString::fromLocal8Bit( getenv("TZ") );
// set timezone
if ( setenv( "TZ", timezone->currentZone(), true ) != 0 )
- Opie::Core::owarn << "There was a problem setting the timezone." << oendl;
+ owarn << "There was a problem setting the timezone." << oendl;
// convert to UTC based on selected TZ (calling tzset internally)
start_utc = TimeConversion::toUTC( start );
end_utc = TimeConversion::toUTC( end );
// done playing around... put it all back
unsetenv( "TZ" );
if ( !realTZ.isNull() )
if ( setenv( "TZ", realTZ, true ) != 0 )
- Opie::Core::owarn << "There was a problem setting the timezone." << oendl;
+ owarn << "There was a problem setting the timezone." << oendl;
// convert UTC to local time (calling tzset internally)
ev.setStart( TimeConversion::fromUTC( start_utc ) );
ev.setEnd( TimeConversion::fromUTC( end_utc ) );
// we only have one type of sound at the moment... LOUD!!!
if ( comboSound->currentItem() != 0 )
st = Event::Loud;
else
st = Event::Silent;
ev.setAlarm( checkAlarm->isChecked(), spinAlarm->value(), st );
if ( rp.type != Event::NoRepeat )
ev.setRepeat( TRUE, rp );
ev.setNotes( noteStr );
//cout << "Start: " << comboStart->currentText() << endl;
return ev;
}
void DateEntry::setRepeatLabel()
{
switch( rp.type ) {
case Event::Daily:
cmdRepeat->setText( tr("Daily...") );
break;
case Event::Weekly:
cmdRepeat->setText( tr("Weekly...") );
break;
case Event::MonthlyDay:
case Event::MonthlyDate:
cmdRepeat->setText( tr("Monthly...") );
break;
case Event::Yearly:
cmdRepeat->setText( tr("Yearly...") );
break;
default:
cmdRepeat->setText( tr("No Repeat...") );
}
}
void DateEntry::setAlarmEnabled( bool alarmPreset, int presetTime, Event::SoundTypeChoice sound )
{
checkAlarm->setChecked( alarmPreset );
spinAlarm->setValue( presetTime );
if ( sound != Event::Silent )
comboSound->setCurrentItem( 1 );