Disable password entry if open is toggeld

This commit is contained in:
Nbiba Bedis 2021-09-27 10:53:31 +01:00
parent c390dbac5d
commit 54c7258ece
2 changed files with 17 additions and 2 deletions

View File

@ -414,7 +414,8 @@ int initUi(int argc, char *argv[]){
g_signal_connect (button_create_hp, "clicked", G_CALLBACK(on_create_hp_clicked), NULL);
g_signal_connect (button_stop_hp, "clicked", G_CALLBACK(on_stop_hp_clicked), NULL);
g_signal_connect (button_about, "clicked", G_CALLBACK(on_about_open_click), NULL);
g_signal_connect (button_refresh, "clicked", G_CALLBACK(on_refresh_clicked), NULL); //new
g_signal_connect (button_refresh, "clicked", G_CALLBACK(on_refresh_clicked), NULL);
g_signal_connect (cb_open, "toggled", G_CALLBACK(on_cb_open_clicked), NULL); //new
g_signal_connect (entry_mac, "changed", G_CALLBACK(entry_mac_warn), NULL);
g_signal_connect (entry_ssd, "changed", G_CALLBACK(entry_ssid_warn), NULL);
@ -938,4 +939,16 @@ static void on_refresh_clicked(GtkWidget *widget, gpointer data)
else {
clear_connecetd_devices_list();
}
}
}
/**
* When open checkbutton is toogled, disable password entry
*/
static void on_cb_open_clicked(GtkWidget *widget, gpointer data)
{
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
gtk_widget_set_sensitive((GtkWidget*)entry_pass, FALSE);
} else {
gtk_widget_set_sensitive((GtkWidget*)entry_pass, TRUE);
}
}

View File

@ -74,6 +74,8 @@ static void set_connected_devices_label(); // new
static void on_refresh_clicked(GtkWidget *widget, gpointer data);
static void on_cb_open_clicked(GtkWidget *widget, gpointer data);
static void clear_connecetd_devices_list();
#endif //WIHOTSPOT_UI_H