Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(ui): groupcolors fix1
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich committed Oct 25, 2018
1 parent aaf5229 commit ab89ca2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/persistence/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void Settings::loadGlobal()
else
style = "None";
}
groupNameColors = s.value("groupNameColors", false).toBool();
nameColors = s.value("nameColors", false).toBool();
}
s.endGroup();

Expand Down Expand Up @@ -548,7 +548,7 @@ void Settings::saveGlobal()
s.setValue("useEmoticons", useEmoticons);
s.setValue("themeColor", themeColor);
s.setValue("style", style);
s.setValue("groupNameColors", groupNameColors);
s.setValue("nameColors", nameColors);
s.setValue("statusChangeNotificationEnabled", statusChangeNotificationEnabled);
s.setValue("spellCheckingEnabled", spellCheckingEnabled);
}
Expand Down Expand Up @@ -2422,12 +2422,12 @@ void Settings::setAutoLogin(bool state)
void Settings::setEnableGroupChatsColor(bool state)
{
QMutexLocker locker{&bigLock};
groupNameColors = state;
nameColors = state;
}

bool Settings::getEnableGroupChatsColor() const
{
return groupNameColors;
return nameColors;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/persistence/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ public slots:
bool notifySound;
bool busySound;
bool groupAlwaysNotify;
bool groupNameColors;
bool nameColors;

bool forceTCP;
bool enableLanDiscovery;
Expand Down
4 changes: 2 additions & 2 deletions src/widget/form/settings/userinterfaceform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ UserInterfaceForm::UserInterfaceForm(SettingsWidget* myParent)
bodyUI->txtChatFont->setCurrentFont(chatBaseFont);
int index = static_cast<int>(s.getStylePreference());
bodyUI->textStyleComboBox->setCurrentIndex(index);
bodyUI->gcColors->setChecked(s.getEnableGroupChatsColor());
bodyUI->useNameColors->setChecked(s.getEnableGroupChatsColor());

bodyUI->notify->setChecked(s.getNotify());
// Note: UI is boolean inversed from settings to maintain setting file backwards compatibility
Expand Down Expand Up @@ -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);
}
4 changes: 1 addition & 3 deletions src/widget/form/settings/userinterfaceform.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ private slots:

void on_txtChatFont_currentFontChanged(const QFont& f);
void on_txtChatFontSize_valueChanged(int arg1);
void on_useNameColors_stateChanged(int arg1);


void on_gcColors_stateChanged(int arg1);

private:
void retranslateUi();
void reloadSmileys();
Expand Down
4 changes: 2 additions & 2 deletions src/widget/form/settings/userinterfacesettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="gcColors">
<widget class="QCheckBox" name="useNameColors">
<property name="text">
<string>Use colors in group chats</string>
<string>Use colored nicknames in chats</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit ab89ca2

Please sign in to comment.