if((conf->value(QString("first")).toInt()==1)){
qDebug()<<"second";
bool ok;
- QString ser=QInputDialog::getText(this, trUtf8("init file"), trUtf8("Enter the URL to download the init file"), QLineEdit::Normal, conf->value(QString("init")).toString(), &ok);
+ QString ser=QInputDialog::getText(this, tr("init file"), tr("Enter the URL to download the init file"), QLineEdit::Normal, conf->value(QString("init")).toString(), &ok);
conf->setValue(QString("init"), ser);
downSQL(ser);
conf->setValue(QString("first"), 2);
db.close();
qApp->quit();
}
-int unsigned MainWindow::addWidget(const QString &key, const CLabel *a){
+int unsigned MainWindow::addWidget(QString &key, CLabel *a){
qDebug()<<"addWidget("<<a->text()<<", "<<key<<")";
- if(key.contains(QString("idem"))){
- key.replace(QString("idem"), a->text());
+ const QString mark="idem";
+ if(key.contains(mark)){
+ key.replace(mark, a->text(), Qt::CaseSensitive);
}
int c=grid->count(), maxc=conf->value(QString("maxcolumn")).toInt(), maxl=conf->value(QString("maxline")).toInt();
grid->addWidget(a, c/maxc, c%maxc, 1, 1, Qt::AlignJustify| Qt::AlignVCenter | Qt::AlignHCenter);
}
void MainWindow::action(const QString &a){
qDebug()<<"action("<<a<<")";
- if(deb)QMessageBox::information(this, trUtf8("action", "box title to debug action"), a);
+ if(deb)QMessageBox::information(this, tr("action", "box title to debug action"), a);
QString aa=a;
bool ok=1;
if(aa.right(1)!=QString("#")){
if(aa.contains(b.key())){//key.replace(b.key(), b.value());
QString abefore=aa;
aa.replace(b.key(), b.value());
- if(deb)QMessageBox::information(this, trUtf8("valeur replace", "box title to debug valeur replace"), QString(abefore+"=>"+aa));
+ if(deb)QMessageBox::information(this, tr("valeur replace", "box title to debug valeur replace"), QString(abefore+"=>"+aa));
}
}}else{
aa.chop(1);
QString c=aa;
QStringList b=aa.split(QString(" "));
c.remove(0,4);
- if(deb)QMessageBox::information(this, trUtf8("action after replace", "box title to debug action"), aa);
+ if(deb)QMessageBox::information(this, tr("action after replace", "box title to debug action"), aa);
int bs=b.size(), part=aa.count(conf->value(QString("sepcmd")).toString());
if(part){
for(int d=0; d<=part; d++){
QString d, e;
bool ok;
if(bs==1){
- d=QInputDialog::getText(this, "set", trUtf8("Variable's name ?", "text to ask value's name before changing it (set)"), QLineEdit::Normal, QString(""), &ok);
+ d=QInputDialog::getText(this, "set", tr("Variable's name ?", "text to ask value's name before changing it (set)"), QLineEdit::Normal, QString(""), &ok);
if(!ok)return;
e=QInputDialog::getText(this, "set", d, QLineEdit::Normal, conf->value(d).toString(), &ok);
if(!ok)return;
d=b[1];
e=b[2];
}else{
- QMessageBox::critical(this, trUtf8("Error","title if action(\"set\") has too much value"), trUtf8("Too much value in button's action", "text if action(\"set\") has too much value"));
+ QMessageBox::critical(this, tr("Error","title if action(\"set\") has too much value"), tr("Too much value in button's action", "text if action(\"set\") has too much value"));
return;
}
//QString z=d+" will be changed to "+e;
- if(conf->value(QString("saychange")).toBool()||deb)QMessageBox::information(this, trUtf8("variable text change", "title to warn about variable content change"), trUtf8("value of "+d.toLocal8Bit()+" changed to "+e.toLocal8Bit(), "text to warn about variable content change"));
+ if(conf->value(QString("saychange")).toBool()||deb)QMessageBox::information(this, tr("variable text change", "title to warn about variable content change"), tr("value of "+d.toLocal8Bit()+" changed to "+e.toLocal8Bit(), "text to warn about variable content change"));
conf->setValue(d, e);
}
else if(b[0]==QString("setint")){
int e;
QString d;
if(bs==1){
- d=QInputDialog::getText(this, "setInt", trUtf8("Variable's name ?", "text to ask value's name before changing it (setint)"), QLineEdit::Normal, QString(""), &ok);
+ d=QInputDialog::getText(this, "setInt", tr("Variable's name ?", "text to ask value's name before changing it (setint)"), QLineEdit::Normal, QString(""), &ok);
if(!ok)return;
e=QInputDialog::getInt(this, "setInt", d, QLineEdit::Normal, conf->value(d).toInt(), &ok);
if(!ok)return;
d=b[1];
e=b[2].toInt();
}else{
- QMessageBox::critical(this, trUtf8("Error","title if action(\"set\") has too much value"), trUtf8("Too much value in button's action", "text if action(\"set\") has too much value"));
+ QMessageBox::critical(this, tr("Error","title if action(\"set\") has too much value"), tr("Too much value in button's action", "text if action(\"set\") has too much value"));
return;
}
//QString z=d+" will be changed to "+e;
- if(conf->value(QString("saychange")).toBool())QMessageBox::information(this, trUtf8("variable integer change", "title to warn about variable content change"), trUtf8("Value of "+d.toLocal8Bit()+" changed", "text to warn about variable content change"));
+ if(conf->value(QString("saychange")).toBool())QMessageBox::information(this, tr("variable integer change", "title to warn about variable content change"), tr("Value of "+d.toLocal8Bit()+" changed", "text to warn about variable content change"));
conf->setValue(d, e);
}
else if(b[0]==QString("start")){
int max=conf->value(QString("maxcolumn")).toInt()*conf->value(QString("maxline")).toInt();
if(!page)tmp=q->seek(0);
else tmp=q->seek(page*(max-2));
- if(deb)QMessageBox::information(this, trUtf8("result", "box title to debug prevpage"), int(tmp));
+ if(deb)QMessageBox::information(this, tr("result", "box title to debug prevpage"), int(tmp));
printItem(*q);
}
bool ok=0;
QString d, e;
if(bs==1){
- d=QInputDialog::getText(this, "setFile", trUtf8("Variable's name ?", "text to ask value's name before changing it (setint)") , QLineEdit::Normal, QString(""), &ok);
+ d=QInputDialog::getText(this, "setFile", tr("Variable's name ?", "text to ask value's name before changing it (setint)") , QLineEdit::Normal, QString(""), &ok);
if(!ok)return;
- e=QFileDialog::getSaveFileName(this, trUtf8("get file", "title to ask file"), conf->value(d).toString());
+ e=QFileDialog::getSaveFileName(this, tr("get file", "title to ask file"), conf->value(d).toString());
}else if(bs==2){
d=b[1];
- e=QFileDialog::getSaveFileName(this, trUtf8("get file", "title to ask file"), conf->value(d).toString());
+ e=QFileDialog::getSaveFileName(this, tr("get file", "title to ask file"), conf->value(d).toString());
}else if(bs==3){
d=b[1];
e=b[2];
}
- if(conf->value(QString("saychange")).toBool())QMessageBox::information(this, trUtf8("variable file change", "title to warn about variable content change"), trUtf8("value of "+d.toLocal8Bit()+" has been changed to "+e.toLocal8Bit(), "text to warn about variable content change"));
+ if(conf->value(QString("saychange")).toBool())QMessageBox::information(this, tr("variable file change", "title to warn about variable content change"), tr("value of "+d.toLocal8Bit()+" has been changed to "+e.toLocal8Bit(), "text to warn about variable content change"));
conf->setValue(d, e);
}
else if(b[0]==QString("box")){
- QMessageBox::information(this, trUtf8("box", "box title to show a text"), c);
+ QMessageBox::information(this, tr("box", "box title to show a text"), c);
}
else if(b[0]==QString("quit")){
//if (value){
for(int d=1; d<=value; d++){
bool ok;
- QString e=QInputDialog::getText(this, trUtf8("set"), c+" : "+d, QLineEdit::Normal, QString(""), &ok);
+ QString e=QInputDialog::getText(this, tr("set"), c+" : "+d, QLineEdit::Normal, QString(""), &ok);
if(ok)cmd.append(e);
else break;// in case of break, exec complain about cmd size
}
//bool ok;
action(beforekey);
if(bs==1){
- /*e=QInputDialog::getText(this, QString("ID"), trUtf8("Enter ID of button to edit"), QLineEdit::Normal, QString(""), &ok);
+ /*e=QInputDialog::getText(this, QString("ID"), tr("Enter ID of button to edit"), QLineEdit::Normal, QString(""), &ok);
if(!ok)return;*/
chooseDB();
}
editDB(conf->value(QString("currenttype")).toString(),b[1]);
}
else{
- 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"));
+ QMessageBox::critical(this, tr("Error","title if action(\"edit\") has too much value"), tr("Too much value in button's action", "text if action(\"edit\") has too much value"));
return;
}
//editDB(conf->value(QString("currenttype")).toString(),e);
bool ok;
int bs=b.size();
if(bs==1){
- a=QInputDialog::getText(this, trUtf8("URL", "title to download a custom file from URL"), trUtf8("Enter the URL of the file", "label to download a custom file"), QLineEdit::Normal, QString(""), &ok);
+ a=QInputDialog::getText(this, tr("URL", "title to download a custom file from URL"), tr("Enter the URL of the file", "label to download a custom file"), QLineEdit::Normal, QString(""), &ok);
if(!ok)return;
- aa=QInputDialog::getText(this, trUtf8("File", "title to write a file downloaded from URL"), trUtf8("Enter the name of the file", "label to write the downloaded data"), QLineEdit::Normal, QString(""), &ok);
+ aa=QInputDialog::getText(this, tr("File", "title to write a file downloaded from URL"), tr("Enter the name of the file", "label to write the downloaded data"), QLineEdit::Normal, QString(""), &ok);
if(!ok)return;
}else if(bs==2){
a=b[1];
- aa=QInputDialog::getText(this, trUtf8("File", "title to write a file downloaded from URL"), trUtf8("Enter the name of the file", "label to write the downloaded data"), QLineEdit::Normal, QString(""), &ok);
+ aa=QInputDialog::getText(this, tr("File", "title to write a file downloaded from URL"), tr("Enter the name of the file", "label to write the downloaded data"), QLineEdit::Normal, QString(""), &ok);
if(!ok)return;
}else if(bs==3){
a=b[1];
a.open(QIODevice::ReadOnly);
read(conf->value(QString("currenttype")).toString(),a.readAll());
}else{
- QMessageBox::warning(this, trUtf8("Error", "title of box if action(\"read\" has too much (or too \"less\") value"), trUtf8("Bad number of value", "text of box if action(\"read\") has too much (or too \"less\") value"));
+ QMessageBox::warning(this, tr("Error", "title of box if action(\"read\" has too much (or too \"less\") value"), tr("Bad number of value", "text of box if action(\"read\") has too much (or too \"less\") value"));
}
}
else if(b[0]==QString("mass")){
}
void MainWindow::createMenuBar(){
qDebug()<<"createMenuBar()";
- FileMenu=new QMenu(trUtf8("&File", "top menu"), this);
- FileMenu->addAction(trUtf8("&Start", "File|Start"), this, SLOT(start()),QKeySequence(trUtf8("Ctrl+S", "File|Start")));
- FileMenu->addAction(trUtf8("&Back", "File|Back"), this, SLOT(back()),QKeySequence(trUtf8("Ctrl+B", "File|Back")));
- FileMenu->addAction(trUtf8("&View/Hide menu", "File|View/Hide menu"), this, SLOT(toggleMenu()), QKeySequence(trUtf8("Ctrl+T", "File|View menu")));
- FileMenu->addAction(trUtf8("sendRAW", "File|SendRAW"), this, SLOT(sendRAW()), QKeySequence(trUtf8("Ctrl+L", "File|Upload")));
- FileMenu->addAction(trUtf8("Reset RAW", "File|resetRAW"), this, SLOT(resetRAW()), QKeySequence(trUtf8("Ctrl+E", "File|Reset")));
- FileMenu->addAction(trUtf8("&Quit", "File|Quit"), this, SLOT(quit()),QKeySequence(trUtf8("Ctrl+Q", "File|Quit")));
+ FileMenu=new QMenu(tr("&File", "top menu"), this);
+ FileMenu->addAction(tr("&Start", "File|Start"), this, SLOT(start()),QKeySequence(tr("Ctrl+S", "File|Start")));
+ FileMenu->addAction(tr("&Back", "File|Back"), this, SLOT(back()),QKeySequence(tr("Ctrl+B", "File|Back")));
+ FileMenu->addAction(tr("&View/Hide menu", "File|View/Hide menu"), this, SLOT(toggleMenu()), QKeySequence(tr("Ctrl+T", "File|View menu")));
+ FileMenu->addAction(tr("sendRAW", "File|SendRAW"), this, SLOT(sendRAW()), QKeySequence(tr("Ctrl+L", "File|Upload")));
+ FileMenu->addAction(tr("Reset RAW", "File|resetRAW"), this, SLOT(resetRAW()), QKeySequence(tr("Ctrl+E", "File|Reset")));
+ FileMenu->addAction(tr("&Quit", "File|Quit"), this, SLOT(quit()),QKeySequence(tr("Ctrl+Q", "File|Quit")));
menuBar()->addMenu(FileMenu);
- EditMenu=new QMenu(trUtf8("&Button", "top menu"));
- EditMenu->addAction(trUtf8("&Download", "Button|Downlad"), this, SLOT(downloadData()),QKeySequence(trUtf8("Ctrl+W", "Button|Downlad")));
- EditMenu->addAction(trUtf8("A&dd", "Button|Add"), this, SLOT(addDB()), QKeySequence(trUtf8("Ctrl+D", "Button|Add")));
- EditMenu->addAction(trUtf8("Sa&v", "Button|Sav"), this, SLOT(savData()), QKeySequence(trUtf8("Ctrl+V", "Button|Save")));
- //EditMenu->addAction(trUtf8("Reset", "Button|Reset"), this, SLOT(reset()), QKeySequence(trUtf8("Ctrl+Z", "Button|Reset")));
- EditMenu->addAction(trUtf8("&Edit", "Button|Edit"), this, SLOT(chooseDB()), QKeySequence(trUtf8("Ctrl+E", "Button|&Edit")));
+ EditMenu=new QMenu(tr("&Button", "top menu"));
+ EditMenu->addAction(tr("&Download", "Button|Downlad"), this, SLOT(downloadData()),QKeySequence(tr("Ctrl+W", "Button|Downlad")));
+ EditMenu->addAction(tr("A&dd", "Button|Add"), this, SLOT(addDB()), QKeySequence(tr("Ctrl+D", "Button|Add")));
+ EditMenu->addAction(tr("Sa&v", "Button|Sav"), this, SLOT(savData()), QKeySequence(tr("Ctrl+V", "Button|Save")));
+ //EditMenu->addAction(tr("Reset", "Button|Reset"), this, SLOT(reset()), QKeySequence(tr("Ctrl+Z", "Button|Reset")));
+ EditMenu->addAction(tr("&Edit", "Button|Edit"), this, SLOT(chooseDB()), QKeySequence(tr("Ctrl+E", "Button|&Edit")));
menuBar()->addMenu(EditMenu);
- HackMenu=new QMenu(trUtf8("&Hack", "top menu"));
- 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("Download sql", "Hack|download sql"), this, SLOT(tmpdown()));
+ HackMenu=new QMenu(tr("&Hack", "top menu"));
+ HackMenu->addAction(tr("New entry", "Hack|Entry"), this, SLOT(entry()));
+ HackMenu->addAction(tr("Action", "Hack|Action"), this, SLOT(action()));
+ HackMenu->addAction(tr("About Qt", "Hack|About Qt"), qApp, SLOT(aboutQt()), QKeySequence(tr("ctrl+H", "Help|About Qt")));
+ //HackMenu->addAction(tr("C&reate Database", "Hack|Create"), this, SLOT(createDB()), QKeySequence(tr("Ctrl+R", "Help|CreateDB")));
+ HackMenu->addAction(tr("Download sql", "Hack|download sql"), this, SLOT(tmpdown()));
menuBar()->addMenu(HackMenu);
menuBar()->show();
}
}
//widget.clear();
}
-CLabel::CLabel( const QString& text, const QSettings & set, int tmpid, QWidget * parent ) : QLabel(parent)
+CLabel::CLabel( const QString& text, QSettings & set, int tmpid, QWidget * parent ) : QLabel(parent)
{
QString a=set.value(QString("currenttype")).toString();
m_style=set.value(a).toString();
QString a=settings->value(QString("currenttype")).toString();
QString bb=settings->value(a+QString("before")).toString();
QString ba=settings->value(a+QString("after")).toString();
- QString tmp("edit "+id);
+ QString tmp("edit "+QString::number(id));
switch(event->button()){
case Qt::LeftButton:
setStyleSheet(m_style.replace(ba, bb));
else if((a=="")&&(conf->value(QString("onlylast")).toBool()))label=way.last()+" : ";
else if((a!="")&&(!conf->value(QString("onlylast")).toBool()))label=context+",\n"+ a +" : ";
else label=way.last()+", "+a+" :\n ";
- if(conf->value(QString("multiline")).toBool())entry=QInputDialog::getMultiLineText(this, trUtf8("New entry"), label, QString(""), &ok);
- else entry=QInputDialog::getText(this, trUtf8("New entry"), label, QLineEdit::Normal, "", &ok);
+ if(conf->value(QString("multiline")).toBool())entry=QInputDialog::getMultiLineText(this, tr("New entry"), label, QString(""), &ok);
+ else entry=QInputDialog::getText(this, tr("New entry"), label, QLineEdit::Normal, "", &ok);
if(!ok)return;
QString c;
}
void MainWindow::addDB(const QString & tmp, const QString & cur){
qDebug()<<"addDB : tmp="<<tmp<<" cur="<<cur;
- if(deb)QMessageBox::information(this, trUtf8("addDB", "box title to debug addDB"), "type : "+tmp);
+ if(deb)QMessageBox::information(this, tr("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 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, tr("label", "Title of box where ask for new label"), tr("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 keyword"), trUtf8("Enter they keyword (no limit !)"), QLineEdit::Normal, *&cur, &ok);
+ b=QInputDialog::getText(this, tr("keyword", "Title of box where ask for new keyword"), tr("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 action"), trUtf8("Enter his action"), QLineEdit::Normal, QString("new idem"), &ok);
+ a=QInputDialog::getText(this, tr("action", "Title of box where ask for new action"), tr("Enter his action"), QLineEdit::Normal, QString("new idem"), &ok);
if ((a=="")||(ok==0))return;
QString tmpfile;
if(a.contains(QString("!file!"))){
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);
+ if(deb)QMessageBox::information(this, tr("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);
void MainWindow::chooseDB(){
QString b;
bool ok=1;
- if(conf->value("askkeyword").toBool())b=QInputDialog::getText(this, trUtf8("chooseDB"), trUtf8("Enter the keyword : "), QLineEdit::Normal, label->text(), &ok);
+ if(conf->value("askkeyword").toBool())b=QInputDialog::getText(this, tr("chooseDB"), tr("Enter the keyword : "), QLineEdit::Normal, label->text(), &ok);
else b=label->text();
if(ok)chooseDB(conf->value(QString("currenttype")).toString(), b);
void MainWindow::editDB(const QString & a, const QString & b){
QString tmp=conf->value(QString("edit")+a).toString(), txt="type="+a+" id="+b;;
- if(deb)QMessageBox::information(this, trUtf8("EditDB", "box title to debug editDB"), txt);
+ if(deb)QMessageBox::information(this, tr("EditDB", "box title to debug editDB"), txt);
exec(QList<QString>({tmp, b}));
if(q->isSelect())q->first();
QString label=q->value(2).toString();
QString action=q->value(3).toString();
QString tmpkeyword, tmplabel, tmpaction;
- if(conf->value(QString("multiline")).toBool())tmpkeyword=QInputDialog::getMultiLineText(this, trUtf8("keyword", "Title of box where ask for button's keyword"), trUtf8("new keyword", "question to get new button's keyword"), keyword, &ok);
- else tmpkeyword=QInputDialog::getText(this, trUtf8("keyword", "Title of box where ask for button's keyword"), trUtf8("new keyword", "question to get new button's keyword"), QLineEdit::Normal, keyword, &ok);
+ if(conf->value(QString("multiline")).toBool())tmpkeyword=QInputDialog::getMultiLineText(this, tr("keyword", "Title of box where ask for button's keyword"), tr("new keyword", "question to get new button's keyword"), keyword, &ok);
+ else tmpkeyword=QInputDialog::getText(this, tr("keyword", "Title of box where ask for button's keyword"), tr("new keyword", "question to get new button's keyword"), QLineEdit::Normal, keyword, &ok);
if(!ok)return;
- if(conf->value(QString("multiline")).toBool())tmplabel=QInputDialog::getMultiLineText(this, trUtf8("label", "Title of box where ask for button's label"), trUtf8("new label", "question to get new button's label"), label, &ok);
- else tmplabel=QInputDialog::getText(this, trUtf8("label", "Title of box where ask for button's label"), trUtf8("new label", "question to get new button's label"), QLineEdit::Normal, label, &ok);
+ if(conf->value(QString("multiline")).toBool())tmplabel=QInputDialog::getMultiLineText(this, tr("label", "Title of box where ask for button's label"), tr("new label", "question to get new button's label"), label, &ok);
+ else tmplabel=QInputDialog::getText(this, tr("label", "Title of box where ask for button's label"), tr("new label", "question to get new button's label"), QLineEdit::Normal, label, &ok);
if(!ok)return;
- if(conf->value(QString("multiline")).toBool())tmpaction=QInputDialog::getMultiLineText(this, trUtf8("action", "Title of box where ask for button's action"), trUtf8("new action", "question to get new button's action"), action, &ok);
- else tmpaction=QInputDialog::getText(this, trUtf8("action", "Title of box where ask for button's action"), trUtf8("new action", "question to get new button's action"), QLineEdit::Normal, action, &ok);
+ if(conf->value(QString("multiline")).toBool())tmpaction=QInputDialog::getMultiLineText(this, tr("action", "Title of box where ask for button's action"), tr("new action", "question to get new button's action"), action, &ok);
+ else tmpaction=QInputDialog::getText(this, tr("action", "Title of box where ask for button's action"), tr("new action", "question to get new button's action"), QLineEdit::Normal, action, &ok);
if(!ok)return;
QString tmpfile;
if(tmpaction.contains(QString("!file!"))){
if((tmpkeyword=="")||(tmplabel=="")||(tmpaction=="")){
remove(a, keyword, label, action);
- if(deb)QMessageBox::information(this, trUtf8("EditDB", "title of box to say a button was deleted"), trUtf8("button was deleted", "text to say button was deleted"));
+ if(deb)QMessageBox::information(this, tr("EditDB", "title of box to say a button was deleted"), tr("button was deleted", "text to say button was deleted"));
return;
}
- if(deb)QMessageBox::information(this, trUtf8("EditDB", "title to print new value of button"), QString("keyword="+tmpkeyword+", label="+tmplabel+", action="+tmpaction));
+ if(deb)QMessageBox::information(this, tr("EditDB", "title to print new value of button"), QString("keyword="+tmpkeyword+", label="+tmplabel+", action="+tmpaction));
exec(QList<QString>({conf->value(QString("update")+a).toString(), tmpkeyword, tmplabel, tmpaction, b}));
}
}
void MainWindow::RAWsent(){
qDebug()<<"RAWsent";
- QMessageBox::information(this, trUtf8("RAWsent", "message title when data has been send"), trUtf8("sendRAW finish", "message text when data has been send"));
+ QMessageBox::information(this, tr("RAWsent", "message title when data has been send"), tr("sendRAW finish", "message text when data has been send"));
}
void MainWindow::back(){
if(QString("-")+label->text()!=conf->value(QString("menuback")).toString()){
QString tmp;
tmp.setNum(k);
qDebug()<<"key released="<<k;
- if(deb)QMessageBox::information(this, trUtf8("key released", "box title to debug keyReleaseEvent"), "key : "+tmp);
+ if(deb)QMessageBox::information(this, tr("key released", "box title to debug keyReleaseEvent"), "key : "+tmp);
if (k==Qt::Key_Menu){
const QString a=conf->value(QString("actionmenu"), QString("")).toString();
- if(a=="")accepted++;
+ if((a=="")&&(accepted))accepted=0;
+ if((a=="")&&(!accepted))accepted=1;
if(a!=lastprint){
beforekey=label->text();
action(a);
};
}else if(k==Qt::Key_Back){
const QString a=conf->value(QString("menuback"), QString("")).toString();
- if(a=="")accepted++;
+ if((a=="")&&(accepted))accepted=0;
+ if((a=="")&&(!accepted))accepted=1;
if(a!=lastprint){
beforekey=label->text();
action(a);
}else if(k==Qt::Key_VolumeDown){
qDebug()<<"keyvolumdown";
const QString a=conf->value(QString("volumdown"), QString("")).toString();
- if(a=="")accepted++;
+ if((a=="")&&(accepted))accepted=0;
+ if((a=="")&&(!accepted))accepted=1;
if(a!=lastprint){
beforekey=lastprint;
action(a);
};
}else if(k==Qt::Key_VolumeUp){
const QString a=conf->value(QString("volumup"), QString("")).toString();
- if(a=="")accepted++;
+ if((a=="")&&(accepted))accepted=0;
+ if((a=="")&&(!accepted))accepted=1;
if(a!=lastprint){
beforekey=lastprint;
action(a);
}
void MainWindow::datasent(){
qDebug()<<"datasent";
- QString texte=trUtf8("Upload finish : ", "pop-up when data has been sent");
+ QString texte=tr("Upload finish : ", "pop-up when data has been sent");
texte=texte+conf->value(QString("uploadDB")).toString();
qDebug()<<"texte : "<<texte;
- QMessageBox::information(this, trUtf8("upload", "pop-up title when data has been sent"), texte);
+ QMessageBox::information(this, tr("upload", "pop-up title when data has been sent"), texte);
}
void MainWindow::downloadDB(){
qDebug()<<"restoreDB() : "<<conf->value(QString("restore")).toString();
void MainWindow::Uisent(){
qDebug()<<"Uisent";
Msav.unlock();
- QMessageBox::information(this, trUtf8("Uisent", "pop-up title when data has been sent"), trUtf8(QString("sav finish of "+savtitle).toStdString().c_str(), "pop-up text when data has been sent"));
+ QMessageBox::information(this, tr("Uisent", "pop-up title when data has been sent"), tr(QString("sav finish of "+savtitle).toStdString().c_str(), "pop-up text when data has been sent"));
}
void MainWindow::resetRAW(){
exec(QList<QString>({"delete from raw;"}));
}
void MainWindow::get(const QString & a){
- const QString b=QInputDialog::getText(this, trUtf8("get", "title to ask keyword to get"), trUtf8("Enter the keyword : ", "ask keyword to get buttons"));
+ const QString b=QInputDialog::getText(this, tr("get", "title to ask keyword to get"), tr("Enter the keyword : ", "ask keyword to get buttons"));
get(a, b);
}
void MainWindow::insert(const QString & type, const QString & keyword, const QString & label, const QString & action){
key=key+" "+keyword;
}else{
- if(deb)QMessageBox::information(this, trUtf8("key.contain(keyword)", "box title to debug insert"), trUtf8("la chaine est déja dans le bouton"));
+ if(deb)QMessageBox::information(this, tr("key.contain(keyword)", "box title to debug insert"), tr("la chaine est déja dans le bouton"));
}
- if(deb)QMessageBox::information(this, trUtf8("action", "box title to debug insert"), trUtf8("insert : key="+key.toLocal8Bit()+" label="+label.toLocal8Bit()+" action="+action.toLocal8Bit(), "label to debug insert"));
+ if(deb)QMessageBox::information(this, tr("action", "box title to debug insert"), tr("insert : key="+key.toLocal8Bit()+" label="+label.toLocal8Bit()+" action="+action.toLocal8Bit(), "label to debug insert"));
if(!id.isValid())exec(QList<QString>({conf->value(QString("add")+type).toString(), key, label, action}));
else{exec(QList<QString>({conf->value(QString("update")+type).toString(), key, label, action, id.toString()}));
};
qDebug()<<"key="<<key<<" keyword="<<keyword;
//key.replace(keyword, QString(""));
key.remove(keyword);
- if(deb)QMessageBox::information(this, trUtf8("key", "box title to debug remove"), QString("remove : id="+id.toString()+" key="+key+" label="+label+" action="+action));
+ if(deb)QMessageBox::information(this, tr("key", "box title to debug remove"), QString("remove : id="+id.toString()+" key="+key+" label="+label+" action="+action));
if(key==QString(" ").repeated(key.size()))exec(QList<QString>({conf->value(QString("delete")+type).toString(), id.toString()}));
else{
exec(QList<QString>({conf->value(QString("update")+type).toString(), key, label, action, id.toString()}));
QDataStream str(&tmp);
str<<m->downloadedData();
emit writed();
- QMessageBox::information(this, trUtf8("writeFile", "pop-up title when file has been written"), trUtf8("File written : "+file.toLocal8Bit(), "pop-up text when file has been written"));
+ QMessageBox::information(this, tr("writeFile", "pop-up title when file has been written"), tr("File written : "+file.toLocal8Bit(), "pop-up text when file has been written"));
m->disconnect();
d.unlock();
}
}
void MainWindow::tmpdown(){
bool ok;
- QString url=QInputDialog::getText(this, trUtf8("tmp URL", "Title of box where ask for button file's URL"), trUtf8("Enter URL", "Label of box where ask for button file's URL"), QLineEdit::Normal, QString(""), &ok), file="file";
+ QString url=QInputDialog::getText(this, tr("tmp URL", "Title of box where ask for button file's URL"), tr("Enter URL", "Label of box where ask for button file's URL"), QLineEdit::Normal, QString(""), &ok), file="file";
if(!ok)download(url);
connect(m, SIGNAL(downloaded()), this, SLOT(readData()));
}
void MainWindow::action(){
bool ok;
- QString cmd=QInputDialog::getText(this, trUtf8("action", "Title of box where ask for a custom action"), trUtf8("Enter your action", "Label of box where ask for custom action"), QLineEdit::Normal, QString(""), &ok);
+ QString cmd=QInputDialog::getText(this, tr("action", "Title of box where ask for a custom action"), tr("Enter your action", "Label of box where ask for custom action"), QLineEdit::Normal, QString(""), &ok);
if(ok)action(cmd);
}
void MainWindow::mass(const QString & type, const QString & column, const QString & before, const QString & after){
}
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);
+ QString use=QInputDialog::getText(this, tr("tmp URL", "Title of box where ask for current type"), tr("Enter string", "Label of box where ask for current type"), QLineEdit::Normal, a, &ok);
if(ok){
//currenttype=use;
conf->setValue(QString("currenttype"), use);
int i=0;
qDebug()<<"printItem()";
if(page){
- addWidget(QString("prevpage"), new CLabel(trUtf8("Prev"), *conf));
+ addWidget(QString("prevpage"), new CLabel(tr("Prev"), *conf));
};
do{
int tmp=0;
if(a.isValid())tmp=addWidget(a.value(actCol).toString(), new CLabel(a.value(labCol).toString(), *conf, a.value(idcol).toInt()));
if(tmp==1){
- addWidget(QString("nextpage"), new CLabel(trUtf8("Next"), *conf));
+ addWidget(QString("nextpage"), new CLabel(tr("Next"), *conf));
return 1;
};
i++;
return 0;
}
void MainWindow::get2(const QString & d, const QString &b){
- if(deb)QMessageBox::information(this, trUtf8("action", "box title to debug get"), "type:"+d+" keyword:"+b);
+ if(deb)QMessageBox::information(this, tr("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);