mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-10-01 05:33:49 +00:00
Add user_query_async to GitgExt.Application
This commit is contained in:
parent
ee1b47cc95
commit
f3fede0912
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue