-// Copyright (c) 2014-2019, PIOT Gabriel
+// Copyright (c) 2014-2020, PIOT Gabriel
// All rights reserved.
// Redistribution and use in source and binary forms, with or without modification,
qDebug()<<"first";
d.lock();
firstrun();
- download(QString("http://www.nothing2do.eu/diary-mobile_")+ QLocale::system().name()+QString(".qm"));
+ download(QString("http://www.nothing2do.fr/diary-mobile_")+ QLocale::system().name()+QString(".qm"));
connect(m, SIGNAL(downloaded()), SLOT(writeTr()));
conf->setValue(QString("first"), 1);
- };
+ }
deb=0;
page=0;
np=0;
screen->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
grid=new QGridLayout(screen);
grid->setSizeConstraint(QLayout::SetMinAndMaxSize);
- signalmap=new QSignalMapper(this);
+ //signalmap=new QSignalMapper(this);
//shell=new QProcess(this);a desperated attempt to get the output of my cmd, i've try Qprocess (but don't get it)
valeur=new QMap<QString, QString>;
qDebug()<<"1' connect : "<<connect(signalmap, SIGNAL(mapped(const QString &)), this, SLOT(action(const QString &)));
conf->setValue(QString("init"), ser);
downSQL(ser);
conf->setValue(QString("first"), 2);
- };
+ }
statusBar()->addPermanentWidget(label);
menuBar()->setVisible(conf->value(QString("menu")).toBool());
//menuBar()->setVisible(true);
}
#endif // Q_OS_SYMBIAN
- Qt::WidgetAttribute attribute;
+ //Qt::WidgetAttribute attribute;
switch (orientation) {
#if QT_VERSION < 0x040702
// Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
case ScreenOrientationLockLandscape:
//attribute = Qt::WA_LockLandscapeOrientation;
break;
- default:
case ScreenOrientationAuto:
//attribute = Qt::WA_AutoOrientation;
break;
#endif // QT_VERSION > 0x040702
- };
+ }
//setAttribute(attribute, true);
}
void MainWindow::showExpanded()
else if(b[0]==QString("prevpage")){
qDebug()<<"page="<<--page;
bool tmp;
- int t=grid->count();
+ //int t=grid->count();
flush();
int max=conf->value(QString("maxcolumn")).toInt()*conf->value(QString("maxline")).toInt();
if(!page)tmp=q->seek(0);
qDebug()<<"but : "<<c;
}else{
downloadData();
- };
+ }
connect(m, SIGNAL(downloaded()), SLOT(writeData()));
}
else if(b[0]==QString("down")){
qDebug()<<"way["<<b<<"]="<<way[b];
context.append(way[b]);
context.append(" ");
- };
+ }
//};
context.append(way.last());
if(a.contains(QString("!file!"))){
tmpfile=QFileDialog::getOpenFileName();
a.replace(QString("!file!"),tmpfile);
- };
+ }
/*if(a.contains(QString("!label"))){
a.replace(QString("!label!"), label->text());
};*/
}
}
void MainWindow::editDB(const QString & a, const QString & b){
- QString tmp=conf->value(QString("edit")+a).toString(), txt="type="+a+" id="+b;;
+ QString tmp=conf->value(QString("edit")+a).toString(), txt="type="+a+" id="+b;
if(deb)QMessageBox::information(this, tr("EditDB", "box title to debug editDB"), txt);
if(tmpaction.contains(QString("!file!"))){
tmpfile=QFileDialog::getOpenFileName();
tmpaction.replace(QString("!file!"),tmpfile);
- };
+ }
if((tmpkeyword=="")||(tmplabel=="")||(tmpaction=="")){
action(a);
}else{
action(QString("-"+beforekey));
- };
+ }
}else if(k==Qt::Key_Back){
const QString a=conf->value(QString("menuback"), QString("")).toString();
if((a=="")&&(accepted))accepted=0;
action(a);
}else{
action(QString("-"+beforekey));
- };
+ }
}else if(k==Qt::Key_VolumeDown){
qDebug()<<"keyvolumdown";
const QString a=conf->value(QString("volumdown"), QString("")).toString();
action(a);
}else{
action(QString("-"+beforekey));
- };
+ }
}else if(k==Qt::Key_VolumeUp){
const QString a=conf->value(QString("volumup"), QString("")).toString();
if((a=="")&&(accepted))accepted=0;
action(a);
}else{
action(QString("-"+beforekey));
- };
- };
+ }
+ }
event->setAccepted(accepted);
}
void CLabel::SetTextToLabel(const QString& text)
}
qDebug()<<"q->exec() : "<<q->exec()<<" lastError()="<<q->lastError();
- };
+ }
db.commit();
emit datafilled();
}
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()}));
- };
+ }
}
void MainWindow::remove(const QString & type, const QString & keyword, const QString & label, const QString & action){
QString tmp("prevpage");
addWidget(tmp, new CLabel(tr("Prev"), *conf));
- };
+ }
bool t;
do{
int tmp=0;
QString tmp3("nextpage");
addWidget(tmp3, new CLabel(tr("Next"), *conf));
return 1;
- };
+ }
i++;
t=a.next();
}while(t);