diff --git a/source/ubinstall-gtk-network.c b/source/ubinstall-gtk-network.c index 75ea523..49ab218 100644 --- a/source/ubinstall-gtk-network.c +++ b/source/ubinstall-gtk-network.c @@ -44,6 +44,11 @@ void on_type_changed(GtkComboBox *self,network_info *info){ } } +void on_network_removed(GtkWidget *,network_info *info){ + gtk_widget_destroy(info->MainBox); + free(info); +} + network_info *yon_network_info_new(){ network_info *info = new(network_info); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_network_info); @@ -77,6 +82,7 @@ network_info *yon_network_info_new(){ g_signal_connect(G_OBJECT(info->AutoGetIPSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch_inversed),info->GatewayEntry); g_signal_connect(G_OBJECT(info->AutoGetIPSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch_inversed),info->MaskEntry); g_signal_connect(G_OBJECT(info->AutoGetIPSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch_inversed),info->DNSEntry); + g_signal_connect(G_OBJECT(info->RemoveButton),"clicked",G_CALLBACK(on_network_removed),info); g_signal_connect(G_OBJECT(info->TypeCombo),"changed",G_CALLBACK(on_type_changed),info); yon_gtk_revealer_set_from_switch_inversed(GTK_REVEALER(info->IpRevealer),GTK_SWITCH(info->AutoGetIPSwitch)); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 5908614..7a972a3 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -1471,4 +1471,5 @@ void yon_startup_language_init(); gboolean on_languages_search_func(GtkTreeModel *model, gint col,const char *key, GtkTreeIter *iter, main_window *widgets); void yon_update_translation(main_window *widgets); void yon_translation_init(GtkBuilder *builder); -void yon_licence_load(main_window *widgets); \ No newline at end of file +void yon_licence_load(main_window *widgets); +void on_network_removed(GtkWidget *,network_info *info); \ No newline at end of file diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 719155f..0646b0c 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -5869,7 +5869,7 @@ agreement True - True + False True