-rw-r--r-- | korganizer/calendarview.cpp | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 00285a5..29c530b 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -301,105 +301,105 @@ void CalendarView::init() | |||
301 | QBoxLayout * mainBoxLayout; | 301 | QBoxLayout * mainBoxLayout; |
302 | if ( KOPrefs::instance()->mVerticalScreen ) { | 302 | if ( KOPrefs::instance()->mVerticalScreen ) { |
303 | mainBoxLayout = new QVBoxLayout(mainBox); | 303 | mainBoxLayout = new QVBoxLayout(mainBox); |
304 | //leftFrameLayout = new QHBoxLayout(leftFrame ); | 304 | //leftFrameLayout = new QHBoxLayout(leftFrame ); |
305 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mainBox);; | 305 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mainBox);; |
306 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left ); | 306 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left ); |
307 | } else { | 307 | } else { |
308 | mainBoxLayout = new QHBoxLayout(mainBox); | 308 | mainBoxLayout = new QHBoxLayout(mainBox); |
309 | //leftFrameLayout = new QVBoxLayout(leftFrame ); | 309 | //leftFrameLayout = new QVBoxLayout(leftFrame ); |
310 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mainBox);; | 310 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mainBox);; |
311 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 311 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
312 | } | 312 | } |
313 | //QBoxLayout * leftFrameLayout; | 313 | //QBoxLayout * leftFrameLayout; |
314 | topLayout->addWidget( mainBox ); | 314 | topLayout->addWidget( mainBox ); |
315 | mainBoxLayout->addWidget (mLeftFrame); | 315 | mainBoxLayout->addWidget (mLeftFrame); |
316 | mDateNavigator = new DateNavigatorContainer( mLeftFrame, | 316 | mDateNavigator = new DateNavigatorContainer( mLeftFrame, |
317 | "CalendarView::DateNavigator" ); | 317 | "CalendarView::DateNavigator" ); |
318 | #if 0 | 318 | #if 0 |
319 | // FIXME | 319 | // FIXME |
320 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, | 320 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, |
321 | "CalendarView::DateNavigator", QDate::currentDate()); | 321 | "CalendarView::DateNavigator", QDate::currentDate()); |
322 | #endif | 322 | #endif |
323 | // mDateNavigator->blockSignals( true ); | 323 | // mDateNavigator->blockSignals( true ); |
324 | //leftFrameLayout->addWidget( mDateNavigator ); | 324 | //leftFrameLayout->addWidget( mDateNavigator ); |
325 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); | 325 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); |
326 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); | 326 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); |
327 | mTodoList->setNavigator( mNavigator ); | 327 | mTodoList->setNavigator( mNavigator ); |
328 | #if 0 | 328 | #if 0 |
329 | if ( QApplication::desktop()->width() < 480 ) { | 329 | if ( QApplication::desktop()->width() < 480 ) { |
330 | leftFrameLayout->addWidget(mFilterView); | 330 | leftFrameLayout->addWidget(mFilterView); |
331 | leftFrameLayout->addWidget(mTodoList, 2 ); | 331 | leftFrameLayout->addWidget(mTodoList, 2 ); |
332 | 332 | ||
333 | } else { | 333 | } else { |
334 | leftFrameLayout->addWidget(mTodoList,2 ); | 334 | leftFrameLayout->addWidget(mTodoList,2 ); |
335 | leftFrameLayout->addWidget(mFilterView ); | 335 | leftFrameLayout->addWidget(mFilterView ); |
336 | } | 336 | } |
337 | #endif | 337 | #endif |
338 | mFilterView->hide(); | 338 | mFilterView->hide(); |
339 | QWidget *rightBox = new QWidget( mainBox ); | 339 | QWidget *rightBox = new QWidget( mainBox ); |
340 | mainBoxLayout->addWidget ( rightBox, 10 ); | 340 | mainBoxLayout->addWidget ( rightBox, 10 ); |
341 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 341 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
342 | mRightFrame = new QWidgetStack( rightBox ); | 342 | mRightFrame = new QWidgetStack( rightBox ); |
343 | rightLayout->addWidget( mRightFrame, 10 ); | 343 | rightLayout->addWidget( mRightFrame, 10 ); |
344 | 344 | ||
345 | //mLeftFrame = (QWidget *)leftFrame; | 345 | //mLeftFrame = (QWidget *)leftFrame; |
346 | if ( KOPrefs::instance()->mVerticalScreen ) { | 346 | if ( KOPrefs::instance()->mVerticalScreen ) { |
347 | mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); | 347 | mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); |
348 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); | 348 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); |
349 | //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); | 349 | mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); |
350 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); | 350 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); |
351 | } else { | 351 | } else { |
352 | mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); | 352 | mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); |
353 | //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); | 353 | mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); |
354 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); | 354 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); |
355 | } | 355 | } |
356 | if ( !KOPrefs::instance()->mShowDateNavigator) | 356 | if ( !KOPrefs::instance()->mShowDateNavigator) |
357 | mLeftFrame->toggle(); | 357 | mDateNavigator->hide(); |
358 | //qDebug("Calendarview Size %d %d ", width(), height()); | 358 | //qDebug("Calendarview Size %d %d ", width(), height()); |
359 | #endif | 359 | #endif |
360 | 360 | ||
361 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 361 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
362 | SLOT( showDates( const KCal::DateList & ) ) ); | 362 | SLOT( showDates( const KCal::DateList & ) ) ); |
363 | 363 | ||
364 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 364 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
365 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 365 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
366 | 366 | ||
367 | 367 | ||
368 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), | 368 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), |
369 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); | 369 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); |
370 | 370 | ||
371 | connect( mDateNavigator, SIGNAL( goPrevYear() ), | 371 | connect( mDateNavigator, SIGNAL( goPrevYear() ), |
372 | mNavigator, SLOT( selectPreviousYear() ) ); | 372 | mNavigator, SLOT( selectPreviousYear() ) ); |
373 | connect( mDateNavigator, SIGNAL( goNextYear() ), | 373 | connect( mDateNavigator, SIGNAL( goNextYear() ), |
374 | mNavigator, SLOT( selectNextYear() ) ); | 374 | mNavigator, SLOT( selectNextYear() ) ); |
375 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), | 375 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), |
376 | mNavigator, SLOT( selectPreviousMonth() ) ); | 376 | mNavigator, SLOT( selectPreviousMonth() ) ); |
377 | connect( mDateNavigator, SIGNAL( goNextMonth() ), | 377 | connect( mDateNavigator, SIGNAL( goNextMonth() ), |
378 | mNavigator, SLOT( selectNextMonth() ) ); | 378 | mNavigator, SLOT( selectNextMonth() ) ); |
379 | 379 | ||
380 | connect( mDateNavigator, SIGNAL( goPrevious() ), | 380 | connect( mDateNavigator, SIGNAL( goPrevious() ), |
381 | mNavigator, SLOT( selectPrevious() ) ); | 381 | mNavigator, SLOT( selectPrevious() ) ); |
382 | connect( mDateNavigator, SIGNAL( goNext() ), | 382 | connect( mDateNavigator, SIGNAL( goNext() ), |
383 | mNavigator, SLOT( selectNext() ) ); | 383 | mNavigator, SLOT( selectNext() ) ); |
384 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), | 384 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), |
385 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 385 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
386 | 386 | ||
387 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 387 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
388 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 388 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
389 | #if 0 | 389 | #if 0 |
390 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), | 390 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), |
391 | SLOT( incidenceAdded( Incidence *) ) ); | 391 | SLOT( incidenceAdded( Incidence *) ) ); |
392 | #endif | 392 | #endif |
393 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); | 393 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); |
394 | 394 | ||
395 | connect( this, SIGNAL( configChanged() ), | 395 | connect( this, SIGNAL( configChanged() ), |
396 | mDateNavigator, SLOT( updateConfig() ) ); | 396 | mDateNavigator, SLOT( updateConfig() ) ); |
397 | 397 | ||
398 | connect( mTodoList, SIGNAL( newTodoSignal() ), | 398 | connect( mTodoList, SIGNAL( newTodoSignal() ), |
399 | SLOT( newTodo() ) ); | 399 | SLOT( newTodo() ) ); |
400 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), | 400 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), |
401 | SLOT( newSubTodo( Todo * ) ) ); | 401 | SLOT( newSubTodo( Todo * ) ) ); |
402 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), | 402 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), |
403 | SLOT( editTodo( Todo * ) ) ); | 403 | SLOT( editTodo( Todo * ) ) ); |
404 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), | 404 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), |
405 | SLOT( showTodo( Todo *) ) ); | 405 | SLOT( showTodo( Todo *) ) ); |
@@ -1776,176 +1776,215 @@ void CalendarView::closeCalendar() | |||
1776 | 1776 | ||
1777 | // child windows no longer valid | 1777 | // child windows no longer valid |
1778 | emit closingDown(); | 1778 | emit closingDown(); |
1779 | 1779 | ||
1780 | mCalendar->close(); | 1780 | mCalendar->close(); |
1781 | setModified(false); | 1781 | setModified(false); |
1782 | updateView(); | 1782 | updateView(); |
1783 | } | 1783 | } |
1784 | 1784 | ||
1785 | void CalendarView::archiveCalendar() | 1785 | void CalendarView::archiveCalendar() |
1786 | { | 1786 | { |
1787 | mDialogManager->showArchiveDialog(); | 1787 | mDialogManager->showArchiveDialog(); |
1788 | } | 1788 | } |
1789 | 1789 | ||
1790 | 1790 | ||
1791 | void CalendarView::readSettings() | 1791 | void CalendarView::readSettings() |
1792 | { | 1792 | { |
1793 | 1793 | ||
1794 | 1794 | ||
1795 | // mViewManager->showAgendaView(); | 1795 | // mViewManager->showAgendaView(); |
1796 | QString str; | 1796 | QString str; |
1797 | //qDebug("CalendarView::readSettings() "); | 1797 | //qDebug("CalendarView::readSettings() "); |
1798 | // read settings from the KConfig, supplying reasonable | 1798 | // read settings from the KConfig, supplying reasonable |
1799 | // defaults where none are to be found | 1799 | // defaults where none are to be found |
1800 | KConfig *config = KOGlobals::config(); | 1800 | KConfig *config = KOGlobals::config(); |
1801 | #ifndef KORG_NOSPLITTER | 1801 | #ifndef KORG_NOSPLITTER |
1802 | config->setGroup("KOrganizer Geometry"); | 1802 | config->setGroup("KOrganizer Geometry"); |
1803 | 1803 | ||
1804 | QValueList<int> sizes = config->readIntListEntry("Separator1"); | 1804 | QValueList<int> sizes = config->readIntListEntry("Separator1"); |
1805 | if (sizes.count() != 2) { | 1805 | if (sizes.count() != 2) { |
1806 | sizes << mDateNavigator->minimumSizeHint().width(); | 1806 | sizes << mDateNavigator->minimumSizeHint().width(); |
1807 | sizes << 300; | 1807 | sizes << 300; |
1808 | } | 1808 | } |
1809 | mPanner->setSizes(sizes); | 1809 | mPanner->setSizes(sizes); |
1810 | 1810 | ||
1811 | sizes = config->readIntListEntry("Separator2"); | 1811 | sizes = config->readIntListEntry("Separator2"); |
1812 | if ( ( mResourceView && sizes.count() == 4 ) || | 1812 | if ( ( mResourceView && sizes.count() == 4 ) || |
1813 | ( !mResourceView && sizes.count() == 3 ) ) { | 1813 | ( !mResourceView && sizes.count() == 3 ) ) { |
1814 | mLeftSplitter->setSizes(sizes); | 1814 | mLeftSplitter->setSizes(sizes); |
1815 | } | 1815 | } |
1816 | #endif | 1816 | #endif |
1817 | globalFlagBlockAgenda = 1; | 1817 | globalFlagBlockAgenda = 1; |
1818 | mViewManager->showAgendaView(); | 1818 | mViewManager->showAgendaView(); |
1819 | //mViewManager->readSettings( config ); | 1819 | //mViewManager->readSettings( config ); |
1820 | mTodoList->restoreLayout(config,QString("Todo Layout")); | 1820 | mTodoList->restoreLayout(config,QString("Todo Layout")); |
1821 | readFilterSettings(config); | 1821 | readFilterSettings(config); |
1822 | config->setGroup( "Views" ); | 1822 | config->setGroup( "Views" ); |
1823 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); | 1823 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); |
1824 | |||
1825 | QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); | ||
1826 | |||
1827 | int resetval = 0; | ||
1828 | int maxVal = 0; | ||
1829 | if (sizes.count() != 3) { | ||
1830 | if ( KOPrefs::instance()->mVerticalScreen ) { | ||
1831 | resetval = mDateNavigator->sizeHint().width()+2; | ||
1832 | } else { | ||
1833 | resetval = mDateNavigator->sizeHint().height()+2; | ||
1834 | } | ||
1835 | } | ||
1836 | if ( !resetval ){// i.e. sizes.count() == 3 | ||
1837 | if ( KOPrefs::instance()->mVerticalScreen ) { | ||
1838 | if ( sizes[0] < mDateNavigator->sizeHint().width()+1 ) | ||
1839 | resetval = mDateNavigator->sizeHint().width()+2; | ||
1840 | } else { | ||
1841 | if ( sizes[0] < mDateNavigator->sizeHint().height()+1 ) | ||
1842 | resetval = mDateNavigator->sizeHint().height()+2; | ||
1843 | } | ||
1844 | } | ||
1845 | if ( resetval ) { | ||
1846 | sizes.clear(); | ||
1847 | if ( KOPrefs::instance()->mVerticalScreen ) { | ||
1848 | maxVal = QApplication::desktop()->width() -10; | ||
1849 | } else { | ||
1850 | maxVal = QApplication::desktop()->height()-10; | ||
1851 | } | ||
1852 | sizes << resetval; | ||
1853 | if ( maxVal < resetval + resetval) | ||
1854 | resetval = maxVal - resetval; | ||
1855 | sizes << resetval; | ||
1856 | sizes << 100; | ||
1857 | } | ||
1858 | mLeftFrame->setSizes(sizes); | ||
1859 | qDebug("sizes count %d ", sizes.count()); | ||
1824 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); | 1860 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); |
1825 | else if ( dateCount == 7 ) mNavigator->selectWeek(); | 1861 | else if ( dateCount == 7 ) mNavigator->selectWeek(); |
1826 | else mNavigator->selectDates( dateCount ); | 1862 | else mNavigator->selectDates( dateCount ); |
1827 | // mViewManager->readSettings( config ); | 1863 | // mViewManager->readSettings( config ); |
1828 | updateConfig(); | 1864 | updateConfig(); |
1829 | globalFlagBlockAgenda = 2; | 1865 | globalFlagBlockAgenda = 2; |
1830 | mViewManager->readSettings( config ); | 1866 | mViewManager->readSettings( config ); |
1831 | #ifdef DESKTOP_VERSION | 1867 | #ifdef DESKTOP_VERSION |
1832 | config->setGroup("WidgetLayout"); | 1868 | config->setGroup("WidgetLayout"); |
1833 | QStringList list; | 1869 | QStringList list; |
1834 | list = config->readListEntry("MainLayout"); | 1870 | list = config->readListEntry("MainLayout"); |
1835 | int x,y,w,h; | 1871 | int x,y,w,h; |
1836 | if ( ! list.isEmpty() ) { | 1872 | if ( ! list.isEmpty() ) { |
1837 | x = list[0].toInt(); | 1873 | x = list[0].toInt(); |
1838 | y = list[1].toInt(); | 1874 | y = list[1].toInt(); |
1839 | w = list[2].toInt(); | 1875 | w = list[2].toInt(); |
1840 | h = list[3].toInt(); | 1876 | h = list[3].toInt(); |
1841 | topLevelWidget()->setGeometry(x,y,w,h); | 1877 | topLevelWidget()->setGeometry(x,y,w,h); |
1842 | 1878 | ||
1843 | } else { | 1879 | } else { |
1844 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); | 1880 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); |
1845 | } | 1881 | } |
1846 | list = config->readListEntry("EditEventLayout"); | 1882 | list = config->readListEntry("EditEventLayout"); |
1847 | if ( ! list.isEmpty() ) { | 1883 | if ( ! list.isEmpty() ) { |
1848 | x = list[0].toInt(); | 1884 | x = list[0].toInt(); |
1849 | y = list[1].toInt(); | 1885 | y = list[1].toInt(); |
1850 | w = list[2].toInt(); | 1886 | w = list[2].toInt(); |
1851 | h = list[3].toInt(); | 1887 | h = list[3].toInt(); |
1852 | mEventEditor->setGeometry(x,y,w,h); | 1888 | mEventEditor->setGeometry(x,y,w,h); |
1853 | 1889 | ||
1854 | } | 1890 | } |
1855 | list = config->readListEntry("EditTodoLayout"); | 1891 | list = config->readListEntry("EditTodoLayout"); |
1856 | if ( ! list.isEmpty() ) { | 1892 | if ( ! list.isEmpty() ) { |
1857 | x = list[0].toInt(); | 1893 | x = list[0].toInt(); |
1858 | y = list[1].toInt(); | 1894 | y = list[1].toInt(); |
1859 | w = list[2].toInt(); | 1895 | w = list[2].toInt(); |
1860 | h = list[3].toInt(); | 1896 | h = list[3].toInt(); |
1861 | mTodoEditor->setGeometry(x,y,w,h); | 1897 | mTodoEditor->setGeometry(x,y,w,h); |
1862 | 1898 | ||
1863 | } | 1899 | } |
1864 | list = config->readListEntry("ViewerLayout"); | 1900 | list = config->readListEntry("ViewerLayout"); |
1865 | if ( ! list.isEmpty() ) { | 1901 | if ( ! list.isEmpty() ) { |
1866 | x = list[0].toInt(); | 1902 | x = list[0].toInt(); |
1867 | y = list[1].toInt(); | 1903 | y = list[1].toInt(); |
1868 | w = list[2].toInt(); | 1904 | w = list[2].toInt(); |
1869 | h = list[3].toInt(); | 1905 | h = list[3].toInt(); |
1870 | getEventViewerDialog()->setGeometry(x,y,w,h); | 1906 | getEventViewerDialog()->setGeometry(x,y,w,h); |
1871 | } | 1907 | } |
1872 | #endif | 1908 | #endif |
1873 | 1909 | ||
1874 | } | 1910 | } |
1875 | 1911 | ||
1876 | 1912 | ||
1877 | void CalendarView::writeSettings() | 1913 | void CalendarView::writeSettings() |
1878 | { | 1914 | { |
1879 | // kdDebug() << "CalendarView::writeSettings" << endl; | 1915 | // kdDebug() << "CalendarView::writeSettings" << endl; |
1880 | 1916 | ||
1881 | KConfig *config = KOGlobals::config(); | 1917 | KConfig *config = KOGlobals::config(); |
1882 | 1918 | ||
1883 | #ifndef KORG_NOSPLITTER | 1919 | #ifndef KORG_NOSPLITTER |
1884 | config->setGroup("KOrganizer Geometry"); | 1920 | config->setGroup("KOrganizer Geometry"); |
1885 | 1921 | ||
1886 | QValueList<int> list = mPanner->sizes(); | 1922 | QValueList<int> list = mPanner->sizes(); |
1887 | config->writeEntry("Separator1",list); | 1923 | config->writeEntry("Separator1",list); |
1888 | 1924 | ||
1889 | list = mLeftSplitter->sizes(); | 1925 | list = mLeftSplitter->sizes(); |
1890 | config->writeEntry("Separator2",list); | 1926 | config->writeEntry("Separator2",list); |
1891 | #endif | 1927 | #endif |
1892 | 1928 | ||
1893 | mViewManager->writeSettings( config ); | 1929 | mViewManager->writeSettings( config ); |
1894 | mTodoList->saveLayout(config,QString("Todo Layout")); | 1930 | mTodoList->saveLayout(config,QString("Todo Layout")); |
1895 | mDialogManager->writeSettings( config ); | 1931 | mDialogManager->writeSettings( config ); |
1896 | //KOPrefs::instance()->usrWriteConfig(); | 1932 | //KOPrefs::instance()->usrWriteConfig(); |
1897 | KOPrefs::instance()->writeConfig(); | 1933 | KOPrefs::instance()->writeConfig(); |
1898 | 1934 | ||
1899 | writeFilterSettings(config); | 1935 | writeFilterSettings(config); |
1900 | 1936 | ||
1901 | config->setGroup( "Views" ); | 1937 | config->setGroup( "Views" ); |
1902 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); | 1938 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); |
1903 | 1939 | ||
1940 | QValueList<int> list = mLeftFrame->sizes(); | ||
1941 | config->writeEntry("Left Splitter Frame",list); | ||
1942 | |||
1904 | #ifdef DESKTOP_VERSION | 1943 | #ifdef DESKTOP_VERSION |
1905 | config->setGroup("WidgetLayout"); | 1944 | config->setGroup("WidgetLayout"); |
1906 | QStringList list ;//= config->readListEntry("MainLayout"); | 1945 | QStringList list ;//= config->readListEntry("MainLayout"); |
1907 | int x,y,w,h; | 1946 | int x,y,w,h; |
1908 | QWidget* wid; | 1947 | QWidget* wid; |
1909 | wid = topLevelWidget(); | 1948 | wid = topLevelWidget(); |
1910 | x = wid->geometry().x(); | 1949 | x = wid->geometry().x(); |
1911 | y = wid->geometry().y(); | 1950 | y = wid->geometry().y(); |
1912 | w = wid->width(); | 1951 | w = wid->width(); |
1913 | h = wid->height(); | 1952 | h = wid->height(); |
1914 | list.clear(); | 1953 | list.clear(); |
1915 | list << QString::number( x ); | 1954 | list << QString::number( x ); |
1916 | list << QString::number( y ); | 1955 | list << QString::number( y ); |
1917 | list << QString::number( w ); | 1956 | list << QString::number( w ); |
1918 | list << QString::number( h ); | 1957 | list << QString::number( h ); |
1919 | config->writeEntry("MainLayout",list ); | 1958 | config->writeEntry("MainLayout",list ); |
1920 | 1959 | ||
1921 | wid = mEventEditor; | 1960 | wid = mEventEditor; |
1922 | x = wid->geometry().x(); | 1961 | x = wid->geometry().x(); |
1923 | y = wid->geometry().y(); | 1962 | y = wid->geometry().y(); |
1924 | w = wid->width(); | 1963 | w = wid->width(); |
1925 | h = wid->height(); | 1964 | h = wid->height(); |
1926 | list.clear(); | 1965 | list.clear(); |
1927 | list << QString::number( x ); | 1966 | list << QString::number( x ); |
1928 | list << QString::number( y ); | 1967 | list << QString::number( y ); |
1929 | list << QString::number( w ); | 1968 | list << QString::number( w ); |
1930 | list << QString::number( h ); | 1969 | list << QString::number( h ); |
1931 | config->writeEntry("EditEventLayout",list ); | 1970 | config->writeEntry("EditEventLayout",list ); |
1932 | 1971 | ||
1933 | wid = mTodoEditor; | 1972 | wid = mTodoEditor; |
1934 | x = wid->geometry().x(); | 1973 | x = wid->geometry().x(); |
1935 | y = wid->geometry().y(); | 1974 | y = wid->geometry().y(); |
1936 | w = wid->width(); | 1975 | w = wid->width(); |
1937 | h = wid->height(); | 1976 | h = wid->height(); |
1938 | list.clear(); | 1977 | list.clear(); |
1939 | list << QString::number( x ); | 1978 | list << QString::number( x ); |
1940 | list << QString::number( y ); | 1979 | list << QString::number( y ); |
1941 | list << QString::number( w ); | 1980 | list << QString::number( w ); |
1942 | list << QString::number( h ); | 1981 | list << QString::number( h ); |
1943 | config->writeEntry("EditTodoLayout",list ); | 1982 | config->writeEntry("EditTodoLayout",list ); |
1944 | wid = getEventViewerDialog(); | 1983 | wid = getEventViewerDialog(); |
1945 | x = wid->geometry().x(); | 1984 | x = wid->geometry().x(); |
1946 | y = wid->geometry().y(); | 1985 | y = wid->geometry().y(); |
1947 | w = wid->width(); | 1986 | w = wid->width(); |
1948 | h = wid->height(); | 1987 | h = wid->height(); |
1949 | list.clear(); | 1988 | list.clear(); |
1950 | list << QString::number( x ); | 1989 | list << QString::number( x ); |
1951 | list << QString::number( y ); | 1990 | list << QString::number( y ); |
@@ -3669,104 +3708,101 @@ void CalendarView::takeOverCalendar() | |||
3669 | events.at(i)->recreate(); | 3708 | events.at(i)->recreate(); |
3670 | events.at(i)->setReadOnly(false); | 3709 | events.at(i)->setReadOnly(false); |
3671 | } | 3710 | } |
3672 | 3711 | ||
3673 | QPtrList<Todo> todos = mCalendar->todos(); | 3712 | QPtrList<Todo> todos = mCalendar->todos(); |
3674 | for(uint i=0; i<todos.count(); ++i) { | 3713 | for(uint i=0; i<todos.count(); ++i) { |
3675 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3714 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3676 | todos.at(i)->recreate(); | 3715 | todos.at(i)->recreate(); |
3677 | todos.at(i)->setReadOnly(false); | 3716 | todos.at(i)->setReadOnly(false); |
3678 | } | 3717 | } |
3679 | 3718 | ||
3680 | QPtrList<Journal> journals = mCalendar->journals(); | 3719 | QPtrList<Journal> journals = mCalendar->journals(); |
3681 | for(uint i=0; i<journals.count(); ++i) { | 3720 | for(uint i=0; i<journals.count(); ++i) { |
3682 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3721 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3683 | journals.at(i)->recreate(); | 3722 | journals.at(i)->recreate(); |
3684 | journals.at(i)->setReadOnly(false); | 3723 | journals.at(i)->setReadOnly(false); |
3685 | } | 3724 | } |
3686 | 3725 | ||
3687 | updateView(); | 3726 | updateView(); |
3688 | } | 3727 | } |
3689 | 3728 | ||
3690 | void CalendarView::showIntro() | 3729 | void CalendarView::showIntro() |
3691 | { | 3730 | { |
3692 | kdDebug() << "To be implemented." << endl; | 3731 | kdDebug() << "To be implemented." << endl; |
3693 | } | 3732 | } |
3694 | 3733 | ||
3695 | QWidgetStack *CalendarView::viewStack() | 3734 | QWidgetStack *CalendarView::viewStack() |
3696 | { | 3735 | { |
3697 | return mRightFrame; | 3736 | return mRightFrame; |
3698 | } | 3737 | } |
3699 | 3738 | ||
3700 | QWidget *CalendarView::leftFrame() | 3739 | QWidget *CalendarView::leftFrame() |
3701 | { | 3740 | { |
3702 | return ( QWidget *)mLeftFrame; | 3741 | return ( QWidget *)mLeftFrame; |
3703 | } | 3742 | } |
3704 | 3743 | ||
3705 | DateNavigator *CalendarView::dateNavigator() | 3744 | DateNavigator *CalendarView::dateNavigator() |
3706 | { | 3745 | { |
3707 | return mNavigator; | 3746 | return mNavigator; |
3708 | } | 3747 | } |
3709 | 3748 | ||
3710 | KDateNavigator* CalendarView::dateNavigatorWidget() | 3749 | KDateNavigator* CalendarView::dateNavigatorWidget() |
3711 | { | 3750 | { |
3712 | return mDateNavigator->navigatorView(); | 3751 | return mDateNavigator->navigatorView(); |
3713 | } | 3752 | } |
3714 | void CalendarView::toggleDateNavigatorWidget() | 3753 | void CalendarView::toggleDateNavigatorWidget() |
3715 | { | 3754 | { |
3716 | KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; | 3755 | KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; |
3717 | mLeftFrame->toggle(); | 3756 | |
3718 | // FIXME mShowDateNavigator is not the toggle state of mLeftFrame | ||
3719 | #if 0 | ||
3720 | if (!KOPrefs::instance()->mShowDateNavigator ) | 3757 | if (!KOPrefs::instance()->mShowDateNavigator ) |
3721 | mDateNavigator->hide(); | 3758 | mDateNavigator->hide(); |
3722 | else | 3759 | else |
3723 | mDateNavigator->show(); | 3760 | mDateNavigator->show(); |
3724 | #endif | ||
3725 | } | 3761 | } |
3726 | void CalendarView::addView(KOrg::BaseView *view) | 3762 | void CalendarView::addView(KOrg::BaseView *view) |
3727 | { | 3763 | { |
3728 | mViewManager->addView(view); | 3764 | mViewManager->addView(view); |
3729 | } | 3765 | } |
3730 | 3766 | ||
3731 | void CalendarView::showView(KOrg::BaseView *view) | 3767 | void CalendarView::showView(KOrg::BaseView *view) |
3732 | { | 3768 | { |
3733 | mViewManager->showView(view, mLeftFrame->isVisible()); | 3769 | mViewManager->showView(view, mLeftFrame->isVisible()); |
3734 | } | 3770 | } |
3735 | 3771 | ||
3736 | Incidence *CalendarView::currentSelection() | 3772 | Incidence *CalendarView::currentSelection() |
3737 | { | 3773 | { |
3738 | return mViewManager->currentSelection(); | 3774 | return mViewManager->currentSelection(); |
3739 | } | 3775 | } |
3740 | void CalendarView::toggleAllDaySize() | 3776 | void CalendarView::toggleAllDaySize() |
3741 | { | 3777 | { |
3742 | /* | 3778 | /* |
3743 | if ( KOPrefs::instance()->mAllDaySize > 47 ) | 3779 | if ( KOPrefs::instance()->mAllDaySize > 47 ) |
3744 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; | 3780 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; |
3745 | else | 3781 | else |
3746 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; | 3782 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; |
3747 | */ | 3783 | */ |
3748 | viewManager()->agendaView()->toggleAllDay(); | 3784 | viewManager()->agendaView()->toggleAllDay(); |
3749 | } | 3785 | } |
3750 | void CalendarView::toggleExpand() | 3786 | void CalendarView::toggleExpand() |
3751 | { | 3787 | { |
3752 | // if ( mLeftFrame->isHidden() ) { | 3788 | // if ( mLeftFrame->isHidden() ) { |
3753 | // mLeftFrame->show(); | 3789 | // mLeftFrame->show(); |
3754 | // emit calendarViewExpanded( false ); | 3790 | // emit calendarViewExpanded( false ); |
3755 | // } else { | 3791 | // } else { |
3756 | // mLeftFrame->hide(); | 3792 | // mLeftFrame->hide(); |
3757 | // emit calendarViewExpanded( true ); | 3793 | // emit calendarViewExpanded( true ); |
3758 | // } | 3794 | // } |
3759 | //qDebug(" CalendarView::toggleExpand()"); | 3795 | //qDebug(" CalendarView::toggleExpand()"); |
3760 | globalFlagBlockAgenda = 1; | 3796 | globalFlagBlockAgenda = 1; |
3761 | emit calendarViewExpanded( !mLeftFrame->isHidden() ); | 3797 | emit calendarViewExpanded( !mLeftFrame->isHidden() ); |
3762 | globalFlagBlockAgenda = 5; | 3798 | globalFlagBlockAgenda = 5; |
3763 | mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); | 3799 | mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); |
3764 | //mViewManager->showView( 0, true ); | 3800 | //mViewManager->showView( 0, true ); |
3765 | } | 3801 | } |
3766 | 3802 | ||
3767 | void CalendarView::calendarModified( bool modified, Calendar * ) | 3803 | void CalendarView::calendarModified( bool modified, Calendar * ) |
3768 | { | 3804 | { |
3769 | setModified( modified ); | 3805 | setModified( modified ); |
3770 | } | 3806 | } |
3771 | 3807 | ||
3772 | Todo *CalendarView::selectedTodo() | 3808 | Todo *CalendarView::selectedTodo() |