Skip to content
Snippets Groups Projects
Commit 24eb37aa authored by guinux's avatar guinux
Browse files

use glib notifications

parent 5e9a58ea
No related branches found
No related tags found
No related merge requests found
...@@ -339,7 +339,7 @@ const PamacUpdateIndicator = new Lang.Class({ ...@@ -339,7 +339,7 @@ const PamacUpdateIndicator = new Lang.Class({
// We have to prepare this only once // We have to prepare this only once
this._notifSource = new MessageTray.SystemNotificationSource(); this._notifSource = new MessageTray.SystemNotificationSource();
this._notifSource.createIcon = function() { this._notifSource.createIcon = function() {
return new St.Icon({ icon_name: "system-software-update" }); return new St.Icon({ icon_name: "system-software-install-symbolic" });
}; };
// Take care of note leaving unneeded sources // Take care of note leaving unneeded sources
this._notifSource.connect('destroy', Lang.bind(this, function() {this._notifSource = null;})); this._notifSource.connect('destroy', Lang.bind(this, function() {this._notifSource = null;}));
......
...@@ -105,8 +105,6 @@ namespace Pamac { ...@@ -105,8 +105,6 @@ namespace Pamac {
start_building.connect (start_progressbar_pulse); start_building.connect (start_progressbar_pulse);
stop_building.connect (stop_progressbar_pulse); stop_building.connect (stop_progressbar_pulse);
write_pamac_config_finished.connect (set_trans_flags); write_pamac_config_finished.connect (set_trans_flags);
// notify
Notify.init (dgettext (null, "Package Manager"));
// flags // flags
set_trans_flags (); set_trans_flags ();
// ask_confirmation option // ask_confirmation option
...@@ -724,14 +722,9 @@ namespace Pamac { ...@@ -724,14 +722,9 @@ namespace Pamac {
dialog.default_width = 600; dialog.default_width = 600;
dialog.default_height = 300; dialog.default_height = 300;
Timeout.add (1000, () => { Timeout.add (1000, () => {
try { var notification = new Notification (dgettext (null, "Package Manager"));
var notification = new Notify.Notification (dgettext (null, "Package Manager"), notification.set_body (message);
message, this.application_window.application.send_notification ("pamac-manager", notification);
"system-software-update");
notification.show ();
} catch (Error e) {
stderr.printf ("Notify Error: %s", e.message);
}
return false; return false;
}); });
dialog.run (); dialog.run ();
...@@ -740,14 +733,9 @@ namespace Pamac { ...@@ -740,14 +733,9 @@ namespace Pamac {
void on_finished (bool success) { void on_finished (bool success) {
if (success) { if (success) {
try { var notification = new Notification (dgettext (null, "Package Manager"));
var notification = new Notify.Notification (dgettext (null, "Package Manager"), notification.set_body (dgettext (null, "Transaction successfully finished"));
dgettext (null, "Transaction successfully finished"), this.application_window.application.send_notification ("pamac-manager", notification);
"system-software-update");
notification.show ();
} catch (Error e) {
stderr.printf ("Notify Error: %s", e.message);
}
show_warnings (false); show_warnings (false);
} else { } else {
warning_textbuffer = new StringBuilder (); warning_textbuffer = new StringBuilder ();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment