[gitg] Factor showing global author details dialog
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Factor showing global author details dialog
- Date: Fri, 7 Aug 2015 11:29:40 +0000 (UTC)
commit cebe1188e7012f38b14f84cb8b56275fa6e2eeee
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Fri Aug 7 13:22:08 2015 +0200
Factor showing global author details dialog
gitg/gitg-author-details-dialog.vala | 21 ++++++++++++++++++++-
gitg/gitg-window.vala | 14 +-------------
2 files changed, 21 insertions(+), 14 deletions(-)
---
diff --git a/gitg/gitg-author-details-dialog.vala b/gitg/gitg-author-details-dialog.vala
index 37b3eab..60fcbb5 100644
--- a/gitg/gitg-author-details-dialog.vala
+++ b/gitg/gitg-author-details-dialog.vala
@@ -54,6 +54,25 @@ namespace Gitg
d_config = config;
}
+ public static AuthorDetailsDialog? show_global(Window window)
+ {
+ Ggit.Config global_config = null;
+
+ try
+ {
+ global_config = new Ggit.Config.default();
+ }
+ catch (Error e)
+ {
+ return null;
+ }
+
+ var author_details = new AuthorDetailsDialog(window, global_config, null);
+ author_details.show();
+
+ return author_details;
+ }
+
public override void show()
{
base.show();
@@ -112,7 +131,7 @@ namespace Gitg
d_input_name.activate.connect((e) => {
response(Gtk.ResponseType.OK);
});
-
+
d_input_email.activate.connect((e) => {
response(Gtk.ResponseType.OK);
});
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 674ea00..c04e5ad 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -483,19 +483,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
private void on_global_author_details_activated()
{
- Ggit.Config global_config = null;
-
- try
- {
- global_config = new Ggit.Config.default();
- }
- catch (Error e)
- {
- return;
- }
-
- var author_details = new AuthorDetailsDialog(this, global_config, null);
- author_details.show();
+ AuthorDetailsDialog.show_global(this);
}
private void on_repo_author_details_activated()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]