summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-07-09 08:48:32 (UTC)
committer zautrix <zautrix>2005-07-09 08:48:32 (UTC)
commitf731dd9fc5b3f14c44d4de26eb5370a79c63887c (patch) (unidiff)
treee3d7b3929cc8819a5451bd04c9698bc0767e49b1 /korganizer
parente27ad31c6016152449bbdaf4f9f387fa61183c37 (diff)
downloadkdepimpi-f731dd9fc5b3f14c44d4de26eb5370a79c63887c.zip
kdepimpi-f731dd9fc5b3f14c44d4de26eb5370a79c63887c.tar.gz
kdepimpi-f731dd9fc5b3f14c44d4de26eb5370a79c63887c.tar.bz2
fixi
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp20
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/journalentry.cpp22
-rw-r--r--korganizer/journalentry.h3
-rw-r--r--korganizer/mainwindow.cpp2
5 files changed, 46 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 940ea91..ccacc52 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1451,8 +1451,10 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1451 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1451 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1452 else 1452 else
1453 idS = inR->IDStr(); 1453 idS = inR->IDStr();
1454 int calID = inR->calID();
1454 remote->deleteIncidence( inR ); 1455 remote->deleteIncidence( inR );
1455 inR = inL->clone(); 1456 inR = inL->clone();
1457 inR->setCalID( calID );
1456 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1458 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1457 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) 1459 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
1458 inR->setIDStr( idS ); 1460 inR->setIDStr( idS );
@@ -1463,8 +1465,10 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1463 } else {// take remote ********************** 1465 } else {// take remote **********************
1464 idS = inL->IDStr(); 1466 idS = inL->IDStr();
1465 int pid = inL->pilotId(); 1467 int pid = inL->pilotId();
1468 int calID = inL->calID();
1466 local->deleteIncidence( inL ); 1469 local->deleteIncidence( inL );
1467 inL = inR->clone(); 1470 inL = inR->clone();
1471 inL->setCalID( calID );
1468 if ( mSyncManager->syncWithDesktop() ) 1472 if ( mSyncManager->syncWithDesktop() )
1469 inL->setPilotId( pid ); 1473 inL->setPilotId( pid );
1470 inL->setIDStr( idS ); 1474 inL->setIDStr( idS );
@@ -1493,6 +1497,8 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1493 inL->setIDStr( ":" ); 1497 inL->setIDStr( ":" );
1494 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1498 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1495 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1499 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1500
1501 inL->setCalID( 0 );// add to default cal
1496 local->addIncidence( inL ); 1502 local->addIncidence( inL );
1497 ++addedEvent; 1503 ++addedEvent;
1498 1504
@@ -1502,6 +1508,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1502 inR->setLastModified( modifiedCalendar ); 1508 inR->setLastModified( modifiedCalendar );
1503 inL = inR->clone(); 1509 inL = inR->clone();
1504 inL->setIDStr( ":" ); 1510 inL->setIDStr( ":" );
1511 inL->setCalID( 0 );// add to default cal
1505 local->addIncidence( inL ); 1512 local->addIncidence( inL );
1506 ++addedEvent; 1513 ++addedEvent;
1507 1514
@@ -1559,6 +1566,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1559 inR = inL->clone(); 1566 inR = inL->clone();
1560 inR->setIDStr( ":" ); 1567 inR->setIDStr( ":" );
1561 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1568 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1569 inR->setCalID( 0 );// add to default cal
1562 remote->addIncidence( inR ); 1570 remote->addIncidence( inR );
1563 } 1571 }
1564 } 1572 }
@@ -1573,6 +1581,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1573 inL->setLastModified( modifiedCalendar ); 1581 inL->setLastModified( modifiedCalendar );
1574 inR = inL->clone(); 1582 inR = inL->clone();
1575 inR->setIDStr( ":" ); 1583 inR->setIDStr( ":" );
1584 inR->setCalID( 0 );// add to default cal
1576 remote->addIncidence( inR ); 1585 remote->addIncidence( inR );
1577 } 1586 }
1578 } 1587 }
@@ -2143,6 +2152,15 @@ bool CalendarView::openCalendar(QString filename, bool merge)
2143 } 2152 }
2144 return false; 2153 return false;
2145} 2154}
2155void CalendarView::mergeFile( QString fn )
2156{
2157 clearAllViews();
2158 mCalendar->mergeCalendarFile( fn );
2159 mCalendar->reInitAlarmSettings();
2160 setSyncEventsReadOnly();
2161 updateUnmanagedViews();
2162 updateView();
2163}
2146void CalendarView::showOpenError() 2164void CalendarView::showOpenError()
2147{ 2165{
2148 KMessageBox::error(this,i18n("Couldn't load calendar\n.")); 2166 KMessageBox::error(this,i18n("Couldn't load calendar\n."));
@@ -3358,12 +3376,14 @@ void CalendarView::newEvent()
3358 } 3376 }
3359 3377
3360 QDate date = mNavigator->selectedDates().first(); 3378 QDate date = mNavigator->selectedDates().first();
3379#if 0
3361 QDateTime current = QDateTime::currentDateTime(); 3380 QDateTime current = QDateTime::currentDateTime();
3362 if ( date <= current.date() ) { 3381 if ( date <= current.date() ) {
3363 int hour = current.time().hour() +1; 3382 int hour = current.time().hour() +1;
3364 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 3383 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
3365 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3384 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
3366 } else 3385 } else
3386#endif
3367 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 3387 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
3368 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 3388 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
3369 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3389 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 706d05d..799c297 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -138,6 +138,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
138 KOEventViewerDialog* getEventViewerDialog(); 138 KOEventViewerDialog* getEventViewerDialog();
139 Incidence *currentSelection(); 139 Incidence *currentSelection();
140 void checkSuspendAlarm(); 140 void checkSuspendAlarm();
141 void mergeFile( QString fn );
141 142
142 signals: 143 signals:
143 void save (); 144 void save ();
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index b8a4cf2..f0e0f86 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -76,7 +76,8 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
76 QPushButton * toggleJournal = new QPushButton( vb ); 76 QPushButton * toggleJournal = new QPushButton( vb );
77 iconp = SmallIcon("1updownarrow"); 77 iconp = SmallIcon("1updownarrow");
78 toggleJournal->setPixmap (iconp ) ; 78 toggleJournal->setPixmap (iconp ) ;
79 vb->setStretchFactor (new QLabel(" "+i18n("Title: "),vb),1); 79 QLabel* textLabel = new QLabel(" "+i18n("Title: "),vb);
80 vb->setStretchFactor (textLabel,1);
80 vb->setStretchFactor( toggleJournal, 1 ); 81 vb->setStretchFactor( toggleJournal, 1 );
81 mTitle = new KOLocationBox(TRUE, vb, 30); 82 mTitle = new KOLocationBox(TRUE, vb, 30);
82 mTitle->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding ,QSizePolicy::Fixed ,FALSE) ); 83 mTitle->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding ,QSizePolicy::Fixed ,FALSE) );
@@ -112,6 +113,11 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
112#ifndef DESKTOP_VERSION 113#ifndef DESKTOP_VERSION
113 QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); 114 QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold );
114#endif 115#endif
116 mMaxWidDiff = 3*size - 2*frameWidth() - textLabel->sizeHint().width();
117 mDeskWid = QApplication::desktop()->width();
118 int maxwid = mDeskWid - mMaxWidDiff;
119 mTitle->setMaximumWidth( maxwid/2 +20 );
120 mCalendarBox->setMaximumWidth( maxwid/2 -20 );
115 mEditor->setWordWrap( KTextEdit::WidgetWidth ); 121 mEditor->setWordWrap( KTextEdit::WidgetWidth );
116 QBoxLayout *topLayout = new QVBoxLayout(this); 122 QBoxLayout *topLayout = new QVBoxLayout(this);
117 topLayout->addWidget(vb); 123 topLayout->addWidget(vb);
@@ -128,6 +134,20 @@ JournalEntry::~JournalEntry()
128{ 134{
129 //qDebug("JournalEntry::~JournalEntry() "); 135 //qDebug("JournalEntry::~JournalEntry() ");
130} 136}
137void JournalEntry::resizeEvent(QResizeEvent* e )
138{
139#ifndef DESKTOP_VERSION
140 if ( mDeskWid != QApplication::desktop()->width() ) {
141 mDeskWid == QApplication::desktop()->width();
142 int maxwid = mDeskWid - mMaxWidDiff;
143 mTitle->setMaximumWidth( maxwid/2 +20 );
144 mCalendarBox->setMaximumWidth( maxwid/2 -20 );
145 }
146 setMaximumWidth( QApplication::desktop()->width() );
147 qDebug("MAXXX %d ", QApplication::desktop()->width());
148#endif
149 QFrame::resizeEvent( e );
150}
131QSize JournalEntry::sizeHint() const 151QSize JournalEntry::sizeHint() const
132{ 152{
133 return QSize ( 240, heiHint ); 153 return QSize ( 240, heiHint );
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h
index ed04b7c..a69846c 100644
--- a/korganizer/journalentry.h
+++ b/korganizer/journalentry.h
@@ -55,6 +55,7 @@ class JournalEntry : public QFrame {
55 QSize sizeHint() const; 55 QSize sizeHint() const;
56 void setVisibleMode( bool b ) { visibleMode = b;} 56 void setVisibleMode( bool b ) { visibleMode = b;}
57 void fillCalendar( int id = 0 ); 57 void fillCalendar( int id = 0 );
58 void resizeEvent(QResizeEvent* e ) ;
58 protected slots: 59 protected slots:
59 void slotSaveTemplate(); 60 void slotSaveTemplate();
60 void slotLoadTemplate(); 61 void slotLoadTemplate();
@@ -71,6 +72,8 @@ class JournalEntry : public QFrame {
71 void writeJournal(); 72 void writeJournal();
72 73
73 private: 74 private:
75 int mMaxWidDiff;
76 int mDeskWid;
74 bool visibleMode; 77 bool visibleMode;
75 bool showOnlyMode; 78 bool showOnlyMode;
76 Calendar *mCalendar; 79 Calendar *mCalendar;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 5249300..4bedb61 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -2544,7 +2544,7 @@ void MainWindow::getFile( bool success )
2544 setCaption( i18n("Error receiving file. Nothing changed!") ); 2544 setCaption( i18n("Error receiving file. Nothing changed!") );
2545 return; 2545 return;
2546 } 2546 }
2547 mView->openCalendar( sentSyncFile() ); 2547 mView->mergeFile( sentSyncFile() );
2548 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2548 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2549 mSyncManager->slotSyncMenu( 999 ); 2549 mSyncManager->slotSyncMenu( 999 );
2550 } 2550 }