Skip to content

Commit d00f6bc

Browse files
committed
Update to new UI
Signed-off-by: Raul Metsma <[email protected]>
1 parent 1cf149f commit d00f6bc

29 files changed

+1136
-1408
lines changed

client/Application.cpp

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,6 @@ class DigidocConf final: public digidoc::XmlConfCurrent
148148
#ifdef Q_OS_MAC
149149
std::string TSLCache() const final
150150
{ return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation).toStdString(); }
151-
152-
void setProxyHost( const std::string &host ) final
153-
{ Settings::PROXY_HOST = host; }
154-
void setProxyPort( const std::string &port ) final
155-
{ Settings::PROXY_PORT = port; }
156-
void setProxyUser( const std::string &user ) final
157-
{ Settings::PROXY_USER = user; }
158-
void setProxyPass( const std::string &pass ) final
159-
{ Settings::PROXY_PASS = pass; }
160151
#endif
161152

162153
std::vector<digidoc::X509Cert> TSCerts() const final
@@ -609,10 +600,6 @@ QVariant Application::confValue( ConfParameter parameter, const QVariant &value
609600
switch( parameter )
610601
{
611602
case SiVaUrl: r = i->verifyServiceUri().c_str(); break;
612-
case ProxyHost: r = i->proxyHost().c_str(); break;
613-
case ProxyPort: r = i->proxyPort().c_str(); break;
614-
case ProxyUser: r = i->proxyUser().c_str(); break;
615-
case ProxyPass: r = i->proxyPass().c_str(); break;
616603
case TSAUrl: r = i->TSUrl().c_str(); break;
617604
case TSLUrl: r = i->TSLUrl().c_str(); break;
618605
case TSLCache: r = i->TSLCache().c_str(); break;
@@ -884,33 +871,6 @@ int Application::run()
884871
return exec();
885872
}
886873

887-
void Application::setConfValue( ConfParameter parameter, const QVariant &value )
888-
{
889-
try
890-
{
891-
auto *i = dynamic_cast<digidoc::XmlConfCurrent*>(digidoc::Conf::instance());
892-
if(!i)
893-
return;
894-
QByteArray v = value.toString().toUtf8();
895-
switch( parameter )
896-
{
897-
case ProxyHost: i->setProxyHost( v.isEmpty()? std::string() : v.constData() ); break;
898-
case ProxyPort: i->setProxyPort( v.isEmpty()? std::string() : v.constData() ); break;
899-
case ProxyUser: i->setProxyUser( v.isEmpty()? std::string() : v.constData() ); break;
900-
case ProxyPass: i->setProxyPass( v.isEmpty()? std::string() : v.constData() ); break;
901-
case TSAUrl:
902-
case SiVaUrl:
903-
case TSLCerts:
904-
case TSLUrl:
905-
case TSLCache: break;
906-
}
907-
}
908-
catch( const digidoc::Exception &e )
909-
{
910-
showWarning(tr("Caught exception!"), e);
911-
}
912-
}
913-
914874
void Application::showClient(const QStringList &params, bool crypto, bool sign, bool newWindow)
915875
{
916876
if(sign)

client/Application.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ class Application final: public BaseApplication
4646
enum ConfParameter : quint8
4747
{
4848
SiVaUrl,
49-
ProxyHost,
50-
ProxyPort,
51-
ProxyUser,
52-
ProxyPass,
5349
TSAUrl,
5450
TSLUrl,
5551
TSLCerts,
@@ -77,7 +73,6 @@ class Application final: public BaseApplication
7773
static QWidget* mainWindow();
7874
static void openHelp();
7975
static uint readTSLVersion(const QString &path);
80-
static void setConfValue( ConfParameter parameter, const QVariant &value );
8176
static void showClient(const QStringList &params = {}, bool crypto = false, bool sign = false, bool newWindow = false);
8277
static void updateTSLCache(const QDateTime &tslTime);
8378

client/Settings.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const Option<QString, QString (*)()> Settings::CDOC2_DEFAULT_KEYSERVER { QString
3333
return Application::confValue(QLatin1String("CDOC2-DEFAULT-KEYSERVER"))
3434
.toString(QStringLiteral("00000000-0000-0000-0000-000000000000"));
3535
}};
36+
const Option<QString> Settings::CDOC2_UUID { QStringLiteral("CDOC2-UUID"), QStringLiteral("00000000-0000-0000-0000-000000000002") };
3637
const Option<QString> Settings::CDOC2_GET { QStringLiteral("CDOC2-GET"), QStringLiteral(CDOC2_GET_URL) };
3738
const Option<QByteArray> Settings::CDOC2_GET_CERT { QStringLiteral("CDOC2-GET-CERT") };
3839
const Option<QString> Settings::CDOC2_POST { QStringLiteral("CDOC2-POST"), QStringLiteral(CDOC2_POST_URL) };

client/Settings.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ struct Settings
4646
void operator =(const T &value) const {
4747
operator =(QVariant(value));
4848
}
49+
void operator() (const T &value) const {
50+
operator =(QVariant(value));
51+
}
4952
template <typename P = T, typename = if_QString<P>>
5053
void operator =(const std::string &value) const {
5154
operator =(QString::fromStdString(value));
@@ -101,6 +104,7 @@ struct Settings
101104
static const Option<bool> CDOC2_NOTIFICATION;
102105
static const Option<bool> CDOC2_USE_KEYSERVER;
103106
static const Option<QString, QString (*)()> CDOC2_DEFAULT_KEYSERVER;
107+
static const Option<QString> CDOC2_UUID;
104108
static const Option<QString> CDOC2_GET;
105109
static const Option<QByteArray> CDOC2_GET_CERT;
106110
static const Option<QString> CDOC2_POST;

0 commit comments

Comments
 (0)