Use the settings icon for the update notification

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2016-12-01 15:32:39 +01:00
parent 4ca7f9c896
commit 917cac5436
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
3 changed files with 11 additions and 5 deletions

View File

@ -43,10 +43,7 @@ if(\OC::$server->getConfig()->getSystemValue('updatechecker', true) === true) {
$manager = \OC::$server->getNotificationManager(); $manager = \OC::$server->getNotificationManager();
$manager->registerNotifier(function() use ($manager) { $manager->registerNotifier(function() use ($manager) {
return new \OCA\UpdateNotification\Notification\Notifier( return \OC::$server->query(\OCA\UpdateNotification\Notification\Notifier::class);
$manager,
\OC::$server->getL10NFactory()
);
}, function() { }, function() {
$l = \OC::$server->getL10N('updatenotification'); $l = \OC::$server->getL10N('updatenotification');
return [ return [

View File

@ -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>

After

Width:  |  Height:  |  Size: 923 B

View File

@ -24,6 +24,7 @@
namespace OCA\UpdateNotification\Notification; namespace OCA\UpdateNotification\Notification;
use OCP\IURLGenerator;
use OCP\L10N\IFactory; use OCP\L10N\IFactory;
use OCP\Notification\IManager; use OCP\Notification\IManager;
use OCP\Notification\INotification; use OCP\Notification\INotification;
@ -31,6 +32,9 @@ use OCP\Notification\INotifier;
class Notifier implements INotifier { class Notifier implements INotifier {
/** @var IURLGenerator */
protected $url;
/** @var IManager */ /** @var IManager */
protected $notificationManager; protected $notificationManager;
@ -43,10 +47,12 @@ class Notifier implements INotifier {
/** /**
* Notifier constructor. * Notifier constructor.
* *
* @param IURLGenerator $url
* @param IManager $notificationManager * @param IManager $notificationManager
* @param IFactory $l10NFactory * @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->notificationManager = $notificationManager;
$this->l10NFactory = $l10NFactory; $this->l10NFactory = $l10NFactory;
$this->appVersions = $this->getAppVersions(); $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->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; return $notification;
} }