QString ser=QInputDialog::getText(this, trUtf8("first button file"), trUtf8("Enter the URL to download the first buttons file"), QLineEdit::Normal, conf->value(QString("download")).toString());
if(ser!="")conf->setValue(QString("download"), ser);
createDB();
- downloadUi();
+ downloadData();
conf->setValue(QString("first"), 2);
};
statusBar()->addPermanentWidget(label);
}
else if(b[0]==QString("but")){
download(c);
- connect(m, SIGNAL(downloaded()), SLOT(writeUi()));
+ connect(m, SIGNAL(downloaded()), SLOT(writeData()));
}
else if(b[0]==QString("down")){
QString a,aa;
aa=b[2];
}
download(a, aa);
+ connect(m, SIGNAL(downloaded()), SLOT(writeFile()));
}
else if(b[0]==QString("vid")){
addMedia(c);
}
else if(b[0]==QString("history")){
flush();
+ //addWidget(QString("back"), new CLabel(trUtf8("back", "label of history's \"back\" button"), conf->value(QString("button")).toString()));
for(int i=0; i<way.size(); i++){
addWidget(QString(way[i]), new CLabel(QString(way[i]), conf->value(QString("button")).toString()));
}
FileMenu->addAction(trUtf8("&Quit"), this, SLOT(quit()),QKeySequence(trUtf8("Ctrl+Q", "File|Quit")));
menuBar()->addMenu(FileMenu);
EditMenu=new QMenu(trUtf8("&Buttons"));
- EditMenu->addAction(trUtf8("&Download"), this, SLOT(downloadUi()),QKeySequence(trUtf8("Ctrl+W", "Buttons|Downlad")));
+ EditMenu->addAction(trUtf8("&Download"), this, SLOT(downloadData()),QKeySequence(trUtf8("Ctrl+W", "Buttons|Downlad")));
EditMenu->addAction(trUtf8("A&dd"), this, SLOT(addButtonDB()), QKeySequence(trUtf8("Ctrl+D", "Buttons|Add")));
EditMenu->addAction(trUtf8("Sa&v"), this, SLOT(savButtons()), QKeySequence(trUtf8("Ctrl+V", "Buttons|Save")));
EditMenu->addAction(trUtf8("Reset"), this, SLOT(resetUi()), QKeySequence(trUtf8("Ctrl+Z", "Buttons|Reset")));
exec(QList<QString>({conf->value(QString("updatebuttons")).toString(), tmpkeyword, tmplabel, tmpaction, a}));
}
-void MainWindow::downloadUi(){
- qDebug()<<"updateUi() : "<<conf->value(QString("download")).toString();
+void MainWindow::downloadData(){
+ qDebug()<<"downloadData() : "<<conf->value(QString("download")).toString();
download(conf->value(QString("download")).toString());
- connect(m, SIGNAL(downloaded()), SLOT(writeUi()));
+ connect(m, SIGNAL(downloaded()), SLOT(writeData()));
}
-void MainWindow::writeUi(){
+void MainWindow::writeData(){
readData(m->downloadedData());
m->deleteLater();
conf->setValue(QString("lastdownload"), QDateTime::currentDateTime().toString(Qt::ISODate));
q->exec("BEGIN TRANSACTION;");// these 2 line is SQLite specific
int a=in.count('\n');
QString d=in.split('\n').at(0);
- //conf->setValue(QString("firstline"), d);
qDebug()<<"first line : "<<d;
for(int i=1; i<a; i++){
q->prepare(d);
tmp.open(QIODevice::WriteOnly);
QDataStream str(&tmp);
str<<m->downloadedData();
+ emit writed();
QMessageBox::information(this, trUtf8("writeFile", "pop-up title when file has been written"), trUtf8("File written : "+file.toLocal8Bit(), "pop-up text when file has been written"));
m->disconnect();
d.unlock();