Added logo to settings. Small bugfixes.

master
Josef Rokos 8 years ago
parent c3598673c6
commit 37b2dd7246

@ -732,6 +732,9 @@
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
@ -754,6 +757,9 @@
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
@ -832,8 +838,8 @@
<tabstop>tableServices</tabstop>
</tabstops>
<resources>
<include location="../core/rc.qrc"/>
<include location="camprc.qrc"/>
<include location="../core/rc.qrc"/>
</resources>
<connections/>
</ui>

@ -63,7 +63,13 @@ bool ExprEvaluator::evaluate(QObject *object, const QString &exp)
QString oper;
QVariant cond;
parseExpr(exp, value, oper, cond, object);
return m_operations[oper](value, cond);
if (cond.isValid())
{
return m_operations[oper](value, cond);
}
return true;
}
}
@ -87,6 +93,10 @@ void ExprEvaluator::parseExpr(const QString &exp, QVariant &value, QString &oper
QStringList expCat = exp.trimmed().split(" ");
value = object->property(expCat[0].toStdString().c_str());
oper = expCat[1];
condition = expCat[2].replace("%20", " ");
if (expCat.size() > 2)
{
condition = expCat[2].replace("%20", " ");
}
}

@ -2,6 +2,7 @@
#include "ui_globalsettingsform.h"
#include <QMessageBox>
#include <QFileDialog>
#include "seasonnamedialog.h"
#include "globalsettings.h"
@ -107,6 +108,11 @@ void GlobalSettingsForm::loadEntity()
setEntity(settings);
ui->grpVat->setEnabled(settings->vatPayer());
if (!settings->logoPath().isEmpty())
{
ui->lblLogo->setPixmap(QPixmap(settings->logoPath()));
}
loadSeasons();
loadNumSeries();
}
@ -155,3 +161,13 @@ void GlobalSettingsForm::on_btnNew_clicked()
});
}
}
void GlobalSettingsForm::on_pushButton_clicked()
{
QString logoPath = QFileDialog::getOpenFileName(this, tr("Select logo"), "", tr("Images (*.png *.xpm *.jpg)"));
if (!logoPath.isEmpty())
{
entity()->setLogoPath(logoPath);
ui->lblLogo->setPixmap(QPixmap(logoPath));
}
}

@ -39,6 +39,7 @@ private slots:
void on_season_currentIndexChanged(int index);
void on_btnEditName_clicked();
void on_btnNew_clicked();
void on_pushButton_clicked();
};
#endif // GLOBALSETTINGSFORM_H

@ -99,9 +99,24 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_8">
<widget class="QLabel" name="lblLogo">
<property name="minimumSize">
<size>
<width>180</width>
<height>160</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>160</height>
</size>
</property>
<property name="text">
<string>Logo</string>
<string/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>

Loading…
Cancel
Save