Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
P
pardus-flatpak-gui
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Pardus
ondokuz
pardus-flatpak-gui
Commits
375e5fe1
Verified
Kaydet (Commit)
375e5fe1
authored
Nis 28, 2020
tarafından
Erdem Ersoy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Some changes:
* Make installing cancellable * Fix corrupting related row after installation error
üst
4f394ef4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
installwindow.py
pardusflatpakgui/installwindow.py
+24
-4
No files found.
pardusflatpakgui/installwindow.py
Dosyayı görüntüle @
375e5fe1
...
@@ -87,6 +87,8 @@ class InstallWindow(object):
...
@@ -87,6 +87,8 @@ class InstallWindow(object):
print
(
_
(
"Error reading GUI file: "
)
+
install_gui_file
)
print
(
_
(
"Error reading GUI file: "
)
+
install_gui_file
)
raise
raise
self
.
InstallCancellation
=
Gio
.
Cancellable
.
new
()
self
.
InstallWindow
=
install_builder
.
get_object
(
"ActionWindow"
)
self
.
InstallWindow
=
install_builder
.
get_object
(
"ActionWindow"
)
self
.
InstallWindow
.
set_application
(
application
)
self
.
InstallWindow
.
set_application
(
application
)
self
.
InstallWindow
.
set_title
(
_
(
"Installing..."
))
self
.
InstallWindow
.
set_title
(
_
(
"Installing..."
))
...
@@ -112,8 +114,9 @@ class InstallWindow(object):
...
@@ -112,8 +114,9 @@ class InstallWindow(object):
GLib
.
threads_init
()
GLib
.
threads_init
()
def
install
(
self
):
def
install
(
self
):
handler_id_cancel
=
self
.
InstallCancellation
.
connect
(
self
.
cancellation_callback
,
None
)
try
:
try
:
self
.
FlatpakTransaction
.
run
(
Gio
.
Cancellable
.
new
()
)
self
.
FlatpakTransaction
.
run
(
self
.
InstallCancellation
)
except
GLib
.
Error
:
except
GLib
.
Error
:
status_text
=
_
(
"Error at installation!"
)
status_text
=
_
(
"Error at installation!"
)
self
.
StatusText
=
self
.
StatusText
+
"
\n
"
+
status_text
self
.
StatusText
=
self
.
StatusText
+
"
\n
"
+
status_text
...
@@ -123,6 +126,8 @@ class InstallWindow(object):
...
@@ -123,6 +126,8 @@ class InstallWindow(object):
GLib
.
idle_add
(
self
.
InstallTextBuffer
.
set_text
,
GLib
.
idle_add
(
self
.
InstallTextBuffer
.
set_text
,
self
.
StatusText
,
self
.
StatusText
,
priority
=
GLib
.
PRIORITY_DEFAULT
)
priority
=
GLib
.
PRIORITY_DEFAULT
)
self
.
disconnect_handlers
(
handler_id_cancel
)
return
None
else
:
else
:
status_text
=
_
(
"Installing completed!"
)
status_text
=
_
(
"Installing completed!"
)
self
.
StatusText
=
self
.
StatusText
+
"
\n
"
+
status_text
self
.
StatusText
=
self
.
StatusText
+
"
\n
"
+
status_text
...
@@ -132,9 +137,7 @@ class InstallWindow(object):
...
@@ -132,9 +137,7 @@ class InstallWindow(object):
GLib
.
idle_add
(
self
.
InstallTextBuffer
.
set_text
,
GLib
.
idle_add
(
self
.
InstallTextBuffer
.
set_text
,
self
.
StatusText
,
self
.
StatusText
,
priority
=
GLib
.
PRIORITY_DEFAULT
)
priority
=
GLib
.
PRIORITY_DEFAULT
)
self
.
FlatpakTransaction
.
disconnect
(
self
.
handler_id
)
self
.
disconnect_handlers
(
handler_id_cancel
)
self
.
FlatpakTransaction
.
disconnect
(
self
.
handler_id_2
)
self
.
FlatpakTransaction
.
disconnect
(
self
.
handler_id_error
)
time
.
sleep
(
0.5
)
time
.
sleep
(
0.5
)
installed_ref
=
Flatpak
.
InstalledRef
()
installed_ref
=
Flatpak
.
InstalledRef
()
...
@@ -223,5 +226,22 @@ class InstallWindow(object):
...
@@ -223,5 +226,22 @@ class InstallWindow(object):
float
(
transaction_progress
.
get_progress
())
/
100.0
,
float
(
transaction_progress
.
get_progress
())
/
100.0
,
priority
=
GLib
.
PRIORITY_DEFAULT
)
priority
=
GLib
.
PRIORITY_DEFAULT
)
def
cancellation_callback
(
self
,
*
data
):
status_text
=
_
(
"Installation canceled!"
)
self
.
StatusText
=
self
.
StatusText
+
"
\n
"
+
status_text
GLib
.
idle_add
(
self
.
InstallLabel
.
set_text
,
status_text
,
priority
=
GLib
.
PRIORITY_DEFAULT
)
GLib
.
idle_add
(
self
.
InstallTextBuffer
.
set_text
,
self
.
StatusText
,
priority
=
GLib
.
PRIORITY_DEFAULT
)
def
disconnect_handlers
(
self
,
handler_id_cancel
):
self
.
InstallCancellation
.
disconnect
(
handler_id_cancel
)
self
.
FlatpakTransaction
.
disconnect
(
self
.
handler_id
)
self
.
FlatpakTransaction
.
disconnect
(
self
.
handler_id_2
)
self
.
FlatpakTransaction
.
disconnect
(
self
.
handler_id_error
)
def
on_delete_action_window
(
self
,
widget
,
event
):
def
on_delete_action_window
(
self
,
widget
,
event
):
self
.
InstallCancellation
.
cancel
()
widget
.
hide_on_delete
()
widget
.
hide_on_delete
()
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