Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
labsync-tray
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto LIVIO BECCARIA
labsync-tray
Commits
d6cfa1f6
Commit
d6cfa1f6
authored
6 months ago
by
Alberto LIVIO BECCARIA
Browse files
Options
Downloads
Patches
Plain Diff
Nuova versione che manda le notifiche usando direttamente l'interfaccia
Python verso DBUS
parent
6906e44a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
DEBIAN/control
+2
-2
2 additions, 2 deletions
DEBIAN/control
DEBIAN/md5sums
+1
-1
1 addition, 1 deletion
DEBIAN/md5sums
build-deb.sh
+1
-1
1 addition, 1 deletion
build-deb.sh
src/labsync-tray-qt.py
+12
-6
12 additions, 6 deletions
src/labsync-tray-qt.py
with
16 additions
and
10 deletions
DEBIAN/control
+
2
−
2
View file @
d6cfa1f6
Package: labsync-tray
Version: 1.3
Version: 1.3
-1
Section: misc
Priority: optional
Architecture: all
Depends: python3 (>= 3.10), python3-pyqt5
Depends: python3 (>= 3.10), python3-pyqt5
, python3-dbus
Installed-Size: 60 kB
Maintainer: ulisse <ulisse@di.unipmn.it>
Description: Tray indicator of /opt synchronization
...
...
This diff is collapsed.
Click to expand it.
DEBIAN/md5sums
+
1
−
1
View file @
d6cfa1f6
09883148bc80f3f00823b877c47cf1d1 etc/xdg/autostart/labsync-tray.desktop
f9f193232003c6cc1385d1843baa6f88
usr/local/sbin/labsync-tray-qt.py
6ef7b2a0ae337e988845f45c73ab1aa5
usr/local/sbin/labsync-tray-qt.py
bff0947d3490abe5c892c2f6dd2bbb83 usr/local/sbin/resources.py
b4894a22afb866cee5d2d8bca7e5cfc8 usr/share/doc/labsync-tray/copyright
5d2cb94cda899d151a73423b152a8d3e usr/share/doc/labsync-tray/README.md
This diff is collapsed.
Click to expand it.
build-deb.sh
+
1
−
1
View file @
d6cfa1f6
...
...
@@ -8,7 +8,7 @@
# exit 1
#fi
VERSION
=
1.3
VERSION
=
1.3
-1
mkdir
labsync-tray_
${
VERSION
}
cd
labsync-tray_
${
VERSION
}
install
-d
-m
0755 etc/xdg/autostart
...
...
This diff is collapsed.
Click to expand it.
src/labsync-tray-qt.py
+
12
−
6
View file @
d6cfa1f6
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__version__
=
'
1.3
'
__version__
=
'
1.3
-1
'
"""
Labsync Tray Qt
...
...
@@ -12,6 +12,7 @@ import os
import
signal
import
atexit
import
argparse
import
dbus
from
functools
import
partial
from
enum
import
Enum
from
PyQt5
import
QtGui
,
QtCore
...
...
@@ -58,7 +59,7 @@ CHECK_INTERVAL = 15000
# Text messages and strings
MSG_SYNC_TITLE
=
"
Aggiornamento software in corso
"
MSG_SYNC_TEXT
=
"""
Stiamo aggiornando il software nella cartella /opt; ci
\
sarà un po
'
di attività sul disco.
sarà un po
'
di attività sul disco.
Alcuni dei programmi lì presenti (comprese le macchine virtuali) potrebbero
\
non funzionare correttamente fino al termine degli aggiornamenti.
...
...
@@ -93,6 +94,11 @@ class SystemTrayIcon(QSystemTrayIcon):
if
check_interval
!=
None
:
self
.
check_interval
=
check_interval
# dbus interface for notifications
item
=
"
org.freedesktop.Notifications
"
self
.
notify_interface
=
dbus
.
Interface
(
dbus
.
SessionBus
().
get_object
(
item
,
"
/
"
+
item
.
replace
(
"
.
"
,
"
/
"
)),
item
)
QSystemTrayIcon
.
__init__
(
self
,
icon
,
parent
)
# Define menu items
...
...
@@ -156,12 +162,12 @@ class SystemTrayIcon(QSystemTrayIcon):
txt
=
MSG_SYNCED_TEXT
#icon = QSystemTrayIcon.Information
'''
This does not work...
icon = QtGui.QIcon(APP_ICONS[self.status])
self
.
messageClicked
.
connect
(
self
.
notificationClicked
)
self.showMessage(title, txt, icon, 150000)
def
notification
Clicked
(
self
):
print
(
"
Tray message clicked!
"
)
'''
# send
notification
using dbus interface
self
.
notify_interface
.
Notify
(
APP_NAME
,
0
,
""
,
title
,
txt
,
[],
{
"
urgency
"
:
1
},
150000
)
def
updateStatus
(
self
):
exists
=
os
.
path
.
isfile
(
FILE_TO_CHECK
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment