mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-15 06:52:15 -07:00
add in-game time as checkbox in settings
This commit is contained in:
parent
71fff5dbd0
commit
a9d3e73c15
5 changed files with 26 additions and 1 deletions
|
|
@ -1100,6 +1100,10 @@ MessagesSettingsPage::MessagesSettingsPage()
|
|||
connect(&messagePopups, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||
&SettingsCache::setShowMessagePopups);
|
||||
|
||||
localTimeCheckBox.setChecked(SettingsCache::instance().getLocalTime());
|
||||
connect(&localTimeCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||
&SettingsCache::setLocalTime);
|
||||
|
||||
mentionPopups.setChecked(SettingsCache::instance().getShowMentionPopup());
|
||||
connect(&mentionPopups, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||
&SettingsCache::setShowMentionPopups);
|
||||
|
|
@ -1112,6 +1116,9 @@ MessagesSettingsPage::MessagesSettingsPage()
|
|||
connect(customAlertString, SIGNAL(textChanged(QString)), &SettingsCache::instance(),
|
||||
SLOT(setHighlightWords(QString)));
|
||||
|
||||
|
||||
|
||||
|
||||
auto *chatGrid = new QGridLayout;
|
||||
chatGrid->addWidget(&chatMentionCheckBox, 0, 0);
|
||||
chatGrid->addWidget(&invertMentionForeground, 0, 1);
|
||||
|
|
@ -1123,6 +1130,7 @@ MessagesSettingsPage::MessagesSettingsPage()
|
|||
chatGrid->addWidget(&messagePopups, 4, 0);
|
||||
chatGrid->addWidget(&mentionPopups, 5, 0);
|
||||
chatGrid->addWidget(&roomHistory, 6, 0);
|
||||
chatGrid->addWidget(&localTimeCheckBox, 7, 0);
|
||||
chatGroupBox = new QGroupBox;
|
||||
chatGroupBox->setLayout(chatGrid);
|
||||
|
||||
|
|
@ -1305,6 +1313,7 @@ void MessagesSettingsPage::retranslateUi()
|
|||
aAdd->setText(tr("Add New Message"));
|
||||
aEdit->setText(tr("Edit Message"));
|
||||
aRemove->setText(tr("Remove Message"));
|
||||
localTimeCheckBox.setText(tr("Enable In-Game Time"));
|
||||
}
|
||||
|
||||
SoundSettingsPage::SoundSettingsPage()
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ private:
|
|||
QCheckBox invertHighlightForeground;
|
||||
QCheckBox ignoreUnregUsersMainChat;
|
||||
QCheckBox ignoreUnregUserMessages;
|
||||
QCheckBox localTimeCheckBox;
|
||||
QCheckBox messagePopups;
|
||||
QCheckBox mentionPopups;
|
||||
QCheckBox roomHistory;
|
||||
|
|
@ -252,7 +253,7 @@ private:
|
|||
QLabel hexHighlightLabel;
|
||||
QLabel customAlertStringLabel;
|
||||
QLabel explainMessagesLabel;
|
||||
|
||||
|
||||
void storeSettings();
|
||||
void updateMentionPreview();
|
||||
void updateHighlightPreview();
|
||||
|
|
|
|||
|
|
@ -420,6 +420,12 @@ void SettingsCache::setRoomHistory(const QT_STATE_CHANGED_T _roomHistory)
|
|||
settings->setValue("chat/roomhistory", roomHistory);
|
||||
}
|
||||
|
||||
void SettingsCache::setLocalTime(const QT_STATE_CHANGED_T _showMessagePopups)
|
||||
{
|
||||
localTime = (bool)_showMessagePopups;
|
||||
settings->setValue("chat/localtime", localTime);
|
||||
}
|
||||
|
||||
void SettingsCache::setLang(const QString &_lang)
|
||||
{
|
||||
lang = _lang;
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ private:
|
|||
bool rememberGameSettings;
|
||||
QList<ReleaseChannel *> releaseChannels;
|
||||
bool isPortableBuild;
|
||||
bool localTime;
|
||||
|
||||
public:
|
||||
SettingsCache();
|
||||
|
|
@ -558,6 +559,10 @@ public:
|
|||
{
|
||||
return showMessagePopups;
|
||||
}
|
||||
bool getLocalTime() const
|
||||
{
|
||||
return localTime;
|
||||
}
|
||||
bool getShowMentionPopup() const
|
||||
{
|
||||
return showMentionPopups;
|
||||
|
|
@ -810,6 +815,7 @@ public slots:
|
|||
void setCardScaling(const QT_STATE_CHANGED_T _scaleCards);
|
||||
void setStackCardOverlapPercent(const int _verticalCardOverlapPercent);
|
||||
void setShowMessagePopups(const QT_STATE_CHANGED_T _showMessagePopups);
|
||||
void setLocalTime(const QT_STATE_CHANGED_T _showMessagePopups);
|
||||
void setShowMentionPopups(const QT_STATE_CHANGED_T _showMentionPopups);
|
||||
void setRoomHistory(const QT_STATE_CHANGED_T _roomHistory);
|
||||
void setLeftJustified(const QT_STATE_CHANGED_T _leftJustified);
|
||||
|
|
|
|||
|
|
@ -88,6 +88,9 @@ void SettingsCache::setStackCardOverlapPercent(const int /* _verticalCardOverlap
|
|||
void SettingsCache::setShowMessagePopups(const QT_STATE_CHANGED_T /* _showMessagePopups */)
|
||||
{
|
||||
}
|
||||
void SettingsCache::setLocalTime(const QT_STATE_CHANGED_T _showMessagePopups /*_LocalTime*/)
|
||||
{
|
||||
}
|
||||
void SettingsCache::setShowMentionPopups(const QT_STATE_CHANGED_T /* _showMentionPopus */)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue