]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
cleaned up
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Sat, 18 Jan 2014 13:35:19 +0000 (14:35 +0100)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Sat, 18 Jan 2014 13:35:19 +0000 (14:35 +0100)
mainwindow.cpp
mainwindow.h

index 8d024a557a08841ad9fea12e3811ada1c2482b2e..9c6642b2023156056f9dd5c2e1b2470f9a361209 100644 (file)
@@ -110,8 +110,8 @@ void MainWindow::lsconfig(){
     flush();
     QStringList tmp=conf->allKeys();
     for(int a=0; a<tmp.size();a++){
-        CLabel * b=new CLabel(tmp[a]);
-        addWidget(tmp[a], b);
+        //CLabel * b=new CLabel(tmp[a]);
+        addWidget(tmp[a], new CLabel(tmp[a]));
     }
 
 
@@ -168,7 +168,7 @@ void MainWindow::createMenuBar(){
     FileMenu=new QMenu(QString("&File"), this);
     FileMenu->addAction(trUtf8("&Start..."), this, SLOT(start()),QKeySequence(trUtf8("Ctrl+S", "Start")));
     FileMenu->addAction(trUtf8("&Back"), this, SLOT(back()),QKeySequence(trUtf8("Ctrl+B", "Back")));
-    FileMenu->addAction(trUtf8("&Download"), this, SLOT(updateUi()),QKeySequence(trUtf8("Ctrl+D", "Downlad")));
+    FileMenu->addAction(trUtf8("&Download"), this, SLOT(updateUi()),QKeySequence(trUtf8("Ctrl+W", "Downlad")));
     FileMenu->addAction(trUtf8("Up&load"), this, SLOT(sendUi()),QKeySequence(trUtf8("Ctrl+L", "Upload")));
     FileMenu->addAction(trUtf8("&Quit..."), this, SLOT(quit()),QKeySequence(trUtf8("Ctrl+Q", "Quit")));
     menuBar()->addMenu(FileMenu);
@@ -178,7 +178,7 @@ void MainWindow::createMenuBar(){
     EditMenu->addAction(trUtf8("Sa&v buttons"), this, SLOT(savButtons()), QKeySequence(trUtf8("Ctrl+V", "Buttons|Save")));
     EditMenu->addAction(trUtf8("&Edit buttons"), this, SLOT(editButtonDB()), QKeySequence(trUtf8("Ctrl+E", "Buttons|&Edit")));
     EditMenu->addAction(trUtf8("&View/Hide menu"), this, SLOT(toggleMenu()), QKeySequence(trUtf8("Ctrl+T", "Buttons|View menu")));
-    EditMenu->addAction(trUtf8("Re&set database"), this, SLOT(resetDB()), QKeySequence(trUtf8("Ctrl+S", "Buttons|ResetDB")));
+    EditMenu->addAction(trUtf8("Reset database"), this, SLOT(resetDB()), QKeySequence(trUtf8("Ctrl+Z", "Buttons|ResetDB")));
     menuBar()->addMenu(EditMenu);
     HelpMenu=new QMenu(QString("&Help"));
     HelpMenu->addAction(tr("About Qt"), qApp, SLOT(aboutQt()), QKeySequence(tr("ctrl+H", "About Qt")));
@@ -328,7 +328,7 @@ void MainWindow::addButtonDB(){
     for(int i=0;i<way.size(); i++){
         a+=way[i];
         a.chop(1);
-        a+=" ";
+        a+="_";
         qDebug()<<"a="<<a<<" i="<<i;
     }
     b=QInputDialog::getText(this, QString("keyword"), QString("Entrez ses mots clé (no limit !)"), QLineEdit::Normal, cur, &ok);
@@ -388,9 +388,10 @@ void MainWindow::sendUi(){
     qDebug()<<"sendUi() : "<<conf->value(QString("upload")).toString();
     QUrl upload(conf->value(QString("upload")).toString());
     net=new QNetworkAccessManager(this);
-    //qDebug()<<"net->put : "<<net->put(QNetworkRequest(upload), data);
-    rep=net->put(QNetworkRequest(upload),data);
-    connect(rep, SIGNAL(finished(QNetworkReply&)), this, SLOT(datasend(QNetworkReply&)));
+    rep=net->put(QNetworkRequest(upload), data);
+    qDebug()<<"net->put : "<<rep;
+    //rep=net->put(QNetworkRequest(upload),data);
+    connect(rep, SIGNAL(finished()), this, SLOT(datasend()));
 }
 void MainWindow::back(){
     flush();
@@ -482,9 +483,13 @@ void MainWindow::readButtons(const QByteArray &in){
     data=in;
     emit datafilled();
 }
-void MainWindow::datasend(QNetworkReply *a){
+void MainWindow::datasend(){
+    qDebug()<<"datasend";
+    QString texte="Update finish"/*, s=m->downloadedData().size()*/;
+    //texte=texte+s.toInt()+" byte)";
+    qDebug()<<"texte : "<<texte;
 
-    qDebug()<<"data send :"<<m->downloadedData().size()<<" byte.";
+    QMessageBox::information(this, "update", texte);
 }
 void MainWindow::resetDB(){
     exec(QList<QString>({"delete from ui;"}));
index ae57bca6cd61621eedea8a0d12c6974e5e01a928..9dabd5dd2cbc2f07ec097e8fb28ba2ee3ad5621c 100644 (file)
@@ -96,7 +96,7 @@ public:
     void showExpanded();
     CLabel* addWidget(const QString &, const CLabel *);
 private slots:
-    void datasend(QNetworkReply *);
+    void datasend();
     void back();
     void start();
     void quit();