New functions; fixes

pull/38/head
parent 2b755a2511
commit 5873918847

@ -64,8 +64,16 @@ void on_file_chooser_selected(GtkWidget *self, filechooser_window *window){
if (success_size) yon_char_parsed_free(paths_success,success_size); if (success_size) yon_char_parsed_free(paths_success,success_size);
} }
filechooser_window *__yon_filechooser_window = NULL;
void yon_file_chooser_set_button_label(char *label){
}
filechooser_window *yon_file_chooser_window_new(GtkFileChooserAction action){ filechooser_window *yon_file_chooser_window_new(GtkFileChooserAction action){
if (!__yon_filechooser_window){
filechooser_window *window = malloc(sizeof(filechooser_window)); filechooser_window *window = malloc(sizeof(filechooser_window));
__yon_filechooser_window = window;
GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_filechooser); GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_filechooser);
window->Window = yon_gtk_builder_get_widget(builder,"Window"); window->Window = yon_gtk_builder_get_widget(builder,"Window");
window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox"); window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
@ -99,6 +107,9 @@ filechooser_window *yon_file_chooser_window_new(GtkFileChooserAction action){
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
return window; return window;
} else {
return __yon_filechooser_window;
}
} }
GtkResponseType yon_file_chooser_start(filechooser_window *window){ GtkResponseType yon_file_chooser_start(filechooser_window *window){

@ -454,8 +454,8 @@ struct loaded_config *yon_config_get_compared(char *command){
} }
char *yon_custom_config_init(){ char *yon_custom_config_init(GtkFileChooserAction type){
filechooser_window *dialog = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_OPEN); filechooser_window *dialog = yon_file_chooser_window_new(type);
gtk_widget_hide(dialog->ChooseFolderCheck); gtk_widget_hide(dialog->ChooseFolderCheck);
yon_gtk_window_setup(GTK_WINDOW(dialog->Window),NULL,template_app_information.app_title,yon_char_unite("com.ublinux.",template_app_information.app_tech_name,NULL),"ConfigFilechooserWindow"); yon_gtk_window_setup(GTK_WINDOW(dialog->Window),NULL,template_app_information.app_title,yon_char_unite("com.ublinux.",template_app_information.app_tech_name,NULL),"ConfigFilechooserWindow");
@ -537,7 +537,7 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
config_to_save = yon_config_get_type_path(type); config_to_save = yon_config_get_type_path(type);
if (!path&&type == YON_CONFIG_CUSTOM){ if (!path&&type == YON_CONFIG_CUSTOM){
path = yon_custom_config_init(); path = yon_custom_config_init(GTK_FILE_CHOOSER_ACTION_SAVE);
if (!path) return NULL; if (!path) return NULL;
} }

@ -325,6 +325,8 @@ char *yon_custom_config_init();
#define CANCEL_LABEL _("Cancel") #define CANCEL_LABEL _("Cancel")
#define ACCEPT_LABEL _("Accept") #define ACCEPT_LABEL _("Accept")
#define OPEN_LABEL _("Open") #define OPEN_LABEL _("Open")
#define CREATE_FOLDER_LABEL _("Create directory")
#define SELECT_FOLDER_LABEL _("Select directory")
#define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?") #define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?")
#define HELP_INFO_LABEL _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.") #define HELP_INFO_LABEL _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.")
@ -375,6 +377,7 @@ char *yon_custom_config_init();
#define CHOOSE_FILE_LABEL _("Choose path") #define CHOOSE_FILE_LABEL _("Choose path")
#define FILE_CHOOSER_CHOOSE_FILDER_LABEL _("Choose directory instead of file") #define FILE_CHOOSER_CHOOSE_FILDER_LABEL _("Choose directory instead of file")
#endif #endif
Loading…
Cancel
Save