summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Unidiff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 29c530b..9acbbb1 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1763,193 +1763,192 @@ bool CalendarView::saveCalendar( QString filename )
1763 success = mStorage->save(); 1763 success = mStorage->save();
1764 if ( !success ) { 1764 if ( !success ) {
1765 return false; 1765 return false;
1766 } 1766 }
1767 if ( filename == MainWindow::defaultFileName() ) { 1767 if ( filename == MainWindow::defaultFileName() ) {
1768 setLoadedFileVersion( lfv ); 1768 setLoadedFileVersion( lfv );
1769 watchSavedFile(); 1769 watchSavedFile();
1770 } 1770 }
1771 return true; 1771 return true;
1772} 1772}
1773 1773
1774void CalendarView::closeCalendar() 1774void CalendarView::closeCalendar()
1775{ 1775{
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
1785void CalendarView::archiveCalendar() 1785void CalendarView::archiveCalendar()
1786{ 1786{
1787 mDialogManager->showArchiveDialog(); 1787 mDialogManager->showArchiveDialog();
1788} 1788}
1789 1789
1790 1790
1791void CalendarView::readSettings() 1791void 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 1824
1825 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 1825 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
1826 1826
1827 int resetval = 0; 1827 int resetval = 0;
1828 int maxVal = 0; 1828 int maxVal = 0;
1829 if (sizes.count() != 3) { 1829 if (sizes.count() != 3) {
1830 if ( KOPrefs::instance()->mVerticalScreen ) { 1830 if ( KOPrefs::instance()->mVerticalScreen ) {
1831 resetval = mDateNavigator->sizeHint().width()+2; 1831 resetval = mDateNavigator->sizeHint().width()+2;
1832 } else { 1832 } else {
1833 resetval = mDateNavigator->sizeHint().height()+2; 1833 resetval = mDateNavigator->sizeHint().height()+2;
1834 } 1834 }
1835 } 1835 }
1836 if ( !resetval ){// i.e. sizes.count() == 3 1836 if ( !resetval ){// i.e. sizes.count() == 3
1837 if ( KOPrefs::instance()->mVerticalScreen ) { 1837 if ( KOPrefs::instance()->mVerticalScreen ) {
1838 if ( sizes[0] < mDateNavigator->sizeHint().width()+1 ) 1838 if ( sizes[0] < mDateNavigator->sizeHint().width()+1 )
1839 resetval = mDateNavigator->sizeHint().width()+2; 1839 resetval = mDateNavigator->sizeHint().width()+2;
1840 } else { 1840 } else {
1841 if ( sizes[0] < mDateNavigator->sizeHint().height()+1 ) 1841 if ( sizes[0] < mDateNavigator->sizeHint().height()+1 )
1842 resetval = mDateNavigator->sizeHint().height()+2; 1842 resetval = mDateNavigator->sizeHint().height()+2;
1843 } 1843 }
1844 } 1844 }
1845 if ( resetval ) { 1845 if ( resetval ) {
1846 sizes.clear(); 1846 sizes.clear();
1847 if ( KOPrefs::instance()->mVerticalScreen ) { 1847 if ( KOPrefs::instance()->mVerticalScreen ) {
1848 maxVal = QApplication::desktop()->width() -10; 1848 maxVal = QApplication::desktop()->width() -10;
1849 } else { 1849 } else {
1850 maxVal = QApplication::desktop()->height()-10; 1850 maxVal = QApplication::desktop()->height()-10;
1851 } 1851 }
1852 sizes << resetval; 1852 sizes << resetval;
1853 if ( maxVal < resetval + resetval) 1853 if ( maxVal < resetval + resetval)
1854 resetval = maxVal - resetval; 1854 resetval = maxVal - resetval;
1855 sizes << resetval; 1855 sizes << resetval;
1856 sizes << 100; 1856 sizes << 100;
1857 } 1857 }
1858 mLeftFrame->setSizes(sizes); 1858 mLeftFrame->setSizes(sizes);
1859 qDebug("sizes count %d ", sizes.count());
1860 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 1859 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
1861 else if ( dateCount == 7 ) mNavigator->selectWeek(); 1860 else if ( dateCount == 7 ) mNavigator->selectWeek();
1862 else mNavigator->selectDates( dateCount ); 1861 else mNavigator->selectDates( dateCount );
1863 // mViewManager->readSettings( config ); 1862 // mViewManager->readSettings( config );
1864 updateConfig(); 1863 updateConfig();
1865 globalFlagBlockAgenda = 2; 1864 globalFlagBlockAgenda = 2;
1866 mViewManager->readSettings( config ); 1865 mViewManager->readSettings( config );
1867#ifdef DESKTOP_VERSION 1866#ifdef DESKTOP_VERSION
1868 config->setGroup("WidgetLayout"); 1867 config->setGroup("WidgetLayout");
1869 QStringList list; 1868 QStringList list;
1870 list = config->readListEntry("MainLayout"); 1869 list = config->readListEntry("MainLayout");
1871 int x,y,w,h; 1870 int x,y,w,h;
1872 if ( ! list.isEmpty() ) { 1871 if ( ! list.isEmpty() ) {
1873 x = list[0].toInt(); 1872 x = list[0].toInt();
1874 y = list[1].toInt(); 1873 y = list[1].toInt();
1875 w = list[2].toInt(); 1874 w = list[2].toInt();
1876 h = list[3].toInt(); 1875 h = list[3].toInt();
1877 topLevelWidget()->setGeometry(x,y,w,h); 1876 topLevelWidget()->setGeometry(x,y,w,h);
1878 1877
1879 } else { 1878 } else {
1880 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 1879 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
1881 } 1880 }
1882 list = config->readListEntry("EditEventLayout"); 1881 list = config->readListEntry("EditEventLayout");
1883 if ( ! list.isEmpty() ) { 1882 if ( ! list.isEmpty() ) {
1884 x = list[0].toInt(); 1883 x = list[0].toInt();
1885 y = list[1].toInt(); 1884 y = list[1].toInt();
1886 w = list[2].toInt(); 1885 w = list[2].toInt();
1887 h = list[3].toInt(); 1886 h = list[3].toInt();
1888 mEventEditor->setGeometry(x,y,w,h); 1887 mEventEditor->setGeometry(x,y,w,h);
1889 1888
1890 } 1889 }
1891 list = config->readListEntry("EditTodoLayout"); 1890 list = config->readListEntry("EditTodoLayout");
1892 if ( ! list.isEmpty() ) { 1891 if ( ! list.isEmpty() ) {
1893 x = list[0].toInt(); 1892 x = list[0].toInt();
1894 y = list[1].toInt(); 1893 y = list[1].toInt();
1895 w = list[2].toInt(); 1894 w = list[2].toInt();
1896 h = list[3].toInt(); 1895 h = list[3].toInt();
1897 mTodoEditor->setGeometry(x,y,w,h); 1896 mTodoEditor->setGeometry(x,y,w,h);
1898 1897
1899 } 1898 }
1900 list = config->readListEntry("ViewerLayout"); 1899 list = config->readListEntry("ViewerLayout");
1901 if ( ! list.isEmpty() ) { 1900 if ( ! list.isEmpty() ) {
1902 x = list[0].toInt(); 1901 x = list[0].toInt();
1903 y = list[1].toInt(); 1902 y = list[1].toInt();
1904 w = list[2].toInt(); 1903 w = list[2].toInt();
1905 h = list[3].toInt(); 1904 h = list[3].toInt();
1906 getEventViewerDialog()->setGeometry(x,y,w,h); 1905 getEventViewerDialog()->setGeometry(x,y,w,h);
1907 } 1906 }
1908#endif 1907#endif
1909 1908
1910} 1909}
1911 1910
1912 1911
1913void CalendarView::writeSettings() 1912void CalendarView::writeSettings()
1914{ 1913{
1915 // kdDebug() << "CalendarView::writeSettings" << endl; 1914 // kdDebug() << "CalendarView::writeSettings" << endl;
1916 1915
1917 KConfig *config = KOGlobals::config(); 1916 KConfig *config = KOGlobals::config();
1918 1917
1919#ifndef KORG_NOSPLITTER 1918#ifndef KORG_NOSPLITTER
1920 config->setGroup("KOrganizer Geometry"); 1919 config->setGroup("KOrganizer Geometry");
1921 1920
1922 QValueList<int> list = mPanner->sizes(); 1921 QValueList<int> list = mPanner->sizes();
1923 config->writeEntry("Separator1",list); 1922 config->writeEntry("Separator1",list);
1924 1923
1925 list = mLeftSplitter->sizes(); 1924 list = mLeftSplitter->sizes();
1926 config->writeEntry("Separator2",list); 1925 config->writeEntry("Separator2",list);
1927#endif 1926#endif
1928 1927
1929 mViewManager->writeSettings( config ); 1928 mViewManager->writeSettings( config );
1930 mTodoList->saveLayout(config,QString("Todo Layout")); 1929 mTodoList->saveLayout(config,QString("Todo Layout"));
1931 mDialogManager->writeSettings( config ); 1930 mDialogManager->writeSettings( config );
1932 //KOPrefs::instance()->usrWriteConfig(); 1931 //KOPrefs::instance()->usrWriteConfig();
1933 KOPrefs::instance()->writeConfig(); 1932 KOPrefs::instance()->writeConfig();
1934 1933
1935 writeFilterSettings(config); 1934 writeFilterSettings(config);
1936 1935
1937 config->setGroup( "Views" ); 1936 config->setGroup( "Views" );
1938 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 1937 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
1939 1938
1940 QValueList<int> list = mLeftFrame->sizes(); 1939 QValueList<int> list = mLeftFrame->sizes();
1941 config->writeEntry("Left Splitter Frame",list); 1940 config->writeEntry("Left Splitter Frame",list);
1942 1941
1943#ifdef DESKTOP_VERSION 1942#ifdef DESKTOP_VERSION
1944 config->setGroup("WidgetLayout"); 1943 config->setGroup("WidgetLayout");
1945 QStringList list ;//= config->readListEntry("MainLayout"); 1944 QStringList list ;//= config->readListEntry("MainLayout");
1946 int x,y,w,h; 1945 int x,y,w,h;
1947 QWidget* wid; 1946 QWidget* wid;
1948 wid = topLevelWidget(); 1947 wid = topLevelWidget();
1949 x = wid->geometry().x(); 1948 x = wid->geometry().x();
1950 y = wid->geometry().y(); 1949 y = wid->geometry().y();
1951 w = wid->width(); 1950 w = wid->width();
1952 h = wid->height(); 1951 h = wid->height();
1953 list.clear(); 1952 list.clear();
1954 list << QString::number( x ); 1953 list << QString::number( x );
1955 list << QString::number( y ); 1954 list << QString::number( y );