From: Norbert Moutarde Date: Mon, 1 Jun 2015 21:25:57 +0000 (+0200) Subject: copyright updated, every buttons is now active the first time and left X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=3fb4a5866aa0a76d77fd524dcb57078dda6c65de;p=diary-mobile.git copyright updated, every buttons is now active the first time and left to the system the second time and css value is now correct. --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 959920c..40456a9 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014, PIOT Gabriel +// Copyright (c) 2014-2015, PIOT Gabriel // All rights reserved. // Redistribution and use in source and binary forms, with or without modification, @@ -81,7 +81,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) menuBar()->setVisible(conf->value(QString("menu")).toBool()); //d.lock(); - //start(); + start(); } void MainWindow::start(){ QString a=conf->value(QString("currenttype"), QString("buttons")).toString(); @@ -175,14 +175,13 @@ int unsigned MainWindow::addWidget(const QString &key, const CLabel *a){ //if(c==(maxc*maxl)-1)return 1; //(p-1)*(ml*mc)+c nombre de boutons en tout osef, -/* if((c==((maxc*maxl)-1))&&(!np)){ + if((c==((maxc*maxl)-1))&&(!np)){ np=1; CLabel * next=new CLabel(QString("Next page"), *conf); addWidget(QString("nextpage"), next); - page++; return 1; } -*/ + return 0; } void MainWindow::action(const QString &a){ @@ -278,13 +277,14 @@ void MainWindow::action(const QString &a){ page--; int maxc=conf->value(QString("maxcolumn")).toInt(), maxl=conf->value(QString("maxline")).toInt(); q->seek(0-(maxc*maxl),1); + printItem(); } else if(b[0]==QString("nextpage")){ page++; int maxc=conf->value(QString("maxcolumn")).toInt(), maxl=conf->value(QString("maxline")).toInt(); q->seek(maxc*maxl,1); - + printItem(); } else if(b[0]==QString("setfile")){ bool ok=0; @@ -432,9 +432,10 @@ void MainWindow::action(const QString &a){ } else if(b[0]==QString("val")){ for(int a=0;a<((bs-1)/2); a++){ - valeur->insert(b[2*a], b[2*a+1]); - qDebug()<<"val.size()=="<size()<insert(b[(2*a)+1], b[(2*a)+2]); + if(deb)QMessageBox::information(this, QString("val"), QString("val("+b[(2*a)+1]+")=="+b[(2*a)+2])); } + if(deb)QMessageBox::information(this, QString("val"), QString("val.size()=="+valeur->size())); } else { @@ -558,15 +559,15 @@ void MainWindow::firstrun(){ 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: 15px;border-radius: 10px;border-color: beige;font: bold 15px;padding: 6px;")); + conf->setValue(QString("buttons"), QVariant("background-color: red;border-style: outset;border-width: 15px;border-radius: 10px;border-color: beige;font-size: 30px;padding: 6px;")); conf->setValue(QString("buttonsbefore"), QVariant("background-color: red;")); conf->setValue(QString("buttonsafter"), QVariant("background-color: blue;")); conf->setValue(QString("menu"), QVariant(1)); conf->setValue(QString("download"), QVariant("http://www.nothing2do.eu/"+conf->value(QString("filebuttons")).toString())); conf->setValue(QString("init"), QVariant("http://www.nothing2do.eu/init")); - conf->setValue(QString("userftp"), QVariant("")); - conf->setValue(QString("hostftp"), QVariant("")); - conf->setValue(QString("passftp"), QVariant("")); + conf->setValue(QString("userftp"), QVariant("")); + conf->setValue(QString("hostftp"), QVariant("")); + conf->setValue(QString("passftp"), QVariant("")); conf->setValue(QString("start"), QVariant("begin")); conf->setValue(QString("restore"), QVariant("http://www.abc.de/db")); conf->setValue(QString("db"), QVariant("/data/data/eu.nothing2do.diarymobile/files/db")); @@ -810,19 +811,21 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event) if (k==Qt::Key_Menu){ action(conf->value(QString("actionmenu")).toString()); - accepted==false; + accepted=false; } else if(k==Qt::Key_Back){ action(conf->value(QString("menuback")).toString()); - accepted==false; + accepted=false; } else if(k==Qt::Key_VolumeDown){ qDebug()<<"keyvolumdown"; const QString a=conf->value(QString("volumdown")).toString(); + accepted=false; action(a); } else if(k==Qt::Key_VolumeUp){ action(conf->value(QString("volumup")).toString()); + accepted=false; }; } void CLabel::SetTextToLabel(const QString& text) @@ -905,7 +908,7 @@ void MainWindow::download(const QString & a){//keep downloaded data into m->down QUrl url(a); m = new FileDownloader(url, this); } -void MainWindow::download(const QString & a, const QString & b){//write downloaded data into "b" +void MainWindow::download(const QString & a, const QString & b){//write downloaded data from "a" into "b" qDebug()<<"download("<next()){ int tmp=addWidget(q->value(actCol).toString(), new CLabel(q->value(labCol).toString(), *conf)); - //if(tmp==1)return 1; + if(tmp==1)return 1; i++; }; //grid->update();