mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Merge pull request #4769 from PastaPastaPasta/develop-trivial-2022-04-16
trivial backports 2022 04 16
This commit is contained in:
commit
d1592dae2d
@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// The parse the following format "perm1,perm2@xxxxxx"
|
// Parse the following format: "perm1,perm2@xxxxxx"
|
||||||
bool TryParsePermissionFlags(const std::string str, NetPermissionFlags& output, size_t& readen, bilingual_str& error)
|
bool TryParsePermissionFlags(const std::string& str, NetPermissionFlags& output, size_t& readen, bilingual_str& error)
|
||||||
{
|
{
|
||||||
NetPermissionFlags flags = PF_NONE;
|
NetPermissionFlags flags = PF_NONE;
|
||||||
const auto atSeparator = str.find('@');
|
const auto atSeparator = str.find('@');
|
||||||
@ -67,7 +67,7 @@ std::vector<std::string> NetPermissions::ToStrings(NetPermissionFlags flags)
|
|||||||
return strings;
|
return strings;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NetWhitebindPermissions::TryParse(const std::string str, NetWhitebindPermissions& output, bilingual_str& error)
|
bool NetWhitebindPermissions::TryParse(const std::string& str, NetWhitebindPermissions& output, bilingual_str& error)
|
||||||
{
|
{
|
||||||
NetPermissionFlags flags;
|
NetPermissionFlags flags;
|
||||||
size_t offset;
|
size_t offset;
|
||||||
@ -90,7 +90,7 @@ bool NetWhitebindPermissions::TryParse(const std::string str, NetWhitebindPermis
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NetWhitelistPermissions::TryParse(const std::string str, NetWhitelistPermissions& output, bilingual_str& error)
|
bool NetWhitelistPermissions::TryParse(const std::string& str, NetWhitelistPermissions& output, bilingual_str& error)
|
||||||
{
|
{
|
||||||
NetPermissionFlags flags;
|
NetPermissionFlags flags;
|
||||||
size_t offset;
|
size_t offset;
|
||||||
|
@ -51,14 +51,14 @@ public:
|
|||||||
class NetWhitebindPermissions : public NetPermissions
|
class NetWhitebindPermissions : public NetPermissions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static bool TryParse(const std::string str, NetWhitebindPermissions& output, bilingual_str& error);
|
static bool TryParse(const std::string& str, NetWhitebindPermissions& output, bilingual_str& error);
|
||||||
CService m_service;
|
CService m_service;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NetWhitelistPermissions : public NetPermissions
|
class NetWhitelistPermissions : public NetPermissions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static bool TryParse(const std::string str, NetWhitelistPermissions& output, bilingual_str& error);
|
static bool TryParse(const std::string& str, NetWhitelistPermissions& output, bilingual_str& error);
|
||||||
CSubNet m_subnet;
|
CSubNet m_subnet;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6,14 +6,14 @@
|
|||||||
|
|
||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
|
|
||||||
#include <boost/signals2/last_value.hpp>
|
#include <boost/signals2/optional_last_value.hpp>
|
||||||
#include <boost/signals2/signal.hpp>
|
#include <boost/signals2/signal.hpp>
|
||||||
|
|
||||||
CClientUIInterface uiInterface;
|
CClientUIInterface uiInterface;
|
||||||
|
|
||||||
struct UISignals {
|
struct UISignals {
|
||||||
boost::signals2::signal<CClientUIInterface::ThreadSafeMessageBoxSig, boost::signals2::last_value<bool>> ThreadSafeMessageBox;
|
boost::signals2::signal<CClientUIInterface::ThreadSafeMessageBoxSig, boost::signals2::optional_last_value<bool>> ThreadSafeMessageBox;
|
||||||
boost::signals2::signal<CClientUIInterface::ThreadSafeQuestionSig, boost::signals2::last_value<bool>> ThreadSafeQuestion;
|
boost::signals2::signal<CClientUIInterface::ThreadSafeQuestionSig, boost::signals2::optional_last_value<bool>> ThreadSafeQuestion;
|
||||||
boost::signals2::signal<CClientUIInterface::InitMessageSig> InitMessage;
|
boost::signals2::signal<CClientUIInterface::InitMessageSig> InitMessage;
|
||||||
boost::signals2::signal<CClientUIInterface::NotifyNumConnectionsChangedSig> NotifyNumConnectionsChanged;
|
boost::signals2::signal<CClientUIInterface::NotifyNumConnectionsChangedSig> NotifyNumConnectionsChanged;
|
||||||
boost::signals2::signal<CClientUIInterface::NotifyNetworkActiveChangedSig> NotifyNetworkActiveChanged;
|
boost::signals2::signal<CClientUIInterface::NotifyNetworkActiveChangedSig> NotifyNetworkActiveChanged;
|
||||||
@ -50,8 +50,8 @@ ADD_SIGNALS_IMPL_WRAPPER(NotifyMasternodeListChanged);
|
|||||||
ADD_SIGNALS_IMPL_WRAPPER(NotifyAdditionalDataSyncProgressChanged);
|
ADD_SIGNALS_IMPL_WRAPPER(NotifyAdditionalDataSyncProgressChanged);
|
||||||
ADD_SIGNALS_IMPL_WRAPPER(BannedListChanged);
|
ADD_SIGNALS_IMPL_WRAPPER(BannedListChanged);
|
||||||
|
|
||||||
bool CClientUIInterface::ThreadSafeMessageBox(const bilingual_str& message, const std::string& caption, unsigned int style) { return g_ui_signals.ThreadSafeMessageBox(message, caption, style); }
|
bool CClientUIInterface::ThreadSafeMessageBox(const bilingual_str& message, const std::string& caption, unsigned int style) { return g_ui_signals.ThreadSafeMessageBox(message, caption, style).value_or(false);}
|
||||||
bool CClientUIInterface::ThreadSafeQuestion(const bilingual_str& message, const std::string& non_interactive_message, const std::string& caption, unsigned int style) { return g_ui_signals.ThreadSafeQuestion(message, non_interactive_message, caption, style); }
|
bool CClientUIInterface::ThreadSafeQuestion(const bilingual_str& message, const std::string& non_interactive_message, const std::string& caption, unsigned int style) { return g_ui_signals.ThreadSafeQuestion(message, non_interactive_message, caption, style).value_or(false);}
|
||||||
void CClientUIInterface::InitMessage(const std::string& message) { return g_ui_signals.InitMessage(message); }
|
void CClientUIInterface::InitMessage(const std::string& message) { return g_ui_signals.InitMessage(message); }
|
||||||
void CClientUIInterface::NotifyNumConnectionsChanged(int newNumConnections) { return g_ui_signals.NotifyNumConnectionsChanged(newNumConnections); }
|
void CClientUIInterface::NotifyNumConnectionsChanged(int newNumConnections) { return g_ui_signals.NotifyNumConnectionsChanged(newNumConnections); }
|
||||||
void CClientUIInterface::NotifyNetworkActiveChanged(bool networkActive) { return g_ui_signals.NotifyNetworkActiveChanged(networkActive); }
|
void CClientUIInterface::NotifyNetworkActiveChanged(bool networkActive) { return g_ui_signals.NotifyNetworkActiveChanged(networkActive); }
|
||||||
|
@ -139,7 +139,7 @@ void InitWarning(const bilingual_str& str);
|
|||||||
|
|
||||||
/** Show error message **/
|
/** Show error message **/
|
||||||
bool InitError(const bilingual_str& str);
|
bool InitError(const bilingual_str& str);
|
||||||
constexpr auto AbortError = InitError;
|
inline bool AbortError(const bilingual_str& str) { return InitError(str); }
|
||||||
|
|
||||||
extern CClientUIInterface uiInterface;
|
extern CClientUIInterface uiInterface;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ EXPECTED_BOOST_INCLUDES=(
|
|||||||
boost/preprocessor/cat.hpp
|
boost/preprocessor/cat.hpp
|
||||||
boost/preprocessor/stringize.hpp
|
boost/preprocessor/stringize.hpp
|
||||||
boost/signals2/connection.hpp
|
boost/signals2/connection.hpp
|
||||||
boost/signals2/last_value.hpp
|
boost/signals2/optional_last_value.hpp
|
||||||
boost/signals2/signal.hpp
|
boost/signals2/signal.hpp
|
||||||
boost/test/unit_test.hpp
|
boost/test/unit_test.hpp
|
||||||
boost/thread.hpp
|
boost/thread.hpp
|
||||||
|
Loading…
Reference in New Issue
Block a user