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
4b0ccc30
Commit
4b0ccc30
authored
Aug 14, 2015
by
Zach
Browse files
Merge pull request #1376 from Fizztastic/customsets_option
parents
26e63a9a
386716b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/tab_deck_editor.cpp
View file @
4b0ccc30
...
...
@@ -21,6 +21,8 @@
#include
<QTimer>
#include
<QDockWidget>
#include
<QPushButton>
#include
<QDir>
#include
<QDesktopServices>
#include
"tab_deck_editor.h"
#include
"window_sets.h"
#include
"carddatabase.h"
...
...
@@ -280,6 +282,8 @@ void TabDeckEditor::createMenus()
connect
(
aClose
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
closeRequest
()));
aOpenCustomFolder
=
new
QAction
(
QString
(),
this
);
connect
(
aOpenCustomFolder
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actOpenCustomFolder
()));
aOpenCustomsetsFolder
=
new
QAction
(
QString
(),
this
);
connect
(
aOpenCustomsetsFolder
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actOpenCustomsetsFolder
()));
aEditSets
=
new
QAction
(
QString
(),
this
);
connect
(
aEditSets
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actEditSets
()));
...
...
@@ -324,6 +328,7 @@ void TabDeckEditor::createMenus()
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
dbMenu
->
addSeparator
();
dbMenu
->
addAction
(
aOpenCustomFolder
);
dbMenu
->
addAction
(
aOpenCustomsetsFolder
);
#endif
addTabMenu
(
dbMenu
);
}
...
...
@@ -532,6 +537,7 @@ void TabDeckEditor::retranslateUi()
aPrintDeck
->
setText
(
tr
(
"&Print deck..."
));
aAnalyzeDeck
->
setText
(
tr
(
"&Analyze deck on deckstats.net"
));
aOpenCustomFolder
->
setText
(
tr
(
"Open custom image folder"
));
aOpenCustomsetsFolder
->
setText
(
tr
(
"Open custom sets folder"
));
aClose
->
setText
(
tr
(
"&Close"
));
aClose
->
setShortcut
(
QKeySequence
(
"Ctrl+Q"
));
...
...
@@ -774,6 +780,33 @@ void TabDeckEditor::actOpenCustomFolder() {
}
void
TabDeckEditor
::
actOpenCustomsetsFolder
()
{
#if QT_VERSION < 0x050000
QString
dataDir
=
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DataLocation
);
#else
QString
dataDir
=
QStandardPaths
::
standardLocations
(
QStandardPaths
::
DataLocation
).
first
();
#endif
#if defined(Q_OS_MAC)
QStringList
scriptArgs
;
scriptArgs
<<
QLatin1String
(
"-e"
);
scriptArgs
<<
QString
::
fromLatin1
(
"tell application
\"
Finder
\"
to open POSIX file
\"
%1
\"
"
).
arg
(
dataDir
+
"/customsets/"
);
scriptArgs
<<
QLatin1String
(
"-e"
);
scriptArgs
<<
QLatin1String
(
"tell application
\"
Finder
\"
to activate"
);
QProcess
::
execute
(
"/usr/bin/osascript"
,
scriptArgs
);
#endif
#if defined(Q_OS_WIN)
QStringList
args
;
dataDir
.
append
(
"/customsets"
);
args
<<
QDir
::
toNativeSeparators
(
dataDir
);
aOpenCustomsetsFolder
->
setText
(
dataDir
);
QProcess
::
startDetached
(
"explorer"
,
args
);
#endif
}
void
TabDeckEditor
::
actEditSets
()
{
WndSets
*
w
=
new
WndSets
;
...
...
cockatrice/src/tab_deck_editor.h
View file @
4b0ccc30
...
...
@@ -54,6 +54,7 @@ class TabDeckEditor : public Tab {
void
actPrintDeck
();
void
actAnalyzeDeck
();
void
actOpenCustomFolder
();
void
actOpenCustomsetsFolder
();
void
actEditSets
();
void
actEditTokens
();
...
...
@@ -112,7 +113,7 @@ private:
QWidget
*
filterBox
;
QMenu
*
deckMenu
,
*
dbMenu
;
QAction
*
aNewDeck
,
*
aLoadDeck
,
*
aSaveDeck
,
*
aSaveDeckAs
,
*
aLoadDeckFromClipboard
,
*
aSaveDeckToClipboard
,
*
aPrintDeck
,
*
aAnalyzeDeck
,
*
aClose
,
*
aOpenCustomFolder
;
QAction
*
aNewDeck
,
*
aLoadDeck
,
*
aSaveDeck
,
*
aSaveDeckAs
,
*
aLoadDeckFromClipboard
,
*
aSaveDeckToClipboard
,
*
aPrintDeck
,
*
aAnalyzeDeck
,
*
aClose
,
*
aOpenCustomFolder
,
*
aOpenCustomsetsFolder
;
QAction
*
aEditSets
,
*
aEditTokens
,
*
aClearFilterAll
,
*
aClearFilterOne
;
QAction
*
aAddCard
,
*
aAddCardToSideboard
,
*
aRemoveCard
,
*
aIncrement
,
*
aDecrement
;
// *aUpdatePrices;
QAction
*
aResetLayout
;
...
...
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