oracle importer changes

This commit is contained in:
Max-Wilhelm Bruker 2010-05-08 23:39:55 +02:00
parent 40fc77c646
commit 6829e2edb2
2 changed files with 12 additions and 0 deletions

View file

@ -74,6 +74,10 @@ WindowMain::WindowMain(QWidget *parent)
setWindowTitle(tr("Oracle importer"));
setFixedSize(600, 500);
QStringList args = qApp->arguments();
if (args.contains("-dlsets"))
downloadSetsFile(defaultSetsUrl);
}
void WindowMain::updateSetList()
@ -108,6 +112,12 @@ void WindowMain::actLoadSetsFile()
void WindowMain::actDownloadSetsFile()
{
QString url = QInputDialog::getText(this, tr("Load sets from URL"), tr("Please enter the URL of the sets file:"), QLineEdit::Normal, defaultSetsUrl);
if (!url.isEmpty())
downloadSetsFile(url);
}
void WindowMain::downloadSetsFile(const QString &url)
{
QNetworkReply *reply = nam->get(QNetworkRequest(url));
connect(reply, SIGNAL(finished()), this, SLOT(setsDownloadFinished()));
}

View file

@ -31,6 +31,8 @@ private:
QTextEdit *messageLog;
QVBoxLayout *checkBoxLayout;
QList<QCheckBox *> checkBoxList;
void downloadSetsFile(const QString &url);
private slots:
void updateTotalProgress(int cardsImported, int setIndex, const QString &nextSetName);
void updateFileProgress(int bytesRead, int totalBytes);