Changeset 707cd31 for src/gui


Ignore:
Timestamp:
01/18/10 20:42:57 (13 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
46a5aba
Parents:
64122f1
Message:

implemented 'Event' dialog to display relevant
'Event's info

Location:
src/gui
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/gui/gui.pro

    r64122f1 r707cd31  
    2626FORMS += mainwindow.ui \
    2727         daynavigatorwidget.ui \
    28          about.ui
     28         about.ui \
     29         eventdialog.ui
    2930
    3031HEADERS += mainwindow.h \
    31            daynavigatorwidget.h
     32           daynavigatorwidget.h \
     33           eventdialog.h
    3234
    3335SOURCES += mainwindow.cpp \
    34            daynavigatorwidget.cpp
     36           daynavigatorwidget.cpp \
     37           eventdialog.cpp
    3538
    3639maemo {
  • src/gui/mainwindow.cpp

    r64122f1 r707cd31  
    1414#include <QDialog>
    1515#include "ui_about.h"
     16#include "eventdialog.h"
    1617#include "daynavigatorwidget.h"
    1718
     
    5657
    5758    //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));
     59    actTreeView->setHeaderHidden(true);
     60    actTreeView->setRootIsDecorated(false);
     61    actTreeView->setIndentation(0);
     62    actTreeView->setAnimated(true);
     63    actTreeView->setModel(new EventModel());
     64    actTreeView->setItemDelegate(new Delegate(actTreeView));
     65
     66    connect(dayTreeView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(itemDoubleClicked(const QModelIndex &)));
     67    connect(favTreeView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(itemDoubleClicked(const QModelIndex &)));
     68    connect(actTreeView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(itemDoubleClicked(const QModelIndex &)));
    6469
    6570    // TESTING: load some 'fav' data
     
    172177{
    173178    int confId = 1;
    174     static_cast<EventModel*>(activityDayTreeView->model())->loadEventsByActivities(aDate,confId);
    175     activityDayTreeView->reset();
     179    static_cast<EventModel*>(actTreeView->model())->loadEventsByActivities(aDate,confId);
     180    actTreeView->reset();
    176181    activityDayNavigator->show();
    177182}
     183
     184void MainWindow::itemDoubleClicked(const QModelIndex &aIndex)
     185{
     186    // have to handle only events, not time-groups
     187    if(!aIndex.parent().isValid()) // time-group
     188        return;
     189
     190    EventDialog dialog(aIndex,this);
     191    dialog.exec();
     192}
     193
  • src/gui/mainwindow.h

    r64122f1 r707cd31  
    2323    /*void updateFavViewComplete();*/
    2424    void updateActivitiesDayView(const QDate &aDate);
     25    void itemDoubleClicked(const QModelIndex &aIndex);
    2526private:
    2627    SqlEngine *mSqlEngine;
  • src/gui/mainwindow.ui

    r64122f1 r707cd31  
    1818     <widget class="QTabWidget" name="tabWidget" >
    1919      <property name="currentIndex" >
    20        <number>2</number>
     20       <number>0</number>
    2121      </property>
    2222      <widget class="QWidget" name="dayViewTab" >
     
    6565          </item>
    6666          <item>
    67            <widget class="TreeView" name="activityDayTreeView" >
     67           <widget class="TreeView" name="actTreeView" >
    6868            <property name="maximumSize" >
    6969             <size>
Note: See TracChangeset for help on using the changeset viewer.