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
713a8148
Commit
713a8148
authored
Aug 16, 2015
by
marco
Browse files
Customizable shorcuts
parents
be82472f
4cb53cca
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/sequenceEdit/ui_shortcutstab.h
0 → 100644
View file @
713a8148
This diff is collapsed.
Click to expand it.
cockatrice/src/shortcutssettings.cpp
View file @
713a8148
...
@@ -16,7 +16,7 @@ ShortcutsSettings::ShortcutsSettings(QString settingsPath, QObject *parent) : QO
...
@@ -16,7 +16,7 @@ ShortcutsSettings::ShortcutsSettings(QString settingsPath, QObject *parent) : QO
if
(
exists
){
if
(
exists
){
shortCutsFile
.
beginGroup
(
"Custom"
);
shortCutsFile
.
beginGroup
(
"Custom"
);
const
QStringList
customKeys
=
shortCutsFile
.
allKeys
();
const
QStringList
customKeys
=
shortCutsFile
.
allKeys
();
for
(
QStringList
::
const_iterator
it
=
customKeys
.
c
b
egin
();
it
!=
customKeys
.
c
e
nd
();
++
it
)
for
(
QStringList
::
const_iterator
it
=
customKeys
.
c
onstB
egin
();
it
!=
customKeys
.
c
onstE
nd
();
++
it
)
{
{
QString
stringSecuence
=
shortCutsFile
.
value
(
*
it
).
toString
();
QString
stringSecuence
=
shortCutsFile
.
value
(
*
it
).
toString
();
QList
<
QKeySequence
>
secuenceList
=
parseSecuenceString
(
stringSecuence
);
QList
<
QKeySequence
>
secuenceList
=
parseSecuenceString
(
stringSecuence
);
...
@@ -26,7 +26,7 @@ ShortcutsSettings::ShortcutsSettings(QString settingsPath, QObject *parent) : QO
...
@@ -26,7 +26,7 @@ ShortcutsSettings::ShortcutsSettings(QString settingsPath, QObject *parent) : QO
shortCutsFile
.
beginGroup
(
"Defaults"
);
shortCutsFile
.
beginGroup
(
"Defaults"
);
const
QStringList
defaultKeys
=
shortCutsFile
.
allKeys
();
const
QStringList
defaultKeys
=
shortCutsFile
.
allKeys
();
for
(
QStringList
::
const_iterator
it
=
defaultKeys
.
c
b
egin
();
it
!=
defaultKeys
.
c
e
nd
();
++
it
)
for
(
QStringList
::
const_iterator
it
=
defaultKeys
.
c
onstB
egin
();
it
!=
defaultKeys
.
c
onstE
nd
();
++
it
)
{
{
QString
stringSecuence
=
shortCutsFile
.
value
(
*
it
).
toString
();
QString
stringSecuence
=
shortCutsFile
.
value
(
*
it
).
toString
();
QList
<
QKeySequence
>
secuenceList
=
parseSecuenceString
(
stringSecuence
);
QList
<
QKeySequence
>
secuenceList
=
parseSecuenceString
(
stringSecuence
);
...
@@ -89,7 +89,7 @@ QList<QKeySequence> ShortcutsSettings::parseSecuenceString(QString stringSecuenc
...
@@ -89,7 +89,7 @@ QList<QKeySequence> ShortcutsSettings::parseSecuenceString(QString stringSecuenc
{
{
QStringList
secuences
=
stringSecuence
.
split
(
";"
);
QStringList
secuences
=
stringSecuence
.
split
(
";"
);
QList
<
QKeySequence
>
secuenceList
;
QList
<
QKeySequence
>
secuenceList
;
for
(
QStringList
::
const_iterator
ss
=
secuences
.
c
b
egin
();
ss
!=
secuences
.
c
e
nd
();
++
ss
)
for
(
QStringList
::
const_iterator
ss
=
secuences
.
c
onstB
egin
();
ss
!=
secuences
.
c
onstE
nd
();
++
ss
)
{
{
secuenceList
.
append
(
QKeySequence
(
*
ss
,
QKeySequence
::
PortableText
));
secuenceList
.
append
(
QKeySequence
(
*
ss
,
QKeySequence
::
PortableText
));
}
}
...
...
cockatrice/src/tab_deck_editor.cpp
View file @
713a8148
...
@@ -279,6 +279,9 @@ void TabDeckEditor::createMenus()
...
@@ -279,6 +279,9 @@ void TabDeckEditor::createMenus()
aSaveDeckAs
->
setShortcuts
(
settingsCache
->
shortcuts
().
getShortcut
(
aSaveDeckAs
->
setShortcuts
(
settingsCache
->
shortcuts
().
getShortcut
(
"TabDeckEditor/aSaveDeckAs"
,
QKeySequence
()));
"TabDeckEditor/aSaveDeckAs"
,
QKeySequence
()));
aOpenCustomsetsFolder
=
new
QAction
(
QString
(),
this
);
connect
(
aOpenCustomsetsFolder
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actOpenCustomsetsFolder
()));
aLoadDeckFromClipboard
=
new
QAction
(
QString
(),
this
);
aLoadDeckFromClipboard
=
new
QAction
(
QString
(),
this
);
connect
(
aLoadDeckFromClipboard
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actLoadDeckFromClipboard
()));
connect
(
aLoadDeckFromClipboard
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actLoadDeckFromClipboard
()));
aLoadDeckFromClipboard
->
setShortcuts
(
settingsCache
->
shortcuts
().
getShortcut
(
aLoadDeckFromClipboard
->
setShortcuts
(
settingsCache
->
shortcuts
().
getShortcut
(
...
@@ -576,7 +579,7 @@ void TabDeckEditor::retranslateUi()
...
@@ -576,7 +579,7 @@ void TabDeckEditor::retranslateUi()
aPrintDeck
->
setText
(
tr
(
"&Print deck..."
));
aPrintDeck
->
setText
(
tr
(
"&Print deck..."
));
aAnalyzeDeck
->
setText
(
tr
(
"&Analyze deck on deckstats.net"
));
aAnalyzeDeck
->
setText
(
tr
(
"&Analyze deck on deckstats.net"
));
aOpenCustomFolder
->
setText
(
tr
(
"Open custom image folder"
));
aOpenCustomFolder
->
setText
(
tr
(
"Open custom image folder"
));
aOpenCustomsetsFolder
->
setText
(
tr
(
"Open custom sets folder"
));
aOpenCustomsetsFolder
->
setText
(
tr
(
"Open custom sets folder"
));
aClose
->
setText
(
tr
(
"&Close"
));
aClose
->
setText
(
tr
(
"&Close"
));
aClose
->
setShortcuts
(
settingsCache
->
shortcuts
().
getShortcut
(
aClose
->
setShortcuts
(
settingsCache
->
shortcuts
().
getShortcut
(
"TabDeckEditor/aClose"
,
"TabDeckEditor/aClose"
,
...
...
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