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ç
Erdem Ersoy
Pardus Flatpak GUI
Commits
53d92544
Verified
Kaydet (Commit)
53d92544
authored
Nis 28, 2020
tarafından
Erdem Ersoy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Some changes:
* Make updating cancellable * Fix corrupting related row after updating error
üst
da3f9f49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
updateallwindow.py
pardusflatpakgui/updateallwindow.py
+25
-4
No files found.
pardusflatpakgui/updateallwindow.py
Dosyayı görüntüle @
53d92544
...
...
@@ -84,6 +84,8 @@ class UpdateAllWindow(object):
print
(
_
(
"Error reading GUI file: "
)
+
update_all_gui_file
)
raise
self
.
UpdateAllCancellation
=
Gio
.
Cancellable
.
new
()
self
.
UpdateAllWindow
=
update_all_builder
.
get_object
(
"ActionWindow"
)
self
.
UpdateAllWindow
.
set_application
(
application
)
self
.
UpdateAllWindow
.
set_title
(
_
(
"Updating All"
))
...
...
@@ -120,8 +122,9 @@ class UpdateAllWindow(object):
GLib
.
threads_init
()
def
update_all
(
self
):
handler_id_cancel
=
self
.
UpdateAllCancellation
.
connect
(
self
.
cancellation_callback
,
None
)
try
:
self
.
FlatpakTransaction
.
run
(
Gio
.
Cancellable
.
new
()
)
self
.
FlatpakTransaction
.
run
(
self
.
UpdateAllCancellation
)
except
GLib
.
Error
:
status_text
=
_
(
"Error at updating!"
)
self
.
StatusText
=
self
.
StatusText
+
"
\n
"
+
status_text
...
...
@@ -131,6 +134,9 @@ class UpdateAllWindow(object):
GLib
.
idle_add
(
self
.
UpdateAllTextBuffer
.
set_text
,
self
.
StatusText
,
priority
=
GLib
.
PRIORITY_DEFAULT
)
self
.
disconnect_handlers
(
handler_id_cancel
)
UpdateAllWindow
.
at_updating
=
False
return
None
else
:
status_text
=
_
(
"Updating completed!"
)
self
.
StatusText
=
self
.
StatusText
+
"
\n
"
+
status_text
...
...
@@ -140,9 +146,7 @@ class UpdateAllWindow(object):
GLib
.
idle_add
(
self
.
UpdateAllTextBuffer
.
set_text
,
self
.
StatusText
,
priority
=
GLib
.
PRIORITY_DEFAULT
)
self
.
FlatpakTransaction
.
disconnect
(
self
.
handler_id
)
self
.
FlatpakTransaction
.
disconnect
(
self
.
handler_id_2
)
self
.
FlatpakTransaction
.
disconnect
(
self
.
handler_id_error
)
self
.
disconnect_handlers
(
handler_id_cancel
)
time
.
sleep
(
0.5
)
UpdateAllWindow
.
at_updating
=
False
...
...
@@ -267,5 +271,22 @@ class UpdateAllWindow(object):
float
(
transaction_progress
.
get_progress
())
/
100.0
,
priority
=
GLib
.
PRIORITY_DEFAULT
)
def
cancellation_callback
(
self
,
*
data
):
status_text
=
_
(
"Updating canceled!"
)
self
.
StatusText
=
self
.
StatusText
+
"
\n
"
+
status_text
GLib
.
idle_add
(
self
.
UpdateAllLabel
.
set_text
,
status_text
,
priority
=
GLib
.
PRIORITY_DEFAULT
)
GLib
.
idle_add
(
self
.
UpdateAllTextBuffer
.
set_text
,
self
.
StatusText
,
priority
=
GLib
.
PRIORITY_DEFAULT
)
def
disconnect_handlers
(
self
,
handler_id_cancel
):
self
.
UpdateAllCancellation
.
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
):
self
.
UpdateAllCancellation
.
cancel
()
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