summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Unidiff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1e83236..beb19d9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1794,126 +1794,130 @@ void CalendarView::closeCalendar()
1794 1794
1795void CalendarView::archiveCalendar() 1795void CalendarView::archiveCalendar()
1796{ 1796{
1797 mDialogManager->showArchiveDialog(); 1797 mDialogManager->showArchiveDialog();
1798} 1798}
1799 1799
1800 1800
1801void CalendarView::readSettings() 1801void CalendarView::readSettings()
1802{ 1802{
1803 1803
1804 1804
1805 // mViewManager->showAgendaView(); 1805 // mViewManager->showAgendaView();
1806 QString str; 1806 QString str;
1807 //qDebug("CalendarView::readSettings() "); 1807 //qDebug("CalendarView::readSettings() ");
1808 // read settings from the KConfig, supplying reasonable 1808 // read settings from the KConfig, supplying reasonable
1809 // defaults where none are to be found 1809 // defaults where none are to be found
1810 KConfig *config = KOGlobals::config(); 1810 KConfig *config = KOGlobals::config();
1811#ifndef KORG_NOSPLITTER 1811#ifndef KORG_NOSPLITTER
1812 config->setGroup("KOrganizer Geometry"); 1812 config->setGroup("KOrganizer Geometry");
1813 1813
1814 QValueList<int> sizes = config->readIntListEntry("Separator1"); 1814 QValueList<int> sizes = config->readIntListEntry("Separator1");
1815 if (sizes.count() != 2) { 1815 if (sizes.count() != 2) {
1816 sizes << mDateNavigator->minimumSizeHint().width(); 1816 sizes << mDateNavigator->minimumSizeHint().width();
1817 sizes << 300; 1817 sizes << 300;
1818 } 1818 }
1819 mPanner->setSizes(sizes); 1819 mPanner->setSizes(sizes);
1820 1820
1821 sizes = config->readIntListEntry("Separator2"); 1821 sizes = config->readIntListEntry("Separator2");
1822 if ( ( mResourceView && sizes.count() == 4 ) || 1822 if ( ( mResourceView && sizes.count() == 4 ) ||
1823 ( !mResourceView && sizes.count() == 3 ) ) { 1823 ( !mResourceView && sizes.count() == 3 ) ) {
1824 mLeftSplitter->setSizes(sizes); 1824 mLeftSplitter->setSizes(sizes);
1825 } 1825 }
1826#endif 1826#endif
1827 globalFlagBlockAgenda = 1; 1827 globalFlagBlockAgenda = 1;
1828 mViewManager->showAgendaView(); 1828 mViewManager->showAgendaView();
1829 //mViewManager->readSettings( config ); 1829 //mViewManager->readSettings( config );
1830 mTodoList->restoreLayout(config,QString("Todo Layout")); 1830 mTodoList->restoreLayout(config,QString("Todo Layout"));
1831 readFilterSettings(config); 1831 readFilterSettings(config);
1832 1832
1833#ifdef DESKTOP_VERSION 1833#ifdef DESKTOP_VERSION
1834 config->setGroup("WidgetLayout"); 1834 config->setGroup("WidgetLayout");
1835 QStringList list; 1835 QStringList list;
1836 list = config->readListEntry("MainLayout"); 1836 list = config->readListEntry("MainLayout");
1837 int x,y,w,h; 1837 int x,y,w,h;
1838 if ( ! list.isEmpty() ) { 1838 if ( ! list.isEmpty() ) {
1839 x = list[0].toInt(); 1839 x = list[0].toInt();
1840 y = list[1].toInt(); 1840 y = list[1].toInt();
1841 w = list[2].toInt(); 1841 w = list[2].toInt();
1842 h = list[3].toInt(); 1842 h = list[3].toInt();
1843 KApplication::testCoords( &x,&y,&w,&h );
1843 topLevelWidget()->setGeometry(x,y,w,h); 1844 topLevelWidget()->setGeometry(x,y,w,h);
1844 1845
1845 } else { 1846 } else {
1846 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 1847 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
1847 } 1848 }
1848 list = config->readListEntry("EditEventLayout"); 1849 list = config->readListEntry("EditEventLayout");
1849 if ( ! list.isEmpty() ) { 1850 if ( ! list.isEmpty() ) {
1850 x = list[0].toInt(); 1851 x = list[0].toInt();
1851 y = list[1].toInt(); 1852 y = list[1].toInt();
1852 w = list[2].toInt(); 1853 w = list[2].toInt();
1853 h = list[3].toInt(); 1854 h = list[3].toInt();
1855 KApplication::testCoords( &x,&y,&w,&h );
1854 mEventEditor->setGeometry(x,y,w,h); 1856 mEventEditor->setGeometry(x,y,w,h);
1855 1857
1856 } 1858 }
1857 list = config->readListEntry("EditTodoLayout"); 1859 list = config->readListEntry("EditTodoLayout");
1858 if ( ! list.isEmpty() ) { 1860 if ( ! list.isEmpty() ) {
1859 x = list[0].toInt(); 1861 x = list[0].toInt();
1860 y = list[1].toInt(); 1862 y = list[1].toInt();
1861 w = list[2].toInt(); 1863 w = list[2].toInt();
1862 h = list[3].toInt(); 1864 h = list[3].toInt();
1865 KApplication::testCoords( &x,&y,&w,&h );
1863 mTodoEditor->setGeometry(x,y,w,h); 1866 mTodoEditor->setGeometry(x,y,w,h);
1864 1867
1865 } 1868 }
1866 list = config->readListEntry("ViewerLayout"); 1869 list = config->readListEntry("ViewerLayout");
1867 if ( ! list.isEmpty() ) { 1870 if ( ! list.isEmpty() ) {
1868 x = list[0].toInt(); 1871 x = list[0].toInt();
1869 y = list[1].toInt(); 1872 y = list[1].toInt();
1870 w = list[2].toInt(); 1873 w = list[2].toInt();
1871 h = list[3].toInt(); 1874 h = list[3].toInt();
1875 KApplication::testCoords( &x,&y,&w,&h );
1872 getEventViewerDialog()->setGeometry(x,y,w,h); 1876 getEventViewerDialog()->setGeometry(x,y,w,h);
1873 } 1877 }
1874#endif 1878#endif
1875 config->setGroup( "Views" ); 1879 config->setGroup( "Views" );
1876 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 1880 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
1877 1881
1878 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 1882 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
1879 1883
1880 int resetval = 0; 1884 int resetval = 0;
1881 int maxVal = 0; 1885 int maxVal = 0;
1882 if (sizes.count() != 3) { 1886 if (sizes.count() != 3) {
1883 if ( KOPrefs::instance()->mVerticalScreen ) { 1887 if ( KOPrefs::instance()->mVerticalScreen ) {
1884 resetval = mDateNavigator->sizeHint().width()+2; 1888 resetval = mDateNavigator->sizeHint().width()+2;
1885 } else { 1889 } else {
1886 resetval = mDateNavigator->sizeHint().height()+2; 1890 resetval = mDateNavigator->sizeHint().height()+2;
1887 } 1891 }
1888 } 1892 }
1889 if ( resetval ) { 1893 if ( resetval ) {
1890 sizes.clear(); 1894 sizes.clear();
1891 if ( KOPrefs::instance()->mVerticalScreen ) { 1895 if ( KOPrefs::instance()->mVerticalScreen ) {
1892 maxVal = QApplication::desktop()->width() -10; 1896 maxVal = QApplication::desktop()->width() -10;
1893 } else { 1897 } else {
1894 maxVal = QApplication::desktop()->height()-10; 1898 maxVal = QApplication::desktop()->height()-10;
1895 } 1899 }
1896 sizes << resetval; 1900 sizes << resetval;
1897 if ( maxVal < resetval + resetval) 1901 if ( maxVal < resetval + resetval)
1898 resetval = maxVal - resetval; 1902 resetval = maxVal - resetval;
1899 sizes << resetval; 1903 sizes << resetval;
1900 sizes << 100; 1904 sizes << 100;
1901 } 1905 }
1902 mLeftFrame->setSizes(sizes); 1906 mLeftFrame->setSizes(sizes);
1903 sizes = config->readIntListEntry("Main Splitter Frame"); 1907 sizes = config->readIntListEntry("Main Splitter Frame");
1904 resetval = 0; 1908 resetval = 0;
1905 maxVal = 0; 1909 maxVal = 0;
1906 if (sizes.count() != 2) { 1910 if (sizes.count() != 2) {
1907 if ( !KOPrefs::instance()->mVerticalScreen ) { 1911 if ( !KOPrefs::instance()->mVerticalScreen ) {
1908 resetval = mDateNavigator->sizeHint().width()+2; 1912 resetval = mDateNavigator->sizeHint().width()+2;
1909 } else { 1913 } else {
1910 resetval = mDateNavigator->sizeHint().height()+2; 1914 resetval = mDateNavigator->sizeHint().height()+2;
1911 } 1915 }
1912 } 1916 }
1913 if ( resetval ) { 1917 if ( resetval ) {
1914 sizes.clear(); 1918 sizes.clear();
1915 if ( !KOPrefs::instance()->mVerticalScreen ) { 1919 if ( !KOPrefs::instance()->mVerticalScreen ) {
1916 maxVal = QApplication::desktop()->width() -10; 1920 maxVal = QApplication::desktop()->width() -10;
1917 } else { 1921 } else {
1918 maxVal = QApplication::desktop()->height()-10; 1922 maxVal = QApplication::desktop()->height()-10;
1919 } 1923 }