]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
added something to save anything to the server and be notified when it's
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 4 Nov 2014 12:51:00 +0000 (13:51 +0100)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 4 Nov 2014 12:51:00 +0000 (13:51 +0100)
finished.

mainwindow.cpp
mainwindow.h

index 16c50994286dde47a00fbafed2f9677248c0e685..ec3a5778d34a65972a630b641e19ea943a7e52a0 100644 (file)
@@ -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<QString> ({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<QString>({"delete from raw;"}));
index e941f330c38eedc9e6deaf7cbaf205f95412320c..0dd7c5797d5488c6bac493a1a83c7e61d3ee2c24 100644 (file)
@@ -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;
 };