Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
P
Pardus APT Update Indicator - GNOME Shell Extension
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 APT Update Indicator - GNOME Shell Extension
Commits
58b18f2e
Kaydet (Commit)
58b18f2e
authored
Ara 08, 2016
tarafından
franglais125
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Organize the menu creation
üst
ec19791c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
29 deletions
+33
-29
extension.js
extension.js
+33
-29
No files found.
extension.js
Dosyayı görüntüle @
58b18f2e
...
...
@@ -105,12 +105,34 @@ const AptUpdateIndicator = new Lang.Class({
box
.
add_child
(
this
.
label
);
this
.
actor
.
add_child
(
box
);
// Assemble the menu
this
.
_assembleMenu
();
// Load settings
this
.
_settings
=
Utils
.
getSettings
();
this
.
_settingsChangedId
=
this
.
_settings
.
connect
(
'changed'
,
Lang
.
bind
(
this
,
this
.
_applySettings
));
this
.
_applySettings
();
// Restore previous state
this
.
_updateList
=
UPDATES_LIST
;
this
.
_updateStatus
(
UPDATES_PENDING
);
// The first run is initialization only: we only read the existing files
this
.
_initializing
=
true
;
this
.
_otherPackages
(
false
,
PKG_STATUS
.
UPGRADABLE
);
},
_openSettings
:
function
()
{
Util
.
spawn
([
"gnome-shell-extension-prefs"
,
Me
.
uuid
]);
},
_assembleMenu
:
function
()
{
// Prepare the special menu : a submenu for updates list that will look like a regular menu item when disabled
// Scrollability will also be taken care of by the popupmenu
this
.
menu
Expander
=
new
PopupMenu
.
PopupSubMenuMenuItem
(
''
);
this
.
updates
Expander
=
new
PopupMenu
.
PopupSubMenuMenuItem
(
''
);
this
.
updatesListMenuLabel
=
new
St
.
Label
();
this
.
menu
Expander
.
menu
.
box
.
add
(
this
.
updatesListMenuLabel
);
this
.
menu
Expander
.
menu
.
box
.
style_class
=
'apt-update-indicator-list'
;
this
.
updates
Expander
.
menu
.
box
.
add
(
this
.
updatesListMenuLabel
);
this
.
updates
Expander
.
menu
.
box
.
style_class
=
'apt-update-indicator-list'
;
this
.
newPackagesExpander
=
new
PopupMenu
.
PopupSubMenuMenuItem
(
_
(
'New in repository'
));
this
.
newPackagesListMenuLabel
=
new
St
.
Label
();
...
...
@@ -142,7 +164,7 @@ const AptUpdateIndicator = new Lang.Class({
this
.
lastCheckMenuItem
.
actor
.
reactive
=
false
;
// Assemble all menu items into the popup menu
this
.
menu
.
addMenuItem
(
this
.
menu
Expander
);
this
.
menu
.
addMenuItem
(
this
.
updates
Expander
);
this
.
menu
.
addMenuItem
(
new
PopupMenu
.
PopupSeparatorMenuItem
());
this
.
menu
.
addMenuItem
(
this
.
newPackagesExpander
);
this
.
menu
.
addMenuItem
(
this
.
obsoletePackagesExpander
);
...
...
@@ -160,23 +182,6 @@ const AptUpdateIndicator = new Lang.Class({
this
.
checkNowMenuItem
.
connect
(
'activate'
,
Lang
.
bind
(
this
,
this
.
_checkUpdates
));
settingsMenuItem
.
connect
(
'activate'
,
Lang
.
bind
(
this
,
this
.
_openSettings
));
this
.
updateNowMenuItem
.
connect
(
'activate'
,
Lang
.
bind
(
this
,
this
.
_updateNow
));
// Load settings
this
.
_settings
=
Utils
.
getSettings
();
this
.
_settingsChangedId
=
this
.
_settings
.
connect
(
'changed'
,
Lang
.
bind
(
this
,
this
.
_applySettings
));
this
.
_applySettings
();
// Restore previous state
this
.
_updateList
=
UPDATES_LIST
;
this
.
_updateStatus
(
UPDATES_PENDING
);
// The first run is initialization only: we only read the existing files
this
.
_initializing
=
true
;
this
.
_otherPackages
(
false
,
PKG_STATUS
.
UPGRADABLE
);
},
_openSettings
:
function
()
{
Util
.
spawn
([
"gnome-shell-extension-prefs"
,
Me
.
uuid
]);
},
_applySettings
:
function
()
{
...
...
@@ -296,9 +301,9 @@ const AptUpdateIndicator = new Lang.Class({
_checkAutoExpandList
:
function
()
{
if
(
this
.
menu
.
isOpen
&&
UPDATES_PENDING
>
0
&&
UPDATES_PENDING
<=
this
.
_settings
.
get_int
(
'auto-expand-list'
))
{
this
.
menu
Expander
.
setSubmenuShown
(
true
);
this
.
updates
Expander
.
setSubmenuShown
(
true
);
}
else
{
this
.
menu
Expander
.
setSubmenuShown
(
false
);
this
.
updates
Expander
.
setSubmenuShown
(
false
);
}
},
...
...
@@ -444,13 +449,13 @@ const AptUpdateIndicator = new Lang.Class({
_updateMenuExpander
:
function
(
enabled
,
label
)
{
if
(
label
==
""
)
{
// No text, hide the menuitem
this
.
menu
Expander
.
actor
.
visible
=
false
;
this
.
updates
Expander
.
actor
.
visible
=
false
;
}
else
{
// We make our expander look like a regular menu label if disabled
this
.
menu
Expander
.
actor
.
reactive
=
enabled
;
this
.
menu
Expander
.
_triangle
.
visible
=
enabled
;
this
.
menu
Expander
.
label
.
set_text
(
label
);
this
.
menu
Expander
.
actor
.
visible
=
true
;
this
.
updates
Expander
.
actor
.
reactive
=
enabled
;
this
.
updates
Expander
.
_triangle
.
visible
=
enabled
;
this
.
updates
Expander
.
label
.
set_text
(
label
);
this
.
updates
Expander
.
actor
.
visible
=
true
;
}
// 'Update now' visibility is linked so let's save a few lines and set it here
...
...
@@ -503,7 +508,6 @@ const AptUpdateIndicator = new Lang.Class({
*/
_checkUpdates
:
function
()
{
this
.
menu
.
close
();
if
(
this
.
_upgradeProcess_sourceId
)
{
// A check is already running ! Maybe we should kill it and run another one ?
return
;
...
...
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