Merge pull request #187 from sigmaSd/open_pass

Disable password entry if open is toggeld
This commit is contained in:
Lakindu Akash 2021-09-27 18:23:17 +05:30 committed by GitHub
commit a3c2b1bcf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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