diff --git a/source/libublsettings-gtk3.c b/source/libublsettings-gtk3.c index b8c2707..cdd8dfe 100644 --- a/source/libublsettings-gtk3.c +++ b/source/libublsettings-gtk3.c @@ -293,6 +293,7 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi if (!access(path,0)){ __yon_window_config_file = g_key_file_new(); __yon_window_config_path=yon_char_new(path); + chmod(__yon_window_config_path,0777); if (!g_key_file_load_from_file(__yon_window_config_file,__yon_window_config_path,G_KEY_FILE_NONE,NULL)){ struct stat st; int size; @@ -1088,9 +1089,7 @@ GtkWidget *yon_ubl_browser_window_open(char *link, char *browser_window_name){ #else GtkWidget *yon_ubl_browser_window_open(char *link, char *browser_window_name){ - char *user=getenv("SUDO_USER"); - if (!user) - user=getlogin(); + char *user=yon_ubl_root_user_get(); char *command=yon_char_unite("sudo -u ",user," xdg-open ", link,NULL); yon_launch(command); return NULL; @@ -1283,6 +1282,19 @@ void yon_gtk_tree_store_fill_children(GtkTreeStore *tree, GtkTreeIter *parent, d #include +void yon_on_password_visibility_changed(GtkEntry *self, GtkEntryIconPosition position){ + if (position==GTK_ENTRY_ICON_SECONDARY){ + int status = gtk_entry_get_visibility(self); + gtk_entry_set_visibility(self,!status); + } +} + +void yon_gtk_entry_set_password_visibility_icon(GtkEntry *target){ + g_return_if_fail(GTK_IS_ENTRY(target)); + gtk_entry_set_icon_from_icon_name(target,GTK_ENTRY_ICON_SECONDARY,"com.ublinux.libublsettingsui-gtk3.view-symbolic"); + g_signal_connect(G_OBJECT(target),"icon-release",G_CALLBACK(yon_on_password_visibility_changed),NULL); +} + void yon_gtk_tree_store_copy_recursive(GtkTreeModel *sourceModel, GtkTreeIter *sourceIter, GtkTreeStore *destination, GtkTreeIter *parentIter) { GtkTreeIter destIter; diff --git a/source/libublsettings-gtk3.h b/source/libublsettings-gtk3.h index 2382910..e15ad98 100644 --- a/source/libublsettings-gtk3.h +++ b/source/libublsettings-gtk3.h @@ -482,6 +482,8 @@ typedef struct { rmb_menu_window *yon_rmb_menu_setup(GtkWidget *target_widget, int (*show_function)(void*), void *show_data, const char *button_label, const char *icon_name, GCallback function, gpointer data,...); #endif +void yon_gtk_entry_set_password_visibility_icon(GtkEntry *target); + void yon_on_text_insert_only_digits(GtkEditable *editable, const gchar *text, gint length, gint *position, gpointer user_data); // GtkTreeStore section