From: Norbert Moutarde Date: Tue, 4 Nov 2014 12:51:00 +0000 (+0100) Subject: added something to save anything to the server and be notified when it's X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=6685d1481f4b93dbd83880ae3cbac54a76dc8195;p=diary-mobile.git added something to save anything to the server and be notified when it's finished. --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 16c5099..ec3a577 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -232,6 +232,8 @@ void MainWindow::action(const QString &a){ } else if(b[0]==QString("sav")){ + Msav.lock(); + sav(c); } else if(b[0]==QString("back")){ @@ -504,7 +506,7 @@ void MainWindow::firstrun(){ conf->setValue(QString("password"), QVariant("pass")); conf->setValue(QString("fileraw"), QVariant("raw")); conf->setValue(QString("filebuttons"), QVariant("ui.sql+")); - conf->setValue(QString("maxcolumn"), QVariant(2)); + conf->setValue(QString("maxcolumn"), QVariant(3)); conf->setValue(QString("maxline"), QVariant(3)); conf->setValue(QString("SQLsettings"), QVariant("connect_timeout=10000")); conf->setValue(QString("buttons"), QVariant("background-color: red;border-style: outset;border-width: 7px;border-radius: 10px;border-color: beige;font: bold 15px;padding: 6px;")); @@ -851,6 +853,7 @@ void MainWindow::download(const QString & a, const QString & b){//write download void MainWindow::sav(const QString & a){ exec(QList ({conf->value(QString("select")+a).toString()})); QString tmp="file"+a; + savtitle=a; QFile b(conf->value(tmp).toString()); b.open(QIODevice::WriteOnly); QTextStream c(&b); @@ -873,7 +876,8 @@ void MainWindow::sav(const QString & a){ } void MainWindow::Uisent(){ qDebug()<<"Uisent"; - QMessageBox::information(this, trUtf8("Uisent", "pop-up title when data has been sent"), trUtf8("sav finish", "pop-up text when data has been sent")); + Msav.unlock(); + QMessageBox::information(this, trUtf8("Uisent", "pop-up title when data has been sent"), trUtf8(QString("sav finish of "+savtitle).toStdString().c_str(), "pop-up text when data has been sent")); } void MainWindow::resetRAW(){ exec(QList({"delete from raw;"})); diff --git a/mainwindow.h b/mainwindow.h index e941f33..0dd7c57 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -198,12 +198,12 @@ private: //QScrollArea * scroll; QMediaPlayer *video; QMediaPlaylist *playlist; - QMutex sql,updatelocker,d; + QMutex sql,updatelocker,d,Msav; QWidget *screen; QGridLayout *grid; QLabel *label; QSettings *conf; - QString tmp, tmp2, file, lastprint, currenttype;//host, user, tmp, password, servercert,database; + QString tmp, tmp2, file, lastprint, currenttype, savtitle;//host, user, tmp, password, servercert,database; QMenu *FileMenu, *EditMenu, *HackMenu; QSignalMapper *signalmap; QStringList way; @@ -215,6 +215,7 @@ private: QNetworkReply * rep; bool orienta;//0=portrait 1=paysage (size.width() > size.height()) unsigned short int deb; + unsigned int page; QVideoWidget * videoWidget; };