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
0bb0530a
Commit
0bb0530a
authored
Aug 11, 2014
by
Gavin Bisesi
Browse files
Merge pull request #245 from pliu037/oracle-cards-path
Oracle cards.xml path
parents
134810b9
3375d455
Changes
1
Show whitespace changes
Inline
Side-by-side
oracle/src/oraclewizard.cpp
View file @
0bb0530a
...
@@ -402,17 +402,27 @@ bool SaveSetsPage::validatePage()
...
@@ -402,17 +402,27 @@ bool SaveSetsPage::validatePage()
#else
#else
QStandardPaths
::
standardLocations
(
QStandardPaths
::
DataLocation
).
first
();
QStandardPaths
::
standardLocations
(
QStandardPaths
::
DataLocation
).
first
();
#endif
#endif
QDir
dir
(
dataDir
);
QSettings
*
settings
=
new
QSettings
(
this
);
if
(
!
dir
.
exists
())
QString
savePath
=
settings
->
value
(
"paths/carddatabase"
).
toString
();
dir
.
mkpath
(
dataDir
);
if
(
savePath
.
isEmpty
())
{
QString
savePath
=
dataDir
+
"/cards.xml"
;
QDir
().
mkpath
(
dataDir
);
}
QString
windowName
=
tr
(
"Save card database"
);
QString
fileType
=
tr
(
"XML; card database (*.xml)"
);
do
{
do
{
QString
fileName
;
QString
fileName
;
if
(
savePath
.
isEmpty
()
||
!
defaultPathCheckBox
->
isChecked
())
if
(
savePath
.
isEmpty
())
{
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Save card database"
),
dataDir
+
"/cards.xml"
,
tr
(
"XML card database (*.xml)"
));
if
(
defaultPathCheckBox
->
isChecked
())
fileName
=
dataDir
+
"/cards.xml"
;
else
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
windowName
,
dataDir
+
"/cards.xml"
,
fileType
);
settings
->
setValue
(
"paths/carddatabase"
,
fileName
);
}
else
{
else
{
if
(
defaultPathCheckBox
->
isChecked
())
fileName
=
savePath
;
fileName
=
savePath
;
savePath
.
clear
();
else
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
windowName
,
savePath
,
fileType
);
}
}
if
(
fileName
.
isEmpty
())
{
if
(
fileName
.
isEmpty
())
{
return
false
;
return
false
;
...
...
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