Ignore:
Timestamp:
01/18/10 18:15:45 (12 years ago)
Author:
korrco <korrco@…>
Branches:
master, qt5
Children:
a35aa83
Parents:
28d9e28
Message:

activities tab implemented - need to fit gui, functionality works fine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    r28d9e28 rfbc1646  
    3737    connect(dayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateDayView(const QDate &)));
    3838    connect(activityDayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateActivitiesDayView(const QDate &)));
    39     connect(tabWidget, SIGNAL(currentChanged(int)), SLOT(updateView(int)));
     39    //connect(tabWidget, SIGNAL(currentChanged(int)), SLOT(updateView(int)));
    4040
    4141    // DAY EVENTS View
     
    5454    favTreeView->setModel(new EventModel());
    5555    favTreeView->setItemDelegate(new Delegate(favTreeView));
     56
     57    //ACTIVITIES View
     58    activityDayTreeView->setHeaderHidden(true);
     59    activityDayTreeView->setRootIsDecorated(false);
     60    activityDayTreeView->setIndentation(0);
     61    activityDayTreeView->setAnimated(true);
     62    activityDayTreeView->setModel(new EventModel());
     63    activityDayTreeView->setItemDelegate(new Delegate(activityDayTreeView));
     64
    5665    // TESTING: load some 'fav' data
    5766    if(Conference::getAll().count()) // no conference(s) in the DB
     
    6372
    6473    if(!Conference::getAll().count()) // no conference(s) in the DB
     74    {
    6575        dayNavigator->hide(); // hide DayNavigatorWidget
     76        activityDayNavigator->hide();
     77    }
    6678    else
    6779    {
    6880        int confId = 1;
    69         dayNavigator->setDates(Conference::getById(confId).start(),Conference::getById(confId).end());
     81        QDate aStartDate = Conference::getById(confId).start();
     82        QDate aEndDate = Conference::getById(confId).end();
     83        dayNavigator->setDates(aStartDate, aEndDate);
     84        activityDayNavigator->setDates(aStartDate, aEndDate);
    7085    }
    71 
    7286    connect(static_cast<EventModel*>(dayTreeView->model()), SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), SLOT(updateFavView()));
    73     connect(static_cast<EventModel*>(favTreeView->model()), SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), SLOT(updateFavViewComplete()));
     87    connect(static_cast<EventModel*>(favTreeView->model()), SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), SLOT(updateFavView()));
     88/*    connect(static_cast<EventModel*>(favTreeView->model()), SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), SLOT(updateFavViewComplete()));*/
    7489}
    7590
     
    138153    favTreeView->reset(); //Necessary reset:
    139154                        //  if favourite event unselected as favourite is the only one in its time, and reset is not produced, crashed
     155
     156    dayNavigator->show();
    140157}
    141158
     159/*
    142160void MainWindow::updateFavViewComplete()
    143161{
     
    146164    updateDayView(Conference::getById(confId).start());
    147165}
     166*/
    148167
    149168void MainWindow::updateActivitiesDayView(const QDate &aDate)
     
    157176void MainWindow::updateView(int tabIndex)
    158177{
    159     //TODO korinpa: skraslit ! aj pre ine taby
     178    //TODO korinpa: change to enum or names ?
    160179    qDebug() << "updateView index: " << tabIndex;
    161     if (tabIndex == 2)
     180    if (tabIndex == 0)
     181    {
     182        QDate date = dayNavigator->getCurrentDate();
     183        updateDayView(date);
     184    }
     185    else if (tabIndex == 1)
     186    {
     187        updateFavView();
     188    }
     189    else if (tabIndex == 2)
    162190    {
    163191        QDate date = activityDayNavigator->getCurrentDate();
Note: See TracChangeset for help on using the changeset viewer.