summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-30 06:47:32 (UTC)
committer zautrix <zautrix>2005-06-30 06:47:32 (UTC)
commit0e4ec4bb2a13a89d3d6145ea076a5734481cb252 (patch) (unidiff)
treefecf6ecb38a726323fb9522eaae1764930ec49cf
parent0fc571a7eadda739fd1a93d627e7129b9956c9f6 (diff)
downloadkdepimpi-0e4ec4bb2a13a89d3d6145ea076a5734481cb252.zip
kdepimpi-0e4ec4bb2a13a89d3d6145ea076a5734481cb252.tar.gz
kdepimpi-0e4ec4bb2a13a89d3d6145ea076a5734481cb252.tar.bz2
fixixix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/journalentry.cpp3
-rw-r--r--korganizer/kojournalview.cpp6
-rw-r--r--korganizer/kojournalview.h1
-rw-r--r--korganizer/koviewmanager.h1
-rw-r--r--korganizer/mainwindow.cpp6
5 files changed, 14 insertions, 3 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index 395392c..3c01eeb 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -250,26 +250,27 @@ void JournalEntry::writeJournal()
250 KOPrefs::instance()->mConfirm = conf; 250 KOPrefs::instance()->mConfirm = conf;
251 } 251 }
252 return; 252 return;
253 } 253 }
254 254
255// kdDebug() << "JournalEntry::writeJournal()..." << endl; 255// kdDebug() << "JournalEntry::writeJournal()..." << endl;
256 256
257 if (!mJournal) { 257 if (!mJournal) {
258 mJournal = new Journal; 258 mJournal = new Journal;
259 mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); 259 mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0)));
260 mCalendar->addJournal(mJournal); 260 mCalendar->addJournal(mJournal);
261 } 261 }
262 262 if ( mJournal->description() != mEditor->text() )
263 mJournal->setDescription(mEditor->text()); 263 mJournal->setDescription(mEditor->text());
264 if ( mJournal->summary() != mTitle->text() )
264 mJournal->setSummary(mTitle->text()); 265 mJournal->setSummary(mTitle->text());
265} 266}
266 267
267void JournalEntry::flushEntry() 268void JournalEntry::flushEntry()
268{ 269{
269 writeJournal(); 270 writeJournal();
270} 271}
271void JournalEntry::keyPressEvent ( QKeyEvent * e ) 272void JournalEntry::keyPressEvent ( QKeyEvent * e )
272{ 273{
273 e->ignore(); 274 e->ignore();
274 275
275} 276}
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index b659d53..51ae0a0 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -109,25 +109,29 @@ void KOJournalView::updateConfig()
109 mEntry = jEntries.next(); 109 mEntry = jEntries.next();
110 } 110 }
111} 111}
112void KOJournalView::updateView() 112void KOJournalView::updateView()
113{ 113{
114 JournalEntry* mEntry = jEntries.first(); 114 JournalEntry* mEntry = jEntries.first();
115 while ( mEntry ) { 115 while ( mEntry ) {
116 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont ); 116 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
117 mEntry = jEntries.next(); 117 mEntry = jEntries.next();
118 } 118 }
119 showDates( mDate, QDate() ); 119 showDates( mDate, QDate() );
120} 120}
121 121void KOJournalView::checkModified()
122{
123 qDebug("checkmod ");
124 flushView();
125}
122void KOJournalView::flushView() 126void KOJournalView::flushView()
123{ 127{
124 static bool ff = false; 128 static bool ff = false;
125 if ( ff ) return; 129 if ( ff ) return;
126 ff = true; 130 ff = true;
127 JournalEntry* mEntry = jEntries.first(); 131 JournalEntry* mEntry = jEntries.first();
128 while ( mEntry ) { 132 while ( mEntry ) {
129 mEntry->flushEntry(); 133 mEntry->flushEntry();
130 mEntry = jEntries.next(); 134 mEntry = jEntries.next();
131 } 135 }
132 ff = false; 136 ff = false;
133} 137}
diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h
index 331bdfa..7fa94ae 100644
--- a/korganizer/kojournalview.h
+++ b/korganizer/kojournalview.h
@@ -41,24 +41,25 @@ class KOJournalView : public KOrg::BaseView
41 Q_OBJECT 41 Q_OBJECT
42 public: 42 public:
43 KOJournalView(Calendar *calendar, QWidget *parent = 0, 43 KOJournalView(Calendar *calendar, QWidget *parent = 0,
44 const char *name = 0); 44 const char *name = 0);
45 ~KOJournalView(); 45 ~KOJournalView();
46 46
47 virtual int currentDateCount(); 47 virtual int currentDateCount();
48 void clearList(); 48 void clearList();
49 virtual QPtrList<Incidence> selectedIncidences(); 49 virtual QPtrList<Incidence> selectedIncidences();
50 DateList selectedDates() 50 DateList selectedDates()
51 {DateList q; 51 {DateList q;
52 return q;}; 52 return q;};
53 void checkModified();
53 signals: 54 signals:
54 void deleteJournal(Journal *); 55 void deleteJournal(Journal *);
55 public slots: 56 public slots:
56 void showOnly ( Journal* ); 57 void showOnly ( Journal* );
57 void newJournal(); 58 void newJournal();
58 void updateView(); 59 void updateView();
59 void flushView(); 60 void flushView();
60 void updateConfig(); 61 void updateConfig();
61 void showDates( const QDate &start, const QDate &end ); 62 void showDates( const QDate &start, const QDate &end );
62 void showEvents(QPtrList<Event> eventList); 63 void showEvents(QPtrList<Event> eventList);
63 64
64 void changeEventDisplay(Event *, int); 65 void changeEventDisplay(Event *, int);
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index d5a8e3b..2e6aaed 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -68,24 +68,25 @@ class KOViewManager : public QObject
68 68
69 void updateView( const QDate &start, const QDate &end ); 69 void updateView( const QDate &start, const QDate &end );
70 void clearAllViews(); 70 void clearAllViews();
71 71
72 void raiseCurrentView( bool fullScreen = false , bool updateView = false); 72 void raiseCurrentView( bool fullScreen = false , bool updateView = false);
73 73
74 void addView(KOrg::BaseView *); 74 void addView(KOrg::BaseView *);
75 75
76 Incidence *currentSelection(); 76 Incidence *currentSelection();
77 QDate currentSelectionDate(); 77 QDate currentSelectionDate();
78 78
79 KOAgendaView *agendaView() const { return mAgendaView; } 79 KOAgendaView *agendaView() const { return mAgendaView; }
80 KOJournalView *journalView() const { return mJournalView; }
80 81
81 signals: 82 signals:
82 void printWNV(); 83 void printWNV();
83 void signalFullScreen( bool ); 84 void signalFullScreen( bool );
84 void signalAgendaView( bool ); 85 void signalAgendaView( bool );
85 public slots: 86 public slots:
86 void setDefaultCalendar(int); 87 void setDefaultCalendar(int);
87 void slotprintWNV(); 88 void slotprintWNV();
88 void showNextView(); 89 void showNextView();
89 void showMonth( const QDate & ); 90 void showMonth( const QDate & );
90 void showDateView( int, QDate ); 91 void showDateView( int, QDate );
91 void updateView(); 92 void updateView();
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index d8373a6..fb6d6ec 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -38,24 +38,25 @@
38#include <libkcal/calendarlocal.h> 38#include <libkcal/calendarlocal.h>
39#include <libkcal/todo.h> 39#include <libkcal/todo.h>
40#include <libkcal/phoneformat.h> 40#include <libkcal/phoneformat.h>
41#include <libkdepim/ksyncprofile.h> 41#include <libkdepim/ksyncprofile.h>
42#include <libkdepim/phoneaccess.h> 42#include <libkdepim/phoneaccess.h>
43#include <libkcal/kincidenceformatter.h> 43#include <libkcal/kincidenceformatter.h>
44#include <libkdepim/kpimglobalprefs.h> 44#include <libkdepim/kpimglobalprefs.h>
45 45
46#include "calendarview.h" 46#include "calendarview.h"
47#include "koviewmanager.h" 47#include "koviewmanager.h"
48#include "datenavigator.h" 48#include "datenavigator.h"
49#include "koagendaview.h" 49#include "koagendaview.h"
50#include "kojournalview.h"
50#include "koagenda.h" 51#include "koagenda.h"
51#include "kodialogmanager.h" 52#include "kodialogmanager.h"
52#include "kdialogbase.h" 53#include "kdialogbase.h"
53#include "kapplication.h" 54#include "kapplication.h"
54#include "kofilterview.h" 55#include "kofilterview.h"
55#include "kstandarddirs.h" 56#include "kstandarddirs.h"
56#include "koprefs.h" 57#include "koprefs.h"
57#include "kfiledialog.h" 58#include "kfiledialog.h"
58#include "koglobals.h" 59#include "koglobals.h"
59#include "kglobal.h" 60#include "kglobal.h"
60#include "ktoolbar.h" 61#include "ktoolbar.h"
61#include "klocale.h" 62#include "klocale.h"
@@ -1825,25 +1826,26 @@ void MainWindow::saveOnClose()
1825 1826
1826 if ( p->mToolBarHorN ) 1827 if ( p->mToolBarHorN )
1827 p->mToolBarUpN = navigatorToolBar->y() > height()/2; 1828 p->mToolBarUpN = navigatorToolBar->y() > height()/2;
1828 else 1829 else
1829 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; 1830 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ;
1830 if ( filterToolBar ) { 1831 if ( filterToolBar ) {
1831 if ( p->mToolBarHorF ) 1832 if ( p->mToolBarHorF )
1832 p->mToolBarUpF = filterToolBar->y() > height()/2; 1833 p->mToolBarUpF = filterToolBar->y() > height()/2;
1833 else 1834 else
1834 p->mToolBarUpF = filterToolBar->x() > width()/2 ; 1835 p->mToolBarUpF = filterToolBar->x() > width()/2 ;
1835 } 1836 }
1836#endif 1837#endif
1837 1838 if ( mView->viewManager()->journalView() )
1839 mView->viewManager()->journalView()->checkModified();
1838 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) 1840 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName()))
1839 save(); 1841 save();
1840 mView->writeSettings(); 1842 mView->writeSettings();
1841} 1843}
1842void MainWindow::slotModifiedChanged( bool changed ) 1844void MainWindow::slotModifiedChanged( bool changed )
1843{ 1845{
1844 if ( mBlockAtStartup ) 1846 if ( mBlockAtStartup )
1845 return; 1847 return;
1846 1848
1847 int msec; 1849 int msec;
1848 // we store the changes after 1 minute, 1850 // we store the changes after 1 minute,
1849 // and for safety reasons after 10 minutes again 1851 // and for safety reasons after 10 minutes again
@@ -1890,24 +1892,26 @@ void MainWindow::backupAllFiles()
1890 KOPrefs::instance()->mLastBackupDate = daysTo; 1892 KOPrefs::instance()->mLastBackupDate = daysTo;
1891 setCaption(i18n("Backup succesfully finished" )); 1893 setCaption(i18n("Backup succesfully finished" ));
1892 } else if ( retval == 2 ){ 1894 } else if ( retval == 2 ){
1893 setCaption(i18n("Backup globally disabled" )); 1895 setCaption(i18n("Backup globally disabled" ));
1894 qDebug("KO: Backup globally cancelled."); 1896 qDebug("KO: Backup globally cancelled.");
1895 // backup globally cancelled 1897 // backup globally cancelled
1896 KPimGlobalPrefs::instance()->mBackupEnabled = false; 1898 KPimGlobalPrefs::instance()->mBackupEnabled = false;
1897 } 1899 }
1898 // retval == 3: do nothing, try again later 1900 // retval == 3: do nothing, try again later
1899} 1901}
1900void MainWindow::save() 1902void MainWindow::save()
1901{ 1903{
1904 if ( mView->viewManager()->journalView() )
1905 mView->viewManager()->journalView()->checkModified();
1902 if ( !mCalendarModifiedFlag ) { 1906 if ( !mCalendarModifiedFlag ) {
1903 qDebug("KO: Calendar not modified. Nothing saved."); 1907 qDebug("KO: Calendar not modified. Nothing saved.");
1904 return; 1908 return;
1905 } 1909 }
1906 if ( mSyncManager->blockSave() ) 1910 if ( mSyncManager->blockSave() )
1907 return; 1911 return;
1908 mSyncManager->setBlockSave(true); 1912 mSyncManager->setBlockSave(true);
1909 if ( mView->checkAllFileVersions() ) { 1913 if ( mView->checkAllFileVersions() ) {
1910 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ 1914 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){
1911 QDate reference ( 2000,1,1); 1915 QDate reference ( 2000,1,1);
1912 int daysTo = reference.daysTo ( QDate::currentDate() ); 1916 int daysTo = reference.daysTo ( QDate::currentDate() );
1913 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { 1917 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) {