summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index ab59d00..96ced08 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1816,97 +1816,97 @@ void CalendarView::readSettings()
1816 if ( ( mResourceView && sizes.count() == 4 ) || 1816 if ( ( mResourceView && sizes.count() == 4 ) ||
1817 ( !mResourceView && sizes.count() == 3 ) ) { 1817 ( !mResourceView && sizes.count() == 3 ) ) {
1818 mLeftSplitter->setSizes(sizes); 1818 mLeftSplitter->setSizes(sizes);
1819 } 1819 }
1820#endif 1820#endif
1821 globalFlagBlockAgenda = 1; 1821 globalFlagBlockAgenda = 1;
1822 mViewManager->showAgendaView(); 1822 mViewManager->showAgendaView();
1823 //mViewManager->readSettings( config ); 1823 //mViewManager->readSettings( config );
1824 mTodoList->restoreLayout(config,QString("Todo Layout")); 1824 mTodoList->restoreLayout(config,QString("Todo Layout"));
1825 readFilterSettings(config); 1825 readFilterSettings(config);
1826 config->setGroup( "Views" ); 1826 config->setGroup( "Views" );
1827 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 1827 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
1828 1828
1829 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 1829 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
1830 1830
1831 int resetval = 0; 1831 int resetval = 0;
1832 int maxVal = 0; 1832 int maxVal = 0;
1833 if (sizes.count() != 3) { 1833 if (sizes.count() != 3) {
1834 if ( KOPrefs::instance()->mVerticalScreen ) { 1834 if ( KOPrefs::instance()->mVerticalScreen ) {
1835 resetval = mDateNavigator->sizeHint().width()+2; 1835 resetval = mDateNavigator->sizeHint().width()+2;
1836 } else { 1836 } else {
1837 resetval = mDateNavigator->sizeHint().height()+2; 1837 resetval = mDateNavigator->sizeHint().height()+2;
1838 } 1838 }
1839 } 1839 }
1840 if ( !resetval ){// i.e. sizes.count() == 3 1840 if ( !resetval ){// i.e. sizes.count() == 3
1841 if ( KOPrefs::instance()->mVerticalScreen ) { 1841 if ( KOPrefs::instance()->mVerticalScreen ) {
1842 if ( sizes[0] < mDateNavigator->sizeHint().width()+1 ) 1842 if ( sizes[0] < mDateNavigator->sizeHint().width()+1 )
1843 resetval = mDateNavigator->sizeHint().width()+2; 1843 resetval = mDateNavigator->sizeHint().width()+2;
1844 } else { 1844 } else {
1845 if ( sizes[0] < mDateNavigator->sizeHint().height()+1 ) 1845 if ( sizes[0] < mDateNavigator->sizeHint().height()+1 )
1846 resetval = mDateNavigator->sizeHint().height()+2; 1846 resetval = mDateNavigator->sizeHint().height()+2;
1847 } 1847 }
1848 } 1848 }
1849 if ( resetval ) { 1849 if ( resetval ) {
1850 sizes.clear(); 1850 sizes.clear();
1851 if ( KOPrefs::instance()->mVerticalScreen ) { 1851 if ( KOPrefs::instance()->mVerticalScreen ) {
1852 maxVal = QApplication::desktop()->width() -10; 1852 maxVal = QApplication::desktop()->width() -10;
1853 } else { 1853 } else {
1854 maxVal = QApplication::desktop()->height()-10; 1854 maxVal = QApplication::desktop()->height()-10;
1855 } 1855 }
1856 sizes << resetval; 1856 sizes << resetval;
1857 if ( maxVal < resetval + resetval) 1857 if ( maxVal < resetval + resetval)
1858 resetval = maxVal - resetval; 1858 resetval = maxVal - resetval;
1859 sizes << resetval; 1859 sizes << resetval;
1860 sizes << 100; 1860 sizes << 100;
1861 } 1861 }
1862 mLeftFrame->setSizes(sizes); 1862 mLeftFrame->setSizes(sizes);
1863 sizes = config->readIntListEntry("Main Splitter Frame"); 1863 sizes = config->readIntListEntry("Main Splitter Frame");
1864 if (sizes.count() != 3) { 1864 if (sizes.count() != 2) {
1865 if ( !KOPrefs::instance()->mVerticalScreen ) { 1865 if ( !KOPrefs::instance()->mVerticalScreen ) {
1866 resetval = mDateNavigator->sizeHint().width()+2; 1866 resetval = mDateNavigator->sizeHint().width()+2;
1867 } else { 1867 } else {
1868 resetval = mDateNavigator->sizeHint().height()+2; 1868 resetval = mDateNavigator->sizeHint().height()+2;
1869 } 1869 }
1870 } 1870 }
1871 if ( !resetval ){// i.e. sizes.count() == 3 1871 if ( !resetval ){// i.e. sizes.count() == 3
1872 if ( !KOPrefs::instance()->mVerticalScreen ) { 1872 if ( !KOPrefs::instance()->mVerticalScreen ) {
1873 if ( sizes[0] < mDateNavigator->sizeHint().width()+1 ) 1873 if ( sizes[0] < mDateNavigator->sizeHint().width()+1 )
1874 resetval = mDateNavigator->sizeHint().width()+2; 1874 resetval = mDateNavigator->sizeHint().width()+2;
1875 } else { 1875 } else {
1876 if ( sizes[0] < mDateNavigator->sizeHint().height()+1 ) 1876 if ( sizes[0] < mDateNavigator->sizeHint().height()+1 )
1877 resetval = mDateNavigator->sizeHint().height()+2; 1877 resetval = mDateNavigator->sizeHint().height()+2;
1878 } 1878 }
1879 } 1879 }
1880 if ( resetval ) { 1880 if ( resetval ) {
1881 sizes.clear(); 1881 sizes.clear();
1882 if ( !KOPrefs::instance()->mVerticalScreen ) { 1882 if ( !KOPrefs::instance()->mVerticalScreen ) {
1883 maxVal = QApplication::desktop()->width() -10; 1883 maxVal = QApplication::desktop()->width() -10;
1884 } else { 1884 } else {
1885 maxVal = QApplication::desktop()->height()-10; 1885 maxVal = QApplication::desktop()->height()-10;
1886 } 1886 }
1887 sizes << resetval; 1887 sizes << resetval;
1888 if ( maxVal < resetval + resetval) 1888 if ( maxVal < resetval + resetval)
1889 resetval = maxVal - resetval; 1889 resetval = maxVal - resetval;
1890 sizes << resetval; 1890 sizes << resetval;
1891 } 1891 }
1892 mMainFrame->setSizes(sizes); 1892 mMainFrame->setSizes(sizes);
1893 1893
1894 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 1894 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
1895 else if ( dateCount == 7 ) mNavigator->selectWeek(); 1895 else if ( dateCount == 7 ) mNavigator->selectWeek();
1896 else mNavigator->selectDates( dateCount ); 1896 else mNavigator->selectDates( dateCount );
1897 // mViewManager->readSettings( config ); 1897 // mViewManager->readSettings( config );
1898 updateConfig(); 1898 updateConfig();
1899 globalFlagBlockAgenda = 2; 1899 globalFlagBlockAgenda = 2;
1900 mViewManager->readSettings( config ); 1900 mViewManager->readSettings( config );
1901#ifdef DESKTOP_VERSION 1901#ifdef DESKTOP_VERSION
1902 config->setGroup("WidgetLayout"); 1902 config->setGroup("WidgetLayout");
1903 QStringList list; 1903 QStringList list;
1904 list = config->readListEntry("MainLayout"); 1904 list = config->readListEntry("MainLayout");
1905 int x,y,w,h; 1905 int x,y,w,h;
1906 if ( ! list.isEmpty() ) { 1906 if ( ! list.isEmpty() ) {
1907 x = list[0].toInt(); 1907 x = list[0].toInt();
1908 y = list[1].toInt(); 1908 y = list[1].toInt();
1909 w = list[2].toInt(); 1909 w = list[2].toInt();
1910 h = list[3].toInt(); 1910 h = list[3].toInt();
1911 topLevelWidget()->setGeometry(x,y,w,h); 1911 topLevelWidget()->setGeometry(x,y,w,h);
1912 1912
@@ -1918,98 +1918,98 @@ void CalendarView::readSettings()
1918 x = list[0].toInt(); 1918 x = list[0].toInt();
1919 y = list[1].toInt(); 1919 y = list[1].toInt();
1920 w = list[2].toInt(); 1920 w = list[2].toInt();
1921 h = list[3].toInt(); 1921 h = list[3].toInt();
1922 mEventEditor->setGeometry(x,y,w,h); 1922 mEventEditor->setGeometry(x,y,w,h);
1923 1923
1924 } 1924 }
1925 list = config->readListEntry("EditTodoLayout"); 1925 list = config->readListEntry("EditTodoLayout");
1926 if ( ! list.isEmpty() ) { 1926 if ( ! list.isEmpty() ) {
1927 x = list[0].toInt(); 1927 x = list[0].toInt();
1928 y = list[1].toInt(); 1928 y = list[1].toInt();
1929 w = list[2].toInt(); 1929 w = list[2].toInt();
1930 h = list[3].toInt(); 1930 h = list[3].toInt();
1931 mTodoEditor->setGeometry(x,y,w,h); 1931 mTodoEditor->setGeometry(x,y,w,h);
1932 1932
1933 } 1933 }
1934 list = config->readListEntry("ViewerLayout"); 1934 list = config->readListEntry("ViewerLayout");
1935 if ( ! list.isEmpty() ) { 1935 if ( ! list.isEmpty() ) {
1936 x = list[0].toInt(); 1936 x = list[0].toInt();
1937 y = list[1].toInt(); 1937 y = list[1].toInt();
1938 w = list[2].toInt(); 1938 w = list[2].toInt();
1939 h = list[3].toInt(); 1939 h = list[3].toInt();
1940 getEventViewerDialog()->setGeometry(x,y,w,h); 1940 getEventViewerDialog()->setGeometry(x,y,w,h);
1941 } 1941 }
1942#endif 1942#endif
1943 1943
1944} 1944}
1945 1945
1946 1946
1947void CalendarView::writeSettings() 1947void CalendarView::writeSettings()
1948{ 1948{
1949 // kdDebug() << "CalendarView::writeSettings" << endl; 1949 // kdDebug() << "CalendarView::writeSettings" << endl;
1950 1950
1951 KConfig *config = KOGlobals::config(); 1951 KConfig *config = KOGlobals::config();
1952 1952
1953 mViewManager->writeSettings( config ); 1953 mViewManager->writeSettings( config );
1954 mTodoList->saveLayout(config,QString("Todo Layout")); 1954 mTodoList->saveLayout(config,QString("Todo Layout"));
1955 mDialogManager->writeSettings( config ); 1955 mDialogManager->writeSettings( config );
1956 //KOPrefs::instance()->usrWriteConfig(); 1956 //KOPrefs::instance()->usrWriteConfig();
1957 KOPrefs::instance()->writeConfig(); 1957 KOPrefs::instance()->writeConfig();
1958 1958
1959 writeFilterSettings(config); 1959 writeFilterSettings(config);
1960 1960
1961 config->setGroup( "Views" ); 1961 config->setGroup( "Views" );
1962 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 1962 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
1963 1963
1964 QValueList<int> listINT = mLeftFrame->sizes(); 1964 QValueList<int> listINT = mLeftFrame->sizes();
1965 config->writeEntry("Left Splitter Frame",listINT); 1965 config->writeEntry("Left Splitter Frame",listINT);
1966 listINT = mMainFrame->sizes(); 1966 QValueList<int> listINT2 = mMainFrame->sizes();
1967 config->writeEntry("Main Splitter Frame",listINT); 1967 config->writeEntry("Main Splitter Frame",listINT2);
1968#ifdef DESKTOP_VERSION 1968#ifdef DESKTOP_VERSION
1969 config->setGroup("WidgetLayout"); 1969 config->setGroup("WidgetLayout");
1970 QStringList list ;//= config->readListEntry("MainLayout"); 1970 QStringList list ;//= config->readListEntry("MainLayout");
1971 int x,y,w,h; 1971 int x,y,w,h;
1972 QWidget* wid; 1972 QWidget* wid;
1973 wid = topLevelWidget(); 1973 wid = topLevelWidget();
1974 x = wid->geometry().x(); 1974 x = wid->geometry().x();
1975 y = wid->geometry().y(); 1975 y = wid->geometry().y();
1976 w = wid->width(); 1976 w = wid->width();
1977 h = wid->height(); 1977 h = wid->height();
1978 list.clear(); 1978 list.clear();
1979 list << QString::number( x ); 1979 list << QString::number( x );
1980 list << QString::number( y ); 1980 list << QString::number( y );
1981 list << QString::number( w ); 1981 list << QString::number( w );
1982 list << QString::number( h ); 1982 list << QString::number( h );
1983 config->writeEntry("MainLayout",list ); 1983 config->writeEntry("MainLayout",list );
1984 1984
1985 wid = mEventEditor; 1985 wid = mEventEditor;
1986 x = wid->geometry().x(); 1986 x = wid->geometry().x();
1987 y = wid->geometry().y(); 1987 y = wid->geometry().y();
1988 w = wid->width(); 1988 w = wid->width();
1989 h = wid->height(); 1989 h = wid->height();
1990 list.clear(); 1990 list.clear();
1991 list << QString::number( x ); 1991 list << QString::number( x );
1992 list << QString::number( y ); 1992 list << QString::number( y );
1993 list << QString::number( w ); 1993 list << QString::number( w );
1994 list << QString::number( h ); 1994 list << QString::number( h );
1995 config->writeEntry("EditEventLayout",list ); 1995 config->writeEntry("EditEventLayout",list );
1996 1996
1997 wid = mTodoEditor; 1997 wid = mTodoEditor;
1998 x = wid->geometry().x(); 1998 x = wid->geometry().x();
1999 y = wid->geometry().y(); 1999 y = wid->geometry().y();
2000 w = wid->width(); 2000 w = wid->width();
2001 h = wid->height(); 2001 h = wid->height();
2002 list.clear(); 2002 list.clear();
2003 list << QString::number( x ); 2003 list << QString::number( x );
2004 list << QString::number( y ); 2004 list << QString::number( y );
2005 list << QString::number( w ); 2005 list << QString::number( w );
2006 list << QString::number( h ); 2006 list << QString::number( h );
2007 config->writeEntry("EditTodoLayout",list ); 2007 config->writeEntry("EditTodoLayout",list );
2008 wid = getEventViewerDialog(); 2008 wid = getEventViewerDialog();
2009 x = wid->geometry().x(); 2009 x = wid->geometry().x();
2010 y = wid->geometry().y(); 2010 y = wid->geometry().y();
2011 w = wid->width(); 2011 w = wid->width();
2012 h = wid->height(); 2012 h = wid->height();
2013 list.clear(); 2013 list.clear();
2014 list << QString::number( x ); 2014 list << QString::number( x );
2015 list << QString::number( y ); 2015 list << QString::number( y );