Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
8e396cad
Commit
8e396cad
authored
Jan 15, 2015
by
Gavin Bisesi
Browse files
Merge pull request #554 from poixen/chatsettingstab
Updated chat setting tab
parents
9aeeee3a
a794112b
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/dlg_settings.cpp
View file @
8e396cad
...
...
@@ -505,10 +505,6 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
tapAnimationCheckBox
=
new
QCheckBox
;
tapAnimationCheckBox
->
setChecked
(
settingsCache
->
getTapAnimation
());
connect
(
tapAnimationCheckBox
,
SIGNAL
(
stateChanged
(
int
)),
settingsCache
,
SLOT
(
setTapAnimation
(
int
)));
chatMentionCheckBox
=
new
QCheckBox
;
chatMentionCheckBox
->
setChecked
(
settingsCache
->
getChatMention
());
connect
(
chatMentionCheckBox
,
SIGNAL
(
stateChanged
(
int
)),
settingsCache
,
SLOT
(
setChatMention
(
int
)));
soundEnabledCheckBox
=
new
QCheckBox
;
soundEnabledCheckBox
->
setChecked
(
settingsCache
->
getSoundEnabled
());
...
...
@@ -541,16 +537,11 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
animationGroupBox
=
new
QGroupBox
;
animationGroupBox
->
setLayout
(
animationGrid
);
QGridLayout
*
chatGrid
=
new
QGridLayout
;
chatGrid
->
addWidget
(
chatMentionCheckBox
,
0
,
0
);
chatGroupBox
=
new
QGroupBox
;
chatGroupBox
->
setLayout
(
chatGrid
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
;
mainLayout
->
addWidget
(
generalGroupBox
);
mainLayout
->
addWidget
(
animationGroupBox
);
mainLayout
->
addWidget
(
chatGroupBox
);
mainLayout
->
addWidget
(
soundGroupBox
);
setLayout
(
mainLayout
);
...
...
@@ -563,9 +554,7 @@ void UserInterfaceSettingsPage::retranslateUi()
doubleClickToPlayCheckBox
->
setText
(
tr
(
"&Double-click cards to play them (instead of single-click)"
));
playToStackCheckBox
->
setText
(
tr
(
"&Play all nonlands onto the stack (not the battlefield) by default"
));
animationGroupBox
->
setTitle
(
tr
(
"Animation settings"
));
chatGroupBox
->
setTitle
(
tr
(
"Chat settings"
));
tapAnimationCheckBox
->
setText
(
tr
(
"&Tap/untap animation"
));
chatMentionCheckBox
->
setText
(
tr
(
"Enable chat mentions ('@yourusername' in chat log will be highlighted)"
));
soundEnabledCheckBox
->
setText
(
tr
(
"Enable &sounds"
));
soundPathLabel
->
setText
(
tr
(
"Path to sounds directory:"
));
soundTestButton
->
setText
(
tr
(
"Test system sound engine"
));
...
...
@@ -625,26 +614,43 @@ void DeckEditorSettingsPage::radioPriceTagSourceClicked(bool checked)
MessagesSettingsPage
::
MessagesSettingsPage
()
{
chatMentionCheckBox
=
new
QCheckBox
;
chatMentionCheckBox
->
setChecked
(
settingsCache
->
getChatMention
());
connect
(
chatMentionCheckBox
,
SIGNAL
(
stateChanged
(
int
)),
settingsCache
,
SLOT
(
setChatMention
(
int
)));
QGridLayout
*
chatGrid
=
new
QGridLayout
;
chatGrid
->
addWidget
(
chatMentionCheckBox
,
0
,
0
);
chatGroupBox
=
new
QGroupBox
;
chatGroupBox
->
setLayout
(
chatGrid
);
QSettings
settings
;
messageList
=
new
QListWidget
;
settings
.
beginGroup
(
"messages"
);
int
count
=
settings
.
value
(
"count"
,
0
).
toInt
();
for
(
int
i
=
0
;
i
<
count
;
i
++
)
messageList
->
addItem
(
settings
.
value
(
QString
(
"msg%1"
).
arg
(
i
)).
toString
());
aAdd
=
new
QAction
(
this
);
connect
(
aAdd
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actAdd
()));
aRemove
=
new
QAction
(
this
);
connect
(
aRemove
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actRemove
()));
messageList
=
new
QListWidget
;
QToolBar
*
messageToolBar
=
new
QToolBar
;
messageToolBar
->
setOrientation
(
Qt
::
Vertical
);
messageToolBar
->
addAction
(
aAdd
);
messageToolBar
->
addAction
(
aRemove
);
QSettings
settings
;
settings
.
beginGroup
(
"messages"
);
int
count
=
settings
.
value
(
"count"
,
0
).
toInt
();
for
(
int
i
=
0
;
i
<
count
;
i
++
)
messageList
->
addItem
(
settings
.
value
(
QString
(
"msg%1"
).
arg
(
i
)).
toString
());
QHBoxLayout
*
messageListLayout
=
new
QHBoxLayout
;
messageListLayout
->
addWidget
(
messageList
);
messageListLayout
->
addWidget
(
messageToolBar
);
messageShortcuts
=
new
QGroupBox
;
messageShortcuts
->
setLayout
(
messageListLayout
);
QHBoxLayout
*
mainLayout
=
new
QHBoxLayout
;
mainLayout
->
addWidget
(
messageList
);
mainLayout
->
addWidget
(
messageToolBar
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
;
mainLayout
->
addWidget
(
messageShortcuts
);
mainLayout
->
addWidget
(
chatGroupBox
);
setLayout
(
mainLayout
);
...
...
@@ -682,6 +688,9 @@ void MessagesSettingsPage::retranslateUi()
{
aAdd
->
setText
(
tr
(
"&Add"
));
aRemove
->
setText
(
tr
(
"&Remove"
));
chatGroupBox
->
setTitle
(
tr
(
"Chat settings"
));
chatMentionCheckBox
->
setText
(
tr
(
"Enable chat mentions ('@yourusername' in chat log will be highlighted)"
));
messageShortcuts
->
setTitle
(
tr
(
"In-game message macros"
));
}
DlgSettings
::
DlgSettings
(
QWidget
*
parent
)
...
...
@@ -852,7 +861,7 @@ void DlgSettings::retranslateUi()
appearanceButton
->
setText
(
tr
(
"Appearance"
));
userInterfaceButton
->
setText
(
tr
(
"User interface"
));
deckEditorButton
->
setText
(
tr
(
"Deck editor"
));
messagesButton
->
setText
(
tr
(
"
Message
s"
));
messagesButton
->
setText
(
tr
(
"
Chat Setting
s"
));
for
(
int
i
=
0
;
i
<
pagesWidget
->
count
();
i
++
)
dynamic_cast
<
AbstractSettingsPage
*>
(
pagesWidget
->
widget
(
i
))
->
retranslateUi
();
...
...
cockatrice/src/dlg_settings.h
View file @
8e396cad
...
...
@@ -91,11 +91,10 @@ private:
QCheckBox
*
doubleClickToPlayCheckBox
;
QCheckBox
*
playToStackCheckBox
;
QCheckBox
*
tapAnimationCheckBox
;
QCheckBox
*
chatMentionCheckBox
;
QCheckBox
*
soundEnabledCheckBox
;
QLabel
*
soundPathLabel
;
QLineEdit
*
soundPathEdit
;
QGroupBox
*
generalGroupBox
,
*
animationGroupBox
,
*
soundGroupBox
,
*
chatGroupBox
;
QGroupBox
*
generalGroupBox
,
*
animationGroupBox
,
*
soundGroupBox
;
QPushButton
*
soundTestButton
;
public:
UserInterfaceSettingsPage
();
...
...
@@ -128,7 +127,10 @@ private slots:
private:
QListWidget
*
messageList
;
QAction
*
aAdd
,
*
aRemove
;
QCheckBox
*
chatMentionCheckBox
;
QGroupBox
*
chatGroupBox
;
QGroupBox
*
messageShortcuts
;
void
storeSettings
();
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment