summaryrefslogtreecommitdiff
path: root/core/pim/datebook/dateentryimpl.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/datebook/dateentryimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/dateentryimpl.cpp6
1 files changed, 3 insertions, 3 deletions
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
@@ -338,211 +338,211 @@ void DateEntry::startDateChanged( int y, int m, int d )
* public slot
*/
void DateEntry::startTimeEdited( const QString &s )
{
startTimeChanged(parseTime(s,ampm));
updateTimeEdit(false,true);
timePickerStart->setHour(startTime.hour());
timePickerStart->setMinute(startTime.minute());
}
void DateEntry::startTimeChanged( const QTime &t )
{
int duration=startTime.secsTo(endTime);
startTime = t;
endTime=t.addSecs(duration);
}
void DateEntry::startTimePicked( const QTime &t ) {
if(m_showStart ){
startTimeChanged(t);
updateTimeEdit(true,true);
}else{
endTimeChanged(t);
updateTimeEdit(false, true );
}
}
/*
* public slot
*/
void DateEntry::typeChanged( const QString &s )
{
bool b = s != "All Day";
buttonStart->setEnabled( b );
comboStart->setEnabled( b );
comboEnd->setEnabled( b );
}
void DateEntry::slotRepeat()
{
// Work around for compiler Bug..
RepeatEntry *e;
// it is better in my opinion to just grab this from the mother,
// since, this dialog doesn't need to keep track of it...
if ( rp.type != Event::NoRepeat )
e = new RepeatEntry( startWeekOnMonday, rp, startDate, this);
else
e = new RepeatEntry( startWeekOnMonday, startDate, this );
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 );
else
comboSound->setCurrentItem( 0 );
}
void DateEntry::initCombos()
{
/*
comboStart->clear();
comboEnd->clear();
if ( ampm ) {
for ( int i = 0; i < 24; i++ ) {
if ( i == 0 ) {
comboStart->insertItem( "12:00 AM" );
comboStart->insertItem( "12:30 AM" );
comboEnd->insertItem( "12:00 AM" );
comboEnd->insertItem( "12:30 AM" );
} else if ( i == 12 ) {
comboStart->insertItem( "12:00 PM" );
comboStart->insertItem( "12:30 PM" );
comboEnd->insertItem( "12:00 PM" );
comboEnd->insertItem( "12:30 PM" );
} else if ( i > 12 ) {
comboStart->insertItem( QString::number( i - 12 ) + ":00 PM" );
comboStart->insertItem( QString::number( i - 12 ) + ":30 PM" );
comboEnd->insertItem( QString::number( i - 12 ) + ":00 PM" );
comboEnd->insertItem( QString::number( i - 12 ) + ":30 PM" );
} else {
comboStart->insertItem( QString::number( i) + ":00 AM" );
comboStart->insertItem( QString::number( i ) + ":30 AM" );
comboEnd->insertItem( QString::number( i ) + ":00 AM" );
comboEnd->insertItem( QString::number( i ) + ":30 AM" );
}
}
} else {
for ( int i = 0; i < 24; i++ ) {
if ( i < 10 ) {
comboStart->insertItem( QString("0")
+ QString::number(i) + ":00" );
comboStart->insertItem( QString("0")
+ QString::number(i) + ":30" );
comboEnd->insertItem( QString("0")
+ QString::number(i) + ":00" );
comboEnd->insertItem( QString("0")
+ QString::number(i) + ":30" );
} else {
comboStart->insertItem( QString::number(i) + ":00" );
comboStart->insertItem( QString::number(i) + ":30" );
comboEnd->insertItem( QString::number(i) + ":00" );