}
}
else if(b[0]==QString("wri")){
- QFile tmp(conf->value(QString("file")).toString());
+ QFile tmp(c);
tmp.open(QIODevice::WriteOnly);
QTextStream stream(&tmp);
- stream<<c;
+ stream<<m->downloadedData();
tmp.close();
}
conf->setValue(QString("sqlval"), QVariant("?"));
conf->setValue(QString("always"), QVariant("+always"));
conf->setValue(QString("currenttype"), QVariant("buttons"));
+ conf->setValue(QString("multiline"), QVariant(0));
+
qDebug()<<"firstrun() finished";
}
QString MainWindow::get(int column){
void MainWindow::entry(const QString &a){
QString label, time=QDateTime::currentDateTime().toString(QString("yyyy-MM-dd hh:mm:ss")), entry, context;
bool ok=0;
- for(int b=0; b<way.size()-1;b++){
- qDebug()<<"way["<<b<<"]="<<way[b];
- context.append(way[b]);
- context.append("<br>");
- }
+ //if(!conf->value(QString("onlylast")).toBool()){
+ for(int b=0; b<way.size()-1;b++){
+ qDebug()<<"way["<<b<<"]="<<way[b];
+ context.append(way[b]);
+ context.append(" ");
+ };
+ //};
context.append(way.last());
- if(a=="")label=context+" : ";
- else label=context+", "+a+" : ";
- //entry=QInputDialog::getText(this, trUtf8("New entry"), label, QLineEdit::Normal, "", &ok);
- entry=QInputDialog::getMultiLineText(this, trUtf8("New entry"), label, QString(""), &ok);
+
+ if((a=="")&&(!conf->value(QString("onlylast")).toBool()))label=context+" : ";
+ else if((a=="")&&(conf->value(QString("onlylast")).toBool()))label=way.last()+" : ";
+ else if((a!="")&&(!conf->value(QString("onlylast")).toBool()))label=context+", "+ a +" : ";
+ else label=way.last()+", "+a+" : ";
+ 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(!ok)return;
QString c;
if(a=="")c=context+" : "+entry;
QString keyword=q->value(1).toString();
QString label=q->value(2).toString();
QString action=q->value(3).toString();
- const QString 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);
+ 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(!ok)return;
- const QString 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, 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(!ok)return;
- const QString 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())const QString 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(!ok)return;
+
if((tmpkeyword=="")||(tmplabel=="")||(tmpaction=="")){
remove(a, keyword, label, action);
return;