Changeset f6300c7 for src/gui


Ignore:
Timestamp:
01/18/10 16:25:57 (13 years ago)
Author:
korrco <korrco@…>
Branches:
master, qt5
Children:
28d9e28
Parents:
b6cd05c
Message:

activities tab implemented - not finished yet

Location:
src/gui
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/gui/daynavigatorwidget.cpp

    rb6cd05c rf6300c7  
    8383}
    8484
     85QDate DayNavigatorWidget::getCurrentDate()
     86{
     87    return mCurDate;
     88}
     89
  • src/gui/daynavigatorwidget.h

    rb6cd05c rf6300c7  
    66#include <QDate>
    77
    8 class DayNavigatorWidget : public QWidget, Ui::DayNavigatorWidget
     8class DayNavigatorWidget : public QWidget, private Ui::DayNavigatorWidget
    99{
    1010    Q_OBJECT
     
    1313        ~DayNavigatorWidget() {}
    1414        void setDates(const QDate &aStartDate, const QDate &aEndDate);
     15        QDate getCurrentDate();
    1516    private slots:
    1617        void prevDayButtonClicked();
  • src/gui/daynavigatorwidget.ui

    rb6cd05c rf6300c7  
    77    <y>0</y>
    88    <width>360</width>
    9     <height>50</height>
     9    <height>52</height>
    1010   </rect>
    1111  </property>
  • src/gui/mainwindow.cpp

    rb6cd05c rf6300c7  
    3636
    3737    connect(dayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateDayView(const QDate &)));
    38 
     38    connect(activityDayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateActivitiesDayView(const QDate &)));
     39    connect(tabWidget, SIGNAL(currentChanged(int)), SLOT(updateView(int)));
    3940
    4041    // DAY EVENTS View
     
    105106        int confId = 1;
    106107        // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates
    107         dayNavigator->setDates(Conference::getById(confId).start(),Conference::getById(confId).end());
     108        dayNavigator->setDates(Conference::getById(confId).start(), Conference::getById(confId).end());
    108109    }
    109110}
     
    145146    updateDayView(Conference::getById(confId).start());
    146147}
     148
     149void MainWindow::updateActivitiesDayView(const QDate &aDate)
     150{
     151    int confId = 1;
     152    static_cast<EventModel*>(activityDayTreeView->model())->loadEventsByActivities(aDate,confId);
     153    activityDayTreeView->reset();
     154    activityDayNavigator->show();
     155}
     156
     157void MainWindow::updateView(int tabIndex)
     158{
     159    //TODO korinpa: skraslit ! aj pre ine taby
     160    qDebug() << "updateView index: " << tabIndex;
     161    if (tabIndex == 2)
     162    {
     163        QDate date = activityDayNavigator->getCurrentDate();
     164        updateActivitiesDayView(date);
     165    }
     166}
     167
  • src/gui/mainwindow.h

    rb6cd05c rf6300c7  
    2222    void updateFavView();
    2323    void updateFavViewComplete();
     24    void updateActivitiesDayView(const QDate &aDate);
     25    void updateView(int tabIndex);
    2426private:
    2527    SqlEngine *mSqlEngine;
  • src/gui/mainwindow.ui

    rb6cd05c rf6300c7  
    5858        <string>Activities</string>
    5959       </attribute>
     60       <widget class="QWidget" name="verticalLayoutWidget" >
     61        <property name="geometry" >
     62         <rect>
     63          <x>0</x>
     64          <y>0</y>
     65          <width>501</width>
     66          <height>231</height>
     67         </rect>
     68        </property>
     69        <layout class="QVBoxLayout" name="activitiesVerticalLayout" >
     70         <item>
     71          <widget class="DayNavigatorWidget" native="1" name="activityDayNavigator" />
     72         </item>
     73         <item>
     74          <widget class="TreeView" name="activityDayTreeView" >
     75           <property name="maximumSize" >
     76            <size>
     77             <width>16777215</width>
     78             <height>16777215</height>
     79            </size>
     80           </property>
     81          </widget>
     82         </item>
     83        </layout>
     84       </widget>
    6085      </widget>
    6186      <widget class="QWidget" name="searchTab" >
     
    79104     <y>0</y>
    80105     <width>534</width>
    81      <height>26</height>
     106     <height>40</height>
    82107    </rect>
    83108   </property>
Note: See TracChangeset for help on using the changeset viewer.