setupUi(this);
mXmlParser = new ScheduleXmlParser(this);
- connect(mXmlParser, SIGNAL(progressStatus(int)), this, SLOT(showParsingProgress(int)));
+ 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();
void ImportScheduleDialog::searchSchedule()
{
mScheduleFileName = QFileDialog::getOpenFileName(this, tr("Select Conference Schedule"), QDir::homePath(), tr("Schedule Files (*.xml)"));
- fileName->setText(mScheduleFileName);
if(QFile::exists(mScheduleFileName))
import->setEnabled(true);
else
{
progressBar->show();
mXmlParser->parseData(data,mSqlEngine);
+ close();
}
}
<rect>
<x>0</x>
<y>0</y>
- <width>408</width>
- <height>118</height>
+ <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>
- <layout class="QHBoxLayout" name="horizontalLayout" >
- <item>
- <widget class="QLabel" name="fileName" >
- <property name="text" >
- <string>Select conference schedule file</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>
- <item>
- <widget class="QPushButton" name="search" >
- <property name="text" >
- <string>Search</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
<item>
<widget class="QProgressBar" name="progressBar" >
<property name="value" >
</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" >
conference["timeslot_duration"] = conferenceElement.firstChildElement("timeslot_duration").text(); // time
aDBEngine->addConferenceToDB(conference);
confId = conference["id"].toInt();
+ emit(parsingSchedule(conference["title"]));
}
// we need to get count of all events in order to emit 'progressStatus' signal