-rw-r--r-- | korganizer/calendarview.cpp | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 96ced08..90b36ac 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1814,24 +1814,67 @@ void CalendarView::readSettings() | |||
1814 | 1814 | ||
1815 | sizes = config->readIntListEntry("Separator2"); | 1815 | sizes = config->readIntListEntry("Separator2"); |
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 | |||
1827 | #ifdef DESKTOP_VERSION | ||
1828 | config->setGroup("WidgetLayout"); | ||
1829 | QStringList list; | ||
1830 | list = config->readListEntry("MainLayout"); | ||
1831 | int x,y,w,h; | ||
1832 | if ( ! list.isEmpty() ) { | ||
1833 | x = list[0].toInt(); | ||
1834 | y = list[1].toInt(); | ||
1835 | w = list[2].toInt(); | ||
1836 | h = list[3].toInt(); | ||
1837 | topLevelWidget()->setGeometry(x,y,w,h); | ||
1838 | |||
1839 | } else { | ||
1840 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); | ||
1841 | } | ||
1842 | list = config->readListEntry("EditEventLayout"); | ||
1843 | if ( ! list.isEmpty() ) { | ||
1844 | x = list[0].toInt(); | ||
1845 | y = list[1].toInt(); | ||
1846 | w = list[2].toInt(); | ||
1847 | h = list[3].toInt(); | ||
1848 | mEventEditor->setGeometry(x,y,w,h); | ||
1849 | |||
1850 | } | ||
1851 | list = config->readListEntry("EditTodoLayout"); | ||
1852 | if ( ! list.isEmpty() ) { | ||
1853 | x = list[0].toInt(); | ||
1854 | y = list[1].toInt(); | ||
1855 | w = list[2].toInt(); | ||
1856 | h = list[3].toInt(); | ||
1857 | mTodoEditor->setGeometry(x,y,w,h); | ||
1858 | |||
1859 | } | ||
1860 | list = config->readListEntry("ViewerLayout"); | ||
1861 | if ( ! list.isEmpty() ) { | ||
1862 | x = list[0].toInt(); | ||
1863 | y = list[1].toInt(); | ||
1864 | w = list[2].toInt(); | ||
1865 | h = list[3].toInt(); | ||
1866 | getEventViewerDialog()->setGeometry(x,y,w,h); | ||
1867 | } | ||
1868 | #endif | ||
1826 | config->setGroup( "Views" ); | 1869 | config->setGroup( "Views" ); |
1827 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); | 1870 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); |
1828 | 1871 | ||
1829 | QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); | 1872 | QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); |
1830 | 1873 | ||
1831 | int resetval = 0; | 1874 | int resetval = 0; |
1832 | int maxVal = 0; | 1875 | int maxVal = 0; |
1833 | if (sizes.count() != 3) { | 1876 | if (sizes.count() != 3) { |
1834 | if ( KOPrefs::instance()->mVerticalScreen ) { | 1877 | if ( KOPrefs::instance()->mVerticalScreen ) { |
1835 | resetval = mDateNavigator->sizeHint().width()+2; | 1878 | resetval = mDateNavigator->sizeHint().width()+2; |
1836 | } else { | 1879 | } else { |
1837 | resetval = mDateNavigator->sizeHint().height()+2; | 1880 | resetval = mDateNavigator->sizeHint().height()+2; |
@@ -1889,67 +1932,24 @@ void CalendarView::readSettings() | |||
1889 | resetval = maxVal - resetval; | 1932 | resetval = maxVal - resetval; |
1890 | sizes << resetval; | 1933 | sizes << resetval; |
1891 | } | 1934 | } |
1892 | mMainFrame->setSizes(sizes); | 1935 | mMainFrame->setSizes(sizes); |
1893 | 1936 | ||
1894 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); | 1937 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); |
1895 | else if ( dateCount == 7 ) mNavigator->selectWeek(); | 1938 | else if ( dateCount == 7 ) mNavigator->selectWeek(); |
1896 | else mNavigator->selectDates( dateCount ); | 1939 | else mNavigator->selectDates( dateCount ); |
1897 | // mViewManager->readSettings( config ); | 1940 | // mViewManager->readSettings( config ); |
1898 | updateConfig(); | 1941 | updateConfig(); |
1899 | globalFlagBlockAgenda = 2; | 1942 | globalFlagBlockAgenda = 2; |
1900 | mViewManager->readSettings( config ); | 1943 | mViewManager->readSettings( config ); |
1901 | #ifdef DESKTOP_VERSION | ||
1902 | config->setGroup("WidgetLayout"); | ||
1903 | QStringList list; | ||
1904 | list = config->readListEntry("MainLayout"); | ||
1905 | int x,y,w,h; | ||
1906 | if ( ! list.isEmpty() ) { | ||
1907 | x = list[0].toInt(); | ||
1908 | y = list[1].toInt(); | ||
1909 | w = list[2].toInt(); | ||
1910 | h = list[3].toInt(); | ||
1911 | topLevelWidget()->setGeometry(x,y,w,h); | ||
1912 | |||
1913 | } else { | ||
1914 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); | ||
1915 | } | ||
1916 | list = config->readListEntry("EditEventLayout"); | ||
1917 | if ( ! list.isEmpty() ) { | ||
1918 | x = list[0].toInt(); | ||
1919 | y = list[1].toInt(); | ||
1920 | w = list[2].toInt(); | ||
1921 | h = list[3].toInt(); | ||
1922 | mEventEditor->setGeometry(x,y,w,h); | ||
1923 | |||
1924 | } | ||
1925 | list = config->readListEntry("EditTodoLayout"); | ||
1926 | if ( ! list.isEmpty() ) { | ||
1927 | x = list[0].toInt(); | ||
1928 | y = list[1].toInt(); | ||
1929 | w = list[2].toInt(); | ||
1930 | h = list[3].toInt(); | ||
1931 | mTodoEditor->setGeometry(x,y,w,h); | ||
1932 | |||
1933 | } | ||
1934 | list = config->readListEntry("ViewerLayout"); | ||
1935 | if ( ! list.isEmpty() ) { | ||
1936 | x = list[0].toInt(); | ||
1937 | y = list[1].toInt(); | ||
1938 | w = list[2].toInt(); | ||
1939 | h = list[3].toInt(); | ||
1940 | getEventViewerDialog()->setGeometry(x,y,w,h); | ||
1941 | } | ||
1942 | #endif | ||
1943 | |||
1944 | } | 1944 | } |
1945 | 1945 | ||
1946 | 1946 | ||
1947 | void CalendarView::writeSettings() | 1947 | void 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 ); |