Add user_query_async to GitgExt.Application

This commit is contained in:
Jesse van den Kieboom 2015-08-13 08:11:00 +02:00
parent ee1b47cc95
commit f3fede0912
2 changed files with 20 additions and 0 deletions

View file

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

View file

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