-rw-r--r-- | korganizer/calendarview.cpp | 2 | ||||
-rw-r--r-- | korganizer/kofilterview.h | 1 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 8 | ||||
-rw-r--r-- | korganizer/komonthview.h | 3 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 9 |
5 files changed, 16 insertions, 7 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 678143d..5c88abd 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2091,17 +2091,17 @@ bool CalendarView::checkFileVersion(QString fn) | |||
2091 | QFileInfo finf ( fn ); | 2091 | QFileInfo finf ( fn ); |
2092 | if ( !finf.exists() ) | 2092 | if ( !finf.exists() ) |
2093 | return true; | 2093 | return true; |
2094 | QDateTime dt = finf.lastModified (); | 2094 | QDateTime dt = finf.lastModified (); |
2095 | qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1()); | 2095 | qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1()); |
2096 | qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1()); | 2096 | qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1()); |
2097 | if ( dt <= loadedFileVersion ) | 2097 | if ( dt <= loadedFileVersion ) |
2098 | return true; | 2098 | return true; |
2099 | int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\n on disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg(fn).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , | 2099 | int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg(KGlobal::formatMessage(fn,0)).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , |
2100 | i18n("KO/Pi Warning"),i18n("Overwrite"), | 2100 | i18n("KO/Pi Warning"),i18n("Overwrite"), |
2101 | i18n("Sync+save")); | 2101 | i18n("Sync+save")); |
2102 | 2102 | ||
2103 | if ( km == KMessageBox::Cancel ) | 2103 | if ( km == KMessageBox::Cancel ) |
2104 | return false; | 2104 | return false; |
2105 | if ( km == KMessageBox::Yes ) | 2105 | if ( km == KMessageBox::Yes ) |
2106 | return true; | 2106 | return true; |
2107 | 2107 | ||
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index 874fc6a..4322299 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h | |||
@@ -20,16 +20,17 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KOFILTERVIEW_H | 23 | #ifndef KOFILTERVIEW_H |
24 | #define KOFILTERVIEW_H | 24 | #define KOFILTERVIEW_H |
25 | 25 | ||
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qcheckbox.h> | 27 | #include <qcheckbox.h> |
28 | #include <qapplication.h> | ||
28 | #include <qradiobutton.h> | 29 | #include <qradiobutton.h> |
29 | #include <qlayout.h> | 30 | #include <qlayout.h> |
30 | #include <qlabel.h> | 31 | #include <qlabel.h> |
31 | #include <qdialog.h> | 32 | #include <qdialog.h> |
32 | #include <qscrollview.h> | 33 | #include <qscrollview.h> |
33 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
34 | #include <kconfig.h> | 35 | #include <kconfig.h> |
35 | #include "kofilterview_base.h" | 36 | #include "kofilterview_base.h" |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 264cf28..4fc447e 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -1787,23 +1787,25 @@ void KOMonthView::setKeyBoardFocus() | |||
1787 | if ( mShowWeekView ) { | 1787 | if ( mShowWeekView ) { |
1788 | shootAgain = !mWeekLabelsW[1]->hasFocus(); | 1788 | shootAgain = !mWeekLabelsW[1]->hasFocus(); |
1789 | mWeekLabelsW[1]->setFocus(); | 1789 | mWeekLabelsW[1]->setFocus(); |
1790 | } | 1790 | } |
1791 | else { | 1791 | else { |
1792 | shootAgain = !mWeekLabels[mNumWeeks]->hasFocus(); | 1792 | shootAgain = !mWeekLabels[mNumWeeks]->hasFocus(); |
1793 | mWeekLabels[mNumWeeks]->setFocus(); | 1793 | mWeekLabels[mNumWeeks]->setFocus(); |
1794 | } | 1794 | } |
1795 | if ( shootAgain ) { | 1795 | --mKBFcounter; |
1796 | QTimer::singleShot( 0, this, SLOT ( setKeyBFocus() ) ); | 1796 | if ( shootAgain && mKBFcounter > 0 ) { |
1797 | QTimer::singleShot( 50, this, SLOT ( setKeyBoardFocus() ) ); | ||
1797 | } | 1798 | } |
1798 | } | 1799 | } |
1799 | void KOMonthView::setKeyBFocus() | 1800 | void KOMonthView::setKeyBFocus() |
1800 | { | 1801 | { |
1801 | //qDebug("KOMonthView::setKeyBFocus() "); | 1802 | //qDebug("KOMonthView::setKeyBFocus() "); |
1803 | mKBFcounter = 10; | ||
1802 | QTimer::singleShot( 0, this, SLOT ( setKeyBoardFocus() ) ); | 1804 | QTimer::singleShot( 0, this, SLOT ( setKeyBoardFocus() ) ); |
1803 | } | 1805 | } |
1804 | void KOMonthView::resizeEvent(QResizeEvent * e) | 1806 | void KOMonthView::resizeEvent(QResizeEvent * e) |
1805 | { | 1807 | { |
1806 | //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); | 1808 | //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); |
1807 | if ( isVisible() ) { | 1809 | if ( isVisible() ) { |
1808 | //qDebug("KOMonthView::isVisible "); | 1810 | //qDebug("KOMonthView::isVisible "); |
1809 | slotComputeLayout(); | 1811 | slotComputeLayout(); |
@@ -1811,17 +1813,17 @@ void KOMonthView::resizeEvent(QResizeEvent * e) | |||
1811 | mComputeLayoutTimer->start( 100 ); | 1813 | mComputeLayoutTimer->start( 100 ); |
1812 | } | 1814 | } |
1813 | 1815 | ||
1814 | void KOMonthView::slotComputeLayout() | 1816 | void KOMonthView::slotComputeLayout() |
1815 | { | 1817 | { |
1816 | mComputeLayoutTimer->stop(); | 1818 | mComputeLayoutTimer->stop(); |
1817 | //qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() ); | 1819 | //qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() ); |
1818 | computeLayout(); | 1820 | computeLayout(); |
1819 | clPending = true; | 1821 | clPending = true; |
1820 | setKeyBFocus(); | 1822 | setKeyBFocus(); |
1821 | } | 1823 | } |
1822 | void KOMonthView::computeLayoutWeek() | 1824 | void KOMonthView::computeLayoutWeek() |
1823 | { | 1825 | { |
1824 | static int lastWid = 0; | 1826 | static int lastWid = 0; |
1825 | static int lastHei = 0; | 1827 | static int lastHei = 0; |
1826 | int daysToShow; | 1828 | int daysToShow; |
1827 | bool combinedSatSun = false; | 1829 | bool combinedSatSun = false; |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 0bd6b1c..a41eb54 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -273,20 +273,20 @@ class KOMonthView: public KOEventView | |||
273 | 273 | ||
274 | void clearSelection(); | 274 | void clearSelection(); |
275 | 275 | ||
276 | void showContextMenu( Incidence * ); | 276 | void showContextMenu( Incidence * ); |
277 | 277 | ||
278 | void setSelectedCell( MonthViewCell * ); | 278 | void setSelectedCell( MonthViewCell * ); |
279 | void setPopupCell( MonthViewCell * ); | 279 | void setPopupCell( MonthViewCell * ); |
280 | void switchView(); | 280 | void switchView(); |
281 | void setKeyBoardFocus(); | ||
282 | void setKeyBFocus(); | 281 | void setKeyBFocus(); |
283 | 282 | ||
284 | protected slots: | 283 | protected slots: |
284 | void setKeyBoardFocus(); | ||
285 | void slotNewTodo(); | 285 | void slotNewTodo(); |
286 | void slotNewEvent(); | 286 | void slotNewEvent(); |
287 | void slotEditJournal(); | 287 | void slotEditJournal(); |
288 | void slotComputeLayout(); | 288 | void slotComputeLayout(); |
289 | void selectInternalWeekNum ( int ); | 289 | void selectInternalWeekNum ( int ); |
290 | void processSelectionChange(); | 290 | void processSelectionChange(); |
291 | signals: | 291 | signals: |
292 | void nextMonth(); | 292 | void nextMonth(); |
@@ -297,16 +297,17 @@ class KOMonthView: public KOEventView | |||
297 | void newTodoSignal( QDateTime, bool ); | 297 | void newTodoSignal( QDateTime, bool ); |
298 | void showJournalSignal( int,QDate ); | 298 | void showJournalSignal( int,QDate ); |
299 | protected: | 299 | protected: |
300 | void resizeEvent(QResizeEvent *); | 300 | void resizeEvent(QResizeEvent *); |
301 | void viewChanged(); | 301 | void viewChanged(); |
302 | void updateDayLabels(); | 302 | void updateDayLabels(); |
303 | 303 | ||
304 | private: | 304 | private: |
305 | int mKBFcounter; | ||
305 | QTimer* mComputeLayoutTimer; | 306 | QTimer* mComputeLayoutTimer; |
306 | NavigatorBar* mNavigatorBar; | 307 | NavigatorBar* mNavigatorBar; |
307 | int currentWeek(); | 308 | int currentWeek(); |
308 | bool clPending; | 309 | bool clPending; |
309 | QWidgetStack * mWidStack; | 310 | QWidgetStack * mWidStack; |
310 | QWidget* mMonthView; | 311 | QWidget* mMonthView; |
311 | QWidget* mWeekView; | 312 | QWidget* mWeekView; |
312 | bool mShowWeekView; | 313 | bool mShowWeekView; |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 862d437..f68f032 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1907,16 +1907,17 @@ void MainWindow::backupAllFiles() | |||
1907 | qDebug("KO: Backup globally cancelled."); | 1907 | qDebug("KO: Backup globally cancelled."); |
1908 | // backup globally cancelled | 1908 | // backup globally cancelled |
1909 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | 1909 | KPimGlobalPrefs::instance()->mBackupEnabled = false; |
1910 | } | 1910 | } |
1911 | // retval == 3: do nothing, try again later | 1911 | // retval == 3: do nothing, try again later |
1912 | } | 1912 | } |
1913 | void MainWindow::save() | 1913 | void MainWindow::save() |
1914 | { | 1914 | { |
1915 | |||
1915 | if ( mView->viewManager()->journalView() ) | 1916 | if ( mView->viewManager()->journalView() ) |
1916 | mView->viewManager()->journalView()->checkModified(); | 1917 | mView->viewManager()->journalView()->checkModified(); |
1917 | if ( !mCalendarModifiedFlag ) { | 1918 | if ( !mCalendarModifiedFlag ) { |
1918 | qDebug("KO: Calendar not modified. Nothing saved."); | 1919 | qDebug("KO: Calendar not modified. Nothing saved."); |
1919 | return; | 1920 | return; |
1920 | } | 1921 | } |
1921 | if ( mSyncManager->blockSave() ) | 1922 | if ( mSyncManager->blockSave() ) |
1922 | return; | 1923 | return; |
@@ -1926,25 +1927,29 @@ void MainWindow::save() | |||
1926 | QDate reference ( 2000,1,1); | 1927 | QDate reference ( 2000,1,1); |
1927 | int daysTo = reference.daysTo ( QDate::currentDate() ); | 1928 | int daysTo = reference.daysTo ( QDate::currentDate() ); |
1928 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { | 1929 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { |
1929 | backupAllFiles(); | 1930 | backupAllFiles(); |
1930 | } | 1931 | } |
1931 | ; // KPimGlobalPrefs::instance()->mLastBackupDate | 1932 | ; // KPimGlobalPrefs::instance()->mLastBackupDate |
1932 | } | 1933 | } |
1933 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1934 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1934 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1935 | if ( !isMinimized () ) |
1936 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | ||
1935 | qDebug("KO: Start saving data to file!"); | 1937 | qDebug("KO: Start saving data to file!"); |
1936 | mView->saveCalendars(); | 1938 | mView->saveCalendars(); |
1937 | mCalendarModifiedFlag = false; | 1939 | mCalendarModifiedFlag = false; |
1938 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1940 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1939 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1941 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1940 | QString savemes; | 1942 | QString savemes; |
1941 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1943 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1942 | setCaption(savemes); | 1944 | if ( !isMinimized () ) |
1945 | setCaption(savemes); | ||
1946 | else | ||
1947 | qDebug(savemes); | ||
1943 | } else | 1948 | } else |
1944 | setCaption(i18n("Saving cancelled!")); | 1949 | setCaption(i18n("Saving cancelled!")); |
1945 | mSyncManager->setBlockSave( false ); | 1950 | mSyncManager->setBlockSave( false ); |
1946 | } | 1951 | } |
1947 | 1952 | ||
1948 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1953 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1949 | { | 1954 | { |
1950 | if ( !e->isAutoRepeat() ) { | 1955 | if ( !e->isAutoRepeat() ) { |