class CustomVBox : VBox
{
public IdCardWidget current_idcard { get; set; default = null; }
+ private MainWindow main_window;
- public CustomVBox (bool homogeneous, int spacing)
+ public CustomVBox (MainWindow window, bool homogeneous, int spacing)
{
- this.set_homogeneous (homogeneous);
- this.set_spacing (spacing);
+ main_window = window;
+ set_homogeneous (homogeneous);
+ set_spacing (spacing);
}
public void receive_expanded_event (IdCardWidget id_card_widget)
{
- var list = this.get_children ();
+ var list = get_children ();
foreach (Widget id_card in list)
{
if (id_card != id_card_widget)
((IdCardWidget) id_card).collapse ();
}
current_idcard = id_card_widget;
+
+ if (current_idcard != null && main_window.request_queue.length > 0)
+ current_idcard.send_button.set_sensitive (true);
}
public void add_id_card_widget (IdCardWidget id_card_widget)
{
- this.pack_start (id_card_widget, false, false);
+ pack_start (id_card_widget, false, false);
}
public void remove_id_card_widget (IdCardWidget id_card_widget)
{
- this.remove (id_card_widget);
+ remove (id_card_widget);
}
}
hbutton_box.pack_end (delete_button);
hbutton_box.pack_end (details_button);
hbutton_box.pack_end (send_button);
+ send_button.set_sensitive (false);
delete_button.clicked.connect (delete_button_cb);
details_button.clicked.connect (details_button_cb);
private MoonshotServer ipc_server;
private IdCard default_id_card;
- private Queue<IdentityRequest> request_queue;
+ public Queue<IdentityRequest> request_queue;
private HashTable<Gtk.Button, string> service_button_map;
IdCard identity = null;
this.request_queue.push_tail (request);
+
+ if (custom_vbox.current_idcard != null &&
+ custom_vbox.current_idcard.send_button != null)
+ custom_vbox.current_idcard.send_button.set_sensitive (true);
if (request.select_default)
{
this.search_entry.notify["text"].connect (search_entry_text_changed_cb);
this.search_entry.key_press_event.connect(search_entry_key_press_event_cb);
- this.custom_vbox = new CustomVBox (false, 6);
+ this.custom_vbox = new CustomVBox (this, false, 6);
var viewport = new Viewport (null, null);
viewport.set_border_width (6);