|
|
|
@ -1276,27 +1276,6 @@ add_log_window *on_add_open(){
|
|
|
|
return window;
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_log_add(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->list);
|
|
|
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
add_log_window *window = on_add_open();
|
|
|
|
|
|
|
|
gtk_widget_show(window->MainWindow);
|
|
|
|
|
|
|
|
gtk_widget_hide(window->StatisticsFrame);
|
|
|
|
|
|
|
|
gtk_widget_hide(window->ControlSectionBox);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_log_path_choose(GtkWidget *self,add_log_window *window){
|
|
|
|
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(TITLE_LABEL,GTK_WINDOW(window->MainWindow),GTK_FILE_CHOOSER_ACTION_OPEN,CANCEL_LABEL,GTK_RESPONSE_CANCEL,ACCEPT_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
|
|
|
|
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),"/");
|
|
|
|
|
|
|
|
int response = gtk_dialog_run(GTK_DIALOG(dialog));
|
|
|
|
|
|
|
|
if (response == GTK_RESPONSE_ACCEPT){
|
|
|
|
|
|
|
|
GtkWidget *parent = gtk_widget_get_parent(self);
|
|
|
|
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(parent));
|
|
|
|
|
|
|
|
gtk_entry_set_text((GtkEntry*)g_list_nth_data(list,1),gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_log_path_remove(GtkWidget *self, add_log_window *window){
|
|
|
|
void on_log_path_remove(GtkWidget *self, add_log_window *window){
|
|
|
|
GList *paths = gtk_container_get_children(GTK_CONTAINER(window->LogPathsBox));
|
|
|
|
GList *paths = gtk_container_get_children(GTK_CONTAINER(window->LogPathsBox));
|
|
|
|
for (int i=0;i<g_list_length(paths);i++){
|
|
|
|
for (int i=0;i<g_list_length(paths);i++){
|
|
|
|
@ -1317,15 +1296,35 @@ void on_log_path_remove(GtkWidget *self, add_log_window *window){
|
|
|
|
g_list_free(paths);
|
|
|
|
g_list_free(paths);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_log_path_choose(GtkWidget *self,add_log_window *window){
|
|
|
|
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(TITLE_LABEL,GTK_WINDOW(window->MainWindow),GTK_FILE_CHOOSER_ACTION_OPEN,CANCEL_LABEL,GTK_RESPONSE_CANCEL,ACCEPT_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
|
|
|
|
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),"/");
|
|
|
|
|
|
|
|
int response = gtk_dialog_run(GTK_DIALOG(dialog));
|
|
|
|
|
|
|
|
if (response == GTK_RESPONSE_ACCEPT){
|
|
|
|
|
|
|
|
GtkWidget *parent = gtk_widget_get_parent(self);
|
|
|
|
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(parent));
|
|
|
|
|
|
|
|
gtk_entry_set_text((GtkEntry*)g_list_nth_data(list,1),gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_log_path_append(GtkWidget *self, add_log_window *window){
|
|
|
|
void on_log_path_append(GtkWidget *self, add_log_window *window){
|
|
|
|
GList *paths = gtk_container_get_children(GTK_CONTAINER(window->LogPathsBox));
|
|
|
|
GList *paths = gtk_container_get_children(GTK_CONTAINER(window->LogPathsBox));
|
|
|
|
GtkWidget *box = (GtkWidget*)g_list_nth_data(paths,g_list_length(paths)-1);
|
|
|
|
GtkWidget *box = (GtkWidget*)g_list_nth_data(paths,g_list_length(paths)-1);
|
|
|
|
GList *path_widgets = gtk_container_get_children(GTK_CONTAINER(box));
|
|
|
|
GList *path_widgets;
|
|
|
|
GtkWidget *entry = (GtkWidget*)g_list_nth_data(path_widgets,1);
|
|
|
|
GtkWidget *entry;
|
|
|
|
if (gtk_widget_get_sensitive(box)&&strcmp(gtk_entry_get_text(GTK_ENTRY(entry)),"")){
|
|
|
|
if (box){
|
|
|
|
|
|
|
|
path_widgets = gtk_container_get_children(GTK_CONTAINER(box));
|
|
|
|
|
|
|
|
entry = (GtkWidget*)g_list_nth_data(path_widgets,1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!gtk_widget_get_sensitive(box)||!strcmp(gtk_entry_get_text(GTK_ENTRY(entry)),"")){
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
gtk_widget_hide(self);
|
|
|
|
|
|
|
|
}
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_add_path_path);
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_add_path_path);
|
|
|
|
GtkWidget *box = yon_gtk_builder_get_widget(builder,"PathBox");
|
|
|
|
GtkWidget *box_path = yon_gtk_builder_get_widget(builder,"PathBox");
|
|
|
|
GtkWidget *entry = yon_gtk_builder_get_widget(builder,"PathEntry");
|
|
|
|
GtkWidget *entry_path = yon_gtk_builder_get_widget(builder,"PathEntry");
|
|
|
|
GtkWidget *AppendButton = yon_gtk_builder_get_widget(builder,"AppendButton");
|
|
|
|
GtkWidget *AppendButton = yon_gtk_builder_get_widget(builder,"AppendButton");
|
|
|
|
GtkWidget *SearchButton = yon_gtk_builder_get_widget(builder,"SearchButton");
|
|
|
|
GtkWidget *SearchButton = yon_gtk_builder_get_widget(builder,"SearchButton");
|
|
|
|
GtkWidget *RemoveButton = yon_gtk_builder_get_widget(builder,"RemoveButton");
|
|
|
|
GtkWidget *RemoveButton = yon_gtk_builder_get_widget(builder,"RemoveButton");
|
|
|
|
@ -1333,11 +1332,17 @@ void on_log_path_append(GtkWidget *self, add_log_window *window){
|
|
|
|
g_signal_connect(G_OBJECT(RemoveButton),"clicked",G_CALLBACK(on_log_path_remove),window);
|
|
|
|
g_signal_connect(G_OBJECT(RemoveButton),"clicked",G_CALLBACK(on_log_path_remove),window);
|
|
|
|
g_signal_connect(G_OBJECT(SearchButton),"clicked",G_CALLBACK(on_log_path_choose),window);
|
|
|
|
g_signal_connect(G_OBJECT(SearchButton),"clicked",G_CALLBACK(on_log_path_choose),window);
|
|
|
|
gtk_widget_show(AppendButton);
|
|
|
|
gtk_widget_show(AppendButton);
|
|
|
|
gtk_widget_hide(self);
|
|
|
|
gtk_box_pack_start(GTK_BOX(window->LogPathsBox),box_path,0,0,5);
|
|
|
|
gtk_box_pack_start(GTK_BOX(window->LogPathsBox),box,0,0,5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free(paths);
|
|
|
|
void on_log_add(GtkWidget *self, main_window *widgets){
|
|
|
|
g_list_free(path_widgets);
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->list);
|
|
|
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
add_log_window *window = on_add_open();
|
|
|
|
|
|
|
|
gtk_widget_show(window->MainWindow);
|
|
|
|
|
|
|
|
gtk_widget_hide(window->StatisticsFrame);
|
|
|
|
|
|
|
|
gtk_widget_hide(window->ControlSectionBox);
|
|
|
|
|
|
|
|
on_log_path_append(NULL,window);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_log_edit(GtkWidget *self,main_window *widgets){
|
|
|
|
void on_log_edit(GtkWidget *self,main_window *widgets){
|
|
|
|
|