[DBus (name = "org.janet.Moonshot")]
public class MoonshotServer : Object {
private int counter;
+ private MainWindow main_window;
+
+ public MoonshotServer (Gtk.Window window)
+ {
+ this.main_window = (MainWindow) window;
+ }
public int ping (string msg)
{
string password,
string service)
{
- string[3] information = {"identity", "password", "certificate"};
+ string[3] information = new string[3];
+
+ var id_card = this.main_window.selected_id_card_widget.id_card;
+
+ information[0] = "identity";
+ information[1] = id_card.password;
+ information[2] = "certificate";
return information;
}
public signal void expanded ();
public signal void remove_id ();
public signal void details_id ();
+ public signal void send_id ();
public void collapse ()
{
this.details_id ();
}
+ private void send_button_cb ()
+ {
+ this.send_id ();
+ }
+
private void set_idcard_color ()
{
var color = Gdk.Color ();
delete_button.clicked.connect (delete_button_cb);
details_button.clicked.connect (details_button_cb);
+ send_button.clicked.connect (send_button_cb);
this.main_vbox = new VBox (false, 12);
main_vbox.pack_start (table, true, true, 0);
private MoonshotServer dbus_server;
+ public IdCardWidget selected_id_card_widget;
+
private enum Columns
{
IDCARD_COL,
id_card_widget.details_id.connect (details_identity_cb);
id_card_widget.remove_id.connect (remove_identity_cb);
+ id_card_widget.send_id.connect (send_identity_cb);
id_card_widget.expanded.connect (this.custom_vbox.receive_expanded_event);
id_card_widget.expanded.connect (fill_details);
}
dialog.destroy ();
}
+ public void send_identity_cb (IdCardWidget id_card_widget)
+ {
+ this.selected_id_card_widget = id_card_widget;
+ }
+
private void label_make_bold (Label label)
{
var font_desc = new Pango.FontDescription ();
uint reply = bus.request_name ("org.janet.Moonshot", (uint) 0);
assert (reply == DBus.RequestNameReply.PRIMARY_OWNER);
- this.dbus_server = new MoonshotServer ();
+ this.dbus_server = new MoonshotServer (this);
conn.register_object ("/org/janet/moonshot", dbus_server);
}