-rw-r--r-- | korganizer/calendarview.cpp | 33 | ||||
-rw-r--r-- | korganizer/calendarview.h | 4 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 55 | ||||
-rw-r--r-- | korganizer/komonthview.h | 6 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 41 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 1 | ||||
-rw-r--r-- | libkdepim/categoryselectdialog.cpp | 3 |
7 files changed, 56 insertions, 87 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 77de94f..0fbaa9a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -272,35 +272,32 @@ void CalendarView::init() #ifdef KORG_NORESOURCEVIEW mResourceView = 0; #else if ( mResourceManager ) { mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); mResourceView->updateView(); connect( mResourceView, SIGNAL( resourcesChanged() ), SLOT( updateView() ) ); } else { mResourceView = 0; } #endif QWidget *rightBox = new QWidget( mPanner ); QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); - mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); - rightLayout->addWidget( mNavigatorBar ); - mRightFrame = new QWidgetStack( rightBox ); rightLayout->addWidget( mRightFrame, 1 ); mLeftFrame = mLeftSplitter; #else QWidget *mainBox = new QWidget( this ); QWidget *leftFrame = new QWidget( mainBox ); QBoxLayout * mainBoxLayout; QBoxLayout * leftFrameLayout; if ( KOPrefs::instance()->mVerticalScreen ) { mainBoxLayout = new QVBoxLayout(mainBox); leftFrameLayout = new QHBoxLayout(leftFrame ); } else { mainBoxLayout = new QHBoxLayout(mainBox); leftFrameLayout = new QVBoxLayout(leftFrame ); @@ -314,89 +311,73 @@ void CalendarView::init() mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); mTodoList->setNavigator( mNavigator ); if ( QApplication::desktop()->width() < 480 ) { leftFrameLayout->addWidget(mFilterView); leftFrameLayout->addWidget(mTodoList, 2 ); } else { leftFrameLayout->addWidget(mTodoList,2 ); leftFrameLayout->addWidget(mFilterView ); } mFilterView->hide(); QWidget *rightBox = new QWidget( mainBox ); mainBoxLayout->addWidget ( rightBox, 10 ); QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); - mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); mRightFrame = new QWidgetStack( rightBox ); - rightLayout->addWidget( mNavigatorBar ); rightLayout->addWidget( mRightFrame, 10 ); mLeftFrame = leftFrame; if ( KOPrefs::instance()->mVerticalScreen ) { mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); } else { mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); } if ( !KOPrefs::instance()->mShowDateNavigator) mDateNavigator->hide(); //qDebug("Calendarview Size %d %d ", width(), height()); #endif connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), SLOT( showDates( const KCal::DateList & ) ) ); connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); - connect( mNavigatorBar, SIGNAL( goPrevYear() ), - mNavigator, SLOT( selectPreviousYear() ) ); - connect( mNavigatorBar, SIGNAL( goNextYear() ), - mNavigator, SLOT( selectNextYear() ) ); - connect( mNavigatorBar, SIGNAL( goPrevMonth() ), - mNavigator, SLOT( selectPreviousMonth() ) ); - connect( mNavigatorBar, SIGNAL( goNextMonth() ), - mNavigator, SLOT( selectNextMonth() ) ); - connect( mNavigatorBar, SIGNAL( selectWeek( int ) ), - mNavigator, SLOT( selectWeek( int ) ) ); - - connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), - mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); + connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), mNavigator, SLOT( selectWeek( const QDate & ) ) ); connect( mDateNavigator, SIGNAL( goPrevYear() ), mNavigator, SLOT( selectPreviousYear() ) ); connect( mDateNavigator, SIGNAL( goNextYear() ), mNavigator, SLOT( selectNextYear() ) ); connect( mDateNavigator, SIGNAL( goPrevMonth() ), mNavigator, SLOT( selectPreviousMonth() ) ); connect( mDateNavigator, SIGNAL( goNextMonth() ), mNavigator, SLOT( selectNextMonth() ) ); connect( mDateNavigator, SIGNAL( goPrevious() ), mNavigator, SLOT( selectPrevious() ) ); connect( mDateNavigator, SIGNAL( goNext() ), mNavigator, SLOT( selectNext() ) ); connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), mNavigator, SLOT( slotMonthSelect( int ) ) ); - connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), - mNavigator, SLOT( slotMonthSelect( int ) ) ); connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), SLOT( eventAdded( Event *) ) ); connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); connect( this, SIGNAL( configChanged() ), mDateNavigator, SLOT( updateConfig() ) ); connect( mTodoList, SIGNAL( newTodoSignal() ), SLOT( newTodo() ) ); connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), SLOT( newSubTodo( Todo * ) ) ); @@ -3855,44 +3836,32 @@ void CalendarView::purgeCompleted() if ( !aTodo->relatedTo() ) rootTodos.append( aTodo ); } for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { removeCompletedSubTodos( aTodo ); } updateView(); } } void CalendarView::slotCalendarChanged() { ; } -NavigatorBar *CalendarView::navigatorBar() -{ - return mNavigatorBar; -} -void CalendarView::showNavigatorBar( bool b) -{ - if ( b ) mNavigatorBar->show(); - else mNavigatorBar->hide(); -} - - - void CalendarView::keyPressEvent ( QKeyEvent *e) { //qDebug(" alendarView::keyPressEvent "); e->ignore(); } bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) { // mSyncManager = manager; if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { qDebug("KO: SyncKDE request detected!"); } mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); mCurrentSyncName = mSyncManager->getCurrentSyncName(); return syncCalendar( filename, mode ); diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 8d7ff36..731298d 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -44,33 +44,32 @@ #include <ksyncmanager.h> class QWidgetStack; class QSplitter; class CalPrinter; class KOFilterView; class KOViewManager; class KODialogManager; class KOTodoView; class KDateNavigator; class DateNavigator; class KOIncidenceEditor; class KDatePicker; class ResourceView; -class NavigatorBar; class KOEventEditor; class KOTodoEditor ; class KOEventViewerDialog; class KOBeamPrefs; class KSyncProfile; class AlarmDialog; class KCal::Attendee; namespace KCal { class FileStorage; } using namespace KCal; /** This is the main calendar widget. It provides the different vies on t he calendar data as well as the date navigator. It also handles synchronisation of the different views and controls the different dialogs like preferences, @@ -93,33 +92,32 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser CalendarView( CalendarResources *calendar, QWidget *parent = 0, const char *name = 0 ); CalendarView( Calendar *calendar, QWidget *parent = 0, const char *name = 0 ); virtual ~CalendarView(); Calendar *calendar() { return mCalendar; } KOViewManager *viewManager(); KODialogManager *dialogManager(); QDate startDate(); QDate endDate(); QWidgetStack *viewStack(); QWidget *leftFrame(); - NavigatorBar *navigatorBar(); DateNavigator *dateNavigator(); KDateNavigator *dateNavigatorWidget(); void addView(KOrg::BaseView *); void showView(KOrg::BaseView *); KOEventViewerDialog* getEventViewerDialog(); Incidence *currentSelection(); signals: void save (); void saveStopTimer (); void tempDisableBR(bool); /** This todo has been modified */ void todoModified(Todo *, int); @@ -163,33 +161,32 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void pasteEnabled(bool); /** Emitted, when the number of incoming messages has changed. */ void numIncomingChanged(int); /** Emitted, when the number of outgoing messages has changed. */ void numOutgoingChanged(int); /** Send status message, which can e.g. be displayed in the status bar. */ void statusMessage(const QString &); void calendarViewExpanded( bool ); void updateSearchDialog(); public slots: - void showNavigatorBar(bool); void showOpenError(); void watchSavedFile(); void recheckTimerAlarm(); void checkNextTimerAlarm(); void addAlarm(const QDateTime &qdt, const QString ¬i ); void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); void removeAlarm(const QDateTime &qdt, const QString ¬i ); /** options dialog made a changed to the configuration. we catch this * and notify all widgets which need to update their configuration. */ void updateConfig(); void insertBirthdays(const QString& uid, const QStringList& birthdayList, const QStringList& anniversaryList, const QStringList& realNameList, const QStringList& emailList, const QStringList& assembledNameList, const QStringList& uidList); @@ -520,33 +517,32 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser int mDatePickerMode; bool mFlagEditDescription; QDateTime mLastCalendarSync; void createPrinter(); void calendarModified( bool, Calendar * ); CalPrinter *mCalPrinter; QSplitter *mPanner; QSplitter *mLeftSplitter; QWidget *mLeftFrame; QWidgetStack *mRightFrame; KDatePicker* mDatePicker; QVBox* mDateFrame; - NavigatorBar *mNavigatorBar; KDateNavigator *mDateNavigator; // widget showing small month view. KOFilterView *mFilterView; ResourceView *mResourceView; // calendar object for this viewing instance Calendar *mCalendar; CalendarResourceManager *mResourceManager; FileStorage *mStorage; DateNavigator *mNavigator; diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 234375b..7ba0b2f 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -780,49 +780,52 @@ void MonthViewCell::selection( QListBoxItem *item ) mMonthView->setSelectedCell( this ); } // ******************************************************************************* // ******************************************************************************* // ******************************************************************************* KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) : KOEventView( calendar, parent, name ), mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) { skipResize = false; clPending = true; + mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); mWidStack = new QWidgetStack( this ); - QHBoxLayout* hb = new QHBoxLayout( this ); + QVBoxLayout* hb = new QVBoxLayout( this ); mMonthView = new QWidget( mWidStack ); mWeekView = new QWidget( mWidStack ); #if QT_VERSION >= 0x030000 mWidStack->addWidget(mMonthView ); mWidStack->addWidget(mWeekView ); #else mWidStack->addWidget( mMonthView, 1 ); mWidStack->addWidget( mWeekView , 1 ); #endif + hb->addWidget( mNavigatorBar ); hb->addWidget( mWidStack ); mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); mShowWeekView = KOPrefs::instance()->mMonthViewWeek; if ( mShowWeekView ) mWeekStartsMonday = true; updatePossible = false; + //updatePossible = true; mCells.setAutoDelete( true ); mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; mDayLabels.resize( mDaysPerWeek ); mDayLabelsW.resize( mDaysPerWeek ); QFont bfont = font(); if ( QApplication::desktop()->width() < 650 ) { bfont.setPointSize( bfont.pointSize() - 2 ); } bfont.setBold( true ); int i; for( i = 0; i < mDaysPerWeek; i++ ) { QLabel *label = new QLabel( mMonthView ); label->setFont(bfont); label->setFrameStyle(QFrame::Panel|QFrame::Raised); label->setLineWidth(1); @@ -904,59 +907,62 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) // ... but we need mWidthLongDayLabel computed QFontMetrics fontmetric(mDayLabels[0]->font()); mWidthLongDayLabel = 0; for (int i = 0; i < 7; i++) { int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; } //mWeekLabels[mNumWeeks]->setText( i18n("W")); if ( mShowWeekView ) mWidStack->raiseWidget( mWeekView ); else mWidStack->raiseWidget( mMonthView ); emit incidenceSelected( 0 ); +#ifndef DESKTOP_VERSION + resize( QApplication::desktop()->size() ); + computeLayout(); +#endif } KOMonthView::~KOMonthView() { delete mContextMenu; } void KOMonthView::selectInternalWeekNum ( int n ) { switchView(); emit selectWeekNum ( n ); } int KOMonthView::currentWeek() { if ( mShowWeekView ) return mWeekLabelsW[0]->getWeekNum(); return mWeekLabels[0]->getWeekNum(); } void KOMonthView::switchView() { if ( selectedCell( ) ) selectedCell()->deselect(); mShowWeekView = !mShowWeekView; KOPrefs::instance()->mMonthViewWeek = mShowWeekView; - //emit showNavigator( !mShowWeekView ); if ( clPending ) { computeLayout(); updateConfig(); } if ( mShowWeekView ) mWidStack->raiseWidget( mWeekView ); else mWidStack->raiseWidget( mMonthView ); clPending = false; } int KOMonthView::maxDatesHint() { return mNumCells; } @@ -1247,79 +1253,73 @@ void KOMonthView::updateView() int i; for( i = 0; i < (*cells).count(); ++i ) { (*cells)[i]->updateCell(); } //qDebug("KOMonthView::updateView() "); processSelectionChange(); // qDebug("---------------------------------------------------------------------+ "); (*cells)[0]->setFocus(); #endif //qDebug("update time %d ", ti.elapsed()); } void KOMonthView::resizeEvent(QResizeEvent * e) { - qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); - if ( skipResize ) { - skipResize = false; - qDebug("skipResize "); - return; - } + //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); computeLayout(); clPending = true; if ( mShowWeekView ) mCellsW[0]->setFocus(); else mCells[0]->setFocus(); } void KOMonthView::computeLayoutWeek() { static int lastWid = 0; static int lastHei = 0; int daysToShow; bool combinedSatSun = false; if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { daysToShow = 6; combinedSatSun = true; } int tWid = topLevelWidget()->size().width(); int tHei = topLevelWidget()->size().height(); - int wid = size().width();//e - int hei = size().height()-1; + int wid = width();//e + int hei = height()-1-mNavigatorBar->height(); if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) return; - - if ( lastWid == width() && lastHei ==height() ) + if ( lastWid == width() && lastHei == height() ) return; - lastWid =width(); + lastWid = width(); lastHei = height(); if ( wid < hei ) daysToShow = 2; else daysToShow = 3; mShowSatSunComp = true; combinedSatSun = true; - qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); + //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); QFontMetrics fm ( mWeekLabels[0]->font() ); int weeklabelwid = fm.width( "888" ); wid -= weeklabelwid; int colWid = wid / daysToShow; int lastCol = wid - ( colWid*6 ); int dayLabelHei = mDayLabelsW[0]->sizeHint().height(); int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); int colModulo = wid % daysToShow; int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; //qDebug("rowmod %d ", rowModulo); int i; int x,y,w,h; x= 0; y= 0; w = colWid; @@ -1374,68 +1374,71 @@ void KOMonthView::computeLayoutWeek() x += w; if ( x + w/2 > wid ) { x = 0; y += h+dayLabelHei ; } } y= dayLabelHei; h = cellHei ; mWeekLabelsW[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei); mWeekLabelsW[1]->setGeometry( 0,0,weeklabelwid,dayLabelHei); // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); mShortDayLabels = mDayLabelsW[0]->width() < mWidthLongDayLabel ; updateDayLabels(); - bool forceUpdate = !updatePossible; + //bool forceUpdate = !updatePossible; updatePossible = true; //mWeekLabels[mNumWeeks]->setText( i18n("M")); - if ( forceUpdate ) - updateView(); + //if ( forceUpdate ) + // updateView(); } void KOMonthView::computeLayout() { static int lastWid = 0; static int lastHei = 0; if ( mShowWeekView ){ computeLayoutWeek(); return; } int daysToShow = 7; bool combinedSatSun = false; if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { daysToShow = 6; combinedSatSun = true; } int tWid = topLevelWidget()->size().width(); int tHei = topLevelWidget()->size().height(); - int wid = size().width();//e - int hei = size().height()-1; + int wid = width();//e + int hei = height()-1-mNavigatorBar->height(); - if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) + if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) { return; - if ( lastWid == width() && lastHei ==height() ) + } + if ( lastWid == width() && lastHei == height() ){ return; - lastWid =width(); - lastHei = height(); - qDebug("KOMonthView::computeLayout() MMM ------------------------------------ "); + } + + lastWid = width(); + lastHei = height(); + //qDebug("KOMonthView::computeLayout() MMM ------------------------------------ "); QFontMetrics fm ( mWeekLabels[0]->font() ); int weeklabelwid = fm.width( "888" ); wid -= weeklabelwid; int colWid = wid / daysToShow; int lastCol = wid - ( colWid*6 ); int dayLabelHei = mDayLabels[0]->sizeHint().height(); int cellHei = (hei - dayLabelHei) /6; int colModulo = wid % daysToShow; int rowModulo = (hei- dayLabelHei) % 6; //qDebug("rowmod %d ", rowModulo); int i; int x,y,w,h; x= 0; y= 0; w = colWid; @@ -1487,37 +1490,35 @@ void KOMonthView::computeLayout() y += h; } } y= dayLabelHei; h = cellHei ; for ( i = 0; i < 6; i++) { if ( i == (6-rowModulo)) ++h; mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h); y += h; } mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; updateDayLabels(); - bool forceUpdate = !updatePossible; + //bool forceUpdate = !updatePossible; updatePossible = true; //mWeekLabels[mNumWeeks]->setText( i18n("W")); - if ( forceUpdate ) - updateView(); } void KOMonthView::showContextMenu( Incidence *incidence ) { mContextMenu->showIncidencePopup(incidence); /* if( incidence && incidence->type() == "Event" ) { Event *event = static_cast<Event *>(incidence); mContextMenu->showEventPopup(event); } else { kdDebug() << "MonthView::showContextMenu(): cast failed." << endl; } */ } MonthViewCell * KOMonthView::selectedCell( ) { diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index a29a1a8..bf861ef 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -23,32 +23,33 @@ #include <qlabel.h> #include <qframe.h> #include <qdatetime.h> #include <qlistbox.h> #include <qpoint.h> #include <qwidgetstack.h> #include <qlayout.h> #include <qintdict.h> #include <qpushbutton.h> #include <qvaluelist.h> #include <qptrvector.h> #include <libkcal/calendar.h> #include <libkcal/event.h> #include "koeventview.h" +#include "navigatorbar.h" #ifdef DESKTOP_VERSION class QToolTipGroup; #endif class KNOWhatsThis; class KOWeekButton : public QPushButton { Q_OBJECT public: KOWeekButton( QWidget *parent=0, const char *name=0 ) : QPushButton( parent, name) { connect( this, SIGNAL( clicked() ), SLOT( bottonClicked() )); mNumber = -1; @@ -214,63 +215,64 @@ class KOMonthView: public KOEventView /** Returns number of currently shown dates. */ virtual int currentDateCount(); /** returns the currently selected events */ virtual QPtrList<Incidence> selectedIncidences(); /** returns dates of the currently selected events */ virtual DateList selectedDates(); virtual void printPreview(CalPrinter *calPrinter, const QDate &, const QDate &); bool isMonthView() { return true; } bool isUpdatePossible() { return updatePossible; } MonthViewCell * selectedCell(); - bool skipResize; + bool skipResize; + NavigatorBar* navigatorBar() { return mNavigatorBar ;} public slots: virtual void updateView(); virtual void updateConfig(); virtual void showDates(const QDate &start, const QDate &end); virtual void showEvents(QPtrList<Event> eventList); void changeEventDisplay(Event *, int); void clearSelection(); void showContextMenu( Incidence * ); void setSelectedCell( MonthViewCell * ); protected slots: void selectInternalWeekNum ( int ); void switchView(); void processSelectionChange(); signals: void nextMonth(); void prevMonth(); - void showNavigator( bool ); void selectWeekNum ( int ); void showDaySignal( QDate ); protected: void resizeEvent(QResizeEvent *); void viewChanged(); void updateDayLabels(); private: + NavigatorBar* mNavigatorBar; int currentWeek(); bool clPending; QWidgetStack * mWidStack; QWidget* mMonthView; QWidget* mWeekView; bool mShowWeekView; bool updatePossible; int mDaysPerWeek; int mNumWeeks; int mNumCells; bool mWeekStartsMonday; bool mShowSatSunComp; void computeLayout(); void computeLayoutWeek(); QPtrVector<MonthViewCell> mCells; diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index ba15f7f..b551e2a 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -188,71 +188,56 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) { //mFlagShowNextxDays = false; //if(view == mCurrentView) return; if ( view == 0 ) { view = mCurrentView; if ( view == 0 ) return; } bool full = fullScreen; if(view == mCurrentView && view != mWhatsNextView ) { if ( mCurrentAgendaView < 0 ) return; full = mMainView->leftFrame()->isVisible(); } else { if ( view == mMonthView && mMonthView) - mMonthView->skipResize = true ; + ;//mMonthView->skipResize = true ; mCurrentView = view; // bool full = fullScreen; bool isFull = !mMainView->leftFrame()->isVisible(); if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) full = true; if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) full = false; } if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); //raiseCurrentView( full ); mMainView->processIncidenceSelection( 0 ); //mMainView->updateView(); raiseCurrentView( full, true ); mMainView->adaptNavigationUnits(); } void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) { mCurrentAgendaView = 0; - int wid = mMainView->width() ; - int hei = mMainView->height(); - if ( mCurrentView == mMonthView ) { - if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) { - mMainView->navigatorBar()->show(); - hei -= mMainView->navigatorBar()->sizeHint().height(); - } - //mMainView->navigatorBar()->hide(); - } else { - mMainView->navigatorBar()->hide(); - } if ( fullScreen ) { mMainView->leftFrame()->hide(); } else { mMainView->leftFrame()->show(); - if ( KOPrefs::instance()->mVerticalScreen ) - hei -= mMainView->leftFrame()->height(); - else - wid -= mMainView->leftFrame()->width(); } emit signalFullScreen( !fullScreen ); if ( callUpdateView ) mMainView->updateView(); if ( globalFlagBlockAgenda == 5 ) { globalFlagBlockAgenda = 4; globalFlagBlockAgendaItemPaint = 1; } mMainView->viewStack()->raiseWidget(mCurrentView); if ( globalFlagBlockAgenda == 4 ) { if ( mCurrentView == mAgendaView ) { //globalFlagBlockAgenda =1 ; if ( KOPrefs::instance()->mSetTimeToDayStartAt ) mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); else if ( KOPrefs::instance()->mCenterOnCurrentTime ) @@ -514,37 +499,53 @@ void KOViewManager::showMonthView() mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), mMainView, SLOT ( moveIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), mMainView, SLOT ( beamIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( selectWeekNum( int ) ), mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), mMainView, SLOT ( showDay( QDate ) ) ); connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); connect( mMonthView, SIGNAL(nextMonth() ), - mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); + mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); connect( mMonthView, SIGNAL(prevMonth() ), - mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); - connect( mMonthView, SIGNAL( showNavigator(bool) ), - mMainView, SLOT ( showNavigatorBar(bool) ) ); + mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), + mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), + mMainView->dateNavigator(), SLOT( selectNextYear() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), + mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), + mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( selectWeek( int ) ), + mMainView->dateNavigator(), SLOT( selectWeek( int ) ) ); + + connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), + mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); + + + connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), + mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); + } globalFlagBlockAgenda = 1; //mFlagShowNextxDays = false; // if(mMonthView == mCurrentView) return; if ( KOPrefs::instance()->mMonthViewWeek ) mMainView->dateNavigator()->selectWeek(); else mMainView->dateNavigator()->selectMonth(); showView(mMonthView, true ); } void KOViewManager::showTodoView() { diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 657f98d..f05e6f6 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -141,32 +141,33 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam ctrlLayout->addWidget( mSelectMonth ); // ctrlLayout->addSpacing( 1 ); // ctrlLayout->addStretch( 1 ); ctrlLayout->addWidget( mNextMonth, 3 ); ctrlLayout->addWidget( mNextYear, 3 ); connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); mPrevYear->setFocusPolicy(NoFocus); mPrevMonth->setFocusPolicy(NoFocus); mNextMonth->setFocusPolicy(NoFocus); mNextYear->setFocusPolicy(NoFocus); mSelectMonth->setFocusPolicy(NoFocus); + setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); } NavigatorBar::~NavigatorBar() { } void NavigatorBar::selectMonth() { int month; KPopupFrame* popup = new KPopupFrame(this); int size = 12; if ( QApplication::desktop()->width() >= 480 ) size = 18; KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(size, popup); diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp index 8b2bc4e..8038934 100644 --- a/libkdepim/categoryselectdialog.cpp +++ b/libkdepim/categoryselectdialog.cpp @@ -129,60 +129,59 @@ void CategorySelectDialog::setColorCat() { QCheckListItem * newColorItem = (QCheckListItem * )mCategories->currentItem (); if ( !newColorItem ) { KMessageBox::error(this,i18n("There is no current item.")); return; } if ( !newColorItem->isOn() ) newColorItem->setOn( true ); setColorItem( newColorItem ); } void CategorySelectDialog::clicked ( QListViewItem * it ) { if ( ! it ) return; QCheckListItem *i = (QCheckListItem *) it; - qDebug("click %d ", i->isOn()); if ( !i->isOn() && i==mColorItem) { setColorItem( 0); QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); while (item) { if (item->isOn()) { setColorItem( item ); break; } item = (QCheckListItem *)item->nextSibling(); } } else if ( i->isOn() && !mColorItem) { setColorItem( i); } } void CategorySelectDialog::setColorItem( QCheckListItem * newColorItem ) { if ( !mColorEnabled ) return; if ( mColorItem == newColorItem) return; if ( mColorItem ) { mColorItem->setPixmap ( 0, QPixmap() ); mColorItem = 0; } if ( newColorItem ) { QPixmap pix (newColorItem->height()/2, newColorItem->height()/2 ); - pix.fill(Qt::blue ); + pix.fill(Qt::red ); newColorItem->setPixmap ( 0, pix ); mColorItem = newColorItem; } } void CategorySelectDialog::slotApply() { QStringList categories; QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); QString colcat; while (item) { if (item->isOn()) { if ( item == mColorItem) colcat = item->text(); else categories.append(item->text()); } |