[gitg] Only auto-hide successfull action notification
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Only auto-hide successfull action notification
- Date: Thu, 13 Aug 2015 06:42:50 +0000 (UTC)
commit 0c09e59f76406d814bf6be1c2313f4e63c65c5a4
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Thu Aug 13 08:42:03 2015 +0200
Only auto-hide successfull action notification
gitg/gitg-remote-notification.vala | 12 ++++++++----
gitg/gitg-simple-notification.vala | 12 ++++++++----
2 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/gitg/gitg-remote-notification.vala b/gitg/gitg-remote-notification.vala
index 185a88b..8505103 100644
--- a/gitg/gitg-remote-notification.vala
+++ b/gitg/gitg-remote-notification.vala
@@ -64,7 +64,7 @@ public class RemoteNotification : ProgressBin, GitgExt.Notification
get_style_context().add_class("success");
- finish();
+ finish(true);
return false;
});
@@ -77,19 +77,23 @@ public class RemoteNotification : ProgressBin, GitgExt.Notification
this.text = text;
get_style_context().add_class("error");
- finish();
+ finish(false);
return false;
});
}
- private void finish()
+ private void finish(bool auto_close)
{
Idle.add(() => {
d_finished = true;
d_button_cancel.label = _("Close");
- close(3000);
+ if (auto_close)
+ {
+ close(3000);
+ }
+
return false;
});
}
diff --git a/gitg/gitg-simple-notification.vala b/gitg/gitg-simple-notification.vala
index 7c68107..b10444c 100644
--- a/gitg/gitg-simple-notification.vala
+++ b/gitg/gitg-simple-notification.vala
@@ -68,7 +68,7 @@ public class SimpleNotification : Gtk.Grid, GitgExt.Notification
this.message = message;
get_style_context().add_class("success");
- finish();
+ finish(true);
return false;
});
@@ -86,19 +86,23 @@ public class SimpleNotification : Gtk.Grid, GitgExt.Notification
this.message = message;
get_style_context().add_class("error");
- finish();
+ finish(false);
return false;
});
}
- private void finish()
+ private void finish(bool auto_close)
{
Idle.add(() => {
d_finished = true;
d_button_cancel.label = _("Close");
- close(3000);
+ if (auto_close)
+ {
+ close(3000);
+ }
+
return false;
});
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]