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
599ef0ae
Commit
599ef0ae
authored
Sep 19, 2015
by
marco
Browse files
Confirmation to clear/restore shortcuts
parent
0ce38ea8
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/sequenceEdit/shortcutstab.cpp
View file @
599ef0ae
...
...
@@ -26,30 +26,36 @@ ShortcutsTab::~ShortcutsTab()
void
ShortcutsTab
::
resetShortcuts
()
{
settingsCache
->
shortcuts
().
resetAllShortcuts
();
if
(
QMessageBox
::
question
(
this
,
tr
(
"Restore all default shortcuts"
),
tr
(
"Do you really want to restore all default shortcuts?"
))
==
QMessageBox
::
Yes
)
{
settingsCache
->
shortcuts
().
resetAllShortcuts
();
}
}
void
ShortcutsTab
::
refreshEdits
()
{
{
QList
<
SequenceEdit
*>
edits
=
this
->
findChildren
<
SequenceEdit
*>
();
for
(
int
i
=
0
;
i
<
edits
.
length
();
++
i
)
{
edits
.
at
(
i
)
->
refreshShortcut
();
}
QMessageBox
::
information
(
this
,
tr
(
"Shortcuts reset"
),
tr
(
"All shortcuts have been reset"
));
}
void
ShortcutsTab
::
clearShortcuts
()
{
settingsCache
->
shortcuts
().
clearAllShortcuts
();
if
(
QMessageBox
::
question
(
this
,
tr
(
"Clear all default shortcuts"
),
tr
(
"Do you really want to clear all shortcuts?"
))
==
QMessageBox
::
Yes
)
{
settingsCache
->
shortcuts
().
clearAllShortcuts
();
}
}
void
ShortcutsTab
::
afterClear
()
{
{
QList
<
SequenceEdit
*>
edits
=
this
->
findChildren
<
SequenceEdit
*>
();
for
(
int
i
=
0
;
i
<
edits
.
length
();
++
i
)
{
edits
.
at
(
i
)
->
clear
();
}
QMessageBox
::
information
(
this
,
tr
(
"Shortcuts reset"
),
tr
(
"All shortcuts have been cleared"
));
}
cockatrice/src/sequenceEdit/ui_shortcutstab.h
View file @
599ef0ae
...
...
@@ -1581,7 +1581,7 @@ public:
tabWidget
->
setTabText
(
tabWidget
->
indexOf
(
tab_3
),
QApplication
::
translate
(
"shortcutsTab"
,
"Draw | Move | View | Gameplay"
,
0
));
tabWidget
->
setTabText
(
tabWidget
->
indexOf
(
tab_4
),
QApplication
::
translate
(
"shortcutsTab"
,
"Counters"
,
0
));
faqLabel
->
setText
(
QString
(
"<a href='%1'>%2</a>"
).
arg
(
WIKI
).
arg
(
QApplication
::
translate
(
"shortcutsTab"
,
"How to set custom shortcuts"
,
0
)));
btnResetAll
->
setText
(
QApplication
::
translate
(
"shortcutsTab"
,
"Res
et all
shortcuts"
,
0
));
btnResetAll
->
setText
(
QApplication
::
translate
(
"shortcutsTab"
,
"Res
tore all default
shortcuts"
,
0
));
btnClearAll
->
setText
(
QApplication
::
translate
(
"shortcutsTab"
,
"Clear all shortcuts"
,
0
));
}
// retranslateUi
...
...
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