diff options
author | Joas Schilling <coding@schilljs.com> | 2016-12-01 15:32:39 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-12-01 15:36:22 +0100 |
commit | 917cac543637016743f5375ce54c5240b0263130 (patch) | |
tree | 843b27fcbce2bcc7c494e1604ecc80e87767b14d /apps/updatenotification | |
parent | 4ca7f9c896508f14ea2e5d9bdce8c3d986ea05dd (diff) | |
download | nextcloud-server-917cac543637016743f5375ce54c5240b0263130.tar.gz nextcloud-server-917cac543637016743f5375ce54c5240b0263130.zip |
Use the settings icon for the update notification
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/updatenotification')
-rw-r--r-- | apps/updatenotification/appinfo/app.php | 5 | ||||
-rw-r--r-- | apps/updatenotification/img/notification.svg | 1 | ||||
-rw-r--r-- | apps/updatenotification/lib/Notification/Notifier.php | 10 |
3 files changed, 11 insertions, 5 deletions
diff --git a/apps/updatenotification/appinfo/app.php b/apps/updatenotification/appinfo/app.php index f5bcf345669..e3010d418bb 100644 --- a/apps/updatenotification/appinfo/app.php +++ b/apps/updatenotification/appinfo/app.php @@ -43,10 +43,7 @@ if(\OC::$server->getConfig()->getSystemValue('updatechecker', true) === true) { $manager = \OC::$server->getNotificationManager(); $manager->registerNotifier(function() use ($manager) { - return new \OCA\UpdateNotification\Notification\Notifier( - $manager, - \OC::$server->getL10NFactory() - ); + return \OC::$server->query(\OCA\UpdateNotification\Notification\Notifier::class); }, function() { $l = \OC::$server->getL10N('updatenotification'); return [ diff --git a/apps/updatenotification/img/notification.svg b/apps/updatenotification/img/notification.svg new file mode 100644 index 00000000000..7a3f6270cbd --- /dev/null +++ b/apps/updatenotification/img/notification.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewbox="0 0 16 16"><path d="M6.938 0A.43.43 0 0 0 6.5.438v1.25a5.818 5.818 0 0 0-1.53.656l-.907-.906a.436.436 0 0 0-.625 0l-1.5 1.5a.436.436 0 0 0 0 .624l.906.907c-.285.48-.514.976-.656 1.53H.938a.43.43 0 0 0-.438.438v2.125C.5 8.81.69 9 .938 9h1.25a5.82 5.82 0 0 0 .656 1.53l-.907.908a.436.436 0 0 0 0 .625l1.5 1.5c.176.176.45.176.625 0l.907-.907c.48.285.976.514 1.53.656v1.25c0 .25.19.438.437.438h2.125a.43.43 0 0 0 .438-.438v-1.25a5.82 5.82 0 0 0 1.53-.657l.907.907c.176.175.45.175.625 0l1.5-1.5a.436.436 0 0 0 0-.625l-.906-.906A5.79 5.79 0 0 0 13.812 9h1.25a.43.43 0 0 0 .438-.438V6.437A.43.43 0 0 0 15.062 6h-1.25a5.79 5.79 0 0 0-.656-1.532l.906-.906a.436.436 0 0 0 0-.625l-1.5-1.5a.436.436 0 0 0-.625 0l-.906.906a5.816 5.816 0 0 0-1.53-.656V.437A.43.43 0 0 0 9.063 0zM8 4.157a3.344 3.344 0 0 1 0 6.686 3.344 3.344 0 0 1 0-6.686z" display="block"/></svg> diff --git a/apps/updatenotification/lib/Notification/Notifier.php b/apps/updatenotification/lib/Notification/Notifier.php index 3e1bc94425f..ccc2c2b6e29 100644 --- a/apps/updatenotification/lib/Notification/Notifier.php +++ b/apps/updatenotification/lib/Notification/Notifier.php @@ -24,6 +24,7 @@ namespace OCA\UpdateNotification\Notification; +use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Notification\IManager; use OCP\Notification\INotification; @@ -31,6 +32,9 @@ use OCP\Notification\INotifier; class Notifier implements INotifier { + /** @var IURLGenerator */ + protected $url; + /** @var IManager */ protected $notificationManager; @@ -43,10 +47,12 @@ class Notifier implements INotifier { /** * Notifier constructor. * + * @param IURLGenerator $url * @param IManager $notificationManager * @param IFactory $l10NFactory */ - public function __construct(IManager $notificationManager, IFactory $l10NFactory) { + public function __construct(IURLGenerator $url, IManager $notificationManager, IFactory $l10NFactory) { + $this->url = $url; $this->notificationManager = $notificationManager; $this->l10NFactory = $l10NFactory; $this->appVersions = $this->getAppVersions(); @@ -81,6 +87,8 @@ class Notifier implements INotifier { $notification->setParsedSubject($l->t('Update for %1$s to version %2$s is available.', [$appName, $notification->getObjectId()])); } + $notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('updatenotification', 'notification.svg'))); + return $notification; } |