Browse Source

fix(ui): groupcolors fix1

reviewable/pr5404/r5
Monsterovich 7 years ago
parent
commit
ab89ca2d8e
  1. 8
      src/persistence/settings.cpp
  2. 2
      src/persistence/settings.h
  3. 4
      src/widget/form/settings/userinterfaceform.cpp
  4. 4
      src/widget/form/settings/userinterfaceform.h
  5. 4
      src/widget/form/settings/userinterfacesettings.ui

8
src/persistence/settings.cpp

@ -242,7 +242,7 @@ void Settings::loadGlobal()
else else
style = "None"; style = "None";
} }
groupNameColors = s.value("groupNameColors", false).toBool(); nameColors = s.value("nameColors", false).toBool();
} }
s.endGroup(); s.endGroup();
@ -548,7 +548,7 @@ void Settings::saveGlobal()
s.setValue("useEmoticons", useEmoticons); s.setValue("useEmoticons", useEmoticons);
s.setValue("themeColor", themeColor); s.setValue("themeColor", themeColor);
s.setValue("style", style); s.setValue("style", style);
s.setValue("groupNameColors", groupNameColors); s.setValue("nameColors", nameColors);
s.setValue("statusChangeNotificationEnabled", statusChangeNotificationEnabled); s.setValue("statusChangeNotificationEnabled", statusChangeNotificationEnabled);
s.setValue("spellCheckingEnabled", spellCheckingEnabled); s.setValue("spellCheckingEnabled", spellCheckingEnabled);
} }
@ -2422,12 +2422,12 @@ void Settings::setAutoLogin(bool state)
void Settings::setEnableGroupChatsColor(bool state) void Settings::setEnableGroupChatsColor(bool state)
{ {
QMutexLocker locker{&bigLock}; QMutexLocker locker{&bigLock};
groupNameColors = state; nameColors = state;
} }
bool Settings::getEnableGroupChatsColor() const bool Settings::getEnableGroupChatsColor() const
{ {
return groupNameColors; return nameColors;
} }
/** /**

2
src/persistence/settings.h

@ -608,7 +608,7 @@ private:
bool notifySound; bool notifySound;
bool busySound; bool busySound;
bool groupAlwaysNotify; bool groupAlwaysNotify;
bool groupNameColors; bool nameColors;
bool forceTCP; bool forceTCP;
bool enableLanDiscovery; bool enableLanDiscovery;

4
src/widget/form/settings/userinterfaceform.cpp

@ -73,7 +73,7 @@ UserInterfaceForm::UserInterfaceForm(SettingsWidget* myParent)
bodyUI->txtChatFont->setCurrentFont(chatBaseFont); bodyUI->txtChatFont->setCurrentFont(chatBaseFont);
int index = static_cast<int>(s.getStylePreference()); int index = static_cast<int>(s.getStylePreference());
bodyUI->textStyleComboBox->setCurrentIndex(index); bodyUI->textStyleComboBox->setCurrentIndex(index);
bodyUI->gcColors->setChecked(s.getEnableGroupChatsColor()); bodyUI->useNameColors->setChecked(s.getEnableGroupChatsColor());
bodyUI->notify->setChecked(s.getNotify()); bodyUI->notify->setChecked(s.getNotify());
// Note: UI is boolean inversed from settings to maintain setting file backwards compatibility // Note: UI is boolean inversed from settings to maintain setting file backwards compatibility
@ -376,7 +376,7 @@ void UserInterfaceForm::on_txtChatFontSize_valueChanged(int px)
} }
} }
void UserInterfaceForm::on_gcColors_stateChanged(int arg1) void UserInterfaceForm::on_useNameColors_stateChanged(int arg1)
{ {
Settings::getInstance().setEnableGroupChatsColor(arg1); Settings::getInstance().setEnableGroupChatsColor(arg1);
} }

4
src/widget/form/settings/userinterfaceform.h

@ -62,9 +62,7 @@ private slots:
void on_txtChatFont_currentFontChanged(const QFont& f); void on_txtChatFont_currentFontChanged(const QFont& f);
void on_txtChatFontSize_valueChanged(int arg1); void on_txtChatFontSize_valueChanged(int arg1);
void on_useNameColors_stateChanged(int arg1);
void on_gcColors_stateChanged(int arg1);
private: private:
void retranslateUi(); void retranslateUi();

4
src/widget/form/settings/userinterfacesettings.ui

@ -150,9 +150,9 @@
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QCheckBox" name="gcColors"> <widget class="QCheckBox" name="useNameColors">
<property name="text"> <property name="text">
<string>Use colors in group chats</string> <string>Use colored nicknames in chats</string>
</property> </property>
</widget> </widget>
</item> </item>

Loading…
Cancel
Save