From: Philipp Spitzer Date: Wed, 21 Sep 2011 20:30:03 +0000 (+0000) Subject: The dateChanged signal is transmitted to the tabcontainers now. X-Git-Tag: 0.5.5~49 X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/commitdiff_plain/bf6be888d0403e38065feaec6d6f0747952e8d52 The dateChanged signal is transmitted to the tabcontainers now. --- diff --git a/src/gui/daynavigatorwidget.cpp b/src/gui/daynavigatorwidget.cpp index f8674af..c6d0a40 100644 --- a/src/gui/daynavigatorwidget.cpp +++ b/src/gui/daynavigatorwidget.cpp @@ -29,6 +29,8 @@ DayNavigatorWidget::DayNavigatorWidget(QWidget *aParent): QWidget(aParent) { connect(prevDayButton, SIGNAL(clicked()), SLOT(prevDayButtonClicked())); connect(nextDayButton, SIGNAL(clicked()), SLOT(nextDayButtonClicked())); connect(todayButton, SIGNAL(clicked()), SLOT(todayButtonClicked())); + + configureNavigation(); } @@ -70,8 +72,8 @@ void DayNavigatorWidget::setCurDate(const QDate& curDate) { void DayNavigatorWidget::configureNavigation() { - prevDayButton->setDisabled(mCurDate == mStartDate); - nextDayButton->setDisabled(mCurDate == mEndDate); + prevDayButton->setDisabled(!mStartDate.isValid() || mCurDate == mStartDate); + nextDayButton->setDisabled(!mEndDate.isValid() || mCurDate == mEndDate); } @@ -102,7 +104,7 @@ void DayNavigatorWidget::paintEvent(QPaintEvent *aEvent) { Q_UNUSED(aEvent); - QString selectedDateStr = mCurDate.toString("dddd\nyyyy-MM-dd"); + QString selectedDateStr = mCurDate.isValid() ? mCurDate.toString("dddd\nyyyy-MM-dd") : tr("No date"); QPainter painter(this); painter.save(); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 71c0bee..91a00e2 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -91,6 +91,14 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent) connect(nowTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); connect(searchTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); + // date has changed + connect(dayNavigator, SIGNAL(dateChanged(QDate)), dayTabContainer, SLOT(setCurDate(QDate))); + connect(dayNavigator, SIGNAL(dateChanged(QDate)), favsTabContainer, SLOT(setCurDate(QDate))); + connect(dayNavigator, SIGNAL(dateChanged(QDate)), tracksTabContainer, SLOT(setCurDate(QDate))); + connect(dayNavigator, SIGNAL(dateChanged(QDate)), roomsTabContainer, SLOT(setCurDate(QDate))); + connect(dayNavigator, SIGNAL(dateChanged(QDate)), nowTabContainer, SLOT(setCurDate(QDate))); + connect(dayNavigator, SIGNAL(dateChanged(QDate)), searchTabContainer, SLOT(setCurDate(QDate))); + connect(aboutAction, SIGNAL(triggered()), SLOT(aboutApp())); connect(settingsAction, SIGNAL(triggered()), SLOT(setup())); connect(conferencesAction, SIGNAL(triggered()), SLOT(showConferences())); diff --git a/src/gui/tabcontainer.cpp b/src/gui/tabcontainer.cpp index c17eff2..48f9120 100644 --- a/src/gui/tabcontainer.cpp +++ b/src/gui/tabcontainer.cpp @@ -111,6 +111,12 @@ void TabContainer::updateTreeViewModel(int aEventId, bool aReloadModel) } } + +void TabContainer::setCurDate(const QDate& curDate) { + updateTreeView(curDate); +} + + void TabContainer::setDates(const QDate &aStart, const QDate &aEnd) { dayNavigator->setDates(aStart, aEnd); diff --git a/src/gui/tabcontainer.h b/src/gui/tabcontainer.h index 572b995..dfbf653 100644 --- a/src/gui/tabcontainer.h +++ b/src/gui/tabcontainer.h @@ -45,6 +45,7 @@ signals: public slots: virtual void updateTreeViewModel(int aEventId, bool aReloadModel = false); + void setCurDate(const QDate& curDate); void setDates(const QDate &aStart, const QDate &aEnd); protected slots: