Changeset 1006c4f


Ignore:
Timestamp:
09/06/11 21:15:35 (10 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
c0559b6
Parents:
3655d06
Message:

Fixed ticket #26 (empty tabs after some actions).

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/gui/daynavigatorwidget.cpp

    r3655d06 r1006c4f  
    4646    mStartDate = aStartDate;
    4747    mEndDate = aEndDate;
    48     mCurDate = aStartDate;
     48    if (!mCurDate.isValid()) mCurDate = mStartDate;
     49    else if (mCurDate < mStartDate) mCurDate = mStartDate;
     50    else if (mCurDate > mEndDate) mCurDate = mEndDate;
    4951
    50     // QRect rect = mFontMetrics->boundingRect(mCurDate.toString("MMM dd yyyy"));
    51 
    52     if(mStartDate==mEndDate) // only one day conference
    53     {
    54         prevDayButton->setDisabled(true);
    55         nextDayButton->setDisabled(true);
    56         emit(dateChanged(mCurDate));
    57     }
    58     else
    59     {
    60         // at least 2-days conference
    61         prevDayButton->setDisabled(true);
    62         nextDayButton->setDisabled(false);
    63         emit(dateChanged(mCurDate));
    64     }
     52    prevDayButton->setDisabled(mCurDate == mStartDate);
     53    nextDayButton->setDisabled(mCurDate == mEndDate);
     54    emit(dateChanged(mCurDate));
    6555}
    6656
  • src/gui/daynavigatorwidget.h

    r3655d06 r1006c4f  
    7878        ~DayNavigatorWidget() {}
    7979        void setDates(const QDate &aStartDate, const QDate &aEndDate);
     80        QDate curDate() const {return mCurDate;}
    8081    protected:
    8182        void paintEvent(QPaintEvent *);
  • src/gui/tabcontainer.cpp

    r3655d06 r1006c4f  
    9797    {
    9898        // requires special handling
    99         // eg. in case of favourities - some favourities may have changed
     99        // eg. in case of favourites - some favourites may have changed
    100100        // and so we need to reload them
    101101        int confId = Conference::activeConference();
     
    103103        QDate endDate = Conference::getById(confId).end();
    104104        dayNavigator->setDates(startDate, endDate);
    105         updateTreeView( Conference::getById(confId).start() );
     105        updateTreeView(dayNavigator->curDate());
    106106    }
    107107    else
  • src/mvc/treeview.cpp

    r3655d06 r1006c4f  
    7171
    7272                QList<Event> conflicts = Event::conflictEvents(event.id(),Conference::activeConference());
    73                 if(event.isFavourite())
    74                     event.setFavourite(false);
    75                 else
    76                     event.setFavourite(true);
     73                event.setFavourite(!event.isFavourite());
    7774                event.update("favourite");
    7875
Note: See TracChangeset for help on using the changeset viewer.