summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--desktop/rpm/kdepim_rpm2
-rw-r--r--korganizer/komonthview.cpp7
-rw-r--r--korganizer/kotodoviewitem.cpp11
-rw-r--r--microkde/kdatetbl.cpp2
-rw-r--r--version2
5 files changed, 14 insertions, 10 deletions
diff --git a/desktop/rpm/kdepim_rpm b/desktop/rpm/kdepim_rpm
index 4c53aac..b7f00ed 100644
--- a/desktop/rpm/kdepim_rpm
+++ b/desktop/rpm/kdepim_rpm
@@ -1,84 +1,84 @@
1Summary: A collection of PIM programs 1Summary: A collection of PIM programs
2Name: KDE-Pim-Pi 2Name: KDE-Pim-Pi
3Version: 2.0.5 3Version: 2.0.6
4Release: SuSE_9.2 4Release: SuSE_9.2
5Copyright:GPL 5Copyright:GPL
6Group: Productivity/Pim 6Group: Productivity/Pim
7Source:http://sourceforge.net/projects/kdepimpi/ 7Source:http://sourceforge.net/projects/kdepimpi/
8URL:http://sourceforge.net/projects/kdepimpi/ 8URL:http://sourceforge.net/projects/kdepimpi/
9Packager: zautrix 9Packager: zautrix
10 10
11%description 11%description
12This package contains the platform-independent PIM programs from 12This package contains the platform-independent PIM programs from
13www.pi-sync.net, compiled for SuSE 9.2: 13www.pi-sync.net, compiled for SuSE 9.2:
14KTimeTacker/Pi 14KTimeTacker/Pi
15KPhone/Pi 15KPhone/Pi
16KAddressbook/Pi 16KAddressbook/Pi
17KOrganizer/Pi 17KOrganizer/Pi
18PasswordManager/Pi 18PasswordManager/Pi
19KOPieMail/Pi 19KOPieMail/Pi
20 20
21These applications do not need anything from the KDE-desktop 21These applications do not need anything from the KDE-desktop
22at all to run on Linux. However, there is a dependency from 22at all to run on Linux. However, there is a dependency from
23two KDE libs, because a small command line program is included 23two KDE libs, because a small command line program is included
24to make it possible to sync with the KDE-desktop applications. 24to make it possible to sync with the KDE-desktop applications.
25 25
26These applications are independent from the KDE-desktop 26These applications are independent from the KDE-desktop
27environment. That means, nothing of your existing 27environment. That means, nothing of your existing
28KDE-desktop setup will be changed, or any data 28KDE-desktop setup will be changed, or any data
29(calendar-addressbook) used by the KDE-desktop 29(calendar-addressbook) used by the KDE-desktop
30applications will be changed or accessed. 30applications will be changed or accessed.
31These applications stores their data and config in 31These applications stores their data and config in
32$HOME/kdepim/ 32$HOME/kdepim/
33However, because the same file format is used, 33However, because the same file format is used,
34an easy exchange of data with the KDE-desktop 34an easy exchange of data with the KDE-desktop
35is possible. 35is possible.
36A small command line program is included 36A small command line program is included
37to make it possible to sync with the KDE-desktop applications. 37to make it possible to sync with the KDE-desktop applications.
38You do not need to call this program from the commandline, 38You do not need to call this program from the commandline,
39it is called from the KDE-Pim/Pi apps when you choose there: 39it is called from the KDE-Pim/Pi apps when you choose there:
40Sync with KDE_Desktop. 40Sync with KDE_Desktop.
41If something is going wrong, please start the 41If something is going wrong, please start the
42KDE-Pim/Pi program itself from the console to get detailed output. 42KDE-Pim/Pi program itself from the console to get detailed output.
43 43
44After installation, you should have a 44After installation, you should have a
45PIM-pi 45PIM-pi
46folder in your KDE start menu, where you can 46folder in your KDE start menu, where you can
47start the applications from. 47start the applications from.
48 48
49These programs makes it possible to sync your Zaurus easily 49These programs makes it possible to sync your Zaurus easily
50(with the KDE-Pim/Pi programs running on the Zaurus) 50(with the KDE-Pim/Pi programs running on the Zaurus)
51with the KDE-desktop calendar/addressbook data. 51with the KDE-desktop calendar/addressbook data.
52If you want to use that, you have to update your 52If you want to use that, you have to update your
53KDE-desktop to version 3.3.0 or higher. 53KDE-desktop to version 3.3.0 or higher.
54SuSE 9.2 contains KDE 3.3.0 such that no update is needed. 54SuSE 9.2 contains KDE 3.3.0 such that no update is needed.
55Actually - after the (non difficult) configuration is set up - 55Actually - after the (non difficult) configuration is set up -
56with two mouseklicks on the Zaurus, 56with two mouseklicks on the Zaurus,
57the Zaurus syncs with the corresponding KDE-Pim/Pi 57the Zaurus syncs with the corresponding KDE-Pim/Pi
58program on the Linux Desktop which syncs automatically 58program on the Linux Desktop which syncs automatically
59with the KDE-desktop data. 59with the KDE-desktop data.
60 60
61If you want to use the KDE-desktop calendar/addressbook applications, 61If you want to use the KDE-desktop calendar/addressbook applications,
62just install these apps in this package and use them as a syncing tool for the 62just install these apps in this package and use them as a syncing tool for the
63Zaurus <-> KDE-desktop sync. 63Zaurus <-> KDE-desktop sync.
64The sync requires a network connection from your Zaurus to 64The sync requires a network connection from your Zaurus to
65the PC. A detailed Sync HowTo is available in the 65the PC. A detailed Sync HowTo is available in the
66Help menu of the applications. 66Help menu of the applications.
67 67
68These applications makes it also possible, that you can sync 68These applications makes it also possible, that you can sync
69(or just export the data to) your mobile phone with your 69(or just export the data to) your mobile phone with your
70data of the KDE-desktop calendar/addressbook applications. 70data of the KDE-desktop calendar/addressbook applications.
71This is tested and working for Nokia mobile phones, 71This is tested and working for Nokia mobile phones,
72it may work with others as well. 72it may work with others as well.
73(More info about that: -> Sync HowTo) 73(More info about that: -> Sync HowTo)
74 74
75NOTE: 75NOTE:
76When using SuSE 9.1 you have to update your KDE to 3.3.x 76When using SuSE 9.1 you have to update your KDE to 3.3.x
77and you have to make an online update in SuSE 9.1 to make it 77and you have to make an online update in SuSE 9.1 to make it
78possible to get the infrared connection working, such that 78possible to get the infrared connection working, such that
79you can sync your (Nokia) mobile phone via infrared. 79you can sync your (Nokia) mobile phone via infrared.
80 80
81%files 81%files
82/opt/kde3/share/applnk/PIM-pi/ 82/opt/kde3/share/applnk/PIM-pi/
83/opt/kdepimpi/ 83/opt/kdepimpi/
84/usr/lib/libmicro* 84/usr/lib/libmicro*
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 02d2585..da81586 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -824,205 +824,212 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
824 if ( QApplication::desktop()->width() < 650 ) { 824 if ( QApplication::desktop()->width() < 650 ) {
825 bfont.setPointSize( bfont.pointSize() - 2 ); 825 bfont.setPointSize( bfont.pointSize() - 2 );
826 } 826 }
827 bfont.setBold( true ); 827 bfont.setBold( true );
828 int i; 828 int i;
829 829
830 for( i = 0; i < mDaysPerWeek; i++ ) { 830 for( i = 0; i < mDaysPerWeek; i++ ) {
831 QLabel *label = new QLabel( mMonthView ); 831 QLabel *label = new QLabel( mMonthView );
832 label->setFont(bfont); 832 label->setFont(bfont);
833 label->setFrameStyle(QFrame::Panel|QFrame::Raised); 833 label->setFrameStyle(QFrame::Panel|QFrame::Raised);
834 label->setLineWidth(1); 834 label->setLineWidth(1);
835 label->setAlignment(AlignCenter); 835 label->setAlignment(AlignCenter);
836 mDayLabels.insert( i, label ); 836 mDayLabels.insert( i, label );
837 label = new QLabel( mWeekView ); 837 label = new QLabel( mWeekView );
838 label->setFont(bfont); 838 label->setFont(bfont);
839 label->setFrameStyle(QFrame::Panel|QFrame::Raised); 839 label->setFrameStyle(QFrame::Panel|QFrame::Raised);
840 label->setLineWidth(1); 840 label->setLineWidth(1);
841 label->setAlignment(AlignCenter); 841 label->setAlignment(AlignCenter);
842 mDayLabelsW.insert( i, label ); 842 mDayLabelsW.insert( i, label );
843 } 843 }
844 844
845 bfont.setBold( false ); 845 bfont.setBold( false );
846 mWeekLabels.resize( mNumWeeks+1 ); 846 mWeekLabels.resize( mNumWeeks+1 );
847 mWeekLabelsW.resize( 2 ); 847 mWeekLabelsW.resize( 2 );
848 for( i = 0; i < mNumWeeks+1; i++ ) { 848 for( i = 0; i < mNumWeeks+1; i++ ) {
849 KOWeekButton *label = new KOWeekButton( mMonthView ); 849 KOWeekButton *label = new KOWeekButton( mMonthView );
850 label->setFocusPolicy(NoFocus); 850 label->setFocusPolicy(NoFocus);
851 label->setFont(bfont); 851 label->setFont(bfont);
852 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); 852 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
853 label->setFlat(true); 853 label->setFlat(true);
854 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); 854 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
855 //label->setFrameStyle(QFrame::Panel|QFrame::Raised); 855 //label->setFrameStyle(QFrame::Panel|QFrame::Raised);
856 //label->setLineWidth(1); 856 //label->setLineWidth(1);
857 //label->setAlignment(AlignCenter); 857 //label->setAlignment(AlignCenter);
858 mWeekLabels.insert( i, label ); 858 mWeekLabels.insert( i, label );
859 } 859 }
860 mWeekLabels[mNumWeeks]->setText( i18n("W")); 860 mWeekLabels[mNumWeeks]->setText( i18n("W"));
861 QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); 861 QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number"));
862 862
863 for( i = 0; i < 1+1; i++ ) { 863 for( i = 0; i < 1+1; i++ ) {
864 KOWeekButton *label = new KOWeekButton( mWeekView ); 864 KOWeekButton *label = new KOWeekButton( mWeekView );
865 label->setFocusPolicy(NoFocus); 865 label->setFocusPolicy(NoFocus);
866 label->setFont(bfont); 866 label->setFont(bfont);
867 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); 867 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
868 label->setFlat(true); 868 label->setFlat(true);
869 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); 869 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
870 //label->setFrameStyle(QFrame::Panel|QFrame::Raised); 870 //label->setFrameStyle(QFrame::Panel|QFrame::Raised);
871 //label->setLineWidth(1); 871 //label->setLineWidth(1);
872 //label->setAlignment(AlignCenter); 872 //label->setAlignment(AlignCenter);
873 mWeekLabelsW.insert( i, label ); 873 mWeekLabelsW.insert( i, label );
874 } 874 }
875 mWeekLabelsW[1]->setText( i18n("W")); 875 mWeekLabelsW[1]->setText( i18n("W"));
876 876
877 877
878 int row, col; 878 int row, col;
879 mCells.resize( mNumCells ); 879 mCells.resize( mNumCells );
880 for( row = 0; row < mNumWeeks; ++row ) { 880 for( row = 0; row < mNumWeeks; ++row ) {
881 for( col = 0; col < mDaysPerWeek; ++col ) { 881 for( col = 0; col < mDaysPerWeek; ++col ) {
882 MonthViewCell *cell = new MonthViewCell( this, mMonthView ); 882 MonthViewCell *cell = new MonthViewCell( this, mMonthView );
883 mCells.insert( row * mDaysPerWeek + col, cell ); 883 mCells.insert( row * mDaysPerWeek + col, cell );
884 884
885 connect( cell, SIGNAL( defaultAction( Incidence * ) ), 885 connect( cell, SIGNAL( defaultAction( Incidence * ) ),
886 SLOT( defaultAction( Incidence * ) ) ); 886 SLOT( defaultAction( Incidence * ) ) );
887 connect( cell, SIGNAL( newEventSignal( QDateTime ) ), 887 connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
888 SIGNAL( newEventSignal( QDateTime ) ) ); 888 SIGNAL( newEventSignal( QDateTime ) ) );
889 connect( cell, SIGNAL( showDaySignal( QDate ) ), 889 connect( cell, SIGNAL( showDaySignal( QDate ) ),
890 SIGNAL( showDaySignal( QDate ) ) ); 890 SIGNAL( showDaySignal( QDate ) ) );
891 } 891 }
892 } 892 }
893 mCellsW.resize( mDaysPerWeek ); 893 mCellsW.resize( mDaysPerWeek );
894 for( col = 0; col < mDaysPerWeek; ++col ) { 894 for( col = 0; col < mDaysPerWeek; ++col ) {
895 MonthViewCell *cell = new MonthViewCell( this, mWeekView ); 895 MonthViewCell *cell = new MonthViewCell( this, mWeekView );
896 mCellsW.insert( col, cell ); 896 mCellsW.insert( col, cell );
897 897
898 connect( cell, SIGNAL( defaultAction( Incidence * ) ), 898 connect( cell, SIGNAL( defaultAction( Incidence * ) ),
899 SLOT( defaultAction( Incidence * ) ) ); 899 SLOT( defaultAction( Incidence * ) ) );
900 connect( cell, SIGNAL( newEventSignal( QDateTime ) ), 900 connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
901 SIGNAL( newEventSignal( QDateTime ) ) ); 901 SIGNAL( newEventSignal( QDateTime ) ) );
902 connect( cell, SIGNAL( showDaySignal( QDate ) ), 902 connect( cell, SIGNAL( showDaySignal( QDate ) ),
903 SIGNAL( showDaySignal( QDate ) ) ); 903 SIGNAL( showDaySignal( QDate ) ) );
904 cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); 904 cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont );
905 } 905 }
906 906
907 //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); 907 //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) );
908 mContextMenu = eventPopup(); 908 mContextMenu = eventPopup();
909 // updateConfig(); //useless here... 909 // updateConfig(); //useless here...
910 // ... but we need mWidthLongDayLabel computed 910 // ... but we need mWidthLongDayLabel computed
911 QFontMetrics fontmetric(mDayLabels[0]->font()); 911 QFontMetrics fontmetric(mDayLabels[0]->font());
912 mWidthLongDayLabel = 0; 912 mWidthLongDayLabel = 0;
913 for (int i = 0; i < 7; i++) { 913 for (int i = 0; i < 7; i++) {
914 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); 914 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
915 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; 915 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
916 } 916 }
917 917
918 //mWeekLabels[mNumWeeks]->setText( i18n("W")); 918 //mWeekLabels[mNumWeeks]->setText( i18n("W"));
919 919
920#if 0
920 if ( mShowWeekView ) 921 if ( mShowWeekView )
921 mWidStack->raiseWidget( mWeekView ); 922 mWidStack->raiseWidget( mWeekView );
922 else 923 else
923 mWidStack->raiseWidget( mMonthView ); 924 mWidStack->raiseWidget( mMonthView );
925#endif
924 926
925 emit incidenceSelected( 0 ); 927 emit incidenceSelected( 0 );
926#ifndef DESKTOP_VERSION 928#ifndef DESKTOP_VERSION
927 resize( QApplication::desktop()->size() ); 929 resize( QApplication::desktop()->size() );
928#else 930#else
929 resize(640, 480 ); 931 resize(640, 480 );
932 updatePossible = true;
930#endif 933#endif
931 computeLayout(); 934 computeLayout();
932 935
936 if ( mShowWeekView )
937 mWidStack->raiseWidget( mWeekView );
938 else
939 mWidStack->raiseWidget( mMonthView );
933} 940}
934 941
935KOMonthView::~KOMonthView() 942KOMonthView::~KOMonthView()
936{ 943{
937 delete mContextMenu; 944 delete mContextMenu;
938} 945}
939 946
940void KOMonthView::selectInternalWeekNum ( int n ) 947void KOMonthView::selectInternalWeekNum ( int n )
941{ 948{
942 switchView(); 949 switchView();
943 emit selectWeekNum ( n ); 950 emit selectWeekNum ( n );
944} 951}
945 952
946int KOMonthView::currentWeek() 953int KOMonthView::currentWeek()
947{ 954{
948 if ( mShowWeekView ) 955 if ( mShowWeekView )
949 return mWeekLabelsW[0]->getWeekNum(); 956 return mWeekLabelsW[0]->getWeekNum();
950 return mWeekLabels[0]->getWeekNum(); 957 return mWeekLabels[0]->getWeekNum();
951} 958}
952void KOMonthView::switchView() 959void KOMonthView::switchView()
953{ 960{
954 961
955 if ( selectedCell( ) ) 962 if ( selectedCell( ) )
956 selectedCell()->deselect(); 963 selectedCell()->deselect();
957 mShowWeekView = !mShowWeekView; 964 mShowWeekView = !mShowWeekView;
958 KOPrefs::instance()->mMonthViewWeek = mShowWeekView; 965 KOPrefs::instance()->mMonthViewWeek = mShowWeekView;
959 if ( clPending ) { 966 if ( clPending ) {
960 computeLayout(); 967 computeLayout();
961 updateConfig(); 968 updateConfig();
962 } 969 }
963 if ( mShowWeekView ) 970 if ( mShowWeekView )
964 mWidStack->raiseWidget( mWeekView ); 971 mWidStack->raiseWidget( mWeekView );
965 else 972 else
966 mWidStack->raiseWidget( mMonthView ); 973 mWidStack->raiseWidget( mMonthView );
967 clPending = false; 974 clPending = false;
968} 975}
969 976
970int KOMonthView::maxDatesHint() 977int KOMonthView::maxDatesHint()
971{ 978{
972 return mNumCells; 979 return mNumCells;
973} 980}
974 981
975int KOMonthView::currentDateCount() 982int KOMonthView::currentDateCount()
976{ 983{
977 return mNumCells; 984 return mNumCells;
978} 985}
979 986
980QPtrList<Incidence> KOMonthView::selectedIncidences() 987QPtrList<Incidence> KOMonthView::selectedIncidences()
981{ 988{
982 QPtrList<Incidence> selected; 989 QPtrList<Incidence> selected;
983 990
984 if ( mSelectedCell ) { 991 if ( mSelectedCell ) {
985 Incidence *incidence = mSelectedCell->selectedIncidence(); 992 Incidence *incidence = mSelectedCell->selectedIncidence();
986 if ( incidence ) selected.append( incidence ); 993 if ( incidence ) selected.append( incidence );
987 } 994 }
988 995
989 return selected; 996 return selected;
990} 997}
991 998
992DateList KOMonthView::selectedDates() 999DateList KOMonthView::selectedDates()
993{ 1000{
994 DateList selected; 1001 DateList selected;
995 1002
996 if ( mSelectedCell ) { 1003 if ( mSelectedCell ) {
997 QDate qd = mSelectedCell->selectedIncidenceDate(); 1004 QDate qd = mSelectedCell->selectedIncidenceDate();
998 if ( qd.isValid() ) selected.append( qd ); 1005 if ( qd.isValid() ) selected.append( qd );
999 } 1006 }
1000 1007
1001 return selected; 1008 return selected;
1002} 1009}
1003 1010
1004void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, 1011void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd,
1005 const QDate &td) 1012 const QDate &td)
1006{ 1013{
1007#ifndef KORG_NOPRINTER 1014#ifndef KORG_NOPRINTER
1008 calPrinter->preview(CalPrinter::Month, fd, td); 1015 calPrinter->preview(CalPrinter::Month, fd, td);
1009#endif 1016#endif
1010} 1017}
1011 1018
1012void KOMonthView::updateConfig() 1019void KOMonthView::updateConfig()
1013{ 1020{
1014 1021
1015 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); 1022 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
1016 1023
1017 if ( mShowWeekView ) { 1024 if ( mShowWeekView ) {
1018 mWeekStartsMonday = true; 1025 mWeekStartsMonday = true;
1019 } 1026 }
1020 QFontMetrics fontmetric(mDayLabels[0]->font()); 1027 QFontMetrics fontmetric(mDayLabels[0]->font());
1021 mWidthLongDayLabel = 0; 1028 mWidthLongDayLabel = 0;
1022 1029
1023 for (int i = 0; i < 7; i++) { 1030 for (int i = 0; i < 7; i++) {
1024 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); 1031 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
1025 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; 1032 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
1026 } 1033 }
1027 bool temp = mShowSatSunComp ; 1034 bool temp = mShowSatSunComp ;
1028 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 1035 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 78d4027..44db209 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -173,292 +173,289 @@ void KOTodoViewItem::setMyPixmap()
173// } else { 173// } else {
174 QPainter p; 174 QPainter p;
175 175
176 int pixSize = 0; 176 int pixSize = 0;
177 QPixmap pPix = QPixmap( size, size ); 177 QPixmap pPix = QPixmap( size, size );
178 if ( mTodo->description().length() > 0 ) { 178 if ( mTodo->description().length() > 0 ) {
179 pixi.resize(size, pixSize+size); 179 pixi.resize(size, pixSize+size);
180 pPix.fill( Qt::darkGreen ); 180 pPix.fill( Qt::darkGreen );
181 p.begin( &pixi ); 181 p.begin( &pixi );
182 p. drawPixmap ( 0, pixSize, pPix); 182 p. drawPixmap ( 0, pixSize, pPix);
183 p.end(); 183 p.end();
184 pixSize += size; 184 pixSize += size;
185 } 185 }
186 if ( mTodo->isAlarmEnabled() ) { 186 if ( mTodo->isAlarmEnabled() ) {
187 pixi.resize(size, pixSize+size); 187 pixi.resize(size, pixSize+size);
188 pPix.fill( Qt::red ); 188 pPix.fill( Qt::red );
189 p.begin( &pixi ); 189 p.begin( &pixi );
190 p. drawPixmap ( 0, pixSize, pPix); 190 p. drawPixmap ( 0, pixSize, pPix);
191 p.end(); 191 p.end();
192 pixSize += size; 192 pixSize += size;
193 } 193 }
194 // } 194 // }
195 if ( pixi.width() > 1 ) { 195 if ( pixi.width() > 1 ) {
196 setPixmap ( 0,pixi ) ; 196 setPixmap ( 0,pixi ) ;
197 } else { 197 } else {
198 setPixmap ( 0,QPixmap() ) ; 198 setPixmap ( 0,QPixmap() ) ;
199 } 199 }
200} 200}
201void KOTodoViewItem::stateChange(bool state) 201void KOTodoViewItem::stateChange(bool state)
202{ 202{
203 // qDebug("KOTodoViewItem::stateChange "); 203 // qDebug("KOTodoViewItem::stateChange ");
204 // do not change setting on startup 204 // do not change setting on startup
205 if ( m_init ) return; 205 if ( m_init ) return;
206 if (isOn()!=state) { 206 if (isOn()!=state) {
207 setOn(state); 207 setOn(state);
208 //qDebug("SETON "); 208 //qDebug("SETON ");
209 return; 209 return;
210 } 210 }
211 if ( mTodo->isCompleted() == state ) { 211 if ( mTodo->isCompleted() == state ) {
212 //qDebug("STATECHANGE:nothing to do "); 212 //qDebug("STATECHANGE:nothing to do ");
213 return; 213 return;
214 } 214 }
215 QString keyd = "=="; 215 QString keyd = "==";
216 QString keyt = "=="; 216 QString keyt = "==";
217 //qDebug("KOTodoViewItem::stateChange %s ", text(0).latin1()); 217 //qDebug("KOTodoViewItem::stateChange %s ", text(0).latin1());
218 mTodo->setCompleted(state); 218 mTodo->setCompleted(state);
219 if (state) mTodo->setCompleted(QDateTime::currentDateTime()); 219 if (state) mTodo->setCompleted(QDateTime::currentDateTime());
220 220
221 if (mTodo->hasDueDate()) { 221 if (mTodo->hasDueDate()) {
222 setText(3, mTodo->dtDueDateStr()); 222 setText(3, mTodo->dtDueDateStr());
223 QDate d = mTodo->dtDue().date(); 223 QDate d = mTodo->dtDue().date();
224 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 224 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
225 setSortKey(3,keyd); 225 setSortKey(3,keyd);
226 if (mTodo->doesFloat()) { 226 if (mTodo->doesFloat()) {
227 setText(4,""); 227 setText(4,"");
228 } 228 }
229 else { 229 else {
230 setText(4,mTodo->dtDueTimeStr()); 230 setText(4,mTodo->dtDueTimeStr());
231 QTime t = mTodo->dtDue().time(); 231 QTime t = mTodo->dtDue().time();
232 keyt.sprintf("%02d%02d",t.hour(),t.minute()); 232 keyt.sprintf("%02d%02d",t.hour(),t.minute());
233 setSortKey(4,keyt); 233 setSortKey(4,keyt);
234 } 234 }
235 } 235 }
236 if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt); 236 if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt);
237 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); 237 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
238 238
239 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); 239 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete())));
240 if (mTodo->percentComplete()<100) { 240 if (mTodo->percentComplete()<100) {
241 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 241 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
242 else setSortKey(2,QString::number(mTodo->percentComplete())); 242 else setSortKey(2,QString::number(mTodo->percentComplete()));
243 } 243 }
244 else { 244 else {
245 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 245 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
246 else setSortKey(2,QString::number(99)); 246 else setSortKey(2,QString::number(99));
247 } 247 }
248 if ( state ) { 248 if ( state ) {
249 QListViewItem * myChild = firstChild(); 249 QListViewItem * myChild = firstChild();
250 KOTodoViewItem *item; 250 KOTodoViewItem *item;
251 while( myChild ) { 251 while( myChild ) {
252 //qDebug("stateCH "); 252 //qDebug("stateCH ");
253 item = static_cast<KOTodoViewItem*>(myChild); 253 item = static_cast<KOTodoViewItem*>(myChild);
254 item->stateChange(state); 254 item->stateChange(state);
255 myChild = myChild->nextSibling(); 255 myChild = myChild->nextSibling();
256 } 256 }
257 } else { 257 } else {
258 QListViewItem * myChild = parent(); 258 QListViewItem * myChild = parent();
259 if ( myChild ) 259 if ( myChild )
260 (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); 260 (static_cast<KOTodoViewItem*>(myChild))->stateChange(state);
261 } 261 }
262 mTodoView->modified(true); 262 mTodoView->modified(true);
263 setMyPixmap(); 263 setMyPixmap();
264 mTodoView->setTodoModified( mTodo ); 264 mTodoView->setTodoModified( mTodo );
265} 265}
266 266
267bool KOTodoViewItem::isAlternate() 267bool KOTodoViewItem::isAlternate()
268{ 268{
269#ifndef KORG_NOLVALTERNATION 269
270 KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); 270 KOTodoListView *lv = static_cast<KOTodoListView *>(listView());
271 if (lv && lv->alternateBackground().isValid()) 271 if (lv && lv->alternateBackground().isValid())
272 { 272 {
273 KOTodoViewItem *above = 0; 273 KOTodoViewItem *above = 0;
274 above = dynamic_cast<KOTodoViewItem *>(itemAbove()); 274 above = dynamic_cast<KOTodoViewItem *>(itemAbove());
275 m_known = above ? above->m_known : true; 275 m_known = above ? above->m_known : true;
276 if (m_known) 276 if (m_known)
277 { 277 {
278 m_odd = above ? !above->m_odd : false; 278 m_odd = above ? !above->m_odd : false;
279 } 279 }
280 else 280 else
281 { 281 {
282 KOTodoViewItem *item; 282 KOTodoViewItem *item;
283 bool previous = true; 283 bool previous = true;
284 if (QListViewItem::parent()) 284 if (QListViewItem::parent())
285 { 285 {
286 item = dynamic_cast<KOTodoViewItem *>(QListViewItem::parent()); 286 item = dynamic_cast<KOTodoViewItem *>(QListViewItem::parent());
287 if (item) 287 if (item)
288 previous = item->m_odd; 288 previous = item->m_odd;
289 item = dynamic_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); 289 item = dynamic_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild());
290 } 290 }
291 else 291 else
292 { 292 {
293 item = dynamic_cast<KOTodoViewItem *>(lv->firstChild()); 293 item = dynamic_cast<KOTodoViewItem *>(lv->firstChild());
294 } 294 }
295 295
296 while(item) 296 while(item)
297 { 297 {
298 item->m_odd = previous = !previous; 298 item->m_odd = previous = !previous;
299 item->m_known = true; 299 item->m_known = true;
300 item = dynamic_cast<KOTodoViewItem *>(item->nextSibling()); 300 item = dynamic_cast<KOTodoViewItem *>(item->nextSibling());
301 } 301 }
302 } 302 }
303 return m_odd; 303 return m_odd;
304 } 304 }
305 return false; 305 return false;
306#else
307 return false;
308#endif
309} 306}
310 307
311void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) 308void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
312{ 309{
313 QColorGroup _cg = cg; 310 QColorGroup _cg = cg;
314 QColorGroup::ColorRole role; 311 QColorGroup::ColorRole role;
315 if ( KOPrefs::instance()->mTodoViewUsesForegroundColor ) 312 if ( KOPrefs::instance()->mTodoViewUsesForegroundColor )
316 role = QColorGroup::Text; 313 role = QColorGroup::Text;
317 else 314 else
318 role = QColorGroup::Base; 315 role = QColorGroup::Base;
319 //#ifndef KORG_NOLVALTERNATION 316 //#ifndef KORG_NOLVALTERNATION
320 // if (isAlternate()) 317 if (isAlternate())
321 // _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground()); 318 _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground());
322 bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors; 319 bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors;
323 QColor colorToSet; 320 QColor colorToSet;
324 if ( setColor ) { 321 if ( setColor ) {
325 QStringList categories = mTodo->categories(); 322 QStringList categories = mTodo->categories();
326 QString cat = categories.first(); 323 QString cat = categories.first();
327 if ( !cat.isEmpty()) { 324 if ( !cat.isEmpty()) {
328 colorToSet = *(KOPrefs::instance()->categoryColor(cat) ); 325 colorToSet = *(KOPrefs::instance()->categoryColor(cat) );
329 } else 326 } else
330 setColor = false; 327 setColor = false;
331 } 328 }
332 329
333 int odue = mTodo->hasDueSubTodo( !isOpen()); 330 int odue = mTodo->hasDueSubTodo( !isOpen());
334 if (odue == 2) { 331 if (odue == 2) {
335 colorToSet = KOPrefs::instance()->mTodoOverdueColor; 332 colorToSet = KOPrefs::instance()->mTodoOverdueColor;
336 setColor = true; 333 setColor = true;
337 } else if ( odue == 1 ) { 334 } else if ( odue == 1 ) {
338 colorToSet = KOPrefs::instance()->mTodoDueTodayColor; 335 colorToSet = KOPrefs::instance()->mTodoDueTodayColor;
339 setColor = true; 336 setColor = true;
340 } 337 }
341 338
342 339
343 if ( setColor ) { 340 if ( setColor ) {
344 _cg.setColor(role,colorToSet ); 341 _cg.setColor(role,colorToSet );
345 if ( role == QColorGroup::Base) { 342 if ( role == QColorGroup::Base) {
346 int rgb = colorToSet.red(); 343 int rgb = colorToSet.red();
347 rgb += colorToSet.blue()/2; 344 rgb += colorToSet.blue()/2;
348 rgb += colorToSet.green(); 345 rgb += colorToSet.green();
349 if ( rgb < 200 ) 346 if ( rgb < 200 )
350 _cg.setColor(QColorGroup::Text,Qt::white ); 347 _cg.setColor(QColorGroup::Text,Qt::white );
351 } 348 }
352 } 349 }
353 //#endif 350 //#endif
354 if ( column > 0 ){ 351 if ( column > 0 ){
355 if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) { 352 if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) {
356 p->save(); 353 p->save();
357 int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5); 354 int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5);
358 355
359 p->fillRect( 0, 0, width, height(), _cg.base() ); // background 356 p->fillRect( 0, 0, width, height(), _cg.base() ); // background
360 // p->setPen(Qt::black ); //border 357 // p->setPen(Qt::black ); //border
361 // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling 358 // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling
362 QColor fc = KOPrefs::instance()->mHighlightColor; 359 QColor fc = KOPrefs::instance()->mHighlightColor;
363 if ( mTodo->percentComplete() == 100 ) 360 if ( mTodo->percentComplete() == 100 )
364 fc = darkGreen; 361 fc = darkGreen;
365 p->drawRect( 2, 2, width-4, height()-4); 362 p->drawRect( 2, 2, width-4, height()-4);
366 p->fillRect( 3, 3, progress, height()-6, 363 p->fillRect( 3, 3, progress, height()-6,
367 fc ); 364 fc );
368 p->restore(); 365 p->restore();
369 } else { 366 } else {
370 QCheckListItem::paintCell(p, _cg, column, width, alignment); 367 QCheckListItem::paintCell(p, _cg, column, width, alignment);
371 } 368 }
372 return; 369 return;
373 } 370 }
374 371
375 int align = alignment; 372 int align = alignment;
376 373
377 if ( !p ) 374 if ( !p )
378 return; 375 return;
379 376
380 p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); 377 p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) );
381 378
382 QListView *lv = listView(); 379 QListView *lv = listView();
383 if ( !lv ) 380 if ( !lv )
384 return; 381 return;
385 int marg = 2;//lv->itemMargin(); 382 int marg = 2;//lv->itemMargin();
386 int r = 0; 383 int r = 0;
387 QCheckListItem::Type myType = QCheckListItem::CheckBox; 384 QCheckListItem::Type myType = QCheckListItem::CheckBox;
388 int BoxSize = 20; 385 int BoxSize = 20;
389 int boxOffset = 2; 386 int boxOffset = 2;
390 int xOffset = 2; 387 int xOffset = 2;
391 if (qApp->desktop()->width() < 300 ) { 388 if (qApp->desktop()->width() < 300 ) {
392 BoxSize = 14; 389 BoxSize = 14;
393 boxOffset = -1; 390 boxOffset = -1;
394 xOffset = 1; 391 xOffset = 1;
395 // marg = 0; 392 // marg = 0;
396 } 393 }
397 if ( height() < BoxSize ) { 394 if ( height() < BoxSize ) {
398 boxOffset = boxOffset - ((BoxSize - height())/2) ; 395 boxOffset = boxOffset - ((BoxSize - height())/2) ;
399 // qDebug("boxOffset %d height %d", boxOffset, height() ); 396 // qDebug("boxOffset %d height %d", boxOffset, height() );
400 BoxSize = height(); 397 BoxSize = height();
401 398
402 } 399 }
403 //bool winStyle = lv->style() == WindowsStyle; 400 //bool winStyle = lv->style() == WindowsStyle;
404 401
405 int lineStart = 5; 402 int lineStart = 5;
406 if ( myType == Controller ) { 403 if ( myType == Controller ) {
407 if ( !pixmap( 0 ) ) 404 if ( !pixmap( 0 ) )
408 r += BoxSize + 4; 405 r += BoxSize + 4;
409 } else { 406 } else {
410 ASSERT( lv ); //### 407 ASSERT( lv ); //###
411 //QFontMetrics fm( lv->font() ); 408 //QFontMetrics fm( lv->font() );
412 //int d = fm.height(); 409 //int d = fm.height();
413 int x = 0; 410 int x = 0;
414 int y = (height() - BoxSize) / 2; 411 int y = (height() - BoxSize) / 2;
415 //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) ); 412 //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) );
416 if ( myType == CheckBox ) { 413 if ( myType == CheckBox ) {
417 if ( isEnabled() ) 414 if ( isEnabled() )
418 p->setPen( QPen( _cg.text(), 1 ) ); 415 p->setPen( QPen( _cg.text(), 1 ) );
419 else 416 else
420 p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) ); 417 p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) );
421 p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 ); 418 p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 );
422 lineStart = x+marg; 419 lineStart = x+marg;
423 ///////////////////// 420 /////////////////////
424 x++; 421 x++;
425 y++; 422 y++;
426 if ( isOn() ) { 423 if ( isOn() ) {
427 QPointArray a( 7*2 ); 424 QPointArray a( 7*2 );
428 int i, xx, yy; 425 int i, xx, yy;
429 xx = x+xOffset+marg+(boxOffset/2); 426 xx = x+xOffset+marg+(boxOffset/2);
430 yy = y+5+boxOffset; 427 yy = y+5+boxOffset;
431 for ( i=0; i<3; i++ ) { 428 for ( i=0; i<3; i++ ) {
432 a.setPoint( 2*i, xx, yy ); 429 a.setPoint( 2*i, xx, yy );
433 a.setPoint( 2*i+1, xx, yy+2 ); 430 a.setPoint( 2*i+1, xx, yy+2 );
434 // qDebug(" "); 431 // qDebug(" ");
435 xx++; yy++; 432 xx++; yy++;
436 } 433 }
437 yy -= 2; 434 yy -= 2;
438 for ( i=3; i<7; i++ ) { 435 for ( i=3; i<7; i++ ) {
439 a.setPoint( 2*i, xx, yy ); 436 a.setPoint( 2*i, xx, yy );
440 a.setPoint( 2*i+1, xx, yy+2 ); 437 a.setPoint( 2*i+1, xx, yy+2 );
441 xx++; yy--; 438 xx++; yy--;
442 } 439 }
443 p->setPen( darkGreen ); 440 p->setPen( darkGreen );
444 p->drawLineSegments( a ); 441 p->drawLineSegments( a );
445 } 442 }
446 //////////////////////// 443 ////////////////////////
447 } 444 }
448 r += BoxSize + 4; 445 r += BoxSize + 4;
449 } 446 }
450 447
451 p->translate( r, 0 ); 448 p->translate( r, 0 );
452 p->setPen( QPen( _cg.text() ) ); 449 p->setPen( QPen( _cg.text() ) );
453 QListViewItem::paintCell( p, _cg, column, width - r, align ); 450 QListViewItem::paintCell( p, _cg, column, width - r, align );
454 if ( mTodo->cancelled () ) { 451 if ( mTodo->cancelled () ) {
455 p->setPen( black ); 452 p->setPen( black );
456 QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); 453 QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() );
457 int wid = br.width() +lineStart; 454 int wid = br.width() +lineStart;
458 if ( wid > width-3 ) 455 if ( wid > width-3 )
459 wid = width-3; 456 wid = width-3;
460 p->drawLine( lineStart, height()/2+1, wid, height()/2+1 ); 457 p->drawLine( lineStart, height()/2+1, wid, height()/2+1 );
461 458
462 } 459 }
463 460
464} 461}
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp
index 1024796..d182279 100644
--- a/microkde/kdatetbl.cpp
+++ b/microkde/kdatetbl.cpp
@@ -365,193 +365,193 @@ KDateTable::contentsMousePressEvent(QMouseEvent *e)
365 KNotifyClient::beep(); 365 KNotifyClient::beep();
366 return; 366 return;
367 } 367 }
368#endif 368#endif
369 temp=firstday+date.day()-dayoff-1; 369 temp=firstday+date.day()-dayoff-1;
370 QDate da = QDate(date.year(), date.month(),1); 370 QDate da = QDate(date.year(), date.month(),1);
371 setDate(da.addDays( pos-firstday+dayoff-1)); 371 setDate(da.addDays( pos-firstday+dayoff-1));
372 updateCell(temp/7+1, temp%7); // Update the previously selected cell 372 updateCell(temp/7+1, temp%7); // Update the previously selected cell
373 updateCell(row, col); // Update the selected cell 373 updateCell(row, col); // Update the selected cell
374 // assert(QDate(date.year(), date.month(), pos-firstday+dayoff).isValid()); 374 // assert(QDate(date.year(), date.month(), pos-firstday+dayoff).isValid());
375 emit(tableClicked()); 375 emit(tableClicked());
376} 376}
377 377
378bool 378bool
379KDateTable::setDate(const QDate& date_) 379KDateTable::setDate(const QDate& date_)
380{ 380{
381 bool changed=false; 381 bool changed=false;
382 QDate temp; 382 QDate temp;
383 mMarkCurrent = false; 383 mMarkCurrent = false;
384 // ----- 384 // -----
385 if(!date_.isValid()) 385 if(!date_.isValid())
386 { 386 {
387 kdDebug() << "KDateTable::setDate: refusing to set invalid date." << endl; 387 kdDebug() << "KDateTable::setDate: refusing to set invalid date." << endl;
388 return false; 388 return false;
389 } 389 }
390 if(date!=date_) 390 if(date!=date_)
391 { 391 {
392 date=date_; 392 date=date_;
393 changed=true; 393 changed=true;
394 } 394 }
395 mMarkCurrent = ( date.month() == QDate::currentDate().month() && date.year() == QDate::currentDate().year() ); 395 mMarkCurrent = ( date.month() == QDate::currentDate().month() && date.year() == QDate::currentDate().year() );
396 temp.setYMD(date.year(), date.month(), 1); 396 temp.setYMD(date.year(), date.month(), 1);
397 firstday=temp.dayOfWeek(); 397 firstday=temp.dayOfWeek();
398 if(firstday==1) firstday=8; 398 if(firstday==1) firstday=8;
399 numdays=date.daysInMonth(); 399 numdays=date.daysInMonth();
400 if(date.month()==1) 400 if(date.month()==1)
401 { // set to december of previous year 401 { // set to december of previous year
402 temp.setYMD(date.year()-1, 12, 1); 402 temp.setYMD(date.year()-1, 12, 1);
403 } else { // set to previous month 403 } else { // set to previous month
404 temp.setYMD(date.year(), date.month()-1, 1); 404 temp.setYMD(date.year(), date.month()-1, 1);
405 } 405 }
406 numDaysPrevMonth=temp.daysInMonth(); 406 numDaysPrevMonth=temp.daysInMonth();
407 if(changed) 407 if(changed)
408 { 408 {
409 repaintContents(false); 409 repaintContents(false);
410 } 410 }
411 emit(dateChanged(date)); 411 emit(dateChanged(date));
412 return true; 412 return true;
413} 413}
414 414
415const QDate& 415const QDate&
416KDateTable::getDate() const 416KDateTable::getDate() const
417{ 417{
418 return date; 418 return date;
419} 419}
420 420
421void KDateTable::focusInEvent( QFocusEvent *e ) 421void KDateTable::focusInEvent( QFocusEvent *e )
422{ 422{
423 repaintContents(false); 423 repaintContents(false);
424 QGridView::focusInEvent( e ); 424 QGridView::focusInEvent( e );
425} 425}
426 426
427void KDateTable::focusOutEvent( QFocusEvent *e ) 427void KDateTable::focusOutEvent( QFocusEvent *e )
428{ 428{
429 repaintContents(false); 429 repaintContents(false);
430 QGridView::focusOutEvent( e ); 430 QGridView::focusOutEvent( e );
431} 431}
432 432
433QSize 433QSize
434KDateTable::sizeHint() const 434KDateTable::sizeHint() const
435{ 435{
436 if(maxCell.height()>0 && maxCell.width()>0) 436 if(maxCell.height()>0 && maxCell.width()>0)
437 { 437 {
438 return QSize((maxCell.width()+2)*numCols()+2*frameWidth(), 438 return QSize((maxCell.width()+2)*numCols()+2*frameWidth(),
439 (maxCell.height()+4)*numRows()+2*frameWidth()); 439 (maxCell.height()+4)*numRows()+2*frameWidth());
440 } else { 440 } else {
441 return QSize(-1, -1); 441 return QSize(-1, -1);
442 } 442 }
443} 443}
444 444
445KDateInternalMonthPicker::KDateInternalMonthPicker 445KDateInternalMonthPicker::KDateInternalMonthPicker
446(QWidget* parent, const char* name) 446(QWidget* parent, const char* name)
447 : QGridView(parent, name), 447 : QGridView(parent, name),
448 result(0) // invalid 448 result(0) // invalid
449{ 449{
450 QRect rect; 450 QRect rect;
451 QFont font; 451 QFont font;
452 // ----- 452 // -----
453 activeCol = -1; 453 activeCol = -1;
454 activeRow = -1; 454 activeRow = -1;
455 font=KGlobalSettings::generalFont(); 455 font=KGlobalSettings::generalFont();
456 int fontsize = 10; 456 int fontsize = 10;
457 int add = 2; 457 int add = 2;
458 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) 458 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
459 add += 8; 459 add += 8;
460 if ( QApplication::desktop()->width() > 640 ) 460 if ( QApplication::desktop()->width() > 640 )
461 add += 4; 461 add += 6;
462 font.setPointSize(fontsize+add); 462 font.setPointSize(fontsize+add);
463 setFont(font); 463 setFont(font);
464 setHScrollBarMode(AlwaysOff); 464 setHScrollBarMode(AlwaysOff);
465 setVScrollBarMode(AlwaysOff); 465 setVScrollBarMode(AlwaysOff);
466 setFrameStyle(QFrame::NoFrame); 466 setFrameStyle(QFrame::NoFrame);
467 setNumRows(4); 467 setNumRows(4);
468 setNumCols(3); 468 setNumCols(3);
469 // enable to find drawing failures: 469 // enable to find drawing failures:
470 // setTableFlags(Tbl_clipCellPainting); 470 // setTableFlags(Tbl_clipCellPainting);
471#if 0 471#if 0
472 viewport()->setEraseColor(lightGray); // for consistency with the datepicker 472 viewport()->setEraseColor(lightGray); // for consistency with the datepicker
473#endif 473#endif
474 // ----- find the preferred size 474 // ----- find the preferred size
475 // (this is slow, possibly, but unfortunatly it is needed here): 475 // (this is slow, possibly, but unfortunatly it is needed here):
476 QFontMetrics metrics(font); 476 QFontMetrics metrics(font);
477 for(int i=1; i <= 12; ++i) 477 for(int i=1; i <= 12; ++i)
478 { 478 {
479 rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); 479 rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false));
480 if(max.width()<rect.width()) max.setWidth(rect.width()); 480 if(max.width()<rect.width()) max.setWidth(rect.width());
481 if(max.height()<rect.height()) max.setHeight(rect.height()); 481 if(max.height()<rect.height()) max.setHeight(rect.height());
482 } 482 }
483 483
484} 484}
485 485
486QSize 486QSize
487KDateInternalMonthPicker::sizeHint() const 487KDateInternalMonthPicker::sizeHint() const
488{ 488{
489 return QSize((max.width()+6)*numCols()+2*frameWidth(), 489 return QSize((max.width()+6)*numCols()+2*frameWidth(),
490 (max.height()+6)*numRows()+2*frameWidth()); 490 (max.height()+6)*numRows()+2*frameWidth());
491} 491}
492 492
493int 493int
494KDateInternalMonthPicker::getResult() const 494KDateInternalMonthPicker::getResult() const
495{ 495{
496 return result; 496 return result;
497} 497}
498 498
499void 499void
500KDateInternalMonthPicker::setupPainter(QPainter *p) 500KDateInternalMonthPicker::setupPainter(QPainter *p)
501{ 501{
502 p->setPen(black); 502 p->setPen(black);
503} 503}
504 504
505void 505void
506KDateInternalMonthPicker::viewportResizeEvent(QResizeEvent*) 506KDateInternalMonthPicker::viewportResizeEvent(QResizeEvent*)
507{ 507{
508 setCellWidth(width()/3); 508 setCellWidth(width()/3);
509 setCellHeight(height()/4); 509 setCellHeight(height()/4);
510} 510}
511 511
512void 512void
513KDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) 513KDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col)
514{ 514{
515 int index; 515 int index;
516 QString text; 516 QString text;
517 // ----- find the number of the cell: 517 // ----- find the number of the cell:
518 index=3*row+col+1; 518 index=3*row+col+1;
519 text=KGlobal::locale()->monthName(index, false); 519 text=KGlobal::locale()->monthName(index, false);
520 painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text); 520 painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text);
521 if ( activeCol == col && activeRow == row ) 521 if ( activeCol == col && activeRow == row )
522 painter->drawRect( 0, 0, cellWidth(), cellHeight() ); 522 painter->drawRect( 0, 0, cellWidth(), cellHeight() );
523} 523}
524 524
525void 525void
526KDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) 526KDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e)
527{ 527{
528 if(!isEnabled() || e->button() != LeftButton) 528 if(!isEnabled() || e->button() != LeftButton)
529 { 529 {
530 KNotifyClient::beep(); 530 KNotifyClient::beep();
531 return; 531 return;
532 } 532 }
533 // ----- 533 // -----
534 int row, col; 534 int row, col;
535 QPoint mouseCoord; 535 QPoint mouseCoord;
536 // ----- 536 // -----
537 mouseCoord = e->pos(); 537 mouseCoord = e->pos();
538 row=rowAt(mouseCoord.y()); 538 row=rowAt(mouseCoord.y());
539 col=columnAt(mouseCoord.x()); 539 col=columnAt(mouseCoord.x());
540 540
541 if(row<0 || col<0) 541 if(row<0 || col<0)
542 { // the user clicked on the frame of the table 542 { // the user clicked on the frame of the table
543 activeCol = -1; 543 activeCol = -1;
544 activeRow = -1; 544 activeRow = -1;
545 } else { 545 } else {
546 activeCol = col; 546 activeCol = col;
547 activeRow = row; 547 activeRow = row;
548 updateCell( row, col /*, false */ ); 548 updateCell( row, col /*, false */ );
549 } 549 }
550} 550}
551 551
552void 552void
553KDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) 553KDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e)
554{ 554{
555 if (e->state() & LeftButton) 555 if (e->state() & LeftButton)
556 { 556 {
557 int row, col; 557 int row, col;
diff --git a/version b/version
index 2976531..c98eacc 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "2.0.5"; version = "2.0.6";