implemented 'conflicts' dialog
authorpavelpa <pavelpa@localhost>
Wed, 27 Jan 2010 19:17:01 +0000 (19:17 +0000)
committerpavelpa <pavelpa@localhost>
Wed, 27 Jan 2010 19:17:01 +0000 (19:17 +0000)
 - displays rooms instead of conflicts for now
   - needs to implement additional methods in Event, ...

14 files changed:
src/gui/conflictdialogcontainer.cpp [new file with mode: 0644]
src/gui/conflictdialogcontainer.h [new file with mode: 0644]
src/gui/conflictsdialog.cpp [new file with mode: 0644]
src/gui/conflictsdialog.h [new file with mode: 0644]
src/gui/conflictsdialog.ui [new file with mode: 0644]
src/gui/daynavigatorwidget.cpp
src/gui/gui.pro
src/gui/mainwindow.ui
src/gui/searchtabcontainer.cpp
src/gui/tabcontainer.cpp
src/gui/tabcontainer.h
src/mvc/treeview.cpp
src/mvc/treeview.h
src/orm/ormrecord.h

diff --git a/src/gui/conflictdialogcontainer.cpp b/src/gui/conflictdialogcontainer.cpp
new file mode 100644 (file)
index 0000000..b09eda7
--- /dev/null
@@ -0,0 +1,26 @@
+
+#include "conflictdialogcontainer.h"
+
+ConflictDialogContainer::ConflictDialogContainer(QWidget *aParent)
+    : TabContainer( aParent )
+{
+}
+
+void ConflictDialogContainer::loadEvents( const QDate &aDate, const int aConferenceId )
+{
+    static_cast<EventModel*>(treeView->model())->loadEventsByRoom( aDate, aConferenceId );
+    //treeView->setAllExpanded(true);
+}
+
+void ConflictDialogContainer::updateTreeViewModel(int aEventId)
+{
+    // requires special handling
+    // we need to reload favourites, because some favourite could be deleted
+    //static_cast<EventModel*>(favTreeView->model())->updateModel(aEventId);
+    int confId = Conference::activeConference();
+    QDate startDate = Conference::getById(confId).start();
+    QDate endDate = Conference::getById(confId).end();
+    dayNavigator->setDates(startDate, endDate);
+    updateTreeView( Conference::getById(confId).start() );
+}
+
diff --git a/src/gui/conflictdialogcontainer.h b/src/gui/conflictdialogcontainer.h
new file mode 100644 (file)
index 0000000..2f5c538
--- /dev/null
@@ -0,0 +1,22 @@
+
+#ifndef CONFLICTDIALOGCONTAINER_H
+#define CONFLICTDIALOGCONTAINER_H
+
+#include "tabcontainer.h"
+
+class ConflictDialogContainer: public TabContainer
+{
+    Q_OBJECT
+public:
+    ConflictDialogContainer(QWidget *aParent);
+    virtual ~ConflictDialogContainer(){}
+
+public slots:
+    virtual void updateTreeViewModel(int aEventId);
+
+protected:
+    virtual void loadEvents( const QDate &aDate, const int aConferenceId );
+};
+
+#endif /* CONFLICTDIALOGCONTAINER_H */
+
diff --git a/src/gui/conflictsdialog.cpp b/src/gui/conflictsdialog.cpp
new file mode 100644 (file)
index 0000000..070dc9d
--- /dev/null
@@ -0,0 +1,20 @@
+#include "conflictsdialog.h"
+
+ConflictsDialog::ConflictsDialog(QWidget *aParent)
+    : QDialog(aParent)
+{
+    setupUi(this);
+    connect(container, SIGNAL(eventHasChanged(int)), this, SIGNAL(eventHasChanged(int)));
+    connect(container, SIGNAL(eventHasChanged(int)), container, SLOT(updateTreeViewModel(int)));
+
+    int confId = Conference::activeConference();
+    QDate startDate = Conference::getById(confId).start();
+    QDate endDate = Conference::getById(confId).end();
+    container->setDates(startDate, endDate);
+}
+
+ConflictsDialog::~ConflictsDialog()
+{
+    disconnect(container, SIGNAL(eventHasChanged(int)), this, SIGNAL(eventHasChanged(int)));
+}
+
diff --git a/src/gui/conflictsdialog.h b/src/gui/conflictsdialog.h
new file mode 100644 (file)
index 0000000..40114ab
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef CONFLICTSDIALOG_H
+#define CONFLICTSDIALOG_H
+
+#include "ui_conflictsdialog.h"
+#include <QDialog>
+
+class ConflictsDialog : public QDialog, Ui::ConflictsDialog
+{
+    Q_OBJECT
+public:
+    ConflictsDialog(QWidget *aParent = NULL);
+    ~ConflictsDialog();
+signals:
+    void eventHasChanged(int aEventId);
+};
+
+#endif /* CONFLICTSDIALOG_H */ 
+
diff --git a/src/gui/conflictsdialog.ui b/src/gui/conflictsdialog.ui
new file mode 100644 (file)
index 0000000..fd1de1a
--- /dev/null
@@ -0,0 +1,89 @@
+<ui version="4.0" >
+ <class>ConflictsDialog</class>
+ <widget class="QDialog" name="ConflictsDialog" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>471</width>
+    <height>373</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Dialog</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout" >
+   <item>
+    <widget class="QLabel" name="message" >
+     <property name="text" >
+      <string>Selected Event is in conflict with the following event(s):</string>
+     </property>
+     <property name="wordWrap" >
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="ConflictDialogContainer" native="1" name="container" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+       <horstretch>0</horstretch>
+       <verstretch>1</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout" >
+     <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>
+     <item>
+      <widget class="QPushButton" name="okButton" >
+       <property name="text" >
+        <string>OK</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>ConflictDialogContainer</class>
+   <extends>QWidget</extends>
+   <header>conflictdialogcontainer.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>okButton</sender>
+   <signal>clicked()</signal>
+   <receiver>ConflictsDialog</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>301</x>
+     <y>156</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>175</x>
+     <y>89</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
index c554c1d..9a2a428 100644 (file)
@@ -29,7 +29,6 @@ void DayNavigatorWidget::setDates(const QDate &aStartDate, const QDate &aEndDate
     mCurDate = aStartDate;
 
     QRect rect = mFontMetrics->boundingRect(mCurDate.toString("MMM dd yyyy"));
     mCurDate = aStartDate;
 
     QRect rect = mFontMetrics->boundingRect(mCurDate.toString("MMM dd yyyy"));
-    qDebug() << mCurDate.toString();
 
     if(mStartDate==mEndDate) // only one day conference
     {
 
     if(mStartDate==mEndDate) // only one day conference
     {
index 7fec1d3..ae85249 100644 (file)
@@ -34,14 +34,17 @@ maemo {
 # 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).
 # 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 += searchhead.ui \
     mainwindow.ui \
     daynavigatorwidget.ui \
     importschedulewidget.ui \
     about.ui \
     eventdialog.ui \
 FORMS += searchhead.ui \
     mainwindow.ui \
     daynavigatorwidget.ui \
     importschedulewidget.ui \
     about.ui \
     eventdialog.ui \
+    conflictsdialog.ui \
     tabcontainer.ui \
     mapwindow.ui
     tabcontainer.ui \
     mapwindow.ui
+
 HEADERS += roomstabcontainer.h \
     nowtabcontainer.h \
     trackstabcontainer.h \
 HEADERS += roomstabcontainer.h \
     nowtabcontainer.h \
     trackstabcontainer.h \
@@ -49,6 +52,8 @@ HEADERS += roomstabcontainer.h \
     searchtabcontainer.h \
     searchhead.h \
     dayviewtabcontainer.h \
     searchtabcontainer.h \
     searchhead.h \
     dayviewtabcontainer.h \
+    conflictdialogcontainer.h \
+    conflictsdialog.h \
     mainwindow.h \
     daynavigatorwidget.h \
     importschedulewidget.h \
     mainwindow.h \
     daynavigatorwidget.h \
     importschedulewidget.h \
@@ -56,6 +61,7 @@ HEADERS += roomstabcontainer.h \
     tabwidget.h \
     tabcontainer.h \
     mapwindow.h
     tabwidget.h \
     tabcontainer.h \
     mapwindow.h
+
 SOURCES += roomstabcontainer.cpp \
     nowtabcontainer.cpp \
     trackstabcontainer.cpp \
 SOURCES += roomstabcontainer.cpp \
     nowtabcontainer.cpp \
     trackstabcontainer.cpp \
@@ -63,6 +69,8 @@ SOURCES += roomstabcontainer.cpp \
     searchtabcontainer.cpp \
     searchhead.cpp \
     dayviewtabcontainer.cpp \
     searchtabcontainer.cpp \
     searchhead.cpp \
     dayviewtabcontainer.cpp \
+    conflictdialogcontainer.cpp \
+    conflictsdialog.cpp \
     mainwindow.cpp \
     daynavigatorwidget.cpp \
     importschedulewidget.cpp \
     mainwindow.cpp \
     daynavigatorwidget.cpp \
     importschedulewidget.cpp \
@@ -70,23 +78,9 @@ SOURCES += roomstabcontainer.cpp \
     tabwidget.cpp \
     tabcontainer.cpp \
     mapwindow.cpp
     tabwidget.cpp \
     tabcontainer.cpp \
     mapwindow.cpp
+
 maemo { 
 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
+    FORMS += alarmdialog.ui
+    HEADERS += alarmdialog.h
+    SOURCES += alarmdialog.cpp
 }
 }
index 2ab2b7c..e36ef9d 100644 (file)
@@ -1,8 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
+<ui version="4.0" >
  <class>MainWindow</class>
  <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>
    <rect>
     <x>0</x>
     <y>0</y>
     <height>498</height>
    </rect>
   </property>
     <height>498</height>
    </rect>
   </property>
-  <property name="minimumSize">
+  <property name="minimumSize" >
    <size>
     <width>400</width>
     <height>300</height>
    </size>
   </property>
    <size>
     <width>400</width>
     <height>300</height>
    </size>
   </property>
-  <property name="windowTitle">
+  <property name="windowTitle" >
    <string>MainWindow</string>
   </property>
    <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>3</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>0</number>
       </property>
       </property>
-      <widget class="QWidget" name="dayViewTab">
-       <attribute name="title">
+      <widget class="QWidget" name="dayViewTab" >
+       <attribute name="title" >
         <string>Day View</string>
        </attribute>
         <string>Day View</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_2">
-        <item row="0" column="0">
-         <widget class="DayViewTabContainer" name="dayTabContainer" native="true"/>
+       <layout class="QGridLayout" name="gridLayout_2" >
+        <item row="0" column="0" >
+         <widget class="DayViewTabContainer" native="1" name="dayTabContainer" />
         </item>
        </layout>
       </widget>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="favouritesTab">
-       <attribute name="title">
+      <widget class="QWidget" name="favouritesTab" >
+       <attribute name="title" >
         <string>Favourites</string>
        </attribute>
         <string>Favourites</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_3">
-        <item row="0" column="0">
-         <widget class="FavTabContainer" name="favsTabContainer" native="true"/>
+       <layout class="QGridLayout" name="gridLayout_3" >
+        <item row="0" column="0" >
+         <widget class="FavTabContainer" native="1" name="favsTabContainer" />
         </item>
        </layout>
       </widget>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="tracksTab">
-       <attribute name="title">
+      <widget class="QWidget" name="tracksTab" >
+       <attribute name="title" >
         <string>Tracks</string>
        </attribute>
         <string>Tracks</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_4">
-        <item row="0" column="0">
-         <widget class="TracksTabContainer" name="tracksTabContainer" native="true"/>
+       <layout class="QGridLayout" name="gridLayout_4" >
+        <item row="0" column="0" >
+         <widget class="TracksTabContainer" native="1" name="tracksTabContainer" />
         </item>
        </layout>
       </widget>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="searchTab">
-       <attribute name="title">
+      <widget class="QWidget" name="searchTab" >
+       <attribute name="title" >
         <string>Search</string>
        </attribute>
         <string>Search</string>
        </attribute>
-       <layout class="QHBoxLayout" name="horizontalLayout_1">
+       <layout class="QHBoxLayout" name="horizontalLayout_1" >
         <item>
         <item>
-         <widget class="SearchTabContainer" name="searchTabContainer" native="true">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+         <widget class="SearchTabContainer" native="1" name="searchTabContainer" >
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
         </item>
        </layout>
       </widget>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="roomsTab">
-       <attribute name="title">
+      <widget class="QWidget" name="roomsTab" >
+       <attribute name="title" >
         <string>Rooms</string>
        </attribute>
         <string>Rooms</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_8">
-        <item row="0" column="0">
-         <widget class="RoomsTabContainer" name="roomsTabContainer" native="true"/>
+       <layout class="QGridLayout" name="gridLayout_8" >
+        <item row="0" column="0" >
+         <widget class="RoomsTabContainer" native="1" name="roomsTabContainer" />
         </item>
        </layout>
       </widget>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="conferenceTab">
-       <attribute name="title">
+      <widget class="QWidget" name="conferenceTab" >
+       <attribute name="title" >
         <string>Conference</string>
        </attribute>
         <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>
           <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>
              <font>
               <weight>75</weight>
               <bold>true</bold>
              </font>
             </property>
-            <property name="text">
+            <property name="text" >
              <string>Conference Name</string>
             </property>
              <string>Conference Name</string>
             </property>
-            <property name="alignment">
+            <property name="alignment" >
              <set>Qt::AlignCenter</set>
             </property>
              <set>Qt::AlignCenter</set>
             </property>
-            <property name="wordWrap">
+            <property name="wordWrap" >
              <bool>true</bool>
             </property>
            </widget>
           </item>
           <item>
              <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>
              <string>Conference Subtitle</string>
             </property>
-            <property name="alignment">
+            <property name="alignment" >
              <set>Qt::AlignCenter</set>
             </property>
              <set>Qt::AlignCenter</set>
             </property>
-            <property name="wordWrap">
+            <property name="wordWrap" >
              <bool>true</bool>
             </property>
            </widget>
           </item>
           <item>
              <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>
              <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>
                <font>
                 <weight>75</weight>
                 <italic>true</italic>
                 <bold>true</bold>
                </font>
               </property>
-              <property name="text">
+              <property name="text" >
                <string>When:</string>
               </property>
              </widget>
             </item>
                <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>
                <font>
                 <weight>75</weight>
                 <italic>true</italic>
                 <bold>true</bold>
                </font>
               </property>
-              <property name="text">
+              <property name="text" >
                <string>Where:</string>
               </property>
              </widget>
             </item>
                <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>
                <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>
                <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>
                <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>
                 <normaloff>:/icons/compassBig.png</normaloff>:/icons/compassBig.png</iconset>
               </property>
-              <property name="flat">
+              <property name="flat" >
                <bool>true</bool>
               </property>
              </widget>
             </item>
                <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>
                <enum>Qt::Horizontal</enum>
               </property>
-              <property name="sizeHint" stdset="0">
+              <property name="sizeHint" stdset="0" >
                <size>
                 <width>40</width>
                 <height>20</height>
                <size>
                 <width>40</width>
                 <height>20</height>
               </property>
              </spacer>
             </item>
               </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>
                <string/>
               </property>
              </widget>
            </layout>
           </item>
           <item>
            </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>
              <enum>Qt::Horizontal</enum>
             </property>
            </widget>
           </item>
           <item>
-           <widget class="ImportScheduleWidget" name="importScheduleWidget" native="true">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+           <widget class="ImportScheduleWidget" native="1" name="importScheduleWidget" >
+            <property name="sizePolicy" >
+             <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
            </widget>
           </item>
           <item>
            </widget>
           </item>
           <item>
-           <spacer name="verticalSpacer">
-            <property name="orientation">
+           <spacer name="verticalSpacer" >
+            <property name="orientation" >
              <enum>Qt::Vertical</enum>
             </property>
              <enum>Qt::Vertical</enum>
             </property>
-            <property name="sizeHint" stdset="0">
+            <property name="sizeHint" stdset="0" >
              <size>
               <width>20</width>
               <height>40</height>
              <size>
               <width>20</width>
               <height>40</height>
         </item>
        </layout>
       </widget>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="nowTab">
-       <attribute name="title">
+      <widget class="QWidget" name="nowTab" >
+       <attribute name="title" >
         <string>Now</string>
        </attribute>
         <string>Now</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_7">
-        <item row="0" column="0">
-         <widget class="NowTabContainer" name="nowTabContainer" native="true"/>
+       <layout class="QGridLayout" name="gridLayout_7" >
+        <item row="0" column="0" >
+         <widget class="NowTabContainer" native="1" name="nowTabContainer" />
         </item>
        </layout>
       </widget>
         </item>
        </layout>
       </widget>
     </item>
    </layout>
   </widget>
     </item>
    </layout>
   </widget>
-  <widget class="QStatusBar" name="statusbar"/>
+  <widget class="QStatusBar" name="statusbar" />
  </widget>
  <customwidgets>
   <customwidget>
  </widget>
  <customwidgets>
   <customwidget>
   </customwidget>
  </customwidgets>
  <resources>
   </customwidget>
  </customwidgets>
  <resources>
-  <include location="../icons.qrc"/>
+  <include location="../icons.qrc" />
  </resources>
  <connections/>
 </ui>
  </resources>
  <connections/>
 </ui>
index b0938a6..b69b664 100644 (file)
@@ -45,8 +45,6 @@ SearchTabContainer::~SearchTabContainer()
 
 void SearchTabContainer::searchButtonClicked()
 {
 
 void SearchTabContainer::searchButtonClicked()
 {
-    qDebug() << "SearchTab::searchButtonClicked()";
-
     QHash<QString,QString> columns;
 
     SearchHead *searchHeader = static_cast<SearchHead*>(header);
     QHash<QString,QString> columns;
 
     SearchHead *searchHeader = static_cast<SearchHead*>(header);
index c03b2e1..a733824 100644 (file)
@@ -10,6 +10,8 @@
 #include "eventdialog.h"
 #include "mapwindow.h"
 
 #include "eventdialog.h"
 #include "mapwindow.h"
 
+#include "conflictsdialog.h"
+
 TabContainer::TabContainer(QWidget *aParent)
     : QWidget(aParent)
 {
 TabContainer::TabContainer(QWidget *aParent)
     : QWidget(aParent)
 {
@@ -27,7 +29,7 @@ TabContainer::TabContainer(QWidget *aParent)
     connect(treeView, SIGNAL(eventHasChanged(int)), SIGNAL(eventHasChanged(int)));
     connect(treeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
     connect(treeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
     connect(treeView, SIGNAL(eventHasChanged(int)), SIGNAL(eventHasChanged(int)));
     connect(treeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
     connect(treeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
-    connect(treeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &)));
+    connect(treeView, SIGNAL(requestForConflicts(const QModelIndex &)), SLOT(displayConflicts(const QModelIndex &)));
 
     if(!Conference::getAll().count()) // no conference(s) in the DB
     {
 
     if(!Conference::getAll().count()) // no conference(s) in the DB
     {
@@ -81,14 +83,14 @@ void TabContainer::displayMap(const QModelIndex &aIndex)
     window.exec();
 }
 
     window.exec();
 }
 
-void TabContainer::displayWarning(const QModelIndex &aIndex)
+void TabContainer::displayConflicts(const QModelIndex &aIndex)
 {
     Q_UNUSED(aIndex);
 
 {
     Q_UNUSED(aIndex);
 
-    QMessageBox::warning(
-        this,
-        tr("Time Conflict Warning"),
-        tr("This event happens at the same time than another one of your favourites.") );
+    ConflictsDialog dialog;
+    connect(&dialog, SIGNAL(eventHasChanged(int)), this, SIGNAL(eventHasChanged(int)));
+    dialog.exec();
+    disconnect(&dialog, SIGNAL(eventHasChanged(int)), this, SIGNAL(eventHasChanged(int)));
 }
 
 void TabContainer::updateTreeViewModel(int aEventId)
 }
 
 void TabContainer::updateTreeViewModel(int aEventId)
index 4959ce4..bcc26cf 100644 (file)
@@ -35,7 +35,7 @@ protected slots:
     void updateTreeView(const QDate &aDate);
     void itemClicked(const QModelIndex &aIndex);
     void displayMap(const QModelIndex &aIndex);
     void updateTreeView(const QDate &aDate);
     void itemClicked(const QModelIndex &aIndex);
     void displayMap(const QModelIndex &aIndex);
-    void displayWarning(const QModelIndex &aIndex);
+    void displayConflicts(const QModelIndex &aIndex);
 };
 
 #endif /* TABCONTAINER_H */
 };
 
 #endif /* TABCONTAINER_H */
index e1dc9b7..ccc2703 100644 (file)
@@ -106,8 +106,7 @@ bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aP
         {
 
             qDebug() << "WARNING CLICKED: " << qVariantValue<QString>(aIndex.data());
         {
 
             qDebug() << "WARNING CLICKED: " << qVariantValue<QString>(aIndex.data());
-            // TODO: implement
-            emit(requestForWarning(aIndex));
+            emit(requestForConflicts(aIndex));
             handled = true;
         }
         break;
             handled = true;
         }
         break;
index e7cd52c..cbd4854 100644 (file)
@@ -18,7 +18,7 @@ private slots:
     void handleItemClicked(const QModelIndex &index);
 signals:
     void requestForMap(const QModelIndex &aIndex);
     void handleItemClicked(const QModelIndex &index);
 signals:
     void requestForMap(const QModelIndex &aIndex);
-    void requestForWarning(const QModelIndex &aIndex);
+    void requestForConflicts(const QModelIndex &aIndex);
     void eventHasChanged(int aEventId); // emited when user changes some event details, eg. sets it Favourite
 };
 
     void eventHasChanged(int aEventId); // emited when user changes some event details, eg. sets it Favourite
 };
 
index a815c8e..c834494 100644 (file)
@@ -134,7 +134,7 @@ QList<T> OrmRecord<T>::load(QSqlQuery query)
         }
         else
         {
         }
         else
         {
-            qDebug() << "SQL OK";
+            /*qDebug() << "SQL OK";*/
         }
     }
 
         }
     }
 
@@ -143,7 +143,7 @@ QList<T> OrmRecord<T>::load(QSqlQuery query)
     {
         objects << hydrate(query.record());
     }
     {
         objects << hydrate(query.record());
     }
-    qDebug() << "Fetch done";
+    /*qDebug() << "Fetch done";*/
     return objects;
 }
 
     return objects;
 }