]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
added a "backmenu" setting (and few tweaks)
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Thu, 17 Apr 2014 17:40:40 +0000 (19:40 +0200)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Thu, 17 Apr 2014 17:40:40 +0000 (19:40 +0200)
README.md
mainwindow.cpp
ui.sql

index 866f389a9eefd59f738723b533f90aec68604bac..90c3099f7451674113b1c70f4ddaf140223f9419 100644 (file)
--- a/README.md
+++ b/README.md
@@ -4,10 +4,8 @@ diary-mobile-android
 a GUI to use diary-shell on android (or computer, or IOS, or symbian,
 or whatever Qt works on if you want, it's so Qt !)
 
-the first time you run this, you've only one buttons ("config"),
-so click on and on the new page, choose "download". Now you've to write
-the full path to get your full button file (don't forget the "http://"
-like me the first time).<br>
+The first time this soft is launched, it will ask an URL to download the buttons 
+(read ui.sql to undertand what is expected).<br>
 To upload in real time, you've to set the "upload" to a ftp server where
 you've an account with syntax :
 ftp://[user]:[pass]@[hostname]/[filename]
index 03fbd647247c38e78ea2391dbc478485da78c128..87f97a8a2f766f6b42642de24cb16c5ce4d67d50 100644 (file)
@@ -105,6 +105,7 @@ void MainWindow::showExpanded()
 void MainWindow::quit(){
     qDebug()<<"quit()";
     conf->setValue(QString("menu"), menuBar()->isVisible());
+
     //savButtons();
     db.commit();
     db.close();
@@ -116,8 +117,8 @@ CLabel* MainWindow::addWidget(const QString &key, const CLabel *a){
     int maxc=conf->value(QString("maxcolumn")).toInt();
     int maxl=conf->value(QString("maxline")).toInt();
     grid->addWidget(a, grid->count()/maxc, grid->count()%maxc, 1, 1, Qt::AlignJustify| Qt::AlignVCenter | Qt::AlignHCenter);
-    //QObject::connect(a, SIGNAL(pressed()), signalmap, SLOT(map()));
-    QObject::connect(a, SIGNAL(released()), signalmap, SLOT(map()));
+    QObject::connect(a, SIGNAL(pressed()), signalmap, SLOT(map()));
+    //QObject::connect(a, SIGNAL(released()), signalmap, SLOT(map()));
     signalmap->setMapping(a, key);
     return a;
 }
@@ -261,6 +262,7 @@ void MainWindow::firstrun(){
     conf->setValue(QString("db"), QVariant("/data/data/eu.nothing2do.diarymobile/files/db"));
     conf->setValue(QString("selectbuttons"), QVariant("select keyword,label,action from ui;"));
     conf->setValue(QString("selectraw"), QVariant("select date,texte from raw;"));
+    conf->setValue(QString("menu"), QVariant("menuback"));
 }
 QString &MainWindow::get(int row, int column){
     q->seek(row);
@@ -301,11 +303,6 @@ void MainWindow::entry(const QString &a){
     if(a=="")c=context+" : "+entry;
     else c=context+", "+a+" : "+entry;
     //qDebug()<<"c="<<c;
-    QFile fichier(conf->value(QString("file"), QVariant("raw")).toString());
-    fichier.open(QIODevice::Append | QIODevice::Text);
-    QTextStream flux(&fichier);
-    flux << time << " " << c << endl;
-    fichier.close();
     QList<QString> d({"INSERT INTO raw (date, texte) VALUES (:date, :txt);", time, c});
     exec(d);
     QSqlError b=q->lastError();
@@ -396,7 +393,7 @@ void MainWindow::sendRAW(){
         b<<q->value(1).toString()<<"\n";
     }
     a.close();
-    //QMessageBox::information(this, QString("end"), conf->value(QString("file")).toString());
+    
     qDebug()<<"a.open()="<<a.open(QIODevice::ReadOnly | QIODevice::Text);
 
     QUrl upload(conf->value(QString("uploadRAW")).toString());
@@ -412,17 +409,10 @@ void MainWindow::RAWsent(){
 }
 void MainWindow::back(){
     flush();
-    if(way.size()-1>0){
-        addWidget(QString("quit"), new CLabel(QString("quitter"), 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()));
-        }
+    getButtons(conf->value(QString("menu")).toString());
+    for(int i=0; i<way.size(); i++){
+        addWidget(QString(way[i]), new CLabel(QString(way[i]), conf->value(QString("button")).toString()));
     }
-    else {
-        getButtons(conf->value(QString("start")).toString());
-        //QMessageBox::information(this, QString("Erreur"), QString("Vous êtes déja au départ."));
-    }
-
 }
 void MainWindow::keyReleaseEvent(QKeyEvent *event)
 {
@@ -532,7 +522,6 @@ void MainWindow::savButtons(){
         b<<q->value(2).toString()<<"\n";
     }
     a.close();
-    QMessageBox::information(this, QString("end"), conf->value(QString("buttonfile"), QVariant("ui.sql")).toString());
     qDebug()<<"a.open()="<<a.open(QIODevice::ReadOnly | QIODevice::Text);
     QUrl upload(conf->value(QString("uploadUi")).toString());
     net=new QNetworkAccessManager(this);
diff --git a/ui.sql b/ui.sql
index 1b4a457c7a12edfb0a33f7a05db55bff8628f957..bd33e17b728fffdbfddae213d8cf9e25871a501e 100644 (file)
--- a/ui.sql
+++ b/ui.sql
@@ -17,4 +17,5 @@ config$start$settext start
 config$DB file$settext db
 config$restore DB$settext restore
 config$selectraw$settext selectraw
+config$menu$settext menu
 main help$action$box action can be : set #1 #2, settext #1, setint #1, setfile #1, box #, quit, # (getbuttons)