summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-04-19 21:43:29 (UTC)
committer harlekin <harlekin>2002-04-19 21:43:29 (UTC)
commit59aeb3bb66ad382201fe1e2cc3066564240d1cc1 (patch) (side-by-side diff)
treee2d5721765a6dc269d2a58bef5c02ccc11d459e5
parent7ea4abeb652e6787e57a938e1ca028d25fd249ce (diff)
downloadopie-59aeb3bb66ad382201fe1e2cc3066564240d1cc1.zip
opie-59aeb3bb66ad382201fe1e2cc3066564240d1cc1.tar.gz
opie-59aeb3bb66ad382201fe1e2cc3066564240d1cc1.tar.bz2
launch ALSO qtmail by clicking on mail icon
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index f5ed8d2..1cb4881 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -358,192 +358,195 @@ void Today::getMail() {
int OUTGOING = cfg.readNumEntry("outgoing",0);
QString output = tr("<b>%1</b> new mail(s), <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING);
MailField->setText(output);
}
/*
* Get the todos
*/
void Today::getTodo() {
QString output;
QString tmpout;
int count = 0;
int ammount = 0;
// get overdue todos first
QValueList<ToDoEvent> overDueList = todo->overDue();
qBubbleSort(overDueList);
for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin();
it!=overDueList.end(); ++it ) {
if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) {
tmpout += "<font color=#e00000><b>-" +((*it).description()).mid(0, MAX_CHAR_CLIP) + "</b></font><br>";
ammount++;
}
}
// get total number of still open todos
QValueList<ToDoEvent> open = todo->rawToDos();
qBubbleSort(open);
for ( QValueList<ToDoEvent>::Iterator it=open.begin();
it!=open.end(); ++it ) {
if (!(*it).isCompleted()){
count +=1;
// not the overdues, we allready got them, and not if we are
// over the maxlines
if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) {
tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>";
ammount++;
}
}
}
if (count > 0) {
if( count == 1 ) {
output = tr("There is <b> 1</b> active task: <br>" );
} else {
output = tr("There are <b> %1</b> active tasks: <br>").arg(count);
}
output += tmpout;
} else {
output = tr("No active tasks");
}
TodoField->setText(tr(output));
}
/*
* launches datebook
*/
void Today::startDatebook() {
QCopEnvelope e("QPE/System", "execute(QString)");
e << QString("datebook");
}
/*
* starts the edit dialog as known from datebook
*/
extern QPEApplication *todayApp;
void Today::editEvent(const Event &e) {
startDatebook();
while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents();
QCopEnvelope env("QPE/Datebook", "editEvent(int)");
env << e.uid();
}
/*
* launches todolist
*/
void Today::startTodo() {
QCopEnvelope e("QPE/System", "execute(QString)");
e << QString("todolist");
}
/*
* launch opiemail
*/
void Today::startMail() {
QCopEnvelope e("QPE/System", "execute(QString)");
e << QString("opiemail");
+//Right now start both, maybe decide which to rum via config file ..
+ QCopEnvelope e("QPE/System", "execute(QString)");
+ e << QString("qtmail");
}
Today::~Today() {
}
/*
* Gets the events for the current day, if it should get all dates
*/
DateBookEvent::DateBookEvent(const EffectiveEvent &ev,
QWidget* parent = 0,
int SHOW_LOCATION = 0,
int SHOW_NOTES = 0,
const char* name = 0,
WFlags fl = 0) :
ClickableLabel(parent,name,fl), event(ev) {
QString msg;
//QTime time = QTime::currentTime();
Config config( "qpe" );
// if 24 h format
ampm = config.readBoolEntry( "AMPM", TRUE );
if (!ONLY_LATER) {
msg += "<B>" + (ev).description() + "</B>";
if ( (ev).event().hasAlarm() ) {
msg += " <b>[with alarm]</b>";
}
// include location or not
if (SHOW_LOCATION == 1) {
msg += "<BR><i>" + (ev).location() + "</i>";
}
if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) {
msg += "<br>All day";
} else {
// start time of event
msg += "<br>" + ampmTime(QTime((ev).event().start().time()) )
// end time of event
+ "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) );
}
// include possible note or not
if (SHOW_NOTES == 1) {
msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP);
}
}
setText(msg);
connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) );
}
QString DateBookEvent::ampmTime(QTime tm) {
QString s;
if( ampm ) {
int hour = tm.hour();
if (hour == 0)
hour = 12;
if (hour > 12)
hour -= 12;
s.sprintf( "%2d:%02d %s", hour, tm.minute(),
(tm.hour() >= 12) ? "PM" : "AM" );
return s;
} else {
s.sprintf( "%2d:%02d", tm.hour(), tm.minute() );
return s;
}
}
DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev,
QWidget* parent = 0,
int SHOW_LOCATION = 0,
int SHOW_NOTES = 0,
const char* name = 0,
WFlags fl = 0) :
ClickableLabel(parent,name,fl), event(ev) {
QString msg;
QTime time = QTime::currentTime();
Config config( "qpe" );
// if 24 h format
ampm = config.readBoolEntry( "AMPM", TRUE );
if ((time.toString() <= TimeString::dateString((ev).event().end())) ) {
// show only later appointments
msg += "<B>" + (ev).description() + "</B>";
if ( (ev).event().hasAlarm() ) {
msg += " <b>[with alarm]</b>";