author | zautrix <zautrix> | 2005-07-05 10:58:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-05 10:58:25 (UTC) |
commit | ea75d46072630883fae6ededd4af1d3c427ff59f (patch) (side-by-side diff) | |
tree | 60c96620f59441cf0ff998e7e4edd5b2bc8007d9 | |
parent | 7e49703511de87f624cc8813b18ebbfcc01752cd (diff) | |
download | kdepimpi-ea75d46072630883fae6ededd4af1d3c427ff59f.zip kdepimpi-ea75d46072630883fae6ededd4af1d3c427ff59f.tar.gz kdepimpi-ea75d46072630883fae6ededd4af1d3c427ff59f.tar.bz2 |
fixx
-rw-r--r-- | korganizer/koagenda.cpp | 23 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 15 | ||||
-rw-r--r-- | korganizer/kofilterview.cpp | 23 | ||||
-rw-r--r-- | korganizer/kofilterview.h | 1 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 6 | ||||
-rw-r--r-- | korganizer/koprefs.h | 4 | ||||
-rw-r--r-- | microkde/kglobalsettings.cpp | 9 | ||||
-rw-r--r-- | microkde/kglobalsettings.h | 1 |
8 files changed, 59 insertions, 23 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 662576f..92c1cd6 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -86,5 +86,5 @@ MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) MarcusBains::~MarcusBains() { - delete minutes; + //delete minutes; } @@ -152,8 +152,9 @@ void MarcusBains::updateLocation(bool recalculate) x+agenda->gridSpacingX()-mTimeBox->width()+offs-1, y-mTimeBox->height()); - mTimeBox->raise(); //mTimeBox->setAutoMask(true); - minutes->start(5000,true); + int secs = QTime::currentTime().second(); + qDebug("second %d ", secs ); + minutes->start( (60 - secs +1)*1000 ,true); } @@ -443,5 +444,5 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) if ( mInvalidPixmap ) { mInvalidPixmap = false; - qDebug("InvalidPixmap "); + qDebug("KO: Upsizing Pixmaps "); computeSizes(); emit updateViewSignal(); @@ -1277,5 +1278,5 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) if ( mInvalidPixmap ) { mInvalidPixmap = false; - qDebug("InvalidPixmap "); + qDebug("KO: Upsizing Pixmaps "); computeSizes(); emit updateViewSignal(); @@ -1418,5 +1419,5 @@ void KOAgenda::finishUpdate() item->repaint( false ); } - + marcus_bains(); } @@ -1801,5 +1802,4 @@ KOAgendaItem *KOAgenda::insertItem (Incidence *event,QDate qd,int X,int YTop,int //agendaItem->show(); - marcus_bains(); return agendaItem; @@ -1874,6 +1874,4 @@ void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, current = next; } - - marcus_bains(); } @@ -1960,5 +1958,5 @@ void KOAgenda::computeSizes() QPixmap* paintPixAll = KOAgendaItem::paintPixAllday(); if ( (paintPixAll->width() < cw || paintPixAll->height() < ch) && cw > 0 && ch > 0 ) { - qDebug("paintPixAll->resize "); + //qDebug("paintPixAll->resize "); paintPixAll->resize( cw, ch ); } @@ -1966,5 +1964,5 @@ void KOAgenda::computeSizes() QPixmap* paintPix = KOAgendaItem::paintPix(); if ( paintPix->width() < cw || paintPix->height() < ch ) { - qDebug("paintPix->resize "); + //qDebug("paintPix->resize "); paintPix->resize( cw , ch ); } @@ -1972,5 +1970,4 @@ void KOAgenda::computeSizes() checkScrollBoundaries(); - marcus_bains(); drawContentsToPainter(); viewport()->repaint(false); @@ -2032,5 +2029,4 @@ void KOAgenda::updateConfig() mGridSpacingY = KOPrefs::instance()->mHourSize; calculateWorkingHours(); - marcus_bains(); } } @@ -2125,5 +2121,4 @@ void KOAgenda::setDateList(const DateList &selectedDates) { mSelectedDates = selectedDates; - marcus_bains(); } diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 1b21a71..ef5c4dd 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -77,5 +77,5 @@ extern int globalFlagBlockLabel; using namespace KOrg; -#define IDLETIMEOUT 15 +#define IDLETIMEOUT 45 TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : @@ -574,26 +574,28 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : connect( mAllDayAgenda, SIGNAL( signalClearSelection() ),mAgenda, SLOT( slotClearSelection()) ); connect( mAgenda, SIGNAL( signalClearSelection() ),mAllDayAgenda, SLOT( slotClearSelection()) ); +#ifndef DESKTOP_VERSION connect( mAllDayAgenda, SIGNAL( updateViewSignal() ),this, SLOT( fillAgenda()) ); connect( mAgenda, SIGNAL( updateViewSignal() ), this, SLOT( fillAgenda()) ); - connect( mAllDayAgenda, SIGNAL( sendPing() ),this, SLOT( startIdleTimeout()) ); connect( mAgenda, SIGNAL( sendPing() ), this, SLOT( startIdleTimeout()) ); - - mIdleTimer = new QTimer ( this );; connect(mIdleTimer,SIGNAL(timeout()),SLOT(slotIdleTimeout())); +#endif } void KOAgendaView::startIdleTimeout() { +#ifndef DESKTOP_VERSION mIdleStart = QDateTime::currentDateTime(); mIdleTimer->start( IDLETIMEOUT * 1000 ); +#endif } void KOAgendaView::slotIdleTimeout() { - qDebug("SECS TO %d ",mIdleStart.secsTo( QDateTime::currentDateTime() ) ); +#ifndef DESKTOP_VERSION + //qDebug("SECS TO %d ",mIdleStart.secsTo( QDateTime::currentDateTime() ) ); int secsfromstart = mIdleStart.secsTo( QDateTime::currentDateTime() ); mIdleTimer->stop(); bool isActice = topLevelWidget()->isActiveWindow(); - qDebug("KO: Active Window %d %d", isActice, isVisible()); + //qDebug("KO: Active Window %d %d", isActice, isVisible()); // we do nothing if we wake up from a suspend if ( secsfromstart > IDLETIMEOUT + 30 && isActice ) { @@ -607,4 +609,5 @@ void KOAgendaView::slotIdleTimeout() KOAgendaItem::paintPix()->resize( 20,20); KOAgendaItem::paintPixAllday()->resize( 20,20); +#endif } diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index ff80afc..7ce3f1f 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -38,4 +38,5 @@ #include <kiconloader.h> #include <kglobal.h> +#include <kglobalsettings.h> #include <kcolorbutton.h> #include <kmessagebox.h> @@ -399,9 +400,23 @@ int KOCalEditView::addCalendar( QString name, QString file, bool ask ) QFileInfo fi ( file ); + QString absFile = file; + bool isRelative = false; + if ( fi.isRelative() ) { + isRelative = true; + absFile = KGlobalSettings::calendarDir()+file; + fi.setFile( absFile ); + } else { + QString cd = KGlobalSettings::calendarDir(); + if ( file.left( cd.length() ) == cd ) { + isRelative = true; + file = fi.fileName (); + fi.setFile( absFile ); + } + } if (!fi.exists() ) { if ( ask ) - if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No ) + if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( KGlobal::formatMessage (absFile,0) ) )== KMessageBox::No ) return 0; - QFile fileIn( file ); + QFile fileIn( absFile ); if (!fileIn.open( IO_WriteOnly ) ) { KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); @@ -415,5 +430,7 @@ int KOCalEditView::addCalendar( QString name, QString file, bool ask ) KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); kkf->mName = name; - kkf->mFileName = file; + kkf->mFileName = absFile; + kkf->mSavedFileName = file; + kkf->isRelative = isRelative; emit calendarAdded( kkf->mCalNumber ); if ( ask ) diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index 4322299..be7b5b6 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h @@ -90,4 +90,5 @@ void checkValid() { if ( url->url().isEmpty() ) { KMessageBox::information( this, i18n("Sorry, the file name is empty!") ); + url->setURL( nameE->text() + ".ics" ); return; } diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index a886735..f1f1442 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -455,8 +455,10 @@ void KOPrefs::usrReadConfig() kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); + kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false ); kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); + kkf->mSavedFileName = fc.readEntry( prefix+"_SavedFileName", kkf->mFileName); kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); if ( kkf->mCalNumber == 1 ) { @@ -467,4 +469,6 @@ void KOPrefs::usrReadConfig() kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); } + if ( kkf->isRelative ) + kkf->mFileName = KGlobalSettings::calendarDir() + kkf->mSavedFileName; } @@ -553,6 +557,8 @@ void KOPrefs::usrWriteConfig() fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); + fc.writeEntry( prefix+"_isRelative", kkf->isRelative ); fc.writeEntry( prefix+"_Name", kkf->mName); fc.writeEntry( prefix+"_FileName", kkf->mFileName); + fc.writeEntry( prefix+"_SavedFileName", kkf->mSavedFileName); fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); } diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 7ec5327..0779e27 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -55,7 +55,9 @@ class KopiCalendarFile : public QObject mName = "Calendar"; mFileName = QDir::homeDirPath() + "/icalfile.ics"; + mSavedFileName = "icalfile.ics"; mCalNumber = 0; mDefaultColor = Qt::red; mErrorOnLoad = false; + isRelative = false; } bool isStandard; @@ -66,4 +68,6 @@ class KopiCalendarFile : public QObject QString mName; QString mFileName; + QString mSavedFileName; + bool isRelative; int mCalNumber; QColor mDefaultColor; diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index 3f8a630..2e483e9 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp @@ -64,4 +64,13 @@ QString KGlobalSettings::backupDataDir() return dir; } +QString KGlobalSettings::calendarDir() +{ + static QString dir; + if ( dir.isEmpty() ) { + dir = locateLocal( "data", "korganizer/d.ttl" ); + dir = dir.left ( dir.length() - 5); + } + return dir; +} QFont KGlobalSettings::toolBarFont() diff --git a/microkde/kglobalsettings.h b/microkde/kglobalsettings.h index 4e4d87c..977e5b6 100644 --- a/microkde/kglobalsettings.h +++ b/microkde/kglobalsettings.h @@ -23,4 +23,5 @@ class KGlobalSettings static QString timeTrackerDir(); static QString backupDataDir(); + static QString calendarDir(); /** |