-rw-r--r-- | korganizer/komonthview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index d0380e3..f9bc1ca 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -921,76 +921,78 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
921 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); | 921 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); |
922 | 922 | ||
923 | #if 0 | 923 | #if 0 |
924 | if ( mShowWeekView ) | 924 | if ( mShowWeekView ) |
925 | mWidStack->raiseWidget( mWeekView ); | 925 | mWidStack->raiseWidget( mWeekView ); |
926 | else | 926 | else |
927 | mWidStack->raiseWidget( mMonthView ); | 927 | mWidStack->raiseWidget( mMonthView ); |
928 | #endif | 928 | #endif |
929 | 929 | ||
930 | emit incidenceSelected( 0 ); | 930 | emit incidenceSelected( 0 ); |
931 | #ifndef DESKTOP_VERSION | 931 | #ifndef DESKTOP_VERSION |
932 | resize( QApplication::desktop()->size() ); | 932 | resize( QApplication::desktop()->size() ); |
933 | #else | 933 | #else |
934 | resize(640, 480 ); | 934 | resize(640, 480 ); |
935 | updatePossible = true; | 935 | updatePossible = true; |
936 | #endif | 936 | #endif |
937 | computeLayout(); | 937 | computeLayout(); |
938 | 938 | ||
939 | if ( mShowWeekView ) | 939 | if ( mShowWeekView ) |
940 | mWidStack->raiseWidget( mWeekView ); | 940 | mWidStack->raiseWidget( mWeekView ); |
941 | else | 941 | else |
942 | mWidStack->raiseWidget( mMonthView ); | 942 | mWidStack->raiseWidget( mMonthView ); |
943 | } | 943 | } |
944 | 944 | ||
945 | KOMonthView::~KOMonthView() | 945 | KOMonthView::~KOMonthView() |
946 | { | 946 | { |
947 | delete mContextMenu; | 947 | delete mContextMenu; |
948 | } | 948 | } |
949 | 949 | ||
950 | void KOMonthView::selectInternalWeekNum ( int n ) | 950 | void KOMonthView::selectInternalWeekNum ( int n ) |
951 | { | 951 | { |
952 | switchView(); | 952 | switchView(); |
953 | if ( !KOPrefs::instance()->mMonthViewWeek ) | ||
954 | emit selectMonth (); | ||
955 | else | ||
953 | emit selectWeekNum ( n ); | 956 | emit selectWeekNum ( n ); |
954 | } | 957 | } |
955 | 958 | ||
956 | int KOMonthView::currentWeek() | 959 | int KOMonthView::currentWeek() |
957 | { | 960 | { |
958 | if ( mShowWeekView ) | 961 | if ( mShowWeekView ) |
959 | return mWeekLabelsW[0]->getWeekNum(); | 962 | return mWeekLabelsW[0]->getWeekNum(); |
960 | return mWeekLabels[0]->getWeekNum(); | 963 | return mWeekLabels[0]->getWeekNum(); |
961 | } | 964 | } |
962 | void KOMonthView::switchView() | 965 | void KOMonthView::switchView() |
963 | { | 966 | { |
964 | |||
965 | if ( selectedCell( ) ) | 967 | if ( selectedCell( ) ) |
966 | selectedCell()->deselect(); | 968 | selectedCell()->deselect(); |
967 | mShowWeekView = !mShowWeekView; | 969 | mShowWeekView = !mShowWeekView; |
968 | KOPrefs::instance()->mMonthViewWeek = mShowWeekView; | 970 | KOPrefs::instance()->mMonthViewWeek = mShowWeekView; |
969 | if ( clPending ) { | 971 | if ( clPending ) { |
970 | computeLayout(); | 972 | computeLayout(); |
971 | updateConfig(); | 973 | updateConfig(); |
972 | } | 974 | } |
973 | if ( mShowWeekView ) | 975 | if ( mShowWeekView ) |
974 | mWidStack->raiseWidget( mWeekView ); | 976 | mWidStack->raiseWidget( mWeekView ); |
975 | else | 977 | else |
976 | mWidStack->raiseWidget( mMonthView ); | 978 | mWidStack->raiseWidget( mMonthView ); |
977 | clPending = false; | 979 | clPending = false; |
978 | } | 980 | } |
979 | 981 | ||
980 | int KOMonthView::maxDatesHint() | 982 | int KOMonthView::maxDatesHint() |
981 | { | 983 | { |
982 | return mNumCells; | 984 | return mNumCells; |
983 | } | 985 | } |
984 | 986 | ||
985 | int KOMonthView::currentDateCount() | 987 | int KOMonthView::currentDateCount() |
986 | { | 988 | { |
987 | return mNumCells; | 989 | return mNumCells; |
988 | } | 990 | } |
989 | 991 | ||
990 | QPtrList<Incidence> KOMonthView::selectedIncidences() | 992 | QPtrList<Incidence> KOMonthView::selectedIncidences() |
991 | { | 993 | { |
992 | QPtrList<Incidence> selected; | 994 | QPtrList<Incidence> selected; |
993 | 995 | ||
994 | if ( mSelectedCell ) { | 996 | if ( mSelectedCell ) { |
995 | Incidence *incidence = mSelectedCell->selectedIncidence(); | 997 | Incidence *incidence = mSelectedCell->selectedIncidence(); |
996 | if ( incidence ) selected.append( incidence ); | 998 | if ( incidence ) selected.append( incidence ); |