From e3b7cd86eb870cf9984f6c3a4a876d9911c2fb7d Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Sat, 18 Jan 2014 14:35:19 +0100 Subject: [PATCH] cleaned up --- mainwindow.cpp | 25 +++++++++++++++---------- mainwindow.h | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 8d024a5..9c6642b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -110,8 +110,8 @@ void MainWindow::lsconfig(){ flush(); QStringList tmp=conf->allKeys(); for(int a=0; aaddAction(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;ivalue(QString("upload")).toString(); QUrl upload(conf->value(QString("upload")).toString()); net=new QNetworkAccessManager(this); - //qDebug()<<"net->put : "<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 : "<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 : "<downloadedData().size()<<" byte."; + QMessageBox::information(this, "update", texte); } void MainWindow::resetDB(){ exec(QList({"delete from ui;"})); diff --git a/mainwindow.h b/mainwindow.h index ae57bca..9dabd5d 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -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(); -- 2.45.1