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
7712942b
Verified
Kaydet (Commit)
7712942b
authored
Nis 17, 2020
tarafından
Erdem Ersoy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rewrite Flatpak GUI mess (5/X):
* Rename/refactor mainwindow.py methods (3/X)
üst
110e8463
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
148 additions
and
131 deletions
+148
-131
mainwindow.py
pardusflatpakgui/mainwindow.py
+146
-129
mainwindow.glade
ui/mainwindow.glade
+2
-2
No files found.
pardusflatpakgui/mainwindow.py
Dosyayı görüntüle @
7712942b
...
...
@@ -330,10 +330,10 @@ class MainWindow(object):
self
.
MessageDialogError
.
run
()
self
.
MessageDialogError
.
hide
()
def
on
Info
(
self
,
menu
item
):
S
election
=
self
.
TreeViewMain
.
get_selection
()
TreeModel
,
TreeIter
=
S
election
.
get_selected
()
if
TreeI
ter
is
None
:
def
on
_info
(
self
,
menu_
item
):
s
election
=
self
.
TreeViewMain
.
get_selection
()
tree_model
,
tree_iter
=
s
election
.
get_selected
()
if
tree_i
ter
is
None
:
self
.
MessageDialogError
.
set_markup
(
_
(
"<big><b>Selection Error</b></big>"
))
self
.
MessageDialogError
.
format_secondary_text
(
...
...
@@ -341,153 +341,170 @@ class MainWindow(object):
self
.
MessageDialogError
.
run
()
self
.
MessageDialogError
.
hide
()
return
None
TreePath
=
TreeModel
.
get_path
(
TreeIter
)
SelectedRowIndex
=
TreePath
.
get_indices
()[
0
]
self
.
FlatpakRefsList
=
self
.
FlatpakInstallation
.
list_installed_refs
()
self
.
FlatpakInstallation
=
Flatpak
.
Installation
.
new_system
()
self
.
InstalledRefsList
=
self
.
FlatpakInstallation
.
list_installed_refs
()
self
.
FlatHubRefsList
=
self
.
FlatpakInstallation
.
list_remote_refs_sync
(
"flathub"
,
Gio
.
Cancellable
.
new
())
self
.
NonInstalledRefsList
=
[]
for
item
in
self
.
FlatpakRefsList
:
for
item2
in
self
.
FlatHubRefsList
:
if
item
.
get_name
()
==
item2
.
get_name
():
self
.
FlatHubRefsList
.
remove
(
item2
)
self
.
FlatpakRefsList
=
self
.
FlatpakRefsList
+
self
.
FlatHubRefsList
AppRealName
=
TreeModel
.
get_value
(
TreeIter
,
0
)
AppArch
=
TreeModel
.
get_value
(
TreeIter
,
1
)
AppBranch
=
TreeModel
.
get_value
(
TreeIter
,
2
)
for
item
in
self
.
FlatHubRefsList
:
self
.
NonInstalledRefsList
.
append
(
item
)
for
item_2
in
self
.
InstalledRefsList
:
if
item
.
get_name
()
==
item_2
.
get_name
()
and
\
item
.
get_arch
()
==
item_2
.
get_arch
()
and
\
item
.
get_branch
()
==
item_2
.
get_branch
()
and
\
len
(
self
.
NonInstalledRefsList
)
!=
0
:
self
.
NonInstalledRefsList
.
pop
(
len
(
self
.
NonInstalledRefsList
)
-
1
)
for
item
in
self
.
FlatpakRefsList
:
if
item
.
get_name
()
==
AppRealName
:
App
=
item
break
self
.
AllRefsList
=
self
.
InstalledRefsList
+
self
.
NonInstalledRefsList
AppCollectionID
=
App
.
get_collection_id
()
if
AppCollectionID
is
None
:
AppCollectionID
=
_
(
"None"
)
AppCommit
=
App
.
get_commit
()
real_name
=
tree_model
.
get_value
(
tree_iter
,
0
)
arch
=
tree_model
.
get_value
(
tree_iter
,
1
)
branch
=
tree_model
.
get_value
(
tree_iter
,
2
)
AppIsInstalledRef
=
isinstance
(
App
,
Flatpak
.
InstalledRef
)
AppIsRemoteRef
=
isinstance
(
App
,
Flatpak
.
RemoteRef
)
for
item
in
self
.
AllRefsList
:
if
item
.
get_name
()
==
real_name
:
ref
=
item
break
else
:
self
.
MessageDialogError
.
set_markup
(
_
(
"<big><b>Invalid Flatpak Reference Error</b></big>"
))
self
.
MessageDialogError
.
format_secondary_text
(
_
(
"Invalid Flatpak reference is: "
)
+
"app/"
+
real_name
+
"/"
+
arch
+
"/"
+
branch
)
self
.
MessageDialogError
.
run
()
self
.
MessageDialogError
.
hide
()
return
None
if
AppIsInstalledRef
:
# AppContentRating = App.get_appdata_content_rating()
# if AppContentRating is None:
# AppContentRating = _("None"
)
collection_id
=
ref
.
get_collection_id
()
if
collection_id
is
None
:
collection_id
=
_
(
"None"
)
commit
=
ref
.
get_commit
(
)
# AppContentRatingType = App.get_appdata_content_rating_type()
# if AppContentRatingType is None:
# AppContentRatingType = _("None")
if
isinstance
(
item
,
Flatpak
.
RemoteRef
):
is_installed
=
False
elif
isinstance
(
item
,
Flatpak
.
InstalledRef
):
is_installed
=
True
else
:
is_installed
=
None
AppLicense
=
App
.
get_appdata_license
()
if
AppLicense
is
None
:
AppLicense
=
_
(
"None"
)
if
is_installed
:
app_license
=
ref
.
get_appdata_license
()
if
app_license
is
None
:
app_license
=
_
(
"None"
)
AppName
=
App
.
get_appdata_name
()
if
AppN
ame
is
None
:
AppN
ame
=
_
(
"None"
)
name
=
ref
.
get_appdata_name
()
if
n
ame
is
None
:
n
ame
=
_
(
"None"
)
AppSummary
=
App
.
get_appdata_summary
()
if
AppS
ummary
is
None
:
AppS
ummary
=
_
(
"None"
)
summary
=
ref
.
get_appdata_summary
()
if
s
ummary
is
None
:
s
ummary
=
_
(
"None"
)
AppVersion
=
App
.
get_appdata_version
()
if
AppV
ersion
is
None
:
AppV
ersion
=
_
(
"None"
)
version
=
ref
.
get_appdata_version
()
if
v
ersion
is
None
:
v
ersion
=
_
(
"None"
)
AppDeployDir
=
App
.
get_deploy_dir
()
if
AppDeployD
ir
is
None
:
AppDeployD
ir
=
_
(
"None"
)
deploy_dir
=
ref
.
get_deploy_dir
()
if
deploy_d
ir
is
None
:
deploy_d
ir
=
_
(
"None"
)
AppEOLReason
=
App
.
get_eol
()
if
AppEOLR
eason
is
None
:
AppEOLR
eason
=
_
(
"None"
)
eol_reason
=
ref
.
get_eol
()
if
eol_r
eason
is
None
:
eol_r
eason
=
_
(
"None"
)
AppEOLRebased
=
App
.
get_eol_rebase
()
if
AppEOLR
ebased
is
None
:
AppEOLR
ebased
=
_
(
"None"
)
eol_rebased
=
ref
.
get_eol_rebase
()
if
eol_r
ebased
is
None
:
eol_r
ebased
=
_
(
"None"
)
AppInstalledSize
=
App
.
get_installed_size
()
AppInstalledSizeMiB
=
AppInstalledS
ize
/
1048576
AppInstalledSizeMiBAsString
=
f
"{AppInstalledSizeMiB
:.2f}"
+
" MiB"
installed_size
=
ref
.
get_installed_size
()
installed_size_mib
=
installed_s
ize
/
1048576
installed_size_mib_as_string
=
f
"{installed_size_mib
:.2f}"
+
" MiB"
AppIsCurrent
=
App
.
get_is_current
()
if
AppIsC
urrent
:
AppIsCurrentString
=
_
(
"Yes"
)
is_current
=
ref
.
get_is_current
()
if
is_c
urrent
:
is_current_str
=
_
(
"Yes"
)
else
:
AppIsCurrentString
=
_
(
"No"
)
is_current_str
=
_
(
"No"
)
AppLatestCommit
=
App
.
get_latest_commit
()
if
AppLatestC
ommit
is
None
:
AppLatestC
ommit
=
_
(
"None"
)
latest_commit
=
ref
.
get_latest_commit
()
if
latest_c
ommit
is
None
:
latest_c
ommit
=
_
(
"None"
)
AppOrigin
=
App
.
get_origin
()
if
AppO
rigin
is
None
:
AppO
rigin
=
_
(
"None"
)
origin
=
ref
.
get_origin
()
if
o
rigin
is
None
:
o
rigin
=
_
(
"None"
)
AppSubpaths
=
App
.
get_subpaths
()
if
AppSubpaths
is
None
or
not
AppSub
paths
:
AppSubpathsAsString
=
_
(
"None"
)
sub_paths
=
ref
.
get_subpaths
()
if
sub_paths
is
None
or
not
sub_
paths
:
sub_paths_str
=
_
(
"None"
)
else
:
AppSubpathsAsString
=
""
for
item
in
AppSubpaths
:
AppSubpathsAsString
=
AppSubpathsAsString
+
item
+
", "
AppSubpathsAsString
=
AppSubpathsAsString
[:
-
2
]
InfoString
=
_
(
"Real Name: "
)
+
AppRealName
+
"
\n
"
+
\
_
(
"Arch: "
)
+
AppArch
+
"
\n
"
+
\
_
(
"Branch: "
)
+
AppBranch
+
"
\n
"
+
\
_
(
"Collection ID: "
)
+
AppCollectionID
+
"
\n
"
+
\
_
(
"Commit: "
)
+
AppCommit
+
"
\n
"
+
\
_
(
"Is Installed: "
)
+
_
(
"Yes"
)
+
"
\n
"
+
\
_
(
"License: "
)
+
AppLicense
+
"
\n
"
+
\
_
(
"Name: "
)
+
AppName
+
"
\n
"
+
\
_
(
"Summary: "
)
+
AppSummary
+
"
\n
"
+
\
_
(
"Version: "
)
+
AppVersion
+
"
\n
"
+
\
_
(
"Deploy Dir: "
)
+
AppDeployDir
+
"
\n
"
+
\
_
(
"EOL Reason: "
)
+
AppEOLReason
+
"
\n
"
+
\
_
(
"EOL Rebased: "
)
+
AppEOLRebased
+
"
\n
"
+
\
_
(
"Installed Size: "
)
+
AppInstalledSizeMiBAsString
+
"
\n
"
+
\
_
(
"Is Current: "
)
+
AppIsCurrentString
+
"
\n
"
+
\
_
(
"Latest Commit: "
)
+
AppLatestCommit
+
"
\n
"
+
\
_
(
"Origin: "
)
+
AppOrigin
+
"
\n
"
+
\
_
(
"Subpaths: "
)
+
AppSubpathsAsString
+
"
\n
"
elif
AppIsRemoteRef
:
AppDownloadSize
=
App
.
get_download_size
()
AppDownloadSizeMiB
=
AppDownloadSize
/
1048576
AppDownloadSizeMiBAsString
=
f
"{AppDownloadSizeMiB:.2f}"
+
" MiB"
AppEOLReason
=
App
.
get_eol
()
if
AppEOLReason
is
None
:
AppEOLReason
=
_
(
"None"
)
AppEOLRebased
=
App
.
get_eol_rebase
()
if
AppEOLRebased
is
None
:
AppEOLRebased
=
_
(
"None"
)
AppInstalledSize
=
App
.
get_installed_size
()
AppInstalledSizeMiB
=
AppInstalledSize
/
1048576
AppInstalledSizeMiBAsString
=
f
"{AppInstalledSizeMiB:.2f}"
+
" MiB"
AppRemoteName
=
App
.
get_remote_name
()
if
AppRemoteName
is
None
:
AppRemoteName
=
_
(
"None"
)
InfoString
=
_
(
"Real Name: "
)
+
AppRealName
+
"
\n
"
+
\
_
(
"Arch: "
)
+
AppArch
+
"
\n
"
+
\
_
(
"Branch: "
)
+
AppBranch
+
"
\n
"
+
\
_
(
"Collection ID: "
)
+
AppCollectionID
+
"
\n
"
+
\
_
(
"Commit: "
)
+
AppCommit
+
"
\n
"
+
\
_
(
"Is Installed: "
)
+
_
(
"Yes"
)
+
"
\n
"
+
\
_
(
"Download Size: "
)
+
AppDownloadSizeMiBAsString
+
"
\n
"
+
\
_
(
"EOL Reason: "
)
+
AppEOLReason
+
"
\n
"
+
\
_
(
"EOL Rebased: "
)
+
AppEOLRebased
+
"
\n
"
+
\
_
(
"Installed Size: "
)
+
AppInstalledSizeMiBAsString
+
"
\n
"
+
\
_
(
"Remote Name: "
)
+
AppRemoteName
+
"
\n
"
InfoWindow
(
self
.
Application
,
InfoString
,
App
)
sub_paths_str
=
""
for
item
in
sub_paths
:
sub_paths_str
=
sub_paths_str
+
item
+
", "
sub_paths_str
=
sub_paths_str
[:
-
2
]
info_str
=
_
(
"Real Name: "
)
+
real_name
+
"
\n
"
+
\
_
(
"Arch: "
)
+
arch
+
"
\n
"
+
\
_
(
"Branch: "
)
+
branch
+
"
\n
"
+
\
_
(
"Collection ID: "
)
+
collection_id
+
"
\n
"
+
\
_
(
"Commit: "
)
+
commit
+
"
\n
"
+
\
_
(
"Is Installed: "
)
+
_
(
"Yes"
)
+
"
\n
"
+
\
_
(
"License: "
)
+
app_license
+
"
\n
"
+
\
_
(
"Name: "
)
+
name
+
"
\n
"
+
\
_
(
"Summary: "
)
+
summary
+
"
\n
"
+
\
_
(
"Version: "
)
+
version
+
"
\n
"
+
\
_
(
"Deploy Dir: "
)
+
deploy_dir
+
"
\n
"
+
\
_
(
"EOL Reason: "
)
+
eol_reason
+
"
\n
"
+
\
_
(
"EOL Rebased: "
)
+
eol_rebased
+
"
\n
"
+
\
_
(
"Installed Size: "
)
+
installed_size_mib_as_string
+
"
\n
"
+
\
_
(
"Is Current: "
)
+
is_current_str
+
"
\n
"
+
\
_
(
"Latest Commit: "
)
+
latest_commit
+
"
\n
"
+
\
_
(
"Origin: "
)
+
origin
+
"
\n
"
+
\
_
(
"Subpaths: "
)
+
sub_paths_str
+
"
\n
"
elif
not
is_installed
:
download_size
=
ref
.
get_download_size
()
download_size_mib
=
download_size
/
1048576
download_size_mib_str
=
f
"{download_size_mib:.2f}"
+
" MiB"
eol_reason
=
ref
.
get_eol
()
if
eol_reason
is
None
:
eol_reason
=
_
(
"None"
)
eol_rebased
=
ref
.
get_eol_rebase
()
if
eol_rebased
is
None
:
eol_rebased
=
_
(
"None"
)
installed_size
=
ref
.
get_installed_size
()
installed_size_mib
=
installed_size
/
1048576
installed_size_mib_as_string
=
f
"{installed_size_mib:.2f}"
+
" MiB"
remote
=
ref
.
get_remote_name
()
if
remote
is
None
:
remote
=
_
(
"None"
)
info_str
=
_
(
"Real Name: "
)
+
real_name
+
"
\n
"
+
\
_
(
"Arch: "
)
+
arch
+
"
\n
"
+
\
_
(
"Branch: "
)
+
branch
+
"
\n
"
+
\
_
(
"Collection ID: "
)
+
collection_id
+
"
\n
"
+
\
_
(
"Commit: "
)
+
commit
+
"
\n
"
+
\
_
(
"Is Installed: "
)
+
_
(
"Yes"
)
+
"
\n
"
+
\
_
(
"Download Size: "
)
+
download_size_mib_str
+
"
\n
"
+
\
_
(
"EOL Reason: "
)
+
eol_reason
+
"
\n
"
+
\
_
(
"EOL Rebased: "
)
+
eol_rebased
+
"
\n
"
+
\
_
(
"Installed Size: "
)
+
installed_size_mib_as_string
+
"
\n
"
+
\
_
(
"Remote Name: "
)
+
remote
+
"
\n
"
else
:
self
.
MessageDialogError
.
set_markup
(
_
(
"<big><b>Invalid Flatpak Reference Error</b></big>"
))
self
.
MessageDialogError
.
format_secondary_text
(
_
(
"Invalid Flatpak reference is: "
)
+
"app/"
+
real_name
+
"/"
+
arch
+
"/"
+
branch
)
self
.
MessageDialogError
.
run
()
self
.
MessageDialogError
.
hide
()
return
None
InfoWindow
(
self
.
Application
,
info_str
,
ref
)
def
onUninstall
(
self
,
menuitem
):
Selection
=
self
.
TreeViewMain
.
get_selection
()
...
...
@@ -564,6 +581,6 @@ class MainWindow(object):
UpdateAllWindow
(
self
.
Application
,
self
.
FlatpakInstallation
,
self
.
ListStoreMain
)
def
on
About
(
self
,
menu
item
):
def
on
_about
(
self
,
menu_
item
):
self
.
AboutDialog
.
run
()
self
.
AboutDialog
.
hide
()
ui/mainwindow.glade
Dosyayı görüntüle @
7712942b
...
...
@@ -106,7 +106,7 @@ Author: Erdem Ersoy
<property
name=
"use_underline"
>
True
</property>
<property
name=
"image"
>
InfoImage
</property>
<property
name=
"use_stock"
>
False
</property>
<signal
name=
"activate"
handler=
"on
I
nfo"
swapped=
"no"
/>
<signal
name=
"activate"
handler=
"on
_i
nfo"
swapped=
"no"
/>
</object>
</child>
<child>
...
...
@@ -187,7 +187,7 @@ Author: Erdem Ersoy
<property
name=
"use_underline"
>
True
</property>
<property
name=
"image"
>
AboutImage
</property>
<property
name=
"use_stock"
>
False
</property>
<signal
name=
"activate"
handler=
"on
A
bout"
swapped=
"no"
/>
<signal
name=
"activate"
handler=
"on
_a
bout"
swapped=
"no"
/>
</object>
</child>
</object>
...
...
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