]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
I've added "always" keyword to add permanent buttons (like the "back"
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 3 Jun 2014 07:22:34 +0000 (09:22 +0200)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 3 Jun 2014 07:22:34 +0000 (09:22 +0200)
one)

mainwindow.cpp

index d324244c7ebc99382046ce6d36dd928abfc1f863..503191e0cd38a48585c6d07385dbcb520c6633e6 100644 (file)
@@ -74,11 +74,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
     start();
 }
 void MainWindow::start(){
-    //way.clear();
-    flush();
     way=conf->value(QString("start")).toStringList();
     if(!way.isEmpty())getButtons(way.takeLast());
-    else getButtons(QString("begin"));
 }
 MainWindow::~MainWindow()
 {
@@ -241,7 +238,10 @@ void MainWindow::action(const QString &a){
         download(c);
         connect(m, SIGNAL(downloaded()), SLOT(writeUi()));
     }
-    else getButtons(a);
+    else {
+        getButtons(a);
+        getButtons(conf->value(QString("always")).toString());
+    }
 }
 void MainWindow::createMenuBar(){
     FileMenu=new QMenu(trUtf8("&File"), this);
@@ -368,6 +368,7 @@ void MainWindow::firstrun(){
     conf->setValue(QString("sepcmd"), QVariant("!@!"));
     conf->setValue(QString("sepchc"), QVariant("!#!"));
     conf->setValue(QString("sqlval"), QVariant("?"));
+    conf->setValue(QString("always"), QVariant("+always"));
     qDebug()<<"firstrun() finished";
 }
 QString &MainWindow::get(int row, int column){
@@ -436,9 +437,10 @@ void MainWindow::getButtons(const QString &b){
     QString a=b;
     if((b[0]!='-')&&(b[0]!='+'))way.append(a);
     else a.remove(0, 1);
-
     qDebug()<<"getButtons("<<a<<") way.size()"<<way.size();
-    if((b[0]!='+')||(b[0]=='%'))flush();
+    if((b[0]!='*')&&(b[0]!='+'))flush();
+    else if(b[0]=='*')a.remove(0, 1);
+
     if(updatelocker.tryLock(60000))updatelocker.unlock();
     else{qDebug()<<"updatelocker is locked more than 1mn";}
     QString c="%"+a+"%";