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
98e5211a
Commit
98e5211a
authored
Sep 15, 2014
by
Fabio Bas
Browse files
Fix oracle under windows
parent
2aeecc60
Changes
2
Show whitespace changes
Inline
Side-by-side
cmake/NSIS.template.in
View file @
98e5211a
...
...
@@ -51,13 +51,15 @@ Section "Application" SecApplication
SectionEnd
Section "Update configuration" SecUpdateConfig
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "carddatabase" "$APPDATA\Cockatrice\cards.xml"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "decks" "$APPDATA\Cockatrice\decks"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "pics" "$APPDATA\Cockatrice\pics"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\sound" "path" "$APPDATA\Cockatrice\sounds"
SetShellVarContext current
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "carddatabase" "$LOCALAPPDATA\Cockatrice\cards.xml"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "decks" "$LOCALAPPDATA\Cockatrice\decks"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "pics" "$LOCALAPPDATA\Cockatrice\pics"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\sound" "path" "$LOCALAPPDATA\Cockatrice\sounds"
SectionEnd
Section "Start menu item" SecStartMenu
SetShellVarContext all
createDirectory "$SMPROGRAMS\Cockatrice"
createShortCut "$SMPROGRAMS\Cockatrice\Cockatrice.lnk" "$INSTDIR\cockatrice.exe" '--debug-output'
createShortCut "$SMPROGRAMS\Cockatrice\Oracle.lnk" "$INSTDIR\oracle.exe"
...
...
@@ -65,7 +67,7 @@ Section "Start menu item" SecStartMenu
SectionEnd
Section Uninstall
SetShellVarContext all
SetShellVarContext all
RMDir /r "$INSTDIR\zonebg"
RMDir /r "$INSTDIR\plugins"
RMDir /r "$INSTDIR\sounds"
...
...
@@ -83,8 +85,10 @@ SetShellVarContext all
RMDir "$SMPROGRAMS\Cockatrice"
DeleteRegKey HKCU "Software\Cockatrice"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice"
SetShellVarContext current
DeleteRegKey HKCU "Software\Cockatrice"
SectionEnd
LangString DESC_SecApplication ${LANG_ENGLISH} "Cockatrice program files"
...
...
oracle/src/oraclewizard.cpp
View file @
98e5211a
...
...
@@ -7,6 +7,7 @@
#endif
#include
<QAbstractButton>
#include
<QCheckBox>
#include
<QDir>
#include
<QFileDialog>
#include
<QGridLayout>
#include
<QLabel>
...
...
@@ -403,15 +404,13 @@ bool SaveSetsPage::validatePage()
QStandardPaths
::
standardLocations
(
QStandardPaths
::
DataLocation
).
first
();
#endif
QSettings
*
settings
=
new
QSettings
(
this
);
QString
savePath
=
settings
->
value
(
"paths/carddatabase"
).
toString
();
if
(
savePath
.
isEmpty
())
{
QDir
().
mkpath
(
dataDir
);
}
QString
defaultPath
=
settings
->
value
(
"paths/carddatabase"
).
toString
();
QString
windowName
=
tr
(
"Save card database"
);
QString
fileType
=
tr
(
"XML; card database (*.xml)"
);
do
{
QString
fileName
;
if
(
save
Path
.
isEmpty
())
{
if
(
default
Path
.
isEmpty
())
{
if
(
defaultPathCheckBox
->
isChecked
())
fileName
=
dataDir
+
"/cards.xml"
;
else
...
...
@@ -420,13 +419,19 @@ bool SaveSetsPage::validatePage()
}
else
{
if
(
defaultPathCheckBox
->
isChecked
())
fileName
=
save
Path
;
fileName
=
default
Path
;
else
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
windowName
,
save
Path
,
fileType
);
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
windowName
,
default
Path
,
fileType
);
}
if
(
fileName
.
isEmpty
())
{
return
false
;
}
QFileInfo
fi
(
fileName
);
QDir
fileDir
(
fi
.
path
());
if
(
!
fileDir
.
exists
()
&&
!
fileDir
.
mkpath
(
fileDir
.
absolutePath
()))
{
return
false
;
}
if
(
wizard
()
->
importer
->
saveToFile
(
fileName
))
{
ok
=
true
;
...
...
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