Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
f78a6e75
There was an error fetching the commit references. Please try again later.
Commit
f78a6e75
authored
6 years ago
by
Zach Hilman
Browse files
Options
Downloads
Patches
Plain Diff
qt: Use custom RawCopy with progress bar for installs
parent
3b3c919e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/yuzu/main.cpp
+28
-2
28 additions, 2 deletions
src/yuzu/main.cpp
with
28 additions
and
2 deletions
src/yuzu/main.cpp
+
28
−
2
View file @
f78a6e75
...
@@ -624,6 +624,32 @@ void GMainWindow::OnMenuInstallToNAND() {
...
@@ -624,6 +624,32 @@ void GMainWindow::OnMenuInstallToNAND() {
"Image (*.xci)"
);
"Image (*.xci)"
);
QString
filename
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Install File"
),
QString
filename
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Install File"
),
UISettings
::
values
.
roms_path
,
file_filter
);
UISettings
::
values
.
roms_path
,
file_filter
);
const
auto
qt_raw_copy
=
[
this
](
FileSys
::
VirtualFile
src
,
FileSys
::
VirtualFile
dest
)
{
if
(
src
==
nullptr
||
dest
==
nullptr
)
return
false
;
if
(
!
dest
->
Resize
(
src
->
GetSize
()))
return
false
;
QProgressDialog
progress
(
fmt
::
format
(
"Installing file
\"
{}
\"
..."
,
src
->
GetName
()).
c_str
(),
"Cancel"
,
0
,
src
->
GetSize
()
/
0x1000
,
this
);
progress
.
setWindowModality
(
Qt
::
WindowModal
);
std
::
array
<
u8
,
0x1000
>
buffer
{};
for
(
size_t
i
=
0
;
i
<
src
->
GetSize
();
i
+=
0x1000
)
{
if
(
progress
.
wasCanceled
())
{
dest
->
Resize
(
0
);
return
false
;
}
progress
.
setValue
(
i
/
0x1000
);
const
auto
read
=
src
->
Read
(
buffer
.
data
(),
buffer
.
size
(),
i
);
dest
->
Write
(
buffer
.
data
(),
read
,
i
);
}
return
true
;
};
if
(
!
filename
.
isEmpty
())
{
if
(
!
filename
.
isEmpty
())
{
if
(
filename
.
endsWith
(
"xci"
,
Qt
::
CaseInsensitive
))
{
if
(
filename
.
endsWith
(
"xci"
,
Qt
::
CaseInsensitive
))
{
const
auto
xci
=
std
::
make_shared
<
FileSys
::
XCI
>
(
const
auto
xci
=
std
::
make_shared
<
FileSys
::
XCI
>
(
...
@@ -635,7 +661,7 @@ void GMainWindow::OnMenuInstallToNAND() {
...
@@ -635,7 +661,7 @@ void GMainWindow::OnMenuInstallToNAND() {
"keys and the file and try again."
));
"keys and the file and try again."
));
return
;
return
;
}
}
if
(
Service
::
FileSystem
::
GetUserNANDContents
()
->
InstallEntry
(
xci
))
{
if
(
Service
::
FileSystem
::
GetUserNANDContents
()
->
InstallEntry
(
xci
,
qt_raw_copy
))
{
QMessageBox
::
information
(
this
,
tr
(
"Successfully Installed XCI"
),
QMessageBox
::
information
(
this
,
tr
(
"Successfully Installed XCI"
),
tr
(
"The file was successfully installed."
));
tr
(
"The file was successfully installed."
));
game_list
->
PopulateAsync
(
UISettings
::
values
.
gamedir
,
game_list
->
PopulateAsync
(
UISettings
::
values
.
gamedir
,
...
@@ -685,7 +711,7 @@ void GMainWindow::OnMenuInstallToNAND() {
...
@@ -685,7 +711,7 @@ void GMainWindow::OnMenuInstallToNAND() {
index
+=
0x7B
;
index
+=
0x7B
;
if
(
Service
::
FileSystem
::
GetUserNANDContents
()
->
InstallEntry
(
if
(
Service
::
FileSystem
::
GetUserNANDContents
()
->
InstallEntry
(
nca
,
static_cast
<
FileSys
::
TitleType
>
(
index
)))
{
nca
,
static_cast
<
FileSys
::
TitleType
>
(
index
)
,
qt_raw_copy
))
{
QMessageBox
::
information
(
this
,
tr
(
"Successfully Installed NCA"
),
QMessageBox
::
information
(
this
,
tr
(
"Successfully Installed NCA"
),
tr
(
"The file was successfully installed."
));
tr
(
"The file was successfully installed."
));
game_list
->
PopulateAsync
(
UISettings
::
values
.
gamedir
,
game_list
->
PopulateAsync
(
UISettings
::
values
.
gamedir
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment