Changeset e493054 for src/gui


Ignore:
Timestamp:
01/21/10 15:41:03 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
e89b296
Parents:
9d8946b
Message:

import/search schedule dialog implemented

Location:
src/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/gui/gui.pro

    r9d8946b re493054  
    2626FORMS += mainwindow.ui \
    2727         daynavigatorwidget.ui \
     28         importscheduledialog.ui \
    2829         about.ui \
    2930         eventdialog.ui \
     
    3233HEADERS += mainwindow.h \
    3334           daynavigatorwidget.h \
     35           importscheduledialog.h \
    3436           eventdialog.h \
    3537           mapwindow.h
     
    3739SOURCES += mainwindow.cpp \
    3840           daynavigatorwidget.cpp \
     41           importscheduledialog.cpp \
    3942           eventdialog.cpp \
    4043           mapwindow.cpp
  • src/gui/mainwindow.cpp

    r9d8946b re493054  
    55
    66#include <sqlengine.h>
    7 #include <schedulexmlparser.h>
    87
    98#include <track.h>
     
    1716#include "eventdialog.h"
    1817#include "daynavigatorwidget.h"
     18#include "importscheduledialog.h"
    1919#include "mapwindow.h"
    2020
     
    3535    mSqlEngine = new SqlEngine(this);
    3636    mSqlEngine->initialize();
    37 
    38     mXmlParser = new ScheduleXmlParser(this);
    39     connect(mXmlParser, SIGNAL(progressStatus(int)), this, SLOT(showParsingProgress(int)));
    40     statusBar()->showMessage(tr("Ready"));
    4137
    4238    //update track map
     
    141137        mSqlEngine = NULL;
    142138    }
    143     if(mXmlParser)
    144     {
    145         delete mXmlParser;
    146         mXmlParser = NULL;
    147     }
    148139}
    149140
    150141void MainWindow::importSchedule()
    151142{
    152     QFile file(":/schedule.en.xml");
    153     if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
    154     {
    155         qDebug() << "can't open " << file.fileName();
    156         return;
    157     }
    158 
    159     QByteArray data = file.readAll();
    160     mXmlParser->parseData(data,mSqlEngine);
    161 
     143    ImportScheduleDialog dialog(mSqlEngine,this);
     144    dialog.exec();
     145   
    162146    if(Conference::getAll().count())
    163147    {
     
    172156}
    173157
    174 void MainWindow::showParsingProgress(int aStatus)
    175 {
    176     QString msg = QString("Parsing completed: %1\%").arg(aStatus);
    177     statusBar()->showMessage(msg,1000);
    178 }
    179 
    180158void MainWindow::aboutApp()
    181159{
  • src/gui/mainwindow.h

    r9d8946b re493054  
    77
    88class SqlEngine;
    9 class ScheduleXmlParser;
    109
    1110class MainWindow : public QMainWindow, private Ui::MainWindow
     
    1918private slots:
    2019    void importSchedule();
    21     void showParsingProgress(int aStatus);
    2220    void aboutApp();
    2321    void updateDayView(const QDate &aDate);
     
    3129private:
    3230    SqlEngine *mSqlEngine;
    33     ScheduleXmlParser *mXmlParser;
    3431};
    3532
Note: See TracChangeset for help on using the changeset viewer.