refs #485, further removed global setup traits from classes with read only

Use global setup from sGui/sApp
This commit is contained in:
Klaus Basan
2016-03-01 01:49:59 +01:00
committed by Mathew Sutcliffe
parent 30b5e5dade
commit aa96731143
20 changed files with 22 additions and 48 deletions

View File

@@ -10,6 +10,7 @@
#include "dblogincomponent.h"
#include "ui_dblogincomponent.h"
#include "blackgui/overlaymessagesframe.h"
#include "blackgui/guiapplication.h"
#include "blackmisc/verify.h"
#include "blackmisc/network/url.h"
#include "blackmisc/logmessage.h"
@@ -28,7 +29,11 @@ namespace BlackGui
{
ui->setupUi(this);
this->setModeLogin(true);
this->ps_setupChanged();
CUrl url(sGui->getGlobalSetup().dbHomePageUrl());
ui->lbl_SwiftDB->setText("<a href=\"" + url.getFullUrl() + "\">swift DB@" + url.getHost() + "</a>");
ui->lbl_SwiftDB->setTextFormat(Qt::RichText);
ui->lbl_SwiftDB->setTextInteractionFlags(Qt::TextBrowserInteraction);
ui->lbl_SwiftDB->setOpenExternalLinks(true);
connect(ui->pb_Login, &QPushButton::clicked, this, &CDbLoginComponent::ps_onLoginClicked);
connect(ui->pb_Logoff, &QPushButton::clicked, this, &CDbLoginComponent::ps_onLogoffClicked);
@@ -89,15 +94,6 @@ namespace BlackGui
}
}
void CDbLoginComponent::ps_setupChanged()
{
CUrl url(m_setup.get().dbHomePageUrl());
ui->lbl_SwiftDB->setText("<a href=\"" + url.getFullUrl() + "\">swift DB@" + url.getHost() + "</a>");
ui->lbl_SwiftDB->setTextFormat(Qt::RichText);
ui->lbl_SwiftDB->setTextInteractionFlags(Qt::TextBrowserInteraction);
ui->lbl_SwiftDB->setOpenExternalLinks(true);
}
void CDbLoginComponent::setModeLogin(bool modeLogin)
{
this->ui->fr_Login->setVisible(modeLogin);

View File

@@ -39,9 +39,8 @@ namespace BlackGui
~CDbLoginComponent();
private:
QScopedPointer<Ui::CDbLoginComponent> ui;
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this, &CDbLoginComponent::ps_setupChanged}; //!< data cache
BlackCore::CDatabaseAuthenticationService m_loginService {this}; //!< login service
QScopedPointer<Ui::CDbLoginComponent> ui;
BlackCore::CDatabaseAuthenticationService m_loginService {this}; //!< login service
//! Overlay messages
void displayOverlayMessages(const BlackMisc::CStatusMessageList &msgs);
@@ -59,8 +58,6 @@ namespace BlackGui
//! User authentication completed
void ps_AuthenticationFinished(const BlackMisc::Network::CAuthenticatedUser &user, const BlackMisc::CStatusMessageList &status);
//! Setup changed
void ps_setupChanged();
};
} // ns
} // ns

View File

@@ -108,7 +108,7 @@ namespace BlackGui
// add a testserver when no servers can be loaded
if (otherServers.isEmpty() && (sGui->isRunningInDeveloperEnvironment() || CProject::isBetaTest()))
{
otherServers.push_back(m_setup.get().fsdTestServersPlusHardcodedServers());
otherServers.push_back(sGui->getGlobalSetup().fsdTestServersPlusHardcodedServers());
CLogMessage(this).info("Added servers for testing");
}
this->ui->cbp_OtherServers->setServers(otherServers);

View File

@@ -143,7 +143,6 @@ namespace BlackGui
const int LogoffIntervalSeconds = 10;
QTimer *m_logoffCountdownTimer { nullptr };
BlackMisc::CSetting<BlackCore::Settings::Network::TrafficServers> m_otherTrafficNetworkServers { this, &CLoginComponent::ps_reloadSettings };
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
};
} // namespace

View File

@@ -55,7 +55,7 @@ namespace BlackGui
// this is debug/bootstrap feature we can continue to test when something goes wrong
if (serverList.isEmpty() && (CProject::isBetaTest() || sGui->isRunningInDeveloperEnvironment()))
{
serverList.push_back(m_setup.get().fsdTestServersPlusHardcodedServers());
serverList.push_back(sGui->getGlobalSetup().fsdTestServersPlusHardcodedServers());
this->ui->tvp_Servers->updateContainer(serverList);
}
}

View File

@@ -50,7 +50,6 @@ namespace BlackGui
private:
QScopedPointer<Ui::CSettingsNetworkServersComponent> ui;
BlackMisc::CSetting<BlackCore::Settings::Network::TrafficServers> m_trafficNetworkServers { this, &CSettingsNetworkServersComponent::ps_reloadSettings };
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
};
} // ns
} // ns