summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show 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
@@ -1453,4 +1453,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
idS = inR->IDStr();
+ int calID = inR->calID();
remote->deleteIncidence( inR );
inR = inL->clone();
+ inR->setCalID( calID );
inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
@@ -1465,4 +1467,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
int pid = inL->pilotId();
+ int calID = inL->calID();
local->deleteIncidence( inL );
inL = inR->clone();
+ inL->setCalID( calID );
if ( mSyncManager->syncWithDesktop() )
@@ -1495,2 +1499,4 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
+
+ inL->setCalID( 0 );// add to default cal
local->addIncidence( inL );
@@ -1504,2 +1510,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
inL->setIDStr( ":" );
+ inL->setCalID( 0 );// add to default cal
local->addIncidence( inL );
@@ -1561,2 +1568,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
+ inR->setCalID( 0 );// add to default cal
remote->addIncidence( inR );
@@ -1575,2 +1583,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
inR->setIDStr( ":" );
+ inR->setCalID( 0 );// add to default cal
remote->addIncidence( inR );
@@ -2145,2 +2154,11 @@ bool CalendarView::openCalendar(QString filename, bool merge)
}
+void CalendarView::mergeFile( QString fn )
+{
+ clearAllViews();
+ mCalendar->mergeCalendarFile( fn );
+ mCalendar->reInitAlarmSettings();
+ setSyncEventsReadOnly();
+ updateUnmanagedViews();
+ updateView();
+}
void CalendarView::showOpenError()
@@ -3360,2 +3378,3 @@ void CalendarView::newEvent()
QDate date = mNavigator->selectedDates().first();
+#if 0
QDateTime current = QDateTime::currentDateTime();
@@ -3366,2 +3385,3 @@ void CalendarView::newEvent()
} else
+#endif
newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 706d05d..799c297 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -140,2 +140,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void checkSuspendAlarm();
+ void mergeFile( QString fn );
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index b8a4cf2..f0e0f86 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -78,3 +78,4 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
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 );
@@ -114,2 +115,7 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
#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 );
@@ -130,2 +136,16 @@ 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
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h
index ed04b7c..a69846c 100644
--- a/korganizer/journalentry.h
+++ b/korganizer/journalentry.h
@@ -57,2 +57,3 @@ class JournalEntry : public QFrame {
void fillCalendar( int id = 0 );
+ void resizeEvent(QResizeEvent* e ) ;
protected slots:
@@ -73,2 +74,4 @@ class JournalEntry : public QFrame {
private:
+ int mMaxWidDiff;
+ int mDeskWid;
bool visibleMode;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 5249300..4bedb61 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -2546,3 +2546,3 @@ void MainWindow::getFile( bool success )
}
- mView->openCalendar( sentSyncFile() );
+ mView->mergeFile( sentSyncFile() );
if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {