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
2960cba1
Commit
2960cba1
authored
Feb 05, 2016
by
Ira Aspen
Browse files
Added a file picker to the add set menu item.
parent
646c4b41
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/tab_deck_editor.cpp
View file @
2960cba1
...
@@ -45,6 +45,10 @@
...
@@ -45,6 +45,10 @@
#include
"cardframe.h"
#include
"cardframe.h"
#include
"filterbuilder.h"
#include
"filterbuilder.h"
const
QStringList
TabDeckEditor
::
fileNameFilters
=
QStringList
()
<<
QObject
::
tr
(
"Cockatrice set format (*.xml)"
)
<<
QObject
::
tr
(
"All files (*.*)"
);
void
SearchLineEdit
::
keyPressEvent
(
QKeyEvent
*
event
)
void
SearchLineEdit
::
keyPressEvent
(
QKeyEvent
*
event
)
{
{
if
(
treeView
&&
((
event
->
key
()
==
Qt
::
Key_Up
)
||
(
event
->
key
()
==
Qt
::
Key_Down
)))
if
(
treeView
&&
((
event
->
key
()
==
Qt
::
Key_Up
)
||
(
event
->
key
()
==
Qt
::
Key_Down
)))
...
@@ -871,6 +875,22 @@ void TabDeckEditor::actOpenCustomsetsFolder() {
...
@@ -871,6 +875,22 @@ void TabDeckEditor::actOpenCustomsetsFolder() {
void
TabDeckEditor
::
actAddCustomSet
()
void
TabDeckEditor
::
actAddCustomSet
()
{
{
#if QT_VERSION < 0x050000
QString
dataDir
=
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DataLocation
);
#else
QString
dataDir
=
QStandardPaths
::
standardLocations
(
QStandardPaths
::
DataLocation
).
first
();
#endif
if
(
!
confirmClose
())
return
;
QFileDialog
dialog
(
this
,
tr
(
"Load set"
));
dialog
.
setDirectory
(
dataDir
);
dialog
.
setNameFilters
(
TabDeckEditor
::
fileNameFilters
);
if
(
!
dialog
.
exec
())
return
;
QString
fileName
=
dialog
.
selectedFiles
().
at
(
0
);
}
}
void
TabDeckEditor
::
actEditSets
()
void
TabDeckEditor
::
actEditSets
()
...
...
cockatrice/src/tab_deck_editor.h
View file @
2960cba1
...
@@ -89,6 +89,7 @@ class TabDeckEditor : public Tab {
...
@@ -89,6 +89,7 @@ class TabDeckEditor : public Tab {
void
dockFloatingTriggered
();
void
dockFloatingTriggered
();
void
dockTopLevelChanged
(
bool
topLevel
);
void
dockTopLevelChanged
(
bool
topLevel
);
private:
private:
static
const
QStringList
fileNameFilters
;
CardInfo
*
currentCardInfo
()
const
;
CardInfo
*
currentCardInfo
()
const
;
void
addCardHelper
(
QString
zoneName
);
void
addCardHelper
(
QString
zoneName
);
void
offsetCountAtIndex
(
const
QModelIndex
&
idx
,
int
offset
);
void
offsetCountAtIndex
(
const
QModelIndex
&
idx
,
int
offset
);
...
...
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