Skip to content

Commit

Permalink
Update to new UI
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma committed Nov 13, 2024
1 parent 88985cb commit b00b649
Show file tree
Hide file tree
Showing 28 changed files with 1,083 additions and 1,408 deletions.
40 changes: 0 additions & 40 deletions client/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,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 @@ -586,10 +577,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 @@ -835,33 +822,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 @@ -41,10 +41,6 @@ class Application final: public Common
enum ConfParameter
{
SiVaUrl,
ProxyHost,
ProxyPort,
ProxyUser,
ProxyPass,
TSAUrl,
TSLUrl,
TSLCerts,
Expand Down Expand Up @@ -72,7 +68,6 @@ class Application final: public Common
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
3 changes: 3 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
Loading

0 comments on commit b00b649

Please sign in to comment.