working tray
This commit is contained in:
@@ -276,7 +276,6 @@ def handle_reply(reply):
|
||||
transaction.t_lock = False
|
||||
transaction.Release()
|
||||
transaction.ProgressWindow.hide()
|
||||
transaction.TransactionDone()
|
||||
transaction.to_add = []
|
||||
transaction.to_remove = []
|
||||
transaction_dict.clear()
|
||||
|
@@ -160,6 +160,18 @@ class PamacDBusService(dbus.service.Object):
|
||||
(is_authorized,is_challenge,details) = policykit_authority.CheckAuthorization(Subject, action, {'': ''}, dbus.UInt32(1), '')
|
||||
return is_authorized
|
||||
|
||||
@dbus.service.signal('org.manjaro.pamac')
|
||||
def EmitAvailableUpdates(self, updates_nb):
|
||||
pass
|
||||
|
||||
def CheckUpdates(self):
|
||||
updates = False
|
||||
for pkg in config.handle.get_localdb().pkgcache:
|
||||
candidate = pyalpm.sync_newversion(pkg, config.handle.get_syncdbs())
|
||||
if candidate:
|
||||
updates = True
|
||||
self.EmitAvailableUpdates(updates)
|
||||
|
||||
@dbus.service.method('org.manjaro.pamac', '', 's')
|
||||
def Refresh(self):
|
||||
global t
|
||||
@@ -173,17 +185,9 @@ class PamacDBusService(dbus.service.Object):
|
||||
except pyalpm.error:
|
||||
error = traceback.format_exc()
|
||||
break
|
||||
self.CheckUpdates()
|
||||
return error
|
||||
|
||||
@dbus.service.signal('org.manjaro.pamac')
|
||||
def EmitTransactionDone(self, done):
|
||||
pass
|
||||
|
||||
@dbus.service.method('org.manjaro.pamac', '', '')
|
||||
def TransactionDone(self):
|
||||
self.EmitTransactionDone(True)
|
||||
return
|
||||
|
||||
@dbus.service.method('org.manjaro.pamac', 'a{sb}', 's', sender_keyword='sender', connection_keyword='connexion')
|
||||
def Init(self, options, sender=None, connexion=None):
|
||||
global t
|
||||
@@ -288,6 +292,7 @@ class PamacDBusService(dbus.service.Object):
|
||||
except dbus.exceptions.DBusException:
|
||||
pass
|
||||
finally:
|
||||
self.CheckUpdates()
|
||||
return error
|
||||
else :
|
||||
return 'You are not authorized'
|
||||
|
@@ -63,7 +63,6 @@ To_Remove = proxy.get_dbus_method('To_Remove','org.manjaro.pamac')
|
||||
To_Add = proxy.get_dbus_method('To_Add','org.manjaro.pamac')
|
||||
Commit = proxy.get_dbus_method('Commit','org.manjaro.pamac')
|
||||
Release = proxy.get_dbus_method('Release','org.manjaro.pamac')
|
||||
TransactionDone = proxy.get_dbus_method('TransactionDone','org.manjaro.pamac')
|
||||
StopDaemon = proxy.get_dbus_method('StopDaemon','org.manjaro.pamac')
|
||||
|
||||
def action_signal_handler(action):
|
||||
@@ -133,8 +132,7 @@ def get_updates():
|
||||
do_syncfirst = True
|
||||
return do_syncfirst, list_first
|
||||
result = []
|
||||
installed_pkglist = handle.get_localdb().pkgcache
|
||||
for pkg in installed_pkglist:
|
||||
for pkg in localpkgs.values():
|
||||
candidate = pyalpm.sync_newversion(pkg, handle.get_syncdbs())
|
||||
if candidate:
|
||||
for repo in handle.get_syncdbs():
|
||||
|
Reference in New Issue
Block a user