From 671a54c6318e035bde19fa7b986228199d87fbd6 Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Fri, 20 Jun 2014 15:16:36 +0200 Subject: [PATCH] =?utf8?q?I've=20added=20a=20value=20to=20use=20diff=C3=A9?= =?utf8?q?rent=20spacename?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- diary-mobile_en_EN.ts | 275 ++++++++++++----------- diary-mobile_fr_FR.ts | 510 ++++++++++++------------------------------ mainwindow.cpp | 133 ++++++----- mainwindow.h | 6 +- 4 files changed, 382 insertions(+), 542 deletions(-) diff --git a/diary-mobile_en_EN.ts b/diary-mobile_en_EN.ts index f6985ca..2d76736 100644 --- a/diary-mobile_en_EN.ts +++ b/diary-mobile_en_EN.ts @@ -4,532 +4,555 @@ MainWindow - - + + get file title to ask file - + box box title to show a text - + set - + Enter ID of button to edit - + Ctrl+S File|Start - + Ctrl+B File|Back - + Ctrl+L File|Upload - + Ctrl+Q File|Quit - + New entry - + ctrl+H Help|About Qt - + &View/Hide menu File|View/Hide menu - - Ctrl+R - Help|CreateDB - - - - - C&reate Database - Hack|Create - - - - + Download sql Hack|download sql - - label - Title of box where ask for new button's label - - - - + Enter his label his/her/?they? I've forget my school lesson - - keyword - Title of box where ask for new button's keyword - - - - + Enter they keyword (no limit !) - - action - Title of box where ask for new button's action - - - - + Enter his action - + Ctrl+T File|View menu - + Enter the URL to download the init file - + init file - + action box title to debug action - + Variable's name ? text to ask value's name before changing it (set) - - + + Error title if action("set") has too much value - - + + Too much value in button's action text if action("set") has too much value - + variable text change title to warn about variable content change - - + + value of - - + + Variable's name ? text to ask value's name before changing it (setint) - + variable integer change title to warn about variable content change - + Value of - + choice title of box who ask multiple choice - + Please choose an action. text to ask multiple choice - + variable file change title to warn about variable content change - + Error title if action("edit") has too much value - + Too much value in button's action text if action("edit") has too much value - + URL title to download a custom file from URL - + Enter the URL of the file label to download a custom file - - + + File title to write a file downloaded from URL - - + + Enter the name of the file label to write the downloaded data - + Error title of box if action("read" has too much (or too "less") value - + Bad number of value text of box if action("read") has too much (or too "less") value - + &File top menu - + &Start File|Start - + &Back File|Back - + sendRAW File|SendRAW - + Reset RAW File|resetRAW - + Ctrl+E File|Reset - + &Quit File|Quit - + &Button top menu - + &Download Button|Downlad - + Ctrl+W Button|Downlad - + A&dd Button|Add - + Ctrl+D Button|Add - + Sa&v Button|Sav - + Ctrl+V Button|Save - + Reset Button|Reset - + Ctrl+Z Button|Reset - + &Edit Button|Edit - + Ctrl+E Button|&Edit - + &Hack top menu - + New entry Hack|Entry - + Action Hack|Action - + About Qt Hack|About Qt - + + addDB + box title to debug addDB + + + + + label + Title of box where ask for new label + + + + + keyword + Title of box where ask for new keyword + + + + + action + Title of box where ask for new action + + + + + action + box title to debug get + + + + + EditDB + box title to debug editDB + + + + upload pop-up title when data has been sent - + + get + title to ask keyword fot get + + + + action box title to debug insert - + + insert : key= + + + + key box title to debug remove - + tmp URL Title of box where ask for button file's URL - + Enter URL Label of box where ask for button file's URL - + action Title of box where ask for a custom action - + Enter your action Label of box where ask for custom action - + + tmp URL + Title of box where ask for current type + + + + + Enter string + Label of box where ask for current type + + + + Enter the keyword : - + chooseDB - + keyword Title of box where ask for button's keyword - + new keyword question to get new button's keyword - + label Title of box where ask for button's label - + new label question to get new button's label - + action Title of box where ask for button's action - + new action question to get new button's action - + RAWsent message title when data has been send - + sendRAW finish message text when data has been send - + Upload finish : pop-up when data has been sent - + Uisent pop-up title when buttons has been sent - + sav finish savbuttons finish pop-up text when buttons has been sent - + Enter the keyword : ask keyword to get buttons - - getButtons - title to ask keyword fot getbuttons - - - - + writeFile pop-up title when file has been written - + File written : diff --git a/diary-mobile_fr_FR.ts b/diary-mobile_fr_FR.ts index f5bdf94..f51f84a 100644 --- a/diary-mobile_fr_FR.ts +++ b/diary-mobile_fr_FR.ts @@ -3,94 +3,63 @@ MainWindow + - first button file - Premier fichier de bouton - - - Enter the URL to download the first buttons file - Entrez l'URL pour télécharger vos boutons - - - choice - Choix - - - Please choose an action. - choisissez une action - - - - + + get file title to ask file choisissez un fichier - + box box title to show a text info - + set définir - + Enter ID of button to edit Entrez l'ID du bouton à éditer - &File - &Fichier - - - &Start - &Départ - - - + Ctrl+S File|Start Ctrl+D - &Back - &Retour - - - + Ctrl+B File|Back Ctrl+R + - &View/Hide menu - File|View/Hide - Voir/Cacher le menu - - - + sendRAW File|SendRAW Envoyer les données - + Reset RAW File|resetRAW Réinitialiser les donnés - + Ctrl+E File|Reset Ctrl+E - + &Quit File|Quit &Quitter @@ -101,686 +70,503 @@ Boutons - Ctrl+W - Buttons|Downlad - Ctrl+D - - - sendRAW - Envoyer les données - - - + Ctrl+L File|Upload Ctrl+L - Reset RAW - Reset Ui - Réinitialiser les donnés - - - Ctrl+Z - Buttons|ResetUi - Ctrl+Z - - - &Quit - &Quitter - - - + Ctrl+Q File|Quit Ctrl+Q - &Buttons - Boutons - - - A&dd buttons - A&jouter un boutons - - - Ctrl+D - Buttons|Add - Ctrl+D - - - Sa&v buttons - Sauvegardez les boutons - - - Ctrl+V - Buttons|Save - Ctrl+V - - - &Edit buttons - &Editer les boutons - - - Ctrl+E - Buttons|&Edit - Ctrl+E - - - &View/Hide menu - Voir/Cacher le menu - - - + Enter the URL to download the init file Entrez l'URL pour téléchargez le fichier d'initialisation - + init file fichier d'initialisation - + action box title to debug action action - + Variable's name ? text to ask value's name before changing it (set) Nom de la variable - - + + Error title if action("set") has too much value Erreur - - + + Too much value in button's action text if action("set") has too much value Trop de mots dans l'action du bouton - + variable text change title to warn about variable content change changement du contenu de la variable - - + + value of Valeur de - - + + Variable's name ? text to ask value's name before changing it (setint) Nom de la variable ? - + variable integer change title to warn about variable content change changement de valeur - + Value of Valeur de - + choice title of box who ask multiple choice Choix - + Please choose an action. text to ask multiple choice Choisissez une action - + variable file change title to warn about variable content change changement de valeur - + Error title if action("edit") has too much value Erreur - + Too much value in button's action text if action("edit") has too much value Trop de mots dans l'action du bouton - + URL title to download a custom file from URL Source - + Enter the URL of the file label to download a custom file Entrez l'URL des données - - + + File title to write a file downloaded from URL Fichier - - + + Enter the name of the file label to write the downloaded data Entrez le nom du fichier - + Error title of box if action("read" has too much (or too "less") value Erreur - + Bad number of value text of box if action("read") has too much (or too "less") value Mauvais "nombre" de mot - + &File top menu &Fichier - + &Start File|Start &Départ - + &Back File|Back &Retour - + Ctrl+T File|View menu Ctrl+M - + &View/Hide menu File|View/Hide menu Voir/Cacher le menu - + &Button top menu Boutons - + &Download Button|Downlad &Téléchargement - + Ctrl+W Button|Downlad Ctrl+D - + A&dd Button|Add Nouveau - + Ctrl+D Button|Add Ctrl+J - + Sa&v Button|Sav Sauvegardez - + Ctrl+V Button|Save Ctrl+V - + Reset Button|Reset Remise à zéro - + Ctrl+Z Button|Reset Ctrl+Z - + &Edit Button|Edit Edition - + Ctrl+E Button|&Edit Ctrl+E - &Data - top menu - Données - - - &Download - Data|Downlad - &Téléchargement - - - Ctrl+W - Data|Downlad - Ctrl+T - - - A&dd - Data|Add - Nouveau - - - Ctrl+D - Data|Add - Nouveau - - - Sa&v - Data|Sav - Sauvegardez - - - Ctrl+V - Data|Save - Ctrl+V - - - Reset - Data|Reset - Remise à zéro - - - Ctrl+Z - Data|Reset - Ctrl+Z - - - &Edit - Data|Edit - Edition - - - Ctrl+E - Data|&Edit - Ctrl+E - - - &Download - Buttons|Downlad - &Téléchargement - - - A&dd - Buttons|Add - Nouveau - - - Sa&v - Buttons|Sav - Sauvegardez - - - Reset - Buttons|Reset - Remise à zéro + + tmp URL + Title of box where ask for current type + URL temporaire - &Edit - Buttons|Edit - Editer + + Enter string + Label of box where ask for current type + Entrez une variable - + &Hack top menu &Hack - + New entry Hack|Entry Nouvelle entrée - + Action Hack|Action Action - + About Qt Hack|About Qt A propos de Qt - + + addDB + box title to debug addDB + addDB + + + + label + Title of box where ask for new label + étiquette + + + + keyword + Title of box where ask for new keyword + mot-clé + + + + action + Title of box where ask for new action + action + + + + action + box title to debug get + action + + + + EditDB + box title to debug editDB + EditDB + + + upload pop-up title when data has been sent Envoie - + + get + title to ask keyword fot get + prendre + + + action box title to debug insert action - + + insert : key= + inser : clé= + + + key box title to debug remove clé - + tmp URL Title of box where ask for button file's URL URL temporaire - + Enter URL Label of box where ask for button file's URL Entrez l'URL - + action Title of box where ask for a custom action action - + Enter your action Label of box where ask for custom action Entrez votre action - &Help - Aide - - - + New entry Nouvelle entrée - getButtons - getButtons - - - About Qt - A propos de Qt - - - + ctrl+H Help|About Qt Ctrl+A - C&reate Database - C&réer une base de donné - - - - Ctrl+R - Help|CreateDB - Ctrl+R - - - - C&reate Database - Hack|Create - C&réer une base de donné - - - + Download sql Hack|download sql Télécharger un fichier sql - label Title of box where ask for new button's label - Etiquette + Etiquette - + Enter his label his/her/?they? I've forget my school lesson Entrez son étiquette - - keyword - Title of box where ask for new button's keyword - mot-clé - - - + Enter they keyword (no limit !) Entrez les mots clé (no limit !) - - action - Title of box where ask for new button's action - action - - - + Enter his action Entrez son action - askkeyword - Title of box where ask for keyword to getbuttons - 0 (non) ou 1 (oui)? - - - &Download - &Téléchargement - - - A&dd - Nouveau - - - Sa&v - Sauvegardez - - - Reset - Remise à zéro - - - Ctrl+Z - Buttons|Reset - Ctrl+Z - - - &Edit - Editez - - - &Hack - Bidouille - - - Download sql - Télécharger un fichier sql - - - chooseButtonDB - chooseButtonDB - - - + Enter the keyword : Entrez le mot-clé : - + chooseDB choisirBD - + keyword Title of box where ask for button's keyword mot-clé - + new keyword question to get new button's keyword nouveau mot-clé - + label Title of box where ask for button's label étiquette - + new label question to get new button's label nouvel étiquette - + action Title of box where ask for button's action action - + new action question to get new button's action nouvelle action - + RAWsent message title when data has been send RAWsent - + sendRAW finish message text when data has been send données envoyées - + Upload finish : pop-up when data has been sent Upload finit : - uploadDB - pop-up title when data has been sent - uploadDB - - - + Uisent pop-up title when buttons has been sent Envoyé - + sav finish savbuttons finish pop-up text when buttons has been sent boutons sauvegardés sur le serveur - + Enter the keyword : ask keyword to get buttons Entrez le mot-clé : - - getButtons - title to ask keyword fot getbuttons - getBoutons - - - + writeFile pop-up title when file has been written fichier - + File written : Fichier écrit : - - tmp URL - Title of box where ask for button tmp's URL - tmp URL - - - Enter URL - Label of box where ask for button tmp's URL - Entrez l'URL - diff --git a/mainwindow.cpp b/mainwindow.cpp index f91a650..36e754c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -52,13 +52,14 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) conf->setValue(QString("first"), 1); }; deb=0; + //currenttype=conf->value(QString("currenttype"), QString("buttons")).toString(); screen=new QWidget(this); screen->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); grid=new QGridLayout(screen); grid->setSizeConstraint(QLayout::SetMinAndMaxSize); signalmap=new QSignalMapper(this); - connect(signalmap, SIGNAL(mapped(const QString &)), this, SLOT(action(const QString &))); - connect(this, SIGNAL(datafilled()), this, SLOT(start())); + qDebug()<<"1' connect : "<addPermanentWidget(label); menuBar()->setVisible(conf->value(QString("menu")).toBool()); - start(); + //start(); } void MainWindow::start(){ way=conf->value(QString("start")).toStringList(); - if(!way.isEmpty())get(QString("buttons"), way.takeLast()); + if(!way.isEmpty())get(conf->value(QString("currenttype")).toString(), way.takeLast()); } MainWindow::~MainWindow() { @@ -238,7 +239,7 @@ void MainWindow::action(const QString &a){ }else{ return; } - get(QString("buttons"), way.takeLast()); + get(conf->value(QString("currenttype")).toString(), way.takeLast()); } else if(b[0]==QString("setfile")){ bool ok=0; @@ -294,7 +295,7 @@ void MainWindow::action(const QString &a){ QMessageBox::critical(this, trUtf8("Error","title if action(\"edit\") has too much value"), trUtf8("Too much value in button's action", "text if action(\"edit\") has too much value")); return; } - editDB(QString("buttons"),e); + editDB(conf->value(QString("currenttype")).toString(),e); } else if(b[0]==QString("but")){ @@ -362,8 +363,11 @@ void MainWindow::action(const QString &a){ else if(b[0]==QString("debug")){ debug(); } + else if(b[0]==QString("use")){ + use(c); + } else { - get(QString("buttons"),a); + get(conf->value(QString("currenttype")).toString(),a); } } @@ -387,7 +391,7 @@ void MainWindow::createMenuBar(){ HackMenu->addAction(trUtf8("New entry", "Hack|Entry"), this, SLOT(entry())); HackMenu->addAction(trUtf8("Action", "Hack|Action"), this, SLOT(action())); HackMenu->addAction(trUtf8("About Qt", "Hack|About Qt"), qApp, SLOT(aboutQt()), QKeySequence(trUtf8("ctrl+H", "Help|About Qt"))); - HackMenu->addAction(trUtf8("C&reate Database", "Hack|Create"), this, SLOT(createDB()), QKeySequence(trUtf8("Ctrl+R", "Help|CreateDB"))); + //HackMenu->addAction(trUtf8("C&reate Database", "Hack|Create"), this, SLOT(createDB()), QKeySequence(trUtf8("Ctrl+R", "Help|CreateDB"))); HackMenu->addAction(trUtf8("Download sql", "Hack|download sql"), this, SLOT(tmpdown())); menuBar()->addMenu(HackMenu); @@ -412,7 +416,9 @@ void MainWindow::flush(){ } CLabel::CLabel( const QString& text, const QSettings & set, QWidget * parent ) : QLabel(parent) { - m_style=set.value(QString("button")).toString(); + //m_style=set.value(QString("buttons")).toString(); + QString a=set.value(QString("currenttype")).toString(); + m_style=set.value(a).toString(); setText(text); setWordWrap(true); setLineWidth(5); @@ -425,14 +431,22 @@ CLabel::~CLabel() } void CLabel::mousePressEvent (QMouseEvent * event ) { + QString a=setting->value(QString("currenttype")).toString(); + QString bb=setting->value(a+QString("before")).toString(); + QString ba=setting->value(a+QString("after")).toString(); switch(event->button()){ - case Qt::LeftButton:setStyleSheet(m_style.replace(setting->value(QString("buttonbefore")).toString(), setting->value(QString("buttonafter")).toString()));emit pressed();break; + case Qt::LeftButton:setStyleSheet(m_style.replace(bb, ba));emit pressed();break; + //case Qt::LeftButton:setStyleSheet(m_style.replace(setting->value(setting->value(QString("currenttype")).toString()+"before").toString(), setting->value(QString("currenttype")).toString()+"after"));emit pressed();break; } } void CLabel::mouseReleaseEvent( QMouseEvent * event ) { + QString a=setting->value(QString("currenttype")).toString(); + QString bb=setting->value(a+QString("before")).toString(); + QString ba=setting->value(a+QString("after")).toString(); switch(event->button()){ - case Qt::LeftButton:setStyleSheet(m_style.replace(setting->value(QString("buttonafter")).toString(), setting->value(QString("buttonbefore")).toString()));emit released();break; + case Qt::LeftButton:setStyleSheet(m_style.replace(ba, bb));emit released();break; + //case Qt::LeftButton:setStyleSheet(m_style.replace(setting->value(setting->value(QString("currenttype")).toString()+"after").toString(), setting->value(QString("currenttype")).toString()+"before"));emit released();break; } } @@ -469,9 +483,9 @@ void MainWindow::firstrun(){ conf->setValue(QString("maxcolumn"), QVariant(2)); conf->setValue(QString("maxline"), QVariant(3)); conf->setValue(QString("SQLsettings"), QVariant("connect_timeout=10000")); - conf->setValue(QString("button"), QVariant("background-color: red;border-style: outset;border-width: 7px;border-radius: 10px;border-color: beige;font: bold 15px;padding: 6px;")); - conf->setValue(QString("buttonbefore"), QVariant("outset")); - conf->setValue(QString("buttonafter"), QVariant("inset")); + conf->setValue(QString("buttons"), QVariant("background-color: red;border-style: outset;border-width: 7px;border-radius: 10px;border-color: beige;font: bold 15px;padding: 6px;")); + conf->setValue(QString("buttonsbefore"), QVariant("background-color: red;")); + conf->setValue(QString("buttonsafter"), QVariant("background-color: blue;")); conf->setValue(QString("menu"), QVariant(0)); conf->setValue(QString("download"), QVariant("http://www.nothing2do.eu/"+conf->value(QString("filebuttons")).toString())); conf->setValue(QString("init"), QVariant("http://www.nothing2do.eu/init")); @@ -482,17 +496,18 @@ void MainWindow::firstrun(){ conf->setValue(QString("restore"), QVariant("http://www.abc.de/db")); conf->setValue(QString("db"), QVariant("/data/data/eu.nothing2do.diarymobile/files/db")); conf->setValue(QString("selectbuttons"), QVariant("select keyword,label,action from ui order by label;")); - conf->setValue(QString("sqlbuttons"), QVariant("INSERT INTO ui (keyword,label,action) VALUES(?,?,?);")); + conf->setValue(QString("sqlbuttons"), QVariant("INSERT INTO buttons (keyword,label,action) VALUES(?,?,?);")); conf->setValue(QString("selectraw"), QVariant("select date,texte from raw order by date;")); conf->setValue(QString("menuback"), QVariant("-menuback")); - conf->setValue(QString("choosebuttons"), QVariant("select id,label from ui where keyword like ? order by label;")); - conf->setValue(QString("addbuttons"), QVariant("insert into ui (keyword, label, action) values (:keyword, :label, :action)")); - conf->setValue(QString("getbuttons"), QVariant("select label,action from ui where keyword like ? order by label;")); - conf->setValue(QString("editbuttons"), QVariant("select id,keyword,label,action from ui where id=?;")); - conf->setValue(QString("updatebuttons"), QVariant("update ui set keyword=?, label=?, action=? where id=?;")); - conf->setValue(QString("deletebuttons"), QVariant("delete from ui where id=?")); - conf->setValue(QString("testbuttons"), QVariant("select id,keyword from ui where label=? and action=?;")); - conf->setValue(QString("changekeyword"), QVariant("select keyword,label,action,id from ui where keyword like ?;")); + conf->setValue(QString("choosebuttons"), QVariant("select id,label from buttons where keyword like ? order by label;")); + conf->setValue(QString("addbuttons"), QVariant("insert into buttons (keyword, label, action) values (:keyword, :label, :action)")); + conf->setValue(QString("addraw"), QVariant("INSERT INTO raw (date, texte) VALUES (:date, :txt);")); + conf->setValue(QString("getbuttons"), QVariant("select label,action from buttons where keyword like ? order by label;")); + conf->setValue(QString("editbuttons"), QVariant("select id,keyword,label,action from buttons where id=?;")); + conf->setValue(QString("updatebuttons"), QVariant("update buttons set keyword=?, label=?, action=? where id=?;")); + conf->setValue(QString("deletebuttons"), QVariant("delete from buttons where id=?")); + conf->setValue(QString("testbuttons"), QVariant("select id,keyword from buttons where label=? and action=?;")); + conf->setValue(QString("changekeyword"), QVariant("select keyword,label,action,id from buttons where keyword like ?;")); conf->setValue(QString("volumdown"), QVariant("back")); conf->setValue(QString("volumup"), QVariant("begin")); conf->setValue(QString("askkeyword"), QVariant(0)); @@ -503,6 +518,7 @@ void MainWindow::firstrun(){ conf->setValue(QString("sepcolbuttons"), QVariant("$")); conf->setValue(QString("sqlval"), QVariant("?")); conf->setValue(QString("always"), QVariant("+always")); + conf->setValue(QString("currenttype"), QVariant("buttons")); qDebug()<<"firstrun() finished"; } QString MainWindow::get(int column){ @@ -557,7 +573,7 @@ void MainWindow::entry(const QString &a){ QString c; if(a=="")c=context+" : "+entry; else c=context+", "+a+" : "+entry; - QList d({"INSERT INTO raw (date, texte) VALUES (:date, :txt);", time, c}); + QList d({conf->value(QString("addraw")).toString(), time, c}); if(!exec(d))qDebug()<<"exec don't works (entry(QString))"; QSqlError b=q->lastError(); if (b.isValid())qDebug()<<"q->lastError():"<({"create table ui(id INTEGER PRIMARY KEY AUTOINCREMENT, keyword text, label text, action text);"})); exec(QList({"create table raw(id INTEGER PRIMARY KEY AUTOINCREMENT, date timestamp, texte text);"})); -} +}*/ void MainWindow::addDB(const QString & tmp){ - qDebug()<<"addDB()"; + if(deb)QMessageBox::information(this, trUtf8("addDB", "box title to debug addDB"), "type : "+tmp); bool ok=0; QString cur=label->text(); - QString a, b, c=QInputDialog::getText(this, trUtf8("label", "Title of box where ask for new button's label"), trUtf8("Enter his label", "his/her/?they? I've forget my school lesson"), QLineEdit::Normal, QString(""), &ok); + QString a, b, c=QInputDialog::getText(this, trUtf8("label", "Title of box where ask for new label"), trUtf8("Enter his label", "his/her/?they? I've forget my school lesson"), QLineEdit::Normal, QString(""), &ok); if ((c=="")||(ok==0))return; - b=QInputDialog::getText(this, trUtf8("keyword", "Title of box where ask for new button's keyword"), trUtf8("Enter they keyword (no limit !)"), QLineEdit::Normal, cur, &ok); + b=QInputDialog::getText(this, trUtf8("keyword", "Title of box where ask for new keyword"), trUtf8("Enter they keyword (no limit !)"), QLineEdit::Normal, cur, &ok); if ((b=="")||(ok==0))return; - a=QInputDialog::getText(this, trUtf8("action", "Title of box where ask for new button's action"), trUtf8("Enter his action"), QLineEdit::Normal, c, &ok); + a=QInputDialog::getText(this, trUtf8("action", "Title of box where ask for new action"), trUtf8("Enter his action"), QLineEdit::Normal, c, &ok); if ((a=="")||(ok==0))return; insert(tmp, b, c, a); return; } void MainWindow::get(const QString & d, const QString &b){ + if(deb)QMessageBox::information(this, trUtf8("action", "box title to debug get"), "type:"+d+" keyword:"+b); QString a=b;lastprint=b; if((b[0]!='-')&&(b[0]!='+'))way.append(a); else a.remove(0, 1); qDebug()<<"get"< tmp({conf->value(QString("get")+d).toString(), c}); + QString c="%"+a+"%", x=conf->value(QString("get")+d).toString(); + qDebug()<<"x="< tmp({x, c}); label->setText(a); exec(tmp); int labCol = 0;//r.indexOf("label"); @@ -609,7 +624,6 @@ void MainWindow::get(const QString & d, const QString &b){ grid->update(); //scroll->updateGeometry(); screen->updateGeometry(); - qDebug()<<"end getButtons : "<value(QString("edit")+a).toString(); - qDebug()<<"a="<({tmp, b})); if(q->isSelect())q->first(); bool ok; @@ -665,7 +681,7 @@ void MainWindow::downloadData(){ connect(m, SIGNAL(downloaded()), SLOT(writeData())); } void MainWindow::writeData(){ - read(QString("buttons"), m->downloadedData()); + read(conf->value(QString("currenttype")).toString(), m->downloadedData()); m->deleteLater(); conf->setValue(QString("lastdownload"), QDateTime::currentDateTime().toString(Qt::ISODate)); } @@ -677,7 +693,7 @@ void MainWindow::sendRAW(){ QTextStream b(&a); //int c=conf->value(QString("columnraw")).toInt()-1; int c=q->record().count()-1; - QString sep=conf->value(QString("sepraw")).toString(); + QString sep=conf->value(QString("sepcolraw")).toString(); while (q->next()) { for (int i=0; ivalue(i).toString()<value(QString("menuback")).toString()); + get(conf->value(QString("currenttype")).toString(),conf->value(QString("menuback")).toString()); }else if(QString("-")+label->text()==conf->value(QString("menuback")).toString())get(QString("buttons"),way.takeLast()); else{ - get(QString("buttons"), QString("+video")); + get(conf->value(QString("currenttype")).toString(), QString("+video")); } } void MainWindow::keyReleaseEvent(QKeyEvent *event) @@ -841,11 +857,11 @@ void MainWindow::Uisent(){ qDebug()<<"Uisent"; QMessageBox::information(this, trUtf8("Uisent", "pop-up title when buttons has been sent"), trUtf8("sav finish", "pop-up text when buttons has been sent")); } -void MainWindow::reset(const QString & a){ - exec(QList({"delete from "+a+";"})); +void MainWindow::resetRAW(){ + exec(QList({"delete from raw;"})); } void MainWindow::get(const QString & a){ - const QString b=QInputDialog::getText(this, trUtf8("getButtons", "title to ask keyword fot getbuttons"), trUtf8("Enter the keyword : ", "ask keyword to get buttons")); + const QString b=QInputDialog::getText(this, trUtf8("get", "title to ask keyword fot get"), trUtf8("Enter the keyword : ", "ask keyword to get buttons")); get(a, b); } void MainWindow::insert(const QString & a, const QString & keyword, const QString & label, const QString & action){ @@ -886,7 +902,8 @@ void MainWindow::remove(const QString & a, const QString & keyword, const QStrin key=key+" "+cur; } qDebug()<<"key="<({conf->value(QString("delete")+a).toString(), id.toString()})); else{ @@ -987,13 +1004,10 @@ void MainWindow::mass(const QString & type, const QString & column, const QStrin get(type, lastprint); } void MainWindow::addDB(){ - addDB(QString("buttons")); + addDB(conf->value(QString("currenttype")).toString()); } void MainWindow::savData(){ - sav(QString("buttons")); -} -void MainWindow::reset(){ - reset(QString("ui")); + sav(conf->value(QString("currenttype")).toString()); } QSettings & MainWindow::getSettings(){ return *conf; @@ -1015,7 +1029,22 @@ void MainWindow::readSQL(){ emit datafilled(); } void MainWindow::debug(){ - //deb=-deb; if(deb)deb=0; else deb=1; } +void MainWindow::reset(const QString & a){ + QList b({"delete from "+a+";"}); + exec(b); +} +void MainWindow::use(const QString & a){ + bool ok; + QString use=QInputDialog::getText(this, trUtf8("tmp URL", "Title of box where ask for current type"), trUtf8("Enter string", "Label of box where ask for current type"), QLineEdit::Normal, a, &ok); + if(!ok){ + //currenttype=use; + conf->setValue(QString("currenttype"), use); + } +} +void MainWindow::reset(){ + QList b({"delete from buttons;"}); + exec(b); +} diff --git a/mainwindow.h b/mainwindow.h index d2c95e9..970ab4c 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -148,6 +148,7 @@ private slots: void quit(); void reset(const QString &); void reset(); + void resetRAW(); void action(const QString &); void action(); void createMenuBar(); @@ -161,7 +162,7 @@ private slots: int exec2(const QList &); void entry(const QString &); void entry(); - void createDB(); + //void createDB(); void addDB(const QString &); void addDB(); void writeDB(); @@ -186,6 +187,7 @@ private slots: void downloadDB(); void download(const QString &); void download(const QString &,const QString &); + void use(const QString &); public slots: signals: @@ -202,7 +204,7 @@ private: QGridLayout *grid; QLabel *label; QSettings *conf; - QString tmp, tmp2, file, lastprint;//host, user, tmp, password, servercert,database; + QString tmp, tmp2, file, lastprint, currenttype;//host, user, tmp, password, servercert,database; QMenu *FileMenu, *EditMenu, *HackMenu; QSignalMapper *signalmap; QList way; -- 2.45.1