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