Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortWINE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikhail Tergoev
PortWINE
Commits
dbde6487
Commit
dbde6487
authored
Jan 17, 2026
by
Mikhail Tergoev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added button for hot change mirror
parent
182911d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
24 deletions
+65
-24
functions_helper
data_from_portwine/scripts/functions_helper
+64
-23
default.pptheme
data_from_portwine/themes/default.pptheme
+1
-1
No files found.
data_from_portwine/scripts/functions_helper
View file @
dbde6487
...
...
@@ -421,14 +421,21 @@ try_check_sha256sum () {
try_download
()
{
export
dest
=
"
$2
"
local
silent
=
"false"
export
no_mirror
=
"false"
local
silent
=
"false"
case
"
$MIRROR
"
in
CLOUD
)
local
NEW_MIRROR
=
"GITHUB"
;;
GITHUB
)
local
NEW_MIRROR
=
"CLOUD"
;;
esac
local
add_button
=
"--button=
${
translations
[Change mirror to]
}
$NEW_MIRROR
:1"
case
"
$3
"
in
silent
)
silent
=
true
;;
no_mirror
)
no_mirror
=
true
add_button
=
"--no-buttons"
;;
esac
local
filename
...
...
@@ -462,7 +469,6 @@ try_download () {
# Normal download
print_info
"Download
$filename
from
${
FIRST_URL
[0]
}
..."
set
-o
pipefail
if
[[
"
$silent
"
==
"true"
]]
;
then
curl
-f
-#
-A
'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)'
-H
'Cache-Control: no-cache, no-store'
\
-H
'Pragma: no-cache'
-L
"
${
FIRST_URL
[@]
}
"
-o
"
$dest
"
2>&1
...
...
@@ -470,45 +476,80 @@ try_download () {
curl
-f
-#
-A
'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)'
-H
'Cache-Control: no-cache, no-store'
\
-H
'Pragma: no-cache'
-L
"
${
FIRST_URL
[@]
}
"
-o
"
$dest
"
2>&1
\
|
tr
'\r'
'\n'
|
sed
-ur
's|[# ]+||g;s|100||g;s|0-||g;s|.*=.*||g'
>>
"
$PW_TMPFS_PATH
/process.log"
elif
[[
"
$no_mirror
"
!=
"true"
]]
;
then
curl
-f
-#
-A
'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)'
-H
'Cache-Control: no-cache, no-store'
\
-H
'Pragma: no-cache'
-L
"
${
FIRST_URL
[@]
}
"
-o
"
$dest
"
2>&1 |
\
tr
'\r'
'\n'
|
sed
-ur
's|[# ]+||g;s|100||g;s|.*=.*||g;s|.*|#Downloading at &\n&|g'
|
\
"
$pw_yad
"
--progress
--text
=
"
${
translations
[Downloading]
}
$filename
"
--auto-close
--no-escape
\
--text-align
=
"center"
--fixed
"
$add_button
"
--title
"PortProton"
--width
=
500
--height
=
90
\
--window-icon
=
"
$PW_GUI_ICON_PATH
/portproton.svg"
--borders
=
"
$PROGRESS_BAR_BORDERS_SIZE
"
&
sleep
1
while
pgrep
-a
"yad"
|
grep
"
$filename
"
&>/dev/null
;
do
sleep
1
done
CURL_PID
=
"
$(
pgrep
-a
curl |
grep
-i
"portproton"
|
cut
-d
' '
-f1
)
"
if
[[
-n
$CURL_PID
]]
;
then
kill
"
$CURL_PID
"
&>/dev/null
local
curl_status
=
"error"
fi
if
[[
$curl_status
!=
"error"
]]
\
&&
try_check_sha256sum
"
${
FIRST_URL
[@]
}
"
then
print_ok
"File downloaded successfully:
$filename
from
${
FIRST_URL
[0]
}
"
return
0
else
local
curl_status
=
"error"
fi
else
set
-o
pipefail
curl
-f
-#
-A
'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)'
-H
'Cache-Control: no-cache, no-store'
\
-H
'Pragma: no-cache'
-L
"
${
FIRST_URL
[@]
}
"
-o
"
$dest
"
2>&1 |
\
tr
'\r'
'\n'
|
sed
-ur
's|[# ]+||g;s|100||g;s|.*=.*||g;s|.*|#Downloading at &\n&|g'
|
\
"
$pw_yad
"
--progress
--text
=
"
${
translations
[Downloading]
}
$filename
"
--auto-close
--no-escape
\
--auto-kill
--text-align
=
"center"
--fixed
--no-buttons
--title
"PortProton"
--width
=
500
--height
=
90
\
--window-icon
=
"
$PW_GUI_ICON_PATH
/portproton.svg"
--borders
=
"
$PROGRESS_BAR_BORDERS_SIZE
"
[[
"
${
PIPESTATUS
[0]
}
"
!=
0
]]
&&
local
curl_status
=
"error"
fi
if
[[
"
${
PIPESTATUS
[0]
}
"
!=
0
]]
;
then
if
[[
$curl_status
==
"error"
]]
;
then
if
[[
"
$no_mirror
"
!=
"true"
]]
;
then
print_warning
"Failed download
$filename
from
${
FIRST_URL
[0]
}
, trying mirror:
${
SECOND_URL
[0]
}
"
set
-o
pipefail
curl
-f
-#
-A
'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)'
-H
'Cache-Control: no-cache, no-store'
\
-H
'Pragma: no-cache'
-L
"
${
SECOND_URL
[@]
}
"
-o
"
$dest
"
2>&1 |
\
-H
'Pragma: no-cache'
-L
-C
-
"
${
SECOND_URL
[@]
}
"
-o
"
$dest
"
2>&1 |
\
tr
'\r'
'\n'
|
sed
-ur
's|[# ]+||g;s|100||g;s|.*=.*||g;s|.*|#Downloading at &\n&|g'
|
\
"
$pw_yad
"
--progress
--text
=
"
${
translations
[Downloading]
}
$filename
"
--auto-close
--no-escape
\
--auto-kill
--text-align
=
"center"
--fixed
--no-buttons
--title
"PortProton"
--width
=
500
--height
=
90
\
--window-icon
=
"
$PW_GUI_ICON_PATH
/portproton.svg"
--borders
=
"
$PROGRESS_BAR_BORDERS_SIZE
"
fi
if
[[
"
${
PIPESTATUS
[0]
}
"
!=
0
]]
;
then
print_error
"Failed to download
$filename
from mirror. Skipping..."
return
1
else
print_ok
"File downloaded successfully:
$filename
from
${
SECOND_URL
[0]
}
"
if
try_check_sha256sum
"
${
SECOND_URL
[@]
}
"
;
then
return
0
else
try_remove_file
"
$dest
"
--auto-kill
--text-align
=
"center"
--fixed
--button
=
"
${
translations
[CANCEL]
}
:1"
\
--title
"PortProton"
--width
=
500
--height
=
90
--window-icon
=
"
$PW_GUI_ICON_PATH
/portproton.svg"
\
--borders
=
"
$PROGRESS_BAR_BORDERS_SIZE
"
if
[[
"
${
PIPESTATUS
[0]
}
"
!=
0
]]
;
then
print_error
"Failed to download
$filename
from mirror."
return
1
else
print_ok
"File downloaded successfully:
$filename
from
${
SECOND_URL
[0]
}
"
export
MIRROR
=
"
$NEW_MIRROR
"
print_warning
"Mirror changed to
$MIRROR
"
edit_user_conf_from_gui MIRROR
if
try_check_sha256sum
"
${
SECOND_URL
[@]
}
"
;
then
return
0
else
try_remove_file
"
$dest
"
return
1
fi
fi
else
try_remove_file
"
$dest
"
print_error
"Failed to download
$filename
from
${
FIRST_URL
[0]
}
"
return
1
fi
fi
print_ok
"File downloaded successfully:
$filename
from
${
FIRST_URL
[0]
}
"
if
try_check_sha256sum
"
${
FIRST_URL
[@]
}
"
;
then
return
0
else
try_remove_file
"
$dest
"
return
1
fi
}
var_winedlloverride_update
()
{
...
...
data_from_portwine/themes/default.pptheme
View file @
dbde6487
...
...
@@ -76,5 +76,5 @@ export NOTEBOOK_GUI_TYPE_TEXT=2
export
NOTEBOOK_GUI_TYPE_IMAGE
=
5
# настройки индикатора прогресса
export
PROGRESS_BAR_BORDERS_SIZE
=
2
0
export
PROGRESS_BAR_BORDERS_SIZE
=
3
0
export
PROGRESS_BAR_WIDTH_SIZE
=
500
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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