import schedule dialog
authorpavelpa <pavelpa@localhost>
Tue, 26 Jan 2010 12:51:56 +0000 (12:51 +0000)
committerpavelpa <pavelpa@localhost>
Tue, 26 Jan 2010 12:51:56 +0000 (12:51 +0000)
 - changed to widget
 - moved to 'conference' tab

12 files changed:
src/gui/gui.pro
src/gui/importscheduledialog.cpp [deleted file]
src/gui/importscheduledialog.h [deleted file]
src/gui/importscheduledialog.ui [deleted file]
src/gui/importschedulewidget.cpp [new file with mode: 0644]
src/gui/importschedulewidget.h [new file with mode: 0644]
src/gui/importschedulewidget.ui [new file with mode: 0644]
src/gui/mainwindow.cpp
src/gui/mainwindow.h
src/gui/mainwindow.ui
src/sql/schedulexmlparser.cpp
src/sql/schedulexmlparser.h

index 601720d..50def41 100644 (file)
@@ -25,21 +25,21 @@ maemo {
 
 FORMS += mainwindow.ui \
          daynavigatorwidget.ui \
-         importscheduledialog.ui \
+         importschedulewidget.ui \
          about.ui \
          eventdialog.ui \
          mapwindow.ui
 
 HEADERS += mainwindow.h \
            daynavigatorwidget.h \
-           importscheduledialog.h \
+           importschedulewidget.h \
            eventdialog.h \
            tabwidget.h \
            mapwindow.h
 
 SOURCES += mainwindow.cpp \
            daynavigatorwidget.cpp \
-           importscheduledialog.cpp \
+           importschedulewidget.cpp \
            eventdialog.cpp \
            tabwidget.cpp \
            mapwindow.cpp
diff --git a/src/gui/importscheduledialog.cpp b/src/gui/importscheduledialog.cpp
deleted file mode 100644 (file)
index a87f36f..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#include "importscheduledialog.h"
-
-#include <schedulexmlparser.h>
-#include <sqlengine.h>
-
-#include <QDir>
-#include <QFile>
-#include <QFileDialog>
-#include <QDebug>
-
-ImportScheduleDialog::ImportScheduleDialog(SqlEngine *aSqlEngine, QWidget *aParent)
-    : QDialog(aParent)
-    , mSqlEngine(aSqlEngine)
-{
-    setupUi(this);
-
-    mXmlParser = new ScheduleXmlParser(this);
-    connect(mXmlParser, SIGNAL(progressStatus(int)), SLOT(showParsingProgress(int)));
-    connect(mXmlParser, SIGNAL(parsingSchedule(const QString &)), SLOT(setWindowTitle(const QString &)));
-
-    connect(import, SIGNAL(clicked()), SLOT(importSchedule()));
-    connect(search, SIGNAL(clicked()), SLOT(searchSchedule()));
-    progressBar->hide();
-    import->setEnabled(false);
-}
-
-ImportScheduleDialog::~ImportScheduleDialog()
-{
-    if(mXmlParser)
-    {
-        delete mXmlParser;
-        mXmlParser = NULL;
-    }
-}
-
-void ImportScheduleDialog::showParsingProgress(int progress)
-{
-    progressBar->setValue(progress);
-}
-
-void ImportScheduleDialog::searchSchedule()
-{
-    mScheduleFileName = QFileDialog::getOpenFileName(this, tr("Select Conference Schedule"), QDir::homePath(), tr("Schedule Files (*.xml)"));
-    if(QFile::exists(mScheduleFileName))
-        import->setEnabled(true);
-    else
-    {
-        import->setEnabled(false);
-        progressBar->hide();
-    }
-}
-
-void ImportScheduleDialog::importSchedule()
-{
-    QFile file(mScheduleFileName);
-    if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
-    {
-        qDebug() << "can't open " << file.fileName();
-        return;
-    }
-
-    QByteArray data = file.readAll();
-    if(mSqlEngine)
-    {
-        progressBar->show();
-        mXmlParser->parseData(data,mSqlEngine);
-        close();
-    }
-}
-
diff --git a/src/gui/importscheduledialog.h b/src/gui/importscheduledialog.h
deleted file mode 100644 (file)
index 7fef281..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef IMPORTSCHEDULEDIALOG_H
-#define IMPORTSCHEDULEDIALOG_H
-
-#include <QDialog>
-#include "ui_importscheduledialog.h"
-
-class ScheduleXmlParser;
-class SqlEngine;
-
-class ImportScheduleDialog : public QDialog, Ui::ImportScheduleDialog
-{
-    Q_OBJECT
-    public:
-        ImportScheduleDialog(SqlEngine *aSqlEngine, QWidget *aParent = NULL);
-        ~ImportScheduleDialog();
-    private slots:
-        void searchSchedule();
-        void importSchedule();
-        void showParsingProgress(int progress);
-    private:
-        ScheduleXmlParser *mXmlParser;
-        SqlEngine *mSqlEngine; // uses it
-        QString mScheduleFileName;
-};
-
-#endif /* IMPORTSCHEDULEDIALOG_H */
-
diff --git a/src/gui/importscheduledialog.ui b/src/gui/importscheduledialog.ui
deleted file mode 100644 (file)
index cea270f..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-<ui version="4.0" >
- <class>ImportScheduleDialog</class>
- <widget class="QDialog" name="ImportScheduleDialog" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>330</width>
-    <height>74</height>
-   </rect>
-  </property>
-  <property name="sizePolicy" >
-   <sizepolicy vsizetype="MinimumExpanding" hsizetype="Preferred" >
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <property name="windowTitle" >
-   <string>Import schedule</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout" >
-   <item row="0" column="0" >
-    <layout class="QVBoxLayout" name="verticalLayout" >
-     <item>
-      <widget class="QProgressBar" name="progressBar" >
-       <property name="value" >
-        <number>0</number>
-       </property>
-       <property name="textVisible" >
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <layout class="QHBoxLayout" name="horizontalLayout_2" >
-       <item>
-        <widget class="QPushButton" name="search" >
-         <property name="text" >
-          <string>Search</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="horizontalSpacer_2" >
-         <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="import" >
-         <property name="text" >
-          <string>Import</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QPushButton" name="cancel" >
-         <property name="text" >
-          <string>Cancel</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections>
-  <connection>
-   <sender>cancel</sender>
-   <signal>clicked()</signal>
-   <receiver>ImportScheduleDialog</receiver>
-   <slot>close()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>515</x>
-     <y>124</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>283</x>
-     <y>80</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/src/gui/importschedulewidget.cpp b/src/gui/importschedulewidget.cpp
new file mode 100644 (file)
index 0000000..20d48ac
--- /dev/null
@@ -0,0 +1,87 @@
+#include "importschedulewidget.h"
+
+#include <schedulexmlparser.h>
+#include <sqlengine.h>
+
+#include <QDir>
+#include <QFile>
+#include <QFileDialog>
+#include <QDebug>
+
+ImportScheduleWidget::ImportScheduleWidget(QWidget *aParent)
+    : QWidget(aParent)
+    , mSqlEngine(NULL)
+{
+    setupUi(this);
+
+    mXmlParser = new ScheduleXmlParser(this);
+    connect(mXmlParser, SIGNAL(progressStatus(int)), SLOT(showParsingProgress(int)));
+    connect(mXmlParser, SIGNAL(parsingSchedule(const QString &)), SLOT(setWindowTitle(const QString &)));
+
+    connect(import, SIGNAL(clicked()), SLOT(importSchedule()));
+    connect(search, SIGNAL(clicked()), SLOT(searchSchedule()));
+    progressBar->hide();
+    import->setEnabled(false);
+}
+
+ImportScheduleWidget::~ImportScheduleWidget()
+{
+    if(mXmlParser)
+    {
+        delete mXmlParser;
+        mXmlParser = NULL;
+    }
+}
+
+void ImportScheduleWidget::setSqlEngine(SqlEngine *aSqlEngine)
+{
+    Q_ASSERT(aSqlEngine != NULL);
+
+    mSqlEngine = aSqlEngine;
+}
+
+void ImportScheduleWidget::showParsingProgress(int progress)
+{
+    progressBar->setValue(progress);
+}
+
+void ImportScheduleWidget::searchSchedule()
+{
+    Q_ASSERT(mSqlEngine != NULL);
+
+    mScheduleFileName = QFileDialog::getOpenFileName(this, tr("Select Conference Schedule"), QDir::homePath(), tr("Schedule Files (*.xml)"));
+    if(QFile::exists(mScheduleFileName))
+        import->setEnabled(true);
+    else
+    {
+        import->setEnabled(false);
+        progressBar->hide();
+    }
+}
+
+void ImportScheduleWidget::importSchedule()
+{
+    if(!mSqlEngine)
+    {
+        qDebug() << "ImportScheduleWidget::importSchedule(): sqlEngine not set";
+        return;
+    }
+
+    QFile file(mScheduleFileName);
+    if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
+    {
+        qDebug() << "can't open " << file.fileName();
+        return;
+    }
+
+    QByteArray data = file.readAll();
+    progressBar->show();
+    int confId = mXmlParser->parseData(data,mSqlEngine);
+
+    // hide stuff
+    import->setEnabled(false);
+    progressBar->hide();
+
+    emit(scheduleImported(confId));
+}
+
diff --git a/src/gui/importschedulewidget.h b/src/gui/importschedulewidget.h
new file mode 100644 (file)
index 0000000..b9d8a1e
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef IMPORTSCHEDULEWIDGET_H
+#define IMPORTSCHEDULEWIDGET_H
+
+#include <QWidget>
+#include "ui_importschedulewidget.h"
+
+class ScheduleXmlParser;
+class SqlEngine;
+
+class ImportScheduleWidget : public QWidget, Ui::ImportScheduleWidget
+{
+    Q_OBJECT
+    public:
+        ImportScheduleWidget(QWidget *aParent = NULL); // don't forget to use setSqlEngine()
+        ~ImportScheduleWidget();
+        void setSqlEngine(SqlEngine *aSqlEngine);
+    private slots:
+        void searchSchedule();
+        void importSchedule();
+        void showParsingProgress(int progress);
+    signals:
+        void scheduleImported(int confId);
+    private:
+        ScheduleXmlParser *mXmlParser;
+        SqlEngine *mSqlEngine; // uses it
+        QString mScheduleFileName;
+};
+
+#endif /* IMPORTSCHEDULEWIDGET_H */
+
diff --git a/src/gui/importschedulewidget.ui b/src/gui/importschedulewidget.ui
new file mode 100644 (file)
index 0000000..bf76875
--- /dev/null
@@ -0,0 +1,78 @@
+<ui version="4.0" >
+ <class>ImportScheduleWidget</class>
+ <widget class="QWidget" name="ImportScheduleWidget" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>379</width>
+    <height>82</height>
+   </rect>
+  </property>
+  <property name="sizePolicy" >
+   <sizepolicy vsizetype="MinimumExpanding" hsizetype="Preferred" >
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle" >
+   <string>Import schedule</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout" >
+   <item row="0" column="0" >
+    <layout class="QVBoxLayout" name="verticalLayout" >
+     <item>
+      <widget class="QProgressBar" name="progressBar" >
+       <property name="value" >
+        <number>0</number>
+       </property>
+       <property name="textVisible" >
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_2" >
+       <item>
+        <widget class="QLabel" name="label" >
+         <property name="text" >
+          <string>Import schedule: </string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="search" >
+         <property name="text" >
+          <string>Search</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_2" >
+         <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="import" >
+         <property name="text" >
+          <string>Import</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
index 17ae65b..aa6aee5 100644 (file)
@@ -18,7 +18,7 @@
 #include "ui_about.h"
 #include "eventdialog.h"
 #include "daynavigatorwidget.h"
-#include "importscheduledialog.h"
+#include "importschedulewidget.h"
 #include "mapwindow.h"
 
 MainWindow::MainWindow(int aEventId, QWidget *aParent)
@@ -30,6 +30,7 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent)
     // opens DB connection (needed for EventModel)
     mSqlEngine = new SqlEngine(this);
     mSqlEngine->initialize();
+    importScheduleWidget->setSqlEngine(mSqlEngine);
 
     // Sanity check for existence of any Conference in the DB
     // it AppSettings::confId() is 0, but there are any Conference(s) in the DB
@@ -45,8 +46,9 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent)
             AppSettings::setConfId(confs[0].id());
     }
 
+    connect(importScheduleWidget, SIGNAL(scheduleImported(int)), SLOT(scheduleImported(int)));
+
     // connect Menu actions
-    connect(actionImportSchedule, SIGNAL(triggered()), SLOT(importSchedule()));
     connect(actionAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
     connect(actionAboutApplication, SIGNAL(triggered()), SLOT(aboutApp()));
 
@@ -199,10 +201,9 @@ MainWindow::~MainWindow()
     }
 }
 
-void MainWindow::importSchedule()
+void MainWindow::scheduleImported(int aConfId)
 {
-    ImportScheduleDialog dialog(mSqlEngine,this);
-    dialog.exec();
+    Q_UNUSED(aConfId);
 
     QList<Conference> confs = Conference::getAll();
     if(!confs.count()) // no conference(s) in the DB
index 58e24f8..6986e15 100644 (file)
@@ -16,7 +16,7 @@ public:
     MainWindow(int aEventId = 0, QWidget *aParent = NULL);
     ~MainWindow();
 private slots:
-    void importSchedule();
+    void scheduleImported(int aConfId);
     void aboutApp();
     void updateDayView(const QDate &aDate);
     void updateTracksView(const QDate &aDate);
index d6932b2..e1b2069 100644 (file)
@@ -6,7 +6,7 @@
     <x>0</x>
     <y>0</y>
     <width>935</width>
-    <height>530</height>
+    <height>514</height>
    </rect>
   </property>
   <property name="minimumSize" >
         </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="QWidget" name="searchVerticalWidget" native="true">
-          <property name="enabled">
+         <widget class="QWidget" native="1" name="searchVerticalWidget" >
+          <property name="enabled" >
            <bool>true</bool>
           </property>
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
-          <layout class="QVBoxLayout" name="searchDayNavigatorVerticalLayout">
-           <property name="margin">
+          <layout class="QVBoxLayout" name="searchDayNavigatorVerticalLayout" >
+           <property name="margin" >
             <number>0</number>
            </property>
            <item>
-            <widget class="QToolButton" name="searchAgainButton">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+            <widget class="QToolButton" name="searchAgainButton" >
+             <property name="sizePolicy" >
+              <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
-             <property name="toolTip">
+             <property name="toolTip" >
               <string>Search again</string>
              </property>
-             <property name="autoFillBackground">
+             <property name="autoFillBackground" >
               <bool>false</bool>
              </property>
-             <property name="text">
+             <property name="text" >
               <string>S</string>
              </property>
-             <property name="icon">
-              <iconset resource="../icons.qrc">
+             <property name="icon" >
+              <iconset resource="../icons.qrc" >
                <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset>
              </property>
-             <property name="iconSize">
+             <property name="iconSize" >
               <size>
                <width>24</width>
                <height>24</height>
               </size>
              </property>
-             <property name="toolButtonStyle">
+             <property name="toolButtonStyle" >
               <enum>Qt::ToolButtonIconOnly</enum>
              </property>
             </widget>
            </item>
            <item>
-            <widget class="DayNavigatorWidget" name="searchDayNavigator" native="true">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+            <widget class="DayNavigatorWidget" native="1" name="searchDayNavigator" >
+             <property name="sizePolicy" >
+              <sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
-             <property name="maximumSize">
+             <property name="maximumSize" >
               <size>
                <width>16777215</width>
                <height>16777215</height>
          </widget>
         </item>
         <item>
-         <layout class="QVBoxLayout" name="verticalLayout_3">
+         <layout class="QVBoxLayout" name="verticalLayout_3" >
           <item>
-           <widget class="QWidget" name="searchHead" native="true">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+           <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">
+            <property name="maximumSize" >
              <size>
               <width>16777215</width>
               <height>16777215</height>
              </size>
             </property>
-            <layout class="QGridLayout" name="searchHeadLayout">
-             <property name="sizeConstraint">
+            <layout class="QGridLayout" name="searchHeadLayout" >
+             <property name="sizeConstraint" >
               <enum>QLayout::SetDefaultConstraint</enum>
              </property>
-             <item row="2" column="0">
-              <layout class="QHBoxLayout" name="horizontalLayout">
+             <item row="2" column="0" >
+              <layout class="QHBoxLayout" name="horizontalLayout" >
                <item>
-                <widget class="QLineEdit" name="searchEdit">
-                 <property name="enabled">
+                <widget class="QLineEdit" name="searchEdit" >
+                 <property name="enabled" >
                   <bool>true</bool>
                  </property>
-                 <property name="toolTip">
+                 <property name="toolTip" >
                   <string>type a keyword to search</string>
                  </property>
                 </widget>
                </item>
                <item>
-                <widget class="QPushButton" name="searchButton">
-                 <property name="text">
+                <widget class="QPushButton" name="searchButton" >
+                 <property name="text" >
                   <string>Search</string>
                  </property>
-                 <property name="icon">
-                  <iconset resource="../icons.qrc">
+                 <property name="icon" >
+                  <iconset resource="../icons.qrc" >
                    <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset>
                  </property>
-                 <property name="checkable">
+                 <property name="checkable" >
                   <bool>false</bool>
                  </property>
-                 <property name="autoDefault">
+                 <property name="autoDefault" >
                   <bool>true</bool>
                  </property>
-                 <property name="default">
+                 <property name="default" >
                   <bool>true</bool>
                  </property>
-                 <property name="flat">
+                 <property name="flat" >
                   <bool>false</bool>
                  </property>
                 </widget>
                </item>
               </layout>
              </item>
-             <item row="0" column="0">
-              <layout class="QHBoxLayout" name="horizontalLayout_6">
+             <item row="0" column="0" >
+              <layout class="QHBoxLayout" name="horizontalLayout_6" >
                <item>
-                <widget class="QCheckBox" name="searchTitle">
-                 <property name="text">
+                <widget class="QCheckBox" name="searchTitle" >
+                 <property name="text" >
                   <string>Title</string>
                  </property>
-                 <property name="checked">
+                 <property name="checked" >
                   <bool>true</bool>
                  </property>
                 </widget>
                </item>
                <item>
-                <widget class="QCheckBox" name="searchAbstract">
-                 <property name="text">
+                <widget class="QCheckBox" name="searchAbstract" >
+                 <property name="text" >
                   <string>Abstract</string>
                  </property>
                 </widget>
                </item>
                <item>
-                <widget class="QCheckBox" name="searchSpeaker">
-                 <property name="text">
+                <widget class="QCheckBox" name="searchSpeaker" >
+                 <property name="text" >
                   <string>Speaker</string>
                  </property>
                 </widget>
                </item>
                <item>
-                <widget class="QCheckBox" name="searchTag">
-                 <property name="text">
+                <widget class="QCheckBox" name="searchTag" >
+                 <property name="text" >
                   <string>Tag</string>
                  </property>
                 </widget>
                </item>
                <item>
-                <widget class="QCheckBox" name="searchRoom">
-                 <property name="text">
+                <widget class="QCheckBox" name="searchRoom" >
+                 <property name="text" >
                   <string>Room</string>
                  </property>
                 </widget>
                </item>
                <item>
-                <spacer name="horizontalSpacer">
-                 <property name="orientation">
+                <spacer name="horizontalSpacer" >
+                 <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>
            </widget>
           </item>
           <item>
-           <widget class="TreeView" name="searchTreeView">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
+           <widget class="TreeView" name="searchTreeView" >
+            <property name="sizePolicy" >
+             <sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" >
               <horstretch>0</horstretch>
               <verstretch>1</verstretch>
              </sizepolicy>
             </property>
-            <property name="minimumSize">
+            <property name="minimumSize" >
              <size>
               <width>0</width>
               <height>0</height>
              </size>
             </property>
-            <property name="maximumSize">
+            <property name="maximumSize" >
              <size>
               <width>16777215</width>
               <height>16777215</height>
              </size>
             </property>
-            <attribute name="headerDefaultSectionSize">
-             <number>100</number>
-            </attribute>
            </widget>
           </item>
           <item>
-           <spacer name="verticalSpacer_2">
-            <property name="orientation">
+           <spacer name="verticalSpacer_2" >
+            <property name="orientation" >
              <enum>Qt::Vertical</enum>
             </property>
-            <property name="sizeType">
+            <property name="sizeType" >
              <enum>QSizePolicy::Expanding</enum>
             </property>
-            <property name="sizeHint" stdset="0">
+            <property name="sizeHint" stdset="0" >
              <size>
               <width>20</width>
               <height>1</height>
             <item row="0" column="1" >
              <widget class="QLabel" name="spacer" >
               <property name="text" >
-               <string>   </string>
+               <string/>
               </property>
              </widget>
             </item>
             </property>
            </widget>
           </item>
+          <item>
+           <widget class="ImportScheduleWidget" native="1" name="importScheduleWidget" >
+            <property name="sizePolicy" >
+             <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+           </widget>
+          </item>
           <item>
            <spacer name="verticalSpacer" >
             <property name="orientation" >
    <header>tabwidget.h</header>
    <container>1</container>
   </customwidget>
+  <customwidget>
+   <class>ImportScheduleWidget</class>
+   <extends>QWidget</extends>
+   <header>importschedulewidget.h</header>
+   <container>1</container>
+  </customwidget>
  </customwidgets>
  <resources>
   <include location="../icons.qrc" />
index 01ddeb5..bb83f8a 100644 (file)
@@ -12,7 +12,7 @@ ScheduleXmlParser::ScheduleXmlParser(QObject *aParent)
 {
 }
 
-void ScheduleXmlParser::parseData(const QByteArray &aData, SqlEngine *aDBEngine)
+int ScheduleXmlParser::parseData(const QByteArray &aData, SqlEngine *aDBEngine)
 {
     Q_ASSERT(NULL != aDBEngine);
 
@@ -21,9 +21,9 @@ void ScheduleXmlParser::parseData(const QByteArray &aData, SqlEngine *aDBEngine)
 
     QDomElement scheduleElement = document.firstChildElement("schedule");
 
+    int confId = 0;
     if (!scheduleElement.isNull())
     {
-        int confId = 0;
         QDomElement conferenceElement = scheduleElement.firstChildElement("conference");
         if (!conferenceElement.isNull())
         {
@@ -128,5 +128,7 @@ void ScheduleXmlParser::parseData(const QByteArray &aData, SqlEngine *aDBEngine)
             } // parsing room elements
         } // parsing day elements
     } // schedule element
+
+    return confId;
 }
 
index f5ecfb5..26cf556 100644 (file)
@@ -12,7 +12,7 @@ class ScheduleXmlParser : public QObject
         ScheduleXmlParser (QObject *aParent = NULL);\r
 \r
     public slots:\r
-        void parseData(const QByteArray &aData, SqlEngine *aDBEngine);\r
+        int parseData(const QByteArray &aData, SqlEngine *aDBEngine); // returns 'confId' of parsed conference schedule\r
 \r
     signals:\r
         void progressStatus(int aStatus);\r