forked from blue/squawk
trust summary gui delivery
This commit is contained in:
parent
fffef9876a
commit
4f295fee3c
13 changed files with 169 additions and 143 deletions
|
@ -226,61 +226,50 @@ Shared::Global::FileInfo Shared::Global::getFileInfo(const QString& path)
|
|||
}
|
||||
|
||||
|
||||
Shared::Global * Shared::Global::getInstance()
|
||||
{
|
||||
Shared::Global * Shared::Global::getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
QString Shared::Global::getName(Message::State rl)
|
||||
{
|
||||
QString Shared::Global::getName(Message::State rl) {
|
||||
return instance->messageState[static_cast<int>(rl)];
|
||||
}
|
||||
|
||||
QString Shared::Global::getName(Shared::Affiliation af)
|
||||
{
|
||||
QString Shared::Global::getName(Shared::Affiliation af) {
|
||||
return instance->affiliation[static_cast<int>(af)];
|
||||
}
|
||||
|
||||
QString Shared::Global::getName(Shared::Availability av)
|
||||
{
|
||||
QString Shared::Global::getName(Shared::Availability av) {
|
||||
return instance->availability[static_cast<int>(av)];
|
||||
}
|
||||
|
||||
QString Shared::Global::getName(Shared::ConnectionState cs)
|
||||
{
|
||||
QString Shared::Global::getName(Shared::ConnectionState cs) {
|
||||
return instance->connectionState[static_cast<int>(cs)];
|
||||
}
|
||||
|
||||
QString Shared::Global::getName(Shared::Role rl)
|
||||
{
|
||||
QString Shared::Global::getName(Shared::Role rl) {
|
||||
return instance->role[static_cast<int>(rl)];
|
||||
}
|
||||
|
||||
QString Shared::Global::getName(Shared::SubscriptionState ss)
|
||||
{
|
||||
QString Shared::Global::getName(Shared::SubscriptionState ss) {
|
||||
return instance->subscriptionState[static_cast<int>(ss)];
|
||||
}
|
||||
|
||||
QString Shared::Global::getName(Shared::AccountPassword ap)
|
||||
{
|
||||
QString Shared::Global::getName(Shared::AccountPassword ap) {
|
||||
return instance->accountPassword[static_cast<int>(ap)];
|
||||
}
|
||||
|
||||
QString Shared::Global::getName(Shared::TrustLevel tl)
|
||||
{
|
||||
QString Shared::Global::getName(Shared::TrustLevel tl) {
|
||||
return instance->trustLevel[static_cast<int>(tl)];
|
||||
}
|
||||
|
||||
void Shared::Global::setSupported(const QString& pluginName, bool support)
|
||||
{
|
||||
void Shared::Global::setSupported(const QString& pluginName, bool support) {
|
||||
std::map<QString, bool>::iterator itr = instance->pluginSupport.find(pluginName);
|
||||
if (itr != instance->pluginSupport.end()) {
|
||||
itr->second = support;
|
||||
}
|
||||
}
|
||||
|
||||
bool Shared::Global::supported(const QString& pluginName)
|
||||
{
|
||||
bool Shared::Global::supported(const QString& pluginName) {
|
||||
std::map<QString, bool>::iterator itr = instance->pluginSupport.find(pluginName);
|
||||
if (itr != instance->pluginSupport.end()) {
|
||||
return itr->second;
|
||||
|
@ -288,8 +277,7 @@ bool Shared::Global::supported(const QString& pluginName)
|
|||
return false;
|
||||
}
|
||||
|
||||
QString Shared::Global::getDescription(Shared::AccountPassword ap)
|
||||
{
|
||||
QString Shared::Global::getDescription(Shared::AccountPassword ap) {
|
||||
return instance->accountPasswordDescription[static_cast<int>(ap)];
|
||||
}
|
||||
|
||||
|
@ -355,8 +343,7 @@ void Shared::Global::highlightInFileManager(const QString& path)
|
|||
}
|
||||
}
|
||||
|
||||
QIcon Shared::Global::createThemePreview(const QString& path)
|
||||
{
|
||||
QIcon Shared::Global::createThemePreview(const QString& path) {
|
||||
if (supported("colorSchemeTools")) {
|
||||
QIcon* icon = createPreview(path);
|
||||
QIcon localIcon = *icon;
|
||||
|
@ -367,8 +354,7 @@ QIcon Shared::Global::createThemePreview(const QString& path)
|
|||
}
|
||||
}
|
||||
|
||||
QString Shared::Global::getColorSchemeName(const QString& path)
|
||||
{
|
||||
QString Shared::Global::getColorSchemeName(const QString& path) {
|
||||
if (supported("colorSchemeTools")) {
|
||||
QString res;
|
||||
colorSchemeName(path, res);
|
||||
|
@ -378,8 +364,7 @@ QString Shared::Global::getColorSchemeName(const QString& path)
|
|||
}
|
||||
}
|
||||
|
||||
void Shared::Global::setTheme(const QString& path)
|
||||
{
|
||||
void Shared::Global::setTheme(const QString& path) {
|
||||
if (supported("colorSchemeTools")) {
|
||||
if (path.toLower() == "system") {
|
||||
QApplication::setPalette(getInstance()->defaultSystemPalette);
|
||||
|
@ -391,8 +376,7 @@ void Shared::Global::setTheme(const QString& path)
|
|||
}
|
||||
}
|
||||
|
||||
void Shared::Global::setStyle(const QString& style)
|
||||
{
|
||||
void Shared::Global::setStyle(const QString& style) {
|
||||
if (style.toLower() == "system") {
|
||||
QApplication::setStyle(getInstance()->defaultSystemStyle);
|
||||
} else {
|
||||
|
@ -404,7 +388,7 @@ void Shared::Global::setStyle(const QString& style)
|
|||
template<> \
|
||||
Enum Shared::Global::fromInt(int src) \
|
||||
{ \
|
||||
if (src < static_cast<int>(Enum##Lowest) && src > static_cast<int>(Enum##Highest)) { \
|
||||
if (src < static_cast<int>(Enum##Lowest) || src > static_cast<int>(Enum##Highest)) { \
|
||||
throw EnumOutOfRange(#Enum); \
|
||||
} \
|
||||
return static_cast<Enum>(src); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue