trust level display in delegate, list size tweaking
This commit is contained in:
parent
d4bf7e599a
commit
b72a837754
10 changed files with 203 additions and 27 deletions
|
@ -144,6 +144,8 @@ enum class TrustLevel {
|
|||
authenticated
|
||||
};
|
||||
Q_ENUM_NS(TrustLevel)
|
||||
static const TrustLevel TrustLevelHighest = TrustLevel::undecided;
|
||||
static const TrustLevel TrustLevelLowest = TrustLevel::authenticated;
|
||||
|
||||
enum class EncryptionProtocol {
|
||||
omemo
|
||||
|
|
|
@ -113,6 +113,14 @@ Shared::Global::Global():
|
|||
tr("Always Ask", "AccountPassword"),
|
||||
tr("KWallet", "AccountPassword")
|
||||
}),
|
||||
trustLevel({
|
||||
tr("Undecided", "TrustLevel"),
|
||||
tr("Automatically distrusted", "TrustLevel"),
|
||||
tr("Manually distrusted", "TrustLevel"),
|
||||
tr("Automatically trusted", "TrustLevel"),
|
||||
tr("Manually trusted", "TrustLevel"),
|
||||
tr("Authenticated", "TrustLevel")
|
||||
}),
|
||||
accountPasswordDescription({
|
||||
tr("Your password is going to be stored in config file in plain text", "AccountPasswordDescription"),
|
||||
tr("Your password is going to be stored in config file but jammed with constant encryption key you can find in program source code. It might look like encryption but it's not", "AccountPasswordDescription"),
|
||||
|
@ -123,10 +131,12 @@ Shared::Global::Global():
|
|||
defaultSystemPalette(QApplication::palette()),
|
||||
omemoSupport(OMEMO_SUPPORT),
|
||||
defaultFont(QFontDatabase::systemFont(QFontDatabase::GeneralFont)),
|
||||
monospaceFont(QFontDatabase::systemFont(QFontDatabase::FixedFont)),
|
||||
smallFont(getFont(QFontDatabase::SmallestReadableFont, false, true)),
|
||||
headerFont(getFont(QFontDatabase::TitleFont, true, false, 1.1)),
|
||||
titleFont(getFont(QFontDatabase::TitleFont, true, false, 1.3)),
|
||||
defaultFontMetrics(defaultFont),
|
||||
monospaceMetrics(monospaceFont),
|
||||
smallFontMetrics(smallFont),
|
||||
headerFontMetrics(headerFont),
|
||||
titleFontMetrics(titleFont),
|
||||
|
@ -256,6 +266,11 @@ QString Shared::Global::getName(Shared::AccountPassword ap)
|
|||
return instance->accountPassword[static_cast<int>(ap)];
|
||||
}
|
||||
|
||||
QString Shared::Global::getName(Shared::TrustLevel tl)
|
||||
{
|
||||
return instance->trustLevel[static_cast<int>(tl)];
|
||||
}
|
||||
|
||||
void Shared::Global::setSupported(const QString& pluginName, bool support)
|
||||
{
|
||||
std::map<QString, bool>::iterator itr = instance->pluginSupport.find(pluginName);
|
||||
|
@ -405,3 +420,4 @@ FROM_INT_INPL(Shared::SubscriptionState)
|
|||
FROM_INT_INPL(Shared::AccountPassword)
|
||||
FROM_INT_INPL(Shared::Avatar)
|
||||
FROM_INT_INPL(Shared::Availability)
|
||||
FROM_INT_INPL(Shared::TrustLevel)
|
||||
|
|
|
@ -74,6 +74,7 @@ namespace Shared {
|
|||
static QString getName(Role rl);
|
||||
static QString getName(Message::State rl);
|
||||
static QString getName(AccountPassword ap);
|
||||
static QString getName(TrustLevel tl);
|
||||
|
||||
static QString getDescription(AccountPassword ap);
|
||||
|
||||
|
@ -84,6 +85,7 @@ namespace Shared {
|
|||
const std::deque<QString> role;
|
||||
const std::deque<QString> messageState;
|
||||
const std::deque<QString> accountPassword;
|
||||
const std::deque<QString> trustLevel;
|
||||
|
||||
const std::deque<QString> accountPasswordDescription;
|
||||
|
||||
|
@ -103,10 +105,12 @@ namespace Shared {
|
|||
static void setStyle(const QString& style);
|
||||
const bool omemoSupport;
|
||||
QFont defaultFont;
|
||||
QFont monospaceFont;
|
||||
QFont smallFont;
|
||||
QFont headerFont;
|
||||
QFont titleFont;
|
||||
QFontMetrics defaultFontMetrics;
|
||||
QFontMetrics monospaceMetrics;
|
||||
QFontMetrics smallFontMetrics;
|
||||
QFontMetrics headerFontMetrics;
|
||||
QFontMetrics titleFontMetrics;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue