[gitg] Add user_query_async to GitgExt.Application
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Add user_query_async to GitgExt.Application
- Date: Thu, 13 Aug 2015 06:20:12 +0000 (UTC)
commit f3fede091241b25ccc43fbcd1b54c8c5fc0ae06f
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Thu Aug 13 08:11:00 2015 +0200
Add user_query_async to GitgExt.Application
gitg/gitg-window.vala | 19 +++++++++++++++++++
libgitg-ext/gitg-ext-application.vala | 1 +
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index c33b70e..a51d716 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -852,6 +852,25 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
d_infobar.show();
}
+ public async Gtk.ResponseType user_query_async(GitgExt.UserQuery query)
+ {
+ SourceFunc cb = user_query_async.callback;
+ Gtk.ResponseType retval = 0;
+
+ query.response.connect((response) => {
+ retval = response;
+
+ Idle.add((owned)cb);
+ return true;
+ });
+
+ user_query(query);
+
+ yield;
+
+ return retval;
+ }
+
public void user_query(GitgExt.UserQuery query)
{
var dlg = new Gtk.MessageDialog(this,
diff --git a/libgitg-ext/gitg-ext-application.vala b/libgitg-ext/gitg-ext-application.vala
index 03858a5..3269d5e 100644
--- a/libgitg-ext/gitg-ext-application.vala
+++ b/libgitg-ext/gitg-ext-application.vala
@@ -76,6 +76,7 @@ public interface Application : Object
public abstract GitgExt.Activity? set_activity_by_id(string id);
public abstract void user_query(UserQuery query);
+ public abstract async Gtk.ResponseType user_query_async(UserQuery query);
public abstract void show_infobar(string primary_msg,
string secondary_msg,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]