From f731dd9fc5b3f14c44d4de26eb5370a79c63887c Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 09 Jul 2005 08:48:32 +0000 Subject: fixi --- (limited to 'korganizer') 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 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); else idS = inR->IDStr(); + int calID = inR->calID(); remote->deleteIncidence( inR ); inR = inL->clone(); + inR->setCalID( calID ); inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) inR->setIDStr( idS ); @@ -1463,8 +1465,10 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int } else {// take remote ********************** idS = inL->IDStr(); int pid = inL->pilotId(); + int calID = inL->calID(); local->deleteIncidence( inL ); inL = inR->clone(); + inL->setCalID( calID ); if ( mSyncManager->syncWithDesktop() ) inL->setPilotId( pid ); inL->setIDStr( idS ); @@ -1493,6 +1497,8 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int inL->setIDStr( ":" ); inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); + + inL->setCalID( 0 );// add to default cal local->addIncidence( inL ); ++addedEvent; @@ -1502,6 +1508,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int inR->setLastModified( modifiedCalendar ); inL = inR->clone(); inL->setIDStr( ":" ); + inL->setCalID( 0 );// add to default cal local->addIncidence( inL ); ++addedEvent; @@ -1559,6 +1566,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int inR = inL->clone(); inR->setIDStr( ":" ); inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); + inR->setCalID( 0 );// add to default cal remote->addIncidence( inR ); } } @@ -1573,6 +1581,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int inL->setLastModified( modifiedCalendar ); inR = inL->clone(); inR->setIDStr( ":" ); + inR->setCalID( 0 );// add to default cal remote->addIncidence( inR ); } } @@ -2143,6 +2152,15 @@ bool CalendarView::openCalendar(QString filename, bool merge) } return false; } +void CalendarView::mergeFile( QString fn ) +{ + clearAllViews(); + mCalendar->mergeCalendarFile( fn ); + mCalendar->reInitAlarmSettings(); + setSyncEventsReadOnly(); + updateUnmanagedViews(); + updateView(); +} void CalendarView::showOpenError() { KMessageBox::error(this,i18n("Couldn't load calendar\n.")); @@ -3358,12 +3376,14 @@ void CalendarView::newEvent() } QDate date = mNavigator->selectedDates().first(); +#if 0 QDateTime current = QDateTime::currentDateTime(); if ( date <= current.date() ) { int hour = current.time().hour() +1; newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); } else +#endif newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 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 KOEventViewerDialog* getEventViewerDialog(); Incidence *currentSelection(); void checkSuspendAlarm(); + void mergeFile( QString fn ); signals: 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) : QPushButton * toggleJournal = new QPushButton( vb ); iconp = SmallIcon("1updownarrow"); toggleJournal->setPixmap (iconp ) ; - vb->setStretchFactor (new QLabel(" "+i18n("Title: "),vb),1); + QLabel* textLabel = new QLabel(" "+i18n("Title: "),vb); + vb->setStretchFactor (textLabel,1); vb->setStretchFactor( toggleJournal, 1 ); mTitle = new KOLocationBox(TRUE, vb, 30); mTitle->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding ,QSizePolicy::Fixed ,FALSE) ); @@ -112,6 +113,11 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : #ifndef DESKTOP_VERSION QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); #endif + mMaxWidDiff = 3*size - 2*frameWidth() - textLabel->sizeHint().width(); + mDeskWid = QApplication::desktop()->width(); + int maxwid = mDeskWid - mMaxWidDiff; + mTitle->setMaximumWidth( maxwid/2 +20 ); + mCalendarBox->setMaximumWidth( maxwid/2 -20 ); mEditor->setWordWrap( KTextEdit::WidgetWidth ); QBoxLayout *topLayout = new QVBoxLayout(this); topLayout->addWidget(vb); @@ -128,6 +134,20 @@ JournalEntry::~JournalEntry() { //qDebug("JournalEntry::~JournalEntry() "); } +void JournalEntry::resizeEvent(QResizeEvent* e ) +{ +#ifndef DESKTOP_VERSION + if ( mDeskWid != QApplication::desktop()->width() ) { + mDeskWid == QApplication::desktop()->width(); + int maxwid = mDeskWid - mMaxWidDiff; + mTitle->setMaximumWidth( maxwid/2 +20 ); + mCalendarBox->setMaximumWidth( maxwid/2 -20 ); + } + setMaximumWidth( QApplication::desktop()->width() ); + qDebug("MAXXX %d ", QApplication::desktop()->width()); +#endif + QFrame::resizeEvent( e ); +} QSize JournalEntry::sizeHint() const { 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 { QSize sizeHint() const; void setVisibleMode( bool b ) { visibleMode = b;} void fillCalendar( int id = 0 ); + void resizeEvent(QResizeEvent* e ) ; protected slots: void slotSaveTemplate(); void slotLoadTemplate(); @@ -71,6 +72,8 @@ class JournalEntry : public QFrame { void writeJournal(); private: + int mMaxWidDiff; + int mDeskWid; bool visibleMode; bool showOnlyMode; 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 ) setCaption( i18n("Error receiving file. Nothing changed!") ); return; } - mView->openCalendar( sentSyncFile() ); + mView->mergeFile( sentSyncFile() ); if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { mSyncManager->slotSyncMenu( 999 ); } -- cgit v0.9.0.2