summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-03 23:47:47 (UTC)
committer zautrix <zautrix>2005-06-03 23:47:47 (UTC)
commit0e0ac7a92ac2fe052b3e72d49e505a078b05e7f3 (patch) (side-by-side diff)
tree01c96ae843e7a988d6957a5353616b42e0b322da
parentaa0f7df485c3ff0c298d4924ac1e8a5e9e6da627 (diff)
downloadkdepimpi-0e0ac7a92ac2fe052b3e72d49e505a078b05e7f3.zip
kdepimpi-0e0ac7a92ac2fe052b3e72d49e505a078b05e7f3.tar.gz
kdepimpi-0e0ac7a92ac2fe052b3e72d49e505a078b05e7f3.tar.bz2
fixxx
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index c01be9b..5132f98 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -125,60 +125,60 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#else
#include <qprocess.h>
#endif
#ifdef DESKTOP_VERSION
#include <kabc/stdaddressbook.h>
#endif
using namespace KOrg;
using namespace KCal;
extern int globalFlagBlockAgenda;
extern int globalFlagBlockStartup;
MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent)
{
mAlarms = alarms;
setBackgroundColor( QColor( 86, 153, 205 ) );
QString mText = "<table width=\"100%\">\n";
//mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
#ifdef DESKTOP_VERSION
- mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>";
-#else
mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
+#else
+ mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>";
#endif
// mText += "<img src=\"";
// mText += ipath;
// mText += "\">";
//mEventDate = QDate::currentDate();
#ifdef DESKTOP_VERSION
- mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h1>";
-#else
mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>";
+#else
+ mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>";
#endif
mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
Incidence * inc = getNextInc( start );
int time = 0;
mText += "<table>";
while ( inc ) {
QDateTime dt ;
QString tempText = "<a ";
bool ok;
dt = inc->getNextOccurence( start, &ok );
if ( !ok ) continue;
if ( inc->type() == "Event" ) {
tempText += "href=\"event:";
} else if ( inc->type() == "Todo" ) {
tempText += "href=\"todo:";
}
tempText += inc->uid() + "\">";
if ( inc->type() == "Todo" )
tempText += i18n("Todo: ");
if ( inc->summary().length() > 0 )
tempText += inc->summary();
else
tempText += i18n("-no summary-");
@@ -629,58 +629,62 @@ void CalendarView::checkAlarms()
KConfig *config = KOGlobals::config();
config->setGroup( "AppRun" );
QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
int secs = config->readNumEntry( "LatestProgramStop" ) - 30;
secs -= ( 3600 * 24*3 ); // debug only
QDateTime latest = dt.addSecs ( secs );
qDebug("KO: Last termination on %s ", latest.toString().latin1());
QPtrList<Incidence> el = mCalendar->rawIncidences();
QPtrList<Incidence> al;
Incidence* inL = el.first();
while ( inL ) {
bool ok = false;
int offset = 0;
QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
if ( ok ) {
//qDebug("OK %s",next.toString().latin1());
if ( next < QDateTime::currentDateTime() ) {
al.append( inL );
qDebug("found missed alarm: %s ", inL->summary().latin1() );
}
}
inL = el.next();
}
if ( al.count() ) {
- QDialog dia ( this, "huhu", true );
- dia.setCaption( i18n("KO/Pi: Missing alarm notification!") );
- QVBoxLayout* lay = new QVBoxLayout( &dia );
- lay->setSpacing( 3 );
- lay->setMargin( 3 );
- MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( &dia, al, latest );
+ QDialog* dia = new QDialog( this, "huhu", false );
+ dia->setCaption( i18n("KO/Pi: Missing alarm notification!") );
+ QVBoxLayout* lay = new QVBoxLayout( dia );
+ lay->setSpacing( 0 );
+ lay->setMargin( 0 );
+ MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
lay->addWidget( matb );
- dia.resize(240,240);
- dia.exec();
+ int si = 220;
+ if ( QApplication::desktop()->width() > 470 )
+ si = 400;
+ dia->resize(si,si/2);
+ dia->setBackgroundColor( QColor( 255, 255, 255 ) );
+ dia->show();
}
}
void CalendarView::showDay( QDate d )
{
dateNavigator()->blockSignals( true );
dateNavigator()->selectDate( d );
dateNavigator()->blockSignals( false );
mViewManager->showDayView();
//dateNavigator()->selectDate( d );
}
void CalendarView::timerAlarm()
{
//qDebug("CalendarView::timerAlarm() ");
computeAlarm(mAlarmNotification );
}
void CalendarView::suspendAlarm()
{
//qDebug(" CalendarView::suspendAlarm() ");
computeAlarm(mSuspendAlarmNotification );
}