Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions client/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,6 @@ class DigidocConf final: public digidoc::XmlConfCurrent
#ifdef Q_OS_MAC
std::string TSLCache() const final
{ return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation).toStdString(); }

void setProxyHost( const std::string &host ) final
{ Settings::PROXY_HOST = host; }
void setProxyPort( const std::string &port ) final
{ Settings::PROXY_PORT = port; }
void setProxyUser( const std::string &user ) final
{ Settings::PROXY_USER = user; }
void setProxyPass( const std::string &pass ) final
{ Settings::PROXY_PASS = pass; }
#endif

std::vector<digidoc::X509Cert> TSCerts() const final
Expand Down Expand Up @@ -609,10 +600,6 @@ QVariant Application::confValue( ConfParameter parameter, const QVariant &value
switch( parameter )
{
case SiVaUrl: r = i->verifyServiceUri().c_str(); break;
case ProxyHost: r = i->proxyHost().c_str(); break;
case ProxyPort: r = i->proxyPort().c_str(); break;
case ProxyUser: r = i->proxyUser().c_str(); break;
case ProxyPass: r = i->proxyPass().c_str(); break;
case TSAUrl: r = i->TSUrl().c_str(); break;
case TSLUrl: r = i->TSLUrl().c_str(); break;
case TSLCache: r = i->TSLCache().c_str(); break;
Expand Down Expand Up @@ -884,33 +871,6 @@ int Application::run()
return exec();
}

void Application::setConfValue( ConfParameter parameter, const QVariant &value )
{
try
{
auto *i = dynamic_cast<digidoc::XmlConfCurrent*>(digidoc::Conf::instance());
if(!i)
return;
QByteArray v = value.toString().toUtf8();
switch( parameter )
{
case ProxyHost: i->setProxyHost( v.isEmpty()? std::string() : v.constData() ); break;
case ProxyPort: i->setProxyPort( v.isEmpty()? std::string() : v.constData() ); break;
case ProxyUser: i->setProxyUser( v.isEmpty()? std::string() : v.constData() ); break;
case ProxyPass: i->setProxyPass( v.isEmpty()? std::string() : v.constData() ); break;
case TSAUrl:
case SiVaUrl:
case TSLCerts:
case TSLUrl:
case TSLCache: break;
}
}
catch( const digidoc::Exception &e )
{
showWarning(tr("Caught exception!"), e);
}
}

void Application::showClient(const QStringList &params, bool crypto, bool sign, bool newWindow)
{
if(sign)
Expand Down
5 changes: 0 additions & 5 deletions client/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ class Application final: public BaseApplication
enum ConfParameter : quint8
{
SiVaUrl,
ProxyHost,
ProxyPort,
ProxyUser,
ProxyPass,
TSAUrl,
TSLUrl,
TSLCerts,
Expand Down Expand Up @@ -77,7 +73,6 @@ class Application final: public BaseApplication
static QWidget* mainWindow();
static void openHelp();
static uint readTSLVersion(const QString &path);
static void setConfValue( ConfParameter parameter, const QVariant &value );
static void showClient(const QStringList &params = {}, bool crypto = false, bool sign = false, bool newWindow = false);
static void updateTSLCache(const QDateTime &tslTime);

Expand Down
4 changes: 3 additions & 1 deletion client/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ const Option<bool> Settings::CDOC2_DEFAULT { QStringLiteral("CDOC2-DEFAULT"), fa
const Option<bool> Settings::CDOC2_NOTIFICATION { QStringLiteral("CDOC2-NOTIFICATION"), false };
const Option<bool> Settings::CDOC2_USE_KEYSERVER { QStringLiteral("CDOC2-USE-KEYSERVER"), true };
const Option<QString, QString (*)()> Settings::CDOC2_DEFAULT_KEYSERVER { QStringLiteral("CDOC2-DEFAULT-KEYSERVER"), [] {
return Application::confValue(QLatin1String("CDOC2-DEFAULT-KEYSERVER")).toString(QStringLiteral("ria-test"));
return Application::confValue(QLatin1String("CDOC2-DEFAULT-KEYSERVER"))
.toString(QStringLiteral("00000000-0000-0000-0000-000000000000"));
}};
const Option<QString> Settings::CDOC2_UUID { QStringLiteral("CDOC2-UUID"), QStringLiteral("00000000-0000-0000-0000-000000000002") };
const Option<QString> Settings::CDOC2_GET { QStringLiteral("CDOC2-GET"), QStringLiteral(CDOC2_GET_URL) };
const Option<QByteArray> Settings::CDOC2_GET_CERT { QStringLiteral("CDOC2-GET-CERT") };
const Option<QString> Settings::CDOC2_POST { QStringLiteral("CDOC2-POST"), QStringLiteral(CDOC2_POST_URL) };
Expand Down
4 changes: 4 additions & 0 deletions client/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ struct Settings
void operator =(const T &value) const {
operator =(QVariant(value));
}
void operator() (const T &value) const {
operator =(QVariant(value));
}
template <typename P = T, typename = if_QString<P>>
void operator =(const std::string &value) const {
operator =(QString::fromStdString(value));
Expand Down Expand Up @@ -101,6 +104,7 @@ struct Settings
static const Option<bool> CDOC2_NOTIFICATION;
static const Option<bool> CDOC2_USE_KEYSERVER;
static const Option<QString, QString (*)()> CDOC2_DEFAULT_KEYSERVER;
static const Option<QString> CDOC2_UUID;
static const Option<QString> CDOC2_GET;
static const Option<QByteArray> CDOC2_GET_CERT;
static const Option<QString> CDOC2_POST;
Expand Down
16 changes: 8 additions & 8 deletions client/dialogs/FirstRun.ui
Original file line number Diff line number Diff line change
Expand Up @@ -849,21 +849,21 @@ border-radius: 3px;</string>
<widget class="QPushButton" name="signSkip">
<property name="geometry">
<rect>
<x>436</x>
<x>363</x>
<y>540</y>
<width>151</width>
<width>298</width>
<height>25</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>151</width>
<width>298</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>151</width>
<width>298</width>
<height>25</height>
</size>
</property>
Expand Down Expand Up @@ -1395,21 +1395,21 @@ border-radius: 3px;</string>
<widget class="QPushButton" name="cryptoSkip">
<property name="geometry">
<rect>
<x>436</x>
<x>363</x>
<y>540</y>
<width>151</width>
<width>298</width>
<height>25</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>151</width>
<width>298</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>151</width>
<width>298</width>
<height>25</height>
</size>
</property>
Expand Down
2 changes: 1 addition & 1 deletion client/dialogs/MobileProgress.ui
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ background-color: #2F70B6;
<number>30</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SizeConstraint::SetFixedSize</enum>
<enum>QLayout::SetFixedSize</enum>
</property>
<property name="leftMargin">
<number>40</number>
Expand Down
Loading
Loading