author | zautrix <zautrix> | 2005-07-05 10:58:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-05 10:58:25 (UTC) |
commit | ea75d46072630883fae6ededd4af1d3c427ff59f (patch) (unidiff) | |
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) | |||
86 | MarcusBains::~MarcusBains() | 86 | MarcusBains::~MarcusBains() |
87 | { | 87 | { |
88 | delete minutes; | 88 | //delete minutes; |
89 | } | 89 | } |
90 | 90 | ||
@@ -152,8 +152,9 @@ void MarcusBains::updateLocation(bool recalculate) | |||
152 | x+agenda->gridSpacingX()-mTimeBox->width()+offs-1, | 152 | x+agenda->gridSpacingX()-mTimeBox->width()+offs-1, |
153 | y-mTimeBox->height()); | 153 | y-mTimeBox->height()); |
154 | |||
155 | mTimeBox->raise(); | 154 | mTimeBox->raise(); |
156 | //mTimeBox->setAutoMask(true); | 155 | //mTimeBox->setAutoMask(true); |
157 | minutes->start(5000,true); | 156 | int secs = QTime::currentTime().second(); |
157 | qDebug("second %d ", secs ); | ||
158 | minutes->start( (60 - secs +1)*1000 ,true); | ||
158 | } | 159 | } |
159 | 160 | ||
@@ -443,5 +444,5 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
443 | if ( mInvalidPixmap ) { | 444 | if ( mInvalidPixmap ) { |
444 | mInvalidPixmap = false; | 445 | mInvalidPixmap = false; |
445 | qDebug("InvalidPixmap "); | 446 | qDebug("KO: Upsizing Pixmaps "); |
446 | computeSizes(); | 447 | computeSizes(); |
447 | emit updateViewSignal(); | 448 | emit updateViewSignal(); |
@@ -1277,5 +1278,5 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | |||
1277 | if ( mInvalidPixmap ) { | 1278 | if ( mInvalidPixmap ) { |
1278 | mInvalidPixmap = false; | 1279 | mInvalidPixmap = false; |
1279 | qDebug("InvalidPixmap "); | 1280 | qDebug("KO: Upsizing Pixmaps "); |
1280 | computeSizes(); | 1281 | computeSizes(); |
1281 | emit updateViewSignal(); | 1282 | emit updateViewSignal(); |
@@ -1418,5 +1419,5 @@ void KOAgenda::finishUpdate() | |||
1418 | item->repaint( false ); | 1419 | item->repaint( false ); |
1419 | } | 1420 | } |
1420 | 1421 | marcus_bains(); | |
1421 | } | 1422 | } |
1422 | 1423 | ||
@@ -1801,5 +1802,4 @@ KOAgendaItem *KOAgenda::insertItem (Incidence *event,QDate qd,int X,int YTop,int | |||
1801 | //agendaItem->show(); | 1802 | //agendaItem->show(); |
1802 | 1803 | ||
1803 | marcus_bains(); | ||
1804 | 1804 | ||
1805 | return agendaItem; | 1805 | return agendaItem; |
@@ -1874,6 +1874,4 @@ void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, | |||
1874 | current = next; | 1874 | current = next; |
1875 | } | 1875 | } |
1876 | |||
1877 | marcus_bains(); | ||
1878 | } | 1876 | } |
1879 | 1877 | ||
@@ -1960,5 +1958,5 @@ void KOAgenda::computeSizes() | |||
1960 | QPixmap* paintPixAll = KOAgendaItem::paintPixAllday(); | 1958 | QPixmap* paintPixAll = KOAgendaItem::paintPixAllday(); |
1961 | if ( (paintPixAll->width() < cw || paintPixAll->height() < ch) && cw > 0 && ch > 0 ) { | 1959 | if ( (paintPixAll->width() < cw || paintPixAll->height() < ch) && cw > 0 && ch > 0 ) { |
1962 | qDebug("paintPixAll->resize "); | 1960 | //qDebug("paintPixAll->resize "); |
1963 | paintPixAll->resize( cw, ch ); | 1961 | paintPixAll->resize( cw, ch ); |
1964 | } | 1962 | } |
@@ -1966,5 +1964,5 @@ void KOAgenda::computeSizes() | |||
1966 | QPixmap* paintPix = KOAgendaItem::paintPix(); | 1964 | QPixmap* paintPix = KOAgendaItem::paintPix(); |
1967 | if ( paintPix->width() < cw || paintPix->height() < ch ) { | 1965 | if ( paintPix->width() < cw || paintPix->height() < ch ) { |
1968 | qDebug("paintPix->resize "); | 1966 | //qDebug("paintPix->resize "); |
1969 | paintPix->resize( cw , ch ); | 1967 | paintPix->resize( cw , ch ); |
1970 | } | 1968 | } |
@@ -1972,5 +1970,4 @@ void KOAgenda::computeSizes() | |||
1972 | 1970 | ||
1973 | checkScrollBoundaries(); | 1971 | checkScrollBoundaries(); |
1974 | marcus_bains(); | ||
1975 | drawContentsToPainter(); | 1972 | drawContentsToPainter(); |
1976 | viewport()->repaint(false); | 1973 | viewport()->repaint(false); |
@@ -2032,5 +2029,4 @@ void KOAgenda::updateConfig() | |||
2032 | mGridSpacingY = KOPrefs::instance()->mHourSize; | 2029 | mGridSpacingY = KOPrefs::instance()->mHourSize; |
2033 | calculateWorkingHours(); | 2030 | calculateWorkingHours(); |
2034 | marcus_bains(); | ||
2035 | } | 2031 | } |
2036 | } | 2032 | } |
@@ -2125,5 +2121,4 @@ void KOAgenda::setDateList(const DateList &selectedDates) | |||
2125 | { | 2121 | { |
2126 | mSelectedDates = selectedDates; | 2122 | mSelectedDates = selectedDates; |
2127 | marcus_bains(); | ||
2128 | } | 2123 | } |
2129 | 2124 | ||
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; | |||
77 | using namespace KOrg; | 77 | using namespace KOrg; |
78 | 78 | ||
79 | #define IDLETIMEOUT 15 | 79 | #define IDLETIMEOUT 45 |
80 | 80 | ||
81 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : | 81 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : |
@@ -574,26 +574,28 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | |||
574 | connect( mAllDayAgenda, SIGNAL( signalClearSelection() ),mAgenda, SLOT( slotClearSelection()) ); | 574 | connect( mAllDayAgenda, SIGNAL( signalClearSelection() ),mAgenda, SLOT( slotClearSelection()) ); |
575 | connect( mAgenda, SIGNAL( signalClearSelection() ),mAllDayAgenda, SLOT( slotClearSelection()) ); | 575 | connect( mAgenda, SIGNAL( signalClearSelection() ),mAllDayAgenda, SLOT( slotClearSelection()) ); |
576 | #ifndef DESKTOP_VERSION | ||
576 | connect( mAllDayAgenda, SIGNAL( updateViewSignal() ),this, SLOT( fillAgenda()) ); | 577 | connect( mAllDayAgenda, SIGNAL( updateViewSignal() ),this, SLOT( fillAgenda()) ); |
577 | connect( mAgenda, SIGNAL( updateViewSignal() ), this, SLOT( fillAgenda()) ); | 578 | connect( mAgenda, SIGNAL( updateViewSignal() ), this, SLOT( fillAgenda()) ); |
578 | |||
579 | connect( mAllDayAgenda, SIGNAL( sendPing() ),this, SLOT( startIdleTimeout()) ); | 579 | connect( mAllDayAgenda, SIGNAL( sendPing() ),this, SLOT( startIdleTimeout()) ); |
580 | connect( mAgenda, SIGNAL( sendPing() ), this, SLOT( startIdleTimeout()) ); | 580 | connect( mAgenda, SIGNAL( sendPing() ), this, SLOT( startIdleTimeout()) ); |
581 | |||
582 | |||
583 | mIdleTimer = new QTimer ( this );; | 581 | mIdleTimer = new QTimer ( this );; |
584 | connect(mIdleTimer,SIGNAL(timeout()),SLOT(slotIdleTimeout())); | 582 | connect(mIdleTimer,SIGNAL(timeout()),SLOT(slotIdleTimeout())); |
583 | #endif | ||
585 | } | 584 | } |
586 | void KOAgendaView::startIdleTimeout() | 585 | void KOAgendaView::startIdleTimeout() |
587 | { | 586 | { |
587 | #ifndef DESKTOP_VERSION | ||
588 | mIdleStart = QDateTime::currentDateTime(); | 588 | mIdleStart = QDateTime::currentDateTime(); |
589 | mIdleTimer->start( IDLETIMEOUT * 1000 ); | 589 | mIdleTimer->start( IDLETIMEOUT * 1000 ); |
590 | #endif | ||
590 | } | 591 | } |
591 | void KOAgendaView::slotIdleTimeout() | 592 | void KOAgendaView::slotIdleTimeout() |
592 | { | 593 | { |
593 | qDebug("SECS TO %d ",mIdleStart.secsTo( QDateTime::currentDateTime() ) ); | 594 | #ifndef DESKTOP_VERSION |
595 | //qDebug("SECS TO %d ",mIdleStart.secsTo( QDateTime::currentDateTime() ) ); | ||
594 | int secsfromstart = mIdleStart.secsTo( QDateTime::currentDateTime() ); | 596 | int secsfromstart = mIdleStart.secsTo( QDateTime::currentDateTime() ); |
595 | mIdleTimer->stop(); | 597 | mIdleTimer->stop(); |
596 | bool isActice = topLevelWidget()->isActiveWindow(); | 598 | bool isActice = topLevelWidget()->isActiveWindow(); |
597 | qDebug("KO: Active Window %d %d", isActice, isVisible()); | 599 | //qDebug("KO: Active Window %d %d", isActice, isVisible()); |
598 | // we do nothing if we wake up from a suspend | 600 | // we do nothing if we wake up from a suspend |
599 | if ( secsfromstart > IDLETIMEOUT + 30 && isActice ) { | 601 | if ( secsfromstart > IDLETIMEOUT + 30 && isActice ) { |
@@ -607,4 +609,5 @@ void KOAgendaView::slotIdleTimeout() | |||
607 | KOAgendaItem::paintPix()->resize( 20,20); | 609 | KOAgendaItem::paintPix()->resize( 20,20); |
608 | KOAgendaItem::paintPixAllday()->resize( 20,20); | 610 | KOAgendaItem::paintPixAllday()->resize( 20,20); |
611 | #endif | ||
609 | 612 | ||
610 | } | 613 | } |
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 @@ | |||
38 | #include <kiconloader.h> | 38 | #include <kiconloader.h> |
39 | #include <kglobal.h> | 39 | #include <kglobal.h> |
40 | #include <kglobalsettings.h> | ||
40 | #include <kcolorbutton.h> | 41 | #include <kcolorbutton.h> |
41 | #include <kmessagebox.h> | 42 | #include <kmessagebox.h> |
@@ -399,9 +400,23 @@ int KOCalEditView::addCalendar( QString name, QString file, bool ask ) | |||
399 | 400 | ||
400 | QFileInfo fi ( file ); | 401 | QFileInfo fi ( file ); |
402 | QString absFile = file; | ||
403 | bool isRelative = false; | ||
404 | if ( fi.isRelative() ) { | ||
405 | isRelative = true; | ||
406 | absFile = KGlobalSettings::calendarDir()+file; | ||
407 | fi.setFile( absFile ); | ||
408 | } else { | ||
409 | QString cd = KGlobalSettings::calendarDir(); | ||
410 | if ( file.left( cd.length() ) == cd ) { | ||
411 | isRelative = true; | ||
412 | file = fi.fileName (); | ||
413 | fi.setFile( absFile ); | ||
414 | } | ||
415 | } | ||
401 | if (!fi.exists() ) { | 416 | if (!fi.exists() ) { |
402 | if ( ask ) | 417 | if ( ask ) |
403 | if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No ) | 418 | 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 ) |
404 | return 0; | 419 | return 0; |
405 | QFile fileIn( file ); | 420 | QFile fileIn( absFile ); |
406 | if (!fileIn.open( IO_WriteOnly ) ) { | 421 | if (!fileIn.open( IO_WriteOnly ) ) { |
407 | KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); | 422 | 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 ) | |||
415 | KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); | 430 | KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); |
416 | kkf->mName = name; | 431 | kkf->mName = name; |
417 | kkf->mFileName = file; | 432 | kkf->mFileName = absFile; |
433 | kkf->mSavedFileName = file; | ||
434 | kkf->isRelative = isRelative; | ||
418 | emit calendarAdded( kkf->mCalNumber ); | 435 | emit calendarAdded( kkf->mCalNumber ); |
419 | if ( ask ) | 436 | 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() { | |||
90 | if ( url->url().isEmpty() ) { | 90 | if ( url->url().isEmpty() ) { |
91 | KMessageBox::information( this, i18n("Sorry, the file name is empty!") ); | 91 | KMessageBox::information( this, i18n("Sorry, the file name is empty!") ); |
92 | url->setURL( nameE->text() + ".ics" ); | ||
92 | return; | 93 | return; |
93 | } | 94 | } |
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() | |||
455 | kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); | 455 | kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); |
456 | kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); | 456 | kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); |
457 | kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false ); | ||
457 | kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); | 458 | kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); |
458 | kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); | 459 | kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); |
459 | kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); | 460 | kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); |
460 | kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); | 461 | kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); |
462 | kkf->mSavedFileName = fc.readEntry( prefix+"_SavedFileName", kkf->mFileName); | ||
461 | kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); | 463 | kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); |
462 | if ( kkf->mCalNumber == 1 ) { | 464 | if ( kkf->mCalNumber == 1 ) { |
@@ -467,4 +469,6 @@ void KOPrefs::usrReadConfig() | |||
467 | kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); | 469 | kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); |
468 | } | 470 | } |
471 | if ( kkf->isRelative ) | ||
472 | kkf->mFileName = KGlobalSettings::calendarDir() + kkf->mSavedFileName; | ||
469 | } | 473 | } |
470 | 474 | ||
@@ -553,6 +557,8 @@ void KOPrefs::usrWriteConfig() | |||
553 | fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); | 557 | fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); |
554 | fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); | 558 | fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); |
559 | fc.writeEntry( prefix+"_isRelative", kkf->isRelative ); | ||
555 | fc.writeEntry( prefix+"_Name", kkf->mName); | 560 | fc.writeEntry( prefix+"_Name", kkf->mName); |
556 | fc.writeEntry( prefix+"_FileName", kkf->mFileName); | 561 | fc.writeEntry( prefix+"_FileName", kkf->mFileName); |
562 | fc.writeEntry( prefix+"_SavedFileName", kkf->mSavedFileName); | ||
557 | fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); | 563 | fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); |
558 | } | 564 | } |
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 | |||
55 | mName = "Calendar"; | 55 | mName = "Calendar"; |
56 | mFileName = QDir::homeDirPath() + "/icalfile.ics"; | 56 | mFileName = QDir::homeDirPath() + "/icalfile.ics"; |
57 | mSavedFileName = "icalfile.ics"; | ||
57 | mCalNumber = 0; | 58 | mCalNumber = 0; |
58 | mDefaultColor = Qt::red; | 59 | mDefaultColor = Qt::red; |
59 | mErrorOnLoad = false; | 60 | mErrorOnLoad = false; |
61 | isRelative = false; | ||
60 | } | 62 | } |
61 | bool isStandard; | 63 | bool isStandard; |
@@ -66,4 +68,6 @@ class KopiCalendarFile : public QObject | |||
66 | QString mName; | 68 | QString mName; |
67 | QString mFileName; | 69 | QString mFileName; |
70 | QString mSavedFileName; | ||
71 | bool isRelative; | ||
68 | int mCalNumber; | 72 | int mCalNumber; |
69 | QColor mDefaultColor; | 73 | 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() | |||
64 | return dir; | 64 | return dir; |
65 | } | 65 | } |
66 | QString KGlobalSettings::calendarDir() | ||
67 | { | ||
68 | static QString dir; | ||
69 | if ( dir.isEmpty() ) { | ||
70 | dir = locateLocal( "data", "korganizer/d.ttl" ); | ||
71 | dir = dir.left ( dir.length() - 5); | ||
72 | } | ||
73 | return dir; | ||
74 | } | ||
66 | 75 | ||
67 | QFont KGlobalSettings::toolBarFont() | 76 | 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 | |||
23 | static QString timeTrackerDir(); | 23 | static QString timeTrackerDir(); |
24 | static QString backupDataDir(); | 24 | static QString backupDataDir(); |
25 | static QString calendarDir(); | ||
25 | 26 | ||
26 | /** | 27 | /** |