refactoring of the TABS
authortimkoma <timkoma@localhost>
Wed, 27 Jan 2010 15:06:21 +0000 (15:06 +0000)
committertimkoma <timkoma@localhost>
Wed, 27 Jan 2010 15:06:21 +0000 (15:06 +0000)
22 files changed:
src/app/app.pro
src/gui/dayviewtabcontainer.cpp [new file with mode: 0644]
src/gui/dayviewtabcontainer.h [new file with mode: 0644]
src/gui/favtabcontainer.cpp [new file with mode: 0644]
src/gui/favtabcontainer.h [new file with mode: 0644]
src/gui/gui.pro
src/gui/mainwindow.cpp
src/gui/mainwindow.ui
src/gui/nowtabcontainer.cpp [new file with mode: 0644]
src/gui/nowtabcontainer.h [new file with mode: 0644]
src/gui/roomstabcontainer.cpp [new file with mode: 0644]
src/gui/roomstabcontainer.h [new file with mode: 0644]
src/gui/searchhead.cpp [new file with mode: 0644]
src/gui/searchhead.h [new file with mode: 0644]
src/gui/searchhead.ui [new file with mode: 0644]
src/gui/searchtabcontainer.cpp [new file with mode: 0644]
src/gui/searchtabcontainer.h [new file with mode: 0644]
src/gui/tabcontainer.cpp
src/gui/tabcontainer.h
src/gui/tabcontainer.ui
src/gui/trackstabcontainer.cpp [new file with mode: 0644]
src/gui/trackstabcontainer.h [new file with mode: 0644]

index 67f6bab..bd1d96f 100644 (file)
@@ -6,7 +6,7 @@ QT += sql xml
 
 # module dependencies
 LIBS += -L$$DESTDIR -lgui -lmvc -lsql
-INCLUDEPATH += ../gui ../sql
+INCLUDEPATH += ../gui ../sql ../mvc ../orm
 DEPENDPATH += . ../gui
 TARGETDEPS += $$DESTDIR/libmvc.a $$DESTDIR/libgui.a $$DESTDIR/libsql.a
 maemo {
diff --git a/src/gui/dayviewtabcontainer.cpp b/src/gui/dayviewtabcontainer.cpp
new file mode 100644 (file)
index 0000000..1514bbf
--- /dev/null
@@ -0,0 +1,15 @@
+
+#include "dayviewtabcontainer.h"
+
+DayViewTabContainer::DayViewTabContainer(QWidget *aParent) : TabContainer( aParent )
+{
+}
+
+DayViewTabContainer::~DayViewTabContainer()
+{
+}
+
+void DayViewTabContainer::loadEvents( const QDate &aDate, const int aConferenceId )
+{
+    static_cast<EventModel*>(treeView->model())->loadEvents( aDate, aConferenceId );
+}
diff --git a/src/gui/dayviewtabcontainer.h b/src/gui/dayviewtabcontainer.h
new file mode 100644 (file)
index 0000000..cfbbbc7
--- /dev/null
@@ -0,0 +1,16 @@
+
+#ifndef DAYVIEWTABCONTAINER_H_
+#define DAYVIEWTABCONTAINER_H_
+
+#include "tabcontainer.h"
+
+class DayViewTabContainer: public TabContainer {
+    Q_OBJECT
+public:
+    DayViewTabContainer(QWidget *aParent);
+    virtual ~DayViewTabContainer();
+protected:
+    virtual void loadEvents(const QDate &aDate, const int aConferenceId );
+};
+
+#endif /* DAYVIEWTABCONTAINER_H_ */
diff --git a/src/gui/favtabcontainer.cpp b/src/gui/favtabcontainer.cpp
new file mode 100644 (file)
index 0000000..4a8e98f
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * favtabcontainer.cpp
+ *
+ *  Created on: Jan 27, 2010
+ *      Author: maemo
+ */
+
+#include "favtabcontainer.h"
+
+FavTabContainer::FavTabContainer(QWidget *aParent) : TabContainer( aParent )
+{
+}
+
+void FavTabContainer::loadEvents( const QDate &aDate, const int aConferenceId )
+{
+    static_cast<EventModel*>(treeView->model())->loadFavEvents( aDate, aConferenceId );
+}
+
+void FavTabContainer::updateTreeViewModel(int aEventId)
+{
+    // requires special handling
+    // we need to reload favourites, because some favourite could be deleted
+    //static_cast<EventModel*>(favTreeView->model())->updateModel(aEventId);
+    QDate aStartDate = Conference::getById(AppSettings::confId()).start();
+    QDate aEndDate = Conference::getById(AppSettings::confId()).end();
+    dayNavigator->setDates(aStartDate, aEndDate);
+    updateTreeView( Conference::getById(AppSettings::confId()).start() );
+}
diff --git a/src/gui/favtabcontainer.h b/src/gui/favtabcontainer.h
new file mode 100644 (file)
index 0000000..06140f0
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * favtabcontainer.h
+ *
+ *  Created on: Jan 27, 2010
+ *      Author: maemo
+ */
+
+#ifndef FAVTABCONTAINER_H_
+#define FAVTABCONTAINER_H_
+
+#include "tabcontainer.h"
+
+class FavTabContainer: public TabContainer
+{
+    Q_OBJECT
+public:
+    FavTabContainer(QWidget *aParent);
+    virtual ~FavTabContainer(){}
+
+public slots:
+    virtual void updateTreeViewModel(int aEventId);
+
+protected:
+    virtual void loadEvents( const QDate &aDate, const int aConferenceId );
+};
+
+#endif /* FAVTABCONTAINER_H_ */
index 82a215e..7fec1d3 100644 (file)
@@ -3,53 +3,90 @@ TEMPLATE = lib
 TARGET = gui
 DESTDIR = ../bin
 CONFIG += static
-QT += sql xml
+QT += sql \
+    xml
 
 # module dependencies
-LIBS += -L$$DESTDIR -lmvc -lorm -lsql
-INCLUDEPATH += ../orm ../mvc ../sql ../app
-DEPENDPATH += . ../orm ../mvc ../sql
-TARGETDEPS += $$DESTDIR/liborm.a $$DESTDIR/libmvc.a $$DESTDIR/libsql.a
-maemo {
-    LIBS += -L$$DESTDIR -lqalarm
+LIBS += -L$$DESTDIR \
+    -lmvc \
+    -lorm \
+    -lsql
+INCLUDEPATH += ../orm \
+    ../mvc \
+    ../sql \
+    ../app
+DEPENDPATH += . \
+    ../orm \
+    ../mvc \
+    ../sql
+TARGETDEPS += $$DESTDIR/liborm.a \
+    $$DESTDIR/libmvc.a \
+    $$DESTDIR/libsql.a
+maemo { 
+    LIBS += -L$$DESTDIR \
+        -lqalarm
     INCLUDEPATH += ../alarm
-    DEPENDPATH +=  ../alarm
-    TARGETDEPS +=  $$DESTDIR/libqalarm.a
+    DEPENDPATH += ../alarm
+    TARGETDEPS += $$DESTDIR/libqalarm.a
 }
 
-
 # A shamelessly long list of sources, headers and forms.
 # Please note that resources MUST be added to the app module
 # (which means they need to be added to the test module as well,
 # but I am sure you can live with that for the time being).
-
-FORMS += mainwindow.ui \
-         daynavigatorwidget.ui \
-         importschedulewidget.ui \
-         about.ui \
-         eventdialog.ui \
-         tabcontainer.ui \
-         mapwindow.ui
-
-HEADERS += mainwindow.h \
-           daynavigatorwidget.h \
-           importschedulewidget.h \
-           eventdialog.h \
-           tabwidget.h \
-           tabcontainer.h \
-           mapwindow.h
-
-SOURCES += mainwindow.cpp \
-           daynavigatorwidget.cpp \
-           importschedulewidget.cpp \
-           eventdialog.cpp \
-           tabwidget.cpp \
-           tabcontainer.cpp \
-           mapwindow.cpp
-
-maemo {
-    FORMS += alarmdialog.ui
-    HEADERS += alarmdialog.h
-    SOURCES += alarmdialog.cpp
+FORMS += searchhead.ui \
+    mainwindow.ui \
+    daynavigatorwidget.ui \
+    importschedulewidget.ui \
+    about.ui \
+    eventdialog.ui \
+    tabcontainer.ui \
+    mapwindow.ui
+HEADERS += roomstabcontainer.h \
+    nowtabcontainer.h \
+    trackstabcontainer.h \
+    favtabcontainer.h \
+    searchtabcontainer.h \
+    searchhead.h \
+    dayviewtabcontainer.h \
+    mainwindow.h \
+    daynavigatorwidget.h \
+    importschedulewidget.h \
+    eventdialog.h \
+    tabwidget.h \
+    tabcontainer.h \
+    mapwindow.h
+SOURCES += roomstabcontainer.cpp \
+    nowtabcontainer.cpp \
+    trackstabcontainer.cpp \
+    favtabcontainer.cpp \
+    searchtabcontainer.cpp \
+    searchhead.cpp \
+    dayviewtabcontainer.cpp \
+    mainwindow.cpp \
+    daynavigatorwidget.cpp \
+    importschedulewidget.cpp \
+    eventdialog.cpp \
+    tabwidget.cpp \
+    tabcontainer.cpp \
+    mapwindow.cpp
+maemo { 
+    FORMS += searchhead.ui \
+        alarmdialog.ui
+    HEADERS += roomstabcontainer.h \
+        nowtabcontainer.h \
+        trackstabcontainer.h \
+        favtabcontainer.h \
+        searchtabcontainer.h \
+        searchhead.h \
+        dayviewtabcontainer.h \
+        alarmdialog.h
+    SOURCES += roomstabcontainer.cpp \
+        nowtabcontainer.cpp \
+        trackstabcontainer.cpp \
+        favtabcontainer.cpp \
+        searchtabcontainer.cpp \
+        searchhead.cpp \
+        dayviewtabcontainer.cpp \
+        alarmdialog.cpp
 }
-
index 660de2b..0016b4b 100644 (file)
@@ -43,13 +43,6 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent)
         setWindowTitle(confs[0].title());
     }
 
-    dayTabContainer->setType(TabContainer::EContainerTypeDay);
-    favsTabContainer->setType(TabContainer::EContainerTypeFavs);
-    tracksTabContainer->setType(TabContainer::EContainerTypeTracks);
-    nowTabContainer->setType(TabContainer::EContainerTypeNow);
-    roomsTabContainer->setType(TabContainer::EContainerTypeRooms);
-    searchTabContainer->setType(TabContainer::EContainerTypeSearch);
-
     connect(importScheduleWidget, SIGNAL(scheduleImported(int)), SLOT(scheduleImported(int)));
 
     // event details have changed
index 63e4e05..2ab2b7c 100644 (file)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow" >
-  <property name="geometry" >
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <height>498</height>
    </rect>
   </property>
-  <property name="minimumSize" >
+  <property name="minimumSize">
    <size>
     <width>400</width>
     <height>300</height>
    </size>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>MainWindow</string>
   </property>
-  <widget class="QWidget" name="centralwidget" >
-   <layout class="QGridLayout" name="gridLayout" >
-    <item row="0" column="0" >
-     <widget class="TabWidget" name="tabWidget" >
-      <property name="currentIndex" >
-       <number>0</number>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QGridLayout" name="gridLayout">
+    <item row="0" column="0">
+     <widget class="TabWidget" name="tabWidget">
+      <property name="currentIndex">
+       <number>3</number>
       </property>
-      <widget class="QWidget" name="dayViewTab" >
-       <attribute name="title" >
+      <widget class="QWidget" name="dayViewTab">
+       <attribute name="title">
         <string>Day View</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_2" >
-        <item row="0" column="0" >
-         <widget class="TabContainer" native="1" name="dayTabContainer" />
+       <layout class="QGridLayout" name="gridLayout_2">
+        <item row="0" column="0">
+         <widget class="DayViewTabContainer" name="dayTabContainer" native="true"/>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="favouritesTab" >
-       <attribute name="title" >
+      <widget class="QWidget" name="favouritesTab">
+       <attribute name="title">
         <string>Favourites</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_3" >
-        <item row="0" column="0" >
-         <widget class="TabContainer" native="1" name="favsTabContainer" />
+       <layout class="QGridLayout" name="gridLayout_3">
+        <item row="0" column="0">
+         <widget class="FavTabContainer" name="favsTabContainer" native="true"/>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="tracksTab" >
-       <attribute name="title" >
+      <widget class="QWidget" name="tracksTab">
+       <attribute name="title">
         <string>Tracks</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_4" >
-        <item row="0" column="0" >
-         <widget class="TabContainer" native="1" name="tracksTabContainer" />
+       <layout class="QGridLayout" name="gridLayout_4">
+        <item row="0" column="0">
+         <widget class="TracksTabContainer" name="tracksTabContainer" native="true"/>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="searchTab" >
-       <attribute name="title" >
+      <widget class="QWidget" name="searchTab">
+       <attribute name="title">
         <string>Search</string>
        </attribute>
-       <layout class="QHBoxLayout" name="horizontalLayout_1" >
+       <layout class="QHBoxLayout" name="horizontalLayout_1">
         <item>
-         <widget class="TabContainer" native="1" name="searchTabContainer" />
+         <widget class="SearchTabContainer" name="searchTabContainer" native="true">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="roomsTab" >
-       <attribute name="title" >
+      <widget class="QWidget" name="roomsTab">
+       <attribute name="title">
         <string>Rooms</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_8" >
-        <item row="0" column="0" >
-         <widget class="TabContainer" native="1" name="roomsTabContainer" />
+       <layout class="QGridLayout" name="gridLayout_8">
+        <item row="0" column="0">
+         <widget class="RoomsTabContainer" name="roomsTabContainer" native="true"/>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="conferenceTab" >
-       <attribute name="title" >
+      <widget class="QWidget" name="conferenceTab">
+       <attribute name="title">
         <string>Conference</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_5" >
-        <item row="0" column="0" >
-         <layout class="QVBoxLayout" name="verticalLayout_4" >
+       <layout class="QGridLayout" name="gridLayout_5">
+        <item row="0" column="0">
+         <layout class="QVBoxLayout" name="verticalLayout_4">
           <item>
-           <widget class="QLabel" name="conferenceTitle" >
-            <property name="font" >
+           <widget class="QLabel" name="conferenceTitle">
+            <property name="font">
              <font>
               <weight>75</weight>
               <bold>true</bold>
              </font>
             </property>
-            <property name="text" >
+            <property name="text">
              <string>Conference Name</string>
             </property>
-            <property name="alignment" >
+            <property name="alignment">
              <set>Qt::AlignCenter</set>
             </property>
-            <property name="wordWrap" >
+            <property name="wordWrap">
              <bool>true</bool>
             </property>
            </widget>
           </item>
           <item>
-           <widget class="QLabel" name="conferenceSubtitle" >
-            <property name="text" >
+           <widget class="QLabel" name="conferenceSubtitle">
+            <property name="text">
              <string>Conference Subtitle</string>
             </property>
-            <property name="alignment" >
+            <property name="alignment">
              <set>Qt::AlignCenter</set>
             </property>
-            <property name="wordWrap" >
+            <property name="wordWrap">
              <bool>true</bool>
             </property>
            </widget>
           </item>
           <item>
-           <widget class="Line" name="line" >
-            <property name="orientation" >
+           <widget class="Line" name="line">
+            <property name="orientation">
              <enum>Qt::Horizontal</enum>
             </property>
            </widget>
           </item>
           <item>
-           <layout class="QGridLayout" name="gridLayout_6" >
-            <item row="0" column="0" >
-             <widget class="QLabel" name="label" >
-              <property name="font" >
+           <layout class="QGridLayout" name="gridLayout_6">
+            <item row="0" column="0">
+             <widget class="QLabel" name="label">
+              <property name="font">
                <font>
                 <weight>75</weight>
                 <italic>true</italic>
                 <bold>true</bold>
                </font>
               </property>
-              <property name="text" >
+              <property name="text">
                <string>When:</string>
               </property>
              </widget>
             </item>
-            <item row="1" column="0" >
-             <widget class="QLabel" name="label_2" >
-              <property name="font" >
+            <item row="1" column="0">
+             <widget class="QLabel" name="label_2">
+              <property name="font">
                <font>
                 <weight>75</weight>
                 <italic>true</italic>
                 <bold>true</bold>
                </font>
               </property>
-              <property name="text" >
+              <property name="text">
                <string>Where:</string>
               </property>
              </widget>
             </item>
-            <item row="0" column="2" >
-             <widget class="QLabel" name="conferenceWhen" >
-              <property name="text" >
+            <item row="0" column="2">
+             <widget class="QLabel" name="conferenceWhen">
+              <property name="text">
                <string>DATE (FROM - TO)</string>
               </property>
              </widget>
             </item>
-            <item row="1" column="2" >
-             <widget class="QLabel" name="conferenceWhere" >
-              <property name="text" >
+            <item row="1" column="2">
+             <widget class="QLabel" name="conferenceWhere">
+              <property name="text">
                <string>CITY, CAMPUS</string>
               </property>
              </widget>
             </item>
-            <item row="1" column="3" >
-             <widget class="QPushButton" name="showMapButton" >
-              <property name="text" >
+            <item row="1" column="3">
+             <widget class="QPushButton" name="showMapButton">
+              <property name="text">
                <string>MAP</string>
               </property>
-              <property name="icon" >
-               <iconset resource="../icons.qrc" >
+              <property name="icon">
+               <iconset resource="../icons.qrc">
                 <normaloff>:/icons/compassBig.png</normaloff>:/icons/compassBig.png</iconset>
               </property>
-              <property name="flat" >
+              <property name="flat">
                <bool>true</bool>
               </property>
              </widget>
             </item>
-            <item row="1" column="4" >
-             <spacer name="horizontalSpacer_3" >
-              <property name="orientation" >
+            <item row="1" column="4">
+             <spacer name="horizontalSpacer_3">
+              <property name="orientation">
                <enum>Qt::Horizontal</enum>
               </property>
-              <property name="sizeHint" stdset="0" >
+              <property name="sizeHint" stdset="0">
                <size>
                 <width>40</width>
                 <height>20</height>
               </property>
              </spacer>
             </item>
-            <item row="0" column="1" >
-             <widget class="QLabel" name="spacer" >
-              <property name="text" >
+            <item row="0" column="1">
+             <widget class="QLabel" name="spacer">
+              <property name="text">
                <string/>
               </property>
              </widget>
            </layout>
           </item>
           <item>
-           <widget class="Line" name="line_2" >
-            <property name="orientation" >
+           <widget class="Line" name="line_2">
+            <property name="orientation">
              <enum>Qt::Horizontal</enum>
             </property>
            </widget>
           </item>
           <item>
-           <widget class="ImportScheduleWidget" native="1" name="importScheduleWidget" >
-            <property name="sizePolicy" >
-             <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
+           <widget class="ImportScheduleWidget" name="importScheduleWidget" native="true">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
            </widget>
           </item>
           <item>
-           <spacer name="verticalSpacer" >
-            <property name="orientation" >
+           <spacer name="verticalSpacer">
+            <property name="orientation">
              <enum>Qt::Vertical</enum>
             </property>
-            <property name="sizeHint" stdset="0" >
+            <property name="sizeHint" stdset="0">
              <size>
               <width>20</width>
               <height>40</height>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="nowTab" >
-       <attribute name="title" >
+      <widget class="QWidget" name="nowTab">
+       <attribute name="title">
         <string>Now</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_7" >
-        <item row="0" column="0" >
-         <widget class="TabContainer" native="1" name="nowTabContainer" />
+       <layout class="QGridLayout" name="gridLayout_7">
+        <item row="0" column="0">
+         <widget class="NowTabContainer" name="nowTabContainer" native="true"/>
         </item>
        </layout>
       </widget>
     </item>
    </layout>
   </widget>
-  <widget class="QStatusBar" name="statusbar" />
+  <widget class="QStatusBar" name="statusbar"/>
  </widget>
  <customwidgets>
   <customwidget>
    <container>1</container>
   </customwidget>
   <customwidget>
-   <class>TabContainer</class>
+   <class>SearchTabContainer</class>
    <extends>QWidget</extends>
-   <header>tabcontainer.h</header>
-   <container>1</container>
+   <header>searchtabcontainer.h</header>
+  </customwidget>
+  <customwidget>
+   <class>DayViewTabContainer</class>
+   <extends>QWidget</extends>
+   <header>dayviewtabcontainer.h</header>
+  </customwidget>
+  <customwidget>
+   <class>FavTabContainer</class>
+   <extends>QWidget</extends>
+   <header>favtabcontainer.h</header>
+  </customwidget>
+  <customwidget>
+   <class>TracksTabContainer</class>
+   <extends>QWidget</extends>
+   <header>trackstabcontainer.h</header>
+  </customwidget>
+  <customwidget>
+   <class>RoomsTabContainer</class>
+   <extends>QWidget</extends>
+   <header>roomstabcontainer.h</header>
+  </customwidget>
+  <customwidget>
+   <class>NowTabContainer</class>
+   <extends>QWidget</extends>
+   <header>nowtabcontainer.h</header>
   </customwidget>
  </customwidgets>
  <resources>
-  <include location="../icons.qrc" />
+  <include location="../icons.qrc"/>
  </resources>
  <connections/>
 </ui>
diff --git a/src/gui/nowtabcontainer.cpp b/src/gui/nowtabcontainer.cpp
new file mode 100644 (file)
index 0000000..249ad64
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * nowtabcontainer.cpp
+ *
+ *  Created on: Jan 27, 2010
+ *      Author: maemo
+ */
+
+#include <QTimer>
+#include "nowtabcontainer.h"
+
+NowTabContainer::NowTabContainer( QWidget *aParent ) : TabContainer( aParent )
+{
+    QTimer *timer = new QTimer( this );
+    connect( timer, SIGNAL(timeout()), SLOT(timerUpdateTreeView()) );
+    timer->start( 30000); // 30 seconds timer
+}
+
+void NowTabContainer::loadEvents( const QDate &aDate, const int aConferenceId )
+{
+    Q_UNUSED( aDate );
+    static_cast<EventModel*>(treeView->model())->loadNowEvents( aConferenceId );
+    treeView->setAllExpanded(true);
+}
+
+void NowTabContainer::timerUpdateTreeView()
+{
+    updateTreeView( QDate() );
+}
diff --git a/src/gui/nowtabcontainer.h b/src/gui/nowtabcontainer.h
new file mode 100644 (file)
index 0000000..a7112fa
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * nowtabcontainer.h
+ *
+ *  Created on: Jan 27, 2010
+ *      Author: maemo
+ */
+
+#ifndef NOWTABCONTAINER_H_
+#define NOWTABCONTAINER_H_
+
+#include "tabcontainer.h"
+
+class NowTabContainer: public TabContainer
+{
+    Q_OBJECT
+public:
+    NowTabContainer( QWidget *aParent );
+    virtual ~NowTabContainer() { }
+
+protected:
+    virtual void loadEvents( const QDate &aDate, const int aConferenceId );
+
+private slots:
+    void timerUpdateTreeView();
+};
+
+#endif /* NOWTABCONTAINER_H_ */
diff --git a/src/gui/roomstabcontainer.cpp b/src/gui/roomstabcontainer.cpp
new file mode 100644 (file)
index 0000000..e5f7af2
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * roomstabcontainer.cpp
+ *
+ *  Created on: Jan 27, 2010
+ *      Author: maemo
+ */
+
+#include "roomstabcontainer.h"
+
+RoomsTabContainer::RoomsTabContainer( QWidget *aParent ) : TabContainer( aParent )
+{
+}
+
+void RoomsTabContainer::loadEvents( const QDate &aDate, const int aConferenceId )
+{
+    static_cast<EventModel*>(treeView->model())->loadEventsByRoom( aDate, aConferenceId );
+}
diff --git a/src/gui/roomstabcontainer.h b/src/gui/roomstabcontainer.h
new file mode 100644 (file)
index 0000000..7c1e59c
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * roomstabcontainer.h
+ *
+ *  Created on: Jan 27, 2010
+ *      Author: maemo
+ */
+
+#ifndef ROOMSTABCONTAINER_H_
+#define ROOMSTABCONTAINER_H_
+
+#include "tabcontainer.h"
+
+class RoomsTabContainer: public TabContainer
+{
+    Q_OBJECT
+public:
+    RoomsTabContainer( QWidget *aParent );
+    virtual ~RoomsTabContainer() {}
+
+protected:
+    virtual void loadEvents( const QDate &aDate, const int aConferenceId );
+
+};
+
+#endif /* ROOMSTABCONTAINER_H_ */
diff --git a/src/gui/searchhead.cpp b/src/gui/searchhead.cpp
new file mode 100644 (file)
index 0000000..1390feb
--- /dev/null
@@ -0,0 +1,21 @@
+
+#include "searchhead.h"
+
+SearchHead::SearchHead(QWidget *parent)
+    : QWidget(parent)
+{
+       setupUi(this);
+       connect( searchButton, SIGNAL(clicked()), SLOT(searchButtonClicked()));
+}
+
+SearchHead::~SearchHead()
+{
+
+}
+
+
+void SearchHead::searchButtonClicked()
+{
+    qDebug() << "SearchHead::searchButtonClicked()";
+    emit( searchClicked() );
+}
diff --git a/src/gui/searchhead.h b/src/gui/searchhead.h
new file mode 100644 (file)
index 0000000..8ab2d69
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef SEARCHHEAD_H
+#define SEARCHHEAD_H
+
+#include <QtGui/QWidget>
+#include <QDebug>
+#include "ui_searchhead.h"
+
+class SearchHead : public QWidget, public Ui::SearchHeadClass
+{
+    Q_OBJECT
+
+public:
+    SearchHead(QWidget *parent = 0);
+    ~SearchHead();
+
+signals:
+    void searchClicked();
+
+private slots:
+    void searchButtonClicked();
+
+//private:
+    //Ui::SearchHeadClass ui;
+};
+
+#endif // SEARCHHEAD_H
diff --git a/src/gui/searchhead.ui b/src/gui/searchhead.ui
new file mode 100644 (file)
index 0000000..c5beae5
--- /dev/null
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SearchHeadClass</class>
+ <widget class="QWidget" name="SearchHeadClass">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>371</width>
+    <height>88</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>10</width>
+    <height>10</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>SearchHead</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="leftMargin">
+    <number>9</number>
+   </property>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_7">
+     <item>
+      <widget class="QCheckBox" name="searchTitle">
+       <property name="text">
+        <string>Title</string>
+       </property>
+       <property name="checked">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QCheckBox" name="searchAbstract">
+       <property name="text">
+        <string>Abstract</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QCheckBox" name="searchSpeaker">
+       <property name="text">
+        <string>Speaker</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QCheckBox" name="searchTag">
+       <property name="text">
+        <string>Tag</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QCheckBox" name="searchRoom">
+       <property name="text">
+        <string>Room</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <widget class="QLineEdit" name="searchEdit">
+       <property name="enabled">
+        <bool>true</bool>
+       </property>
+       <property name="toolTip">
+        <string>type a keyword to search</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="searchButton">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Search</string>
+       </property>
+       <property name="icon">
+        <iconset resource="../icons.qrc">
+         <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset>
+       </property>
+       <property name="checkable">
+        <bool>false</bool>
+       </property>
+       <property name="autoDefault">
+        <bool>true</bool>
+       </property>
+       <property name="default">
+        <bool>true</bool>
+       </property>
+       <property name="flat">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources>
+  <include location="../icons.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/src/gui/searchtabcontainer.cpp b/src/gui/searchtabcontainer.cpp
new file mode 100644 (file)
index 0000000..64d989f
--- /dev/null
@@ -0,0 +1,102 @@
+
+#include <appsettings.h>
+
+#include "searchtabcontainer.h"
+#include "searchhead.h"
+
+
+SearchTabContainer::SearchTabContainer(QWidget *aParent) : TabContainer( aParent )
+{
+    header = new SearchHead(this);
+    header->setObjectName(QString::fromUtf8("header"));
+    QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+    sizePolicy.setHorizontalStretch(0);
+    sizePolicy.setVerticalStretch(0);
+    //sizePolicy.setHeightForWidth(TabContainer::sizePolicy().hasHeightForWidth());
+    sizePolicy.setHeightForWidth(header->sizePolicy().hasHeightForWidth());
+    header->setSizePolicy(sizePolicy);
+    header->setMinimumSize(QSize(10, 10));
+
+    verticalLayout->insertWidget(0,header);
+
+    header->show();
+
+    searchAgainButton = new QToolButton(this);
+    searchAgainButton->setObjectName(QString::fromUtf8("button"));
+    QIcon icon;
+    icon.addPixmap(QPixmap(QString::fromUtf8(":/icons/search.png")), QIcon::Normal, QIcon::Off);
+    searchAgainButton->setIcon(icon);
+    QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Minimum);
+    sizePolicy1.setHorizontalStretch(0);
+    sizePolicy1.setVerticalStretch(0);
+    sizePolicy1.setHeightForWidth(searchAgainButton->sizePolicy().hasHeightForWidth());
+    searchAgainButton->setSizePolicy(sizePolicy1);
+
+    verticalLayout_2->insertWidget(0,searchAgainButton);
+
+    searchAgainButton->show();
+
+    connect( header, SIGNAL(searchClicked()), SLOT(searchButtonClicked()));
+    connect( searchAgainButton, SIGNAL(clicked()), SLOT(searchAgainClicked()));
+}
+
+SearchTabContainer::~SearchTabContainer()
+{
+}
+
+void SearchTabContainer::searchButtonClicked()
+{
+    qDebug() << "SearchTab::searchButtonClicked()";
+
+    QHash<QString,QString> columns;
+
+    SearchHead *searchHeader = static_cast<SearchHead*>(header);
+    if( searchHeader->searchTitle->isChecked() )
+        columns.insertMulti("EVENT", "title");
+    if( searchHeader->searchAbstract->isChecked() )
+        columns.insertMulti("EVENT", "abstract");
+    if( searchHeader->searchTag->isChecked() )
+        columns.insertMulti("EVENT", "tag");
+    if( searchHeader->searchSpeaker->isChecked() )
+        columns["PERSON"] = "name";
+    if( searchHeader->searchRoom->isChecked() )
+        columns["ROOM"] = "name";
+
+    QString keyword = searchHeader->searchEdit->text().replace( QString("%"), QString("\\%") );
+    qDebug() << "\nKeyword to search: " << keyword;
+    SqlEngine::searchEvent( AppSettings::confId(), columns, keyword );
+
+    QDate startDate = Conference::getById(AppSettings::confId()).start();
+    QDate endDate = Conference::getById(AppSettings::confId()).end();
+    dayNavigator->setDates(startDate, endDate);
+    updateTreeView( Conference::getById(AppSettings::confId()).start() );
+}
+
+void SearchTabContainer::searchAgainClicked()
+{
+    qDebug() << "SearchTab::searchAgainClicked()";
+    header->show();
+    searchAgainButton->hide();
+    dayNavigator->hide();
+    treeView->hide();
+}
+
+void SearchTabContainer::loadEvents( const QDate &aDate, const int aConferenceId )
+{
+    int eventsCount = static_cast<EventModel*>(treeView->model())->loadSearchResultEvents( aDate, aConferenceId );
+    if( eventsCount ||
+            //TODO: this is not good test
+            dayNavigator->getCurrentDate() != Conference::getById( aConferenceId ).start()
+            ){
+        searchAgainButton->show();
+        dayNavigator->show();
+        treeView->show();
+        header->hide();
+    }
+    else{
+        treeView->hide();
+        searchAgainButton->hide();
+        dayNavigator->hide();
+        header->show();
+    }
+}
diff --git a/src/gui/searchtabcontainer.h b/src/gui/searchtabcontainer.h
new file mode 100644 (file)
index 0000000..bcfdc7b
--- /dev/null
@@ -0,0 +1,26 @@
+
+#ifndef SEARCHTAB_H_
+#define SEARCHTAB_H_
+
+#include <QWidget>
+
+#include "tabcontainer.h"
+#include "searchhead.h"
+
+class SearchTabContainer: public TabContainer {
+    Q_OBJECT
+public:
+    SearchTabContainer(QWidget *aParent);
+    virtual ~SearchTabContainer();
+protected:
+    virtual void loadEvents( const QDate &aDate, const int aConferenceId );
+private slots:
+    void searchButtonClicked();
+    void searchAgainClicked();
+
+private:
+    SearchHead *header;
+    QToolButton *searchAgainButton;
+};
+
+#endif /* SEARCHTAB_H_ */
index 3d3cc7b..f2e3fff 100644 (file)
@@ -4,13 +4,7 @@
 #include <QMessageBox>
 #include <QTimer>
 
-#include <sqlengine.h>
-#include <appsettings.h>
-
-#include <conference.h>
-
 #include <treeview.h>
-#include <eventmodel.h>
 #include <delegate.h>
 
 #include "eventdialog.h"
 
 TabContainer::TabContainer(QWidget *aParent)
     : QWidget(aParent)
-    , mType(EContainerTypeNone)
 {
     setupUi(this);
 
-    searchAgainButton->hide();
-    searchHead->hide();
-
     treeView->setHeaderHidden(true);
     treeView->setRootIsDecorated(false);
     treeView->setIndentation(0);
@@ -39,9 +29,6 @@ TabContainer::TabContainer(QWidget *aParent)
     connect(treeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
     connect(treeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &)));
 
-    connect(searchButton, SIGNAL(clicked()), SLOT(searchClicked()));
-    connect(searchAgainButton, SIGNAL(clicked()), SLOT(searchAgainClicked()));
-
     if(!Conference::getAll().count()) // no conference(s) in the DB
     {
         dayNavigator->hide(); // hide DayNavigatorWidget
@@ -54,79 +41,11 @@ TabContainer::TabContainer(QWidget *aParent)
     }
 }
 
-void TabContainer::setType(TabContainer::Type aType)
-{
-    mType = aType;
-
-    if(aType == EContainerTypeNow)
-    {
-        QTimer *timer = new QTimer( this );
-        connect( timer, SIGNAL(timeout()), SLOT(timerUpdateTreeView()) );
-        timer->start( 30000); // 30 seconds timer
-    }
-    if(aType == EContainerTypeSearch)
-    {
-        searchHead->show();
-    }
-}
-
 void TabContainer::updateTreeView(const QDate &aDate)
 {
-    switch(mType)
-    {
-        case EContainerTypeDay:
-            {
-                static_cast<EventModel*>(treeView->model())->loadEvents(aDate,AppSettings::confId());
-            }
-            break;
-        case EContainerTypeFavs:
-            {
-                static_cast<EventModel*>(treeView->model())->loadFavEvents(aDate,AppSettings::confId());
-            }
-            break;
-        case EContainerTypeTracks:
-            {
-                static_cast<EventModel*>(treeView->model())->loadEventsByTrack(aDate, AppSettings::confId());
-            }
-            break;
-        case EContainerTypeRooms:
-            {
-                static_cast<EventModel*>(treeView->model())->loadEventsByRoom(aDate, AppSettings::confId());
-            }
-            break;
-        case EContainerTypeNow:
-            {
-                static_cast<EventModel*>(treeView->model())->loadNowEvents(AppSettings::confId());
-                treeView->setAllExpanded(true);
-            }
-            break;
-        case EContainerTypeSearch:
-            {
-                treeView->reset();
-                int eventsCount = static_cast<EventModel*>(treeView->model())->loadSearchResultEvents(aDate,AppSettings::confId());
-                if( eventsCount ||
-                        dayNavigator->getCurrentDate() != Conference::getById(AppSettings::confId()).start() ){
-                    searchAgainButton->show();
-                    dayNavigator->show();
-                    treeView->show();
-                    searchHead->hide();
-                }
-                else{
-                    treeView->hide();
-                    searchAgainButton->hide();
-                    dayNavigator->hide();
-                    searchHead->show();
-                }
-            }
-            break;
-        case EContainerTypeNone:
-        default:
-            {
-                qDebug() << "Container type not specified";
-            }
-    }
-    treeView->reset();
     dayNavigator->show();
+    loadEvents( aDate, AppSettings::confId() );
+    treeView->reset();
 }
 
 void TabContainer::itemClicked(const QModelIndex &aIndex)
@@ -174,26 +93,7 @@ void TabContainer::displayWarning(const QModelIndex &aIndex)
 
 void TabContainer::updateTreeViewModel(int aEventId)
 {
-    switch(mType)
-    {
-        case EContainerTypeFavs:
-            {
-                // requires special handling
-                // we need to reload favourites, because some favourite could be deleted
-                //static_cast<EventModel*>(favTreeView->model())->updateModel(aEventId);
-                QDate aStartDate = Conference::getById(AppSettings::confId()).start();
-                QDate aEndDate = Conference::getById(AppSettings::confId()).end();
-                dayNavigator->setDates(aStartDate, aEndDate);
-                updateTreeView( Conference::getById(AppSettings::confId()).start() );
-            }
-            break;
-        case EContainerTypeDay:
-        case EContainerTypeNone:
-        default:
-            {
-                static_cast<EventModel*>(treeView->model())->updateModel(aEventId);
-            }
-    }
+    static_cast<EventModel*>(treeView->model())->updateModel(aEventId);
 }
 
 void TabContainer::setDates(const QDate &aStart, const QDate &aEnd)
@@ -201,50 +101,5 @@ void TabContainer::setDates(const QDate &aStart, const QDate &aEnd)
     dayNavigator->setDates(aStart, aEnd);
 }
 
-void TabContainer::timerUpdateTreeView()
-{
-    if(mType == EContainerTypeNow)
-    {
-        updateTreeView(QDate());
-    }
-}
 
-void TabContainer::searchClicked()
-{
-    if(mType == EContainerTypeSearch)
-    {
-        QHash<QString,QString> columns;
-
-        if( searchTitle->isChecked() )
-            columns.insertMulti("EVENT", "title");
-        if( searchAbstract->isChecked() )
-            columns.insertMulti("EVENT", "abstract");
-        if( searchTag->isChecked() )
-            columns.insertMulti("EVENT", "tag");
-        if( searchSpeaker->isChecked() )
-            columns["PERSON"] = "name";
-        if( searchRoom->isChecked() )
-            columns["ROOM"] = "name";
-
-        QString keyword = searchEdit->text().replace( QString("%"), QString("\\%") );
-        qDebug() << "\nKeyword to search: " << keyword;
-        SqlEngine::searchEvent( AppSettings::confId(), columns, keyword );
-
-        QDate startDate = Conference::getById(AppSettings::confId()).start();
-        QDate endDate = Conference::getById(AppSettings::confId()).end();
-        dayNavigator->setDates(startDate, endDate);
-        updateTreeView( Conference::getById(AppSettings::confId()).start() );
-    }
-}
-
-void TabContainer::searchAgainClicked()
-{
-    if(mType == EContainerTypeSearch)
-    {
-        searchHead->show();
-        searchAgainButton->hide();
-        dayNavigator->hide();
-        treeView->hide();
-    }
-}
 
index 47748a0..8c682fe 100644 (file)
@@ -4,46 +4,38 @@
 #include <QWidget>
 #include "ui_tabcontainer.h"
 
-class TabContainer : public QWidget, Ui::TabContainer
+#include <appsettings.h>
+#include <sqlengine.h>
+#include <conference.h>
+#include <eventmodel.h>
+
+class TabContainer : public QWidget, public Ui::TabContainer
 {
     Q_OBJECT
 public:
 
-    // type of the container
-    // specifies the type of the data that treeView holds
-    enum Type
+    TabContainer(QWidget *aParent = NULL);
+    virtual ~TabContainer() {}
+
+protected:
+    virtual void loadEvents( const QDate &aDate, const int aConferenceId )
     {
-        EContainerTypeNone = 0,
-        EContainerTypeDay,
-        EContainerTypeFavs,
-        EContainerTypeTracks,
-        EContainerTypeRooms,
-        EContainerTypeSearch,
-        EContainerTypeNow
+        Q_UNUSED(aDate);
+        Q_UNUSED(aConferenceId);
     };
 
-    TabContainer(QWidget *aParent = NULL);
-    ~TabContainer() {}
-    void setType(TabContainer::Type aType);
-
 signals:
     void eventHasChanged(int aEventId);
 
 public slots:
-    void updateTreeViewModel(int aEventId);
+    virtual void updateTreeViewModel(int aEventId);
     void setDates(const QDate &aStart, const QDate &aEnd);
 
-private slots:
+protected slots:
     void updateTreeView(const QDate &aDate);
-    void timerUpdateTreeView();
     void itemClicked(const QModelIndex &aIndex);
     void displayMap(const QModelIndex &aIndex);
     void displayWarning(const QModelIndex &aIndex);
-    void searchClicked();
-    void searchAgainClicked();
-
-private:
-    TabContainer::Type mType;
 };
 
 #endif /* TABCONTAINER_H */
index 4da6b10..4f194da 100644 (file)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>TabContainer</class>
- <widget class="QWidget" name="TabContainer" >
-  <property name="geometry" >
+ <widget class="QWidget" name="TabContainer">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <height>292</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout" >
-   <item row="0" column="2" >
-    <layout class="QVBoxLayout" name="verticalLayout" >
-     <item>
-      <widget class="QWidget" native="1" name="searchHead" >
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="maximumSize" >
-        <size>
-         <width>16777215</width>
-         <height>16777215</height>
-        </size>
-       </property>
-       <layout class="QGridLayout" name="searchHeadLayout_2" >
-        <property name="sizeConstraint" >
-         <enum>QLayout::SetDefaultConstraint</enum>
-        </property>
-        <item row="2" column="0" >
-         <layout class="QHBoxLayout" name="horizontalLayout_2" >
-          <item>
-           <widget class="QLineEdit" name="searchEdit" >
-            <property name="enabled" >
-             <bool>true</bool>
-            </property>
-            <property name="toolTip" >
-             <string>type a keyword to search</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="searchButton" >
-            <property name="sizePolicy" >
-             <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="text" >
-             <string>Search</string>
-            </property>
-            <property name="icon" >
-             <iconset resource="../icons.qrc" >
-              <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset>
-            </property>
-            <property name="checkable" >
-             <bool>false</bool>
-            </property>
-            <property name="autoDefault" >
-             <bool>true</bool>
-            </property>
-            <property name="default" >
-             <bool>true</bool>
-            </property>
-            <property name="flat" >
-             <bool>false</bool>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </item>
-        <item row="0" column="0" >
-         <layout class="QHBoxLayout" name="horizontalLayout_7" >
-          <item>
-           <widget class="QCheckBox" name="searchTitle" >
-            <property name="text" >
-             <string>Title</string>
-            </property>
-            <property name="checked" >
-             <bool>true</bool>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QCheckBox" name="searchAbstract" >
-            <property name="text" >
-             <string>Abstract</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QCheckBox" name="searchSpeaker" >
-            <property name="text" >
-             <string>Speaker</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QCheckBox" name="searchTag" >
-            <property name="text" >
-             <string>Tag</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QCheckBox" name="searchRoom" >
-            <property name="text" >
-             <string>Room</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer" >
-            <property name="orientation" >
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0" >
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item row="3" column="0" >
-         <spacer name="verticalSpacer" >
-          <property name="orientation" >
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeHint" stdset="0" >
-           <size>
-            <width>20</width>
-            <height>40</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-     </item>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item row="0" column="2">
+    <layout class="QVBoxLayout" name="verticalLayout">
      <item>
-      <widget class="TreeView" name="treeView" />
+      <widget class="TreeView" name="treeView"/>
      </item>
     </layout>
    </item>
-   <item row="0" column="1" >
-    <layout class="QVBoxLayout" name="verticalLayout_2" >
+   <item row="0" column="1">
+    <layout class="QVBoxLayout" name="verticalLayout_2">
      <item>
-      <widget class="QToolButton" name="searchAgainButton" >
-       <property name="enabled" >
-        <bool>true</bool>
-       </property>
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+      <widget class="DayNavigatorWidget" name="dayNavigator" native="true">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-       <property name="toolTip" >
-        <string>Search again</string>
-       </property>
-       <property name="text" >
-        <string>S</string>
-       </property>
-       <property name="icon" >
-        <iconset resource="../icons.qrc" >
-         <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset>
-       </property>
-       <property name="iconSize" >
+       <property name="minimumSize">
         <size>
-         <width>24</width>
-         <height>24</height>
+         <width>10</width>
+         <height>10</height>
         </size>
        </property>
-       <property name="toolButtonStyle" >
-        <enum>Qt::ToolButtonIconOnly</enum>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="DayNavigatorWidget" native="1" name="dayNavigator" >
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
       </widget>
      </item>
     </layout>
   </customwidget>
  </customwidgets>
  <resources>
-  <include location="../icons.qrc" />
+  <include location="../icons.qrc"/>
  </resources>
  <connections/>
 </ui>
diff --git a/src/gui/trackstabcontainer.cpp b/src/gui/trackstabcontainer.cpp
new file mode 100644 (file)
index 0000000..eea8f2b
--- /dev/null
@@ -0,0 +1,11 @@
+
+#include "trackstabcontainer.h"
+
+TracksTabContainer::TracksTabContainer( QWidget *aParent ) : TabContainer( aParent )
+{
+}
+
+void TracksTabContainer::loadEvents( const QDate &aDate, const int aConferenceId )
+{
+    static_cast<EventModel*>(treeView->model())->loadEventsByTrack( aDate, aConferenceId );
+}
diff --git a/src/gui/trackstabcontainer.h b/src/gui/trackstabcontainer.h
new file mode 100644 (file)
index 0000000..46cfd9f
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * trackstabcontainer.h
+ *
+ *  Created on: Jan 27, 2010
+ *      Author: maemo
+ */
+
+#ifndef TRACKSTABCONTAINER_H_
+#define TRACKSTABCONTAINER_H_
+
+#include "tabcontainer.h"
+
+class TracksTabContainer: public TabContainer
+{
+    Q_OBJECT
+public:
+    TracksTabContainer( QWidget *aParent );
+    virtual ~TracksTabContainer() {}
+
+protected:
+    virtual void loadEvents( const QDate &aDate, const int aConferenceId );
+
+};
+
+#endif /* TRACKSTABCONTAINER_H_ */