projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adjust the includes now that some paths have changed
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
modules
/
gui
/
main
/
src
/
callbacks.c
diff --git
a/ltt/branches/poly/lttv/modules/gui/main/src/callbacks.c
b/ltt/branches/poly/lttv/modules/gui/main/src/callbacks.c
index 8b537cc61db68e0848c78a0d39e7b8d694ae2f38..76890d1575941454677c6ba1cbb2d3a2b6ddfcd6 100644
(file)
--- a/
ltt/branches/poly/lttv/modules/gui/main/src/callbacks.c
+++ b/
ltt/branches/poly/lttv/modules/gui/main/src/callbacks.c
@@
-21,19
+21,19
@@
#endif
#include <gtk/gtk.h>
#endif
#include <gtk/gtk.h>
-#include <gmodule.h>
#include "callbacks.h"
#include "interface.h"
#include "support.h"
#include "callbacks.h"
#include "interface.h"
#include "support.h"
-#include <lttv/mainwindow.h>
-#include <lttv/menu.h>
-#include <lttv/toolbar.h>
-#include <lttv/gtktraceset.h>
+#include <lttv/lttv.h>
+#include <lttvgui/mainwindow.h>
+#include <lttvgui/menu.h>
+#include <lttvgui/toolbar.h>
+#include <lttvgui/gtktraceset.h>
#include <lttv/module.h>
#include <lttv/module.h>
-#include <lttv/gtkdirsel.h>
+#include <lttv
gui
/gtkdirsel.h>
#include <lttv/iattribute.h>
#include <lttv/iattribute.h>
-#include <lttv/lttvfilter.h>
+#include <lttv
gui
/lttvfilter.h>
#include <ltt/trace.h>
#include <ltt/facility.h>
#include <ltt/trace.h>
#include <ltt/facility.h>
@@
-48,6
+48,11
@@
extern GSList * g_main_window_list;
static int g_win_count = 0;
static int g_win_count = 0;
+// MD : keep old directory
+static char remember_plugins_dir[PATH_LENGTH] = "";
+static char remember_trace_dir[PATH_LENGTH] = "";
+
+
MainWindow * get_window_data_struct(GtkWidget * widget);
char * get_unload_module(char ** loaded_module_name, int nb_module);
char * get_remove_trace(char ** all_trace_name, int nb_trace);
MainWindow * get_window_data_struct(GtkWidget * widget);
char * get_unload_module(char ** loaded_module_name, int nb_module);
char * get_remove_trace(char ** all_trace_name, int nb_trace);
@@
-274,10
+279,10
@@
void create_new_window(GtkWidget* widget, gpointer user_data, gboolean clone)
if(clone){
g_printf("Clone : use the same traceset\n");
if(clone){
g_printf("Clone : use the same traceset\n");
- construct_main_window(parent
, NULL
);
+ construct_main_window(parent);
}else{
g_printf("Empty : traceset is set to NULL\n");
}else{
g_printf("Empty : traceset is set to NULL\n");
- construct_main_window(NULL
, parent->win_creation_data
);
+ construct_main_window(NULL);
}
}
}
}
@@
-481,12
+486,15
@@
void add_trace(GtkWidget * widget, gpointer user_data)
MainWindow * mw_data = get_window_data_struct(widget);
GtkDirSelection * file_selector = (GtkDirSelection *)gtk_dir_selection_new("Select a trace");
gtk_dir_selection_hide_fileop_buttons(file_selector);
MainWindow * mw_data = get_window_data_struct(widget);
GtkDirSelection * file_selector = (GtkDirSelection *)gtk_dir_selection_new("Select a trace");
gtk_dir_selection_hide_fileop_buttons(file_selector);
+ if(remember_trace_dir[0] != '\0')
+ gtk_dir_selection_set_filename(file_selector, remember_trace_dir);
id = gtk_dialog_run(GTK_DIALOG(file_selector));
switch(id){
case GTK_RESPONSE_ACCEPT:
case GTK_RESPONSE_OK:
dir = gtk_dir_selection_get_dir (file_selector);
id = gtk_dialog_run(GTK_DIALOG(file_selector));
switch(id){
case GTK_RESPONSE_ACCEPT:
case GTK_RESPONSE_OK:
dir = gtk_dir_selection_get_dir (file_selector);
+ strncpy(remember_trace_dir, dir, PATH_LENGTH);
if(!dir || strlen(dir) ==0){
gtk_widget_destroy((GtkWidget*)file_selector);
break;
if(!dir || strlen(dir) ==0){
gtk_widget_destroy((GtkWidget*)file_selector);
break;
@@
-1026,6
+1034,8
@@
on_load_module_activate (GtkMenuItem *menuitem,
char str[PATH_LENGTH], *str1;
MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
GtkFileSelection * file_selector = (GtkFileSelection *)gtk_file_selection_new("Select a module");
char str[PATH_LENGTH], *str1;
MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
GtkFileSelection * file_selector = (GtkFileSelection *)gtk_file_selection_new("Select a module");
+ if(remember_plugins_dir[0] != '\0')
+ gtk_file_selection_set_filename(file_selector, remember_plugins_dir);
gtk_file_selection_hide_fileop_buttons(file_selector);
str[0] = '\0';
gtk_file_selection_hide_fileop_buttons(file_selector);
str[0] = '\0';
@@
-1034,17
+1044,15
@@
on_load_module_activate (GtkMenuItem *menuitem,
case GTK_RESPONSE_ACCEPT:
case GTK_RESPONSE_OK:
dir = gtk_file_selection_get_selections (file_selector);
case GTK_RESPONSE_ACCEPT:
case GTK_RESPONSE_OK:
dir = gtk_file_selection_get_selections (file_selector);
- sprintf(str,dir[0]);
+ strncpy(str,dir[0],PATH_LENGTH);
+ strncpy(remember_plugins_dir,dir[0],PATH_LENGTH);
str1 = strrchr(str,'/');
if(str1)str1++;
else{
str1 = strrchr(str,'\\');
str1++;
}
str1 = strrchr(str,'/');
if(str1)str1++;
else{
str1 = strrchr(str,'\\');
str1++;
}
- if(mw_data->win_creation_data)
- lttv_module_load(str1, mw_data->win_creation_data->argc,mw_data->win_creation_data->argv);
- else
- lttv_module_load(str1, 0,NULL);
+ lttv_module_require(str1, NULL);
g_slist_foreach(g_main_window_list, (gpointer)insert_menu_toolbar_item,
NULL);
g_strfreev(dir);
g_slist_foreach(g_main_window_list, (gpointer)insert_menu_toolbar_item,
NULL);
g_strfreev(dir);
@@
-1067,30
+1075,36
@@
on_unload_module_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
int i;
gpointer user_data)
{
int i;
- char **name, *unload_module_name;
+ GPtrArray *name;
+ char *unload_module_name;
guint nb;
guint nb;
- LttvModule ** modules, *module;
+ LttvLibrary *library;
+ LttvLibraryInfo library_info;
MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
- modules = lttv_module_list(&nb);
- name = g_new(char*, nb);
+ name = g_ptr_array_new();
+ nb = lttv_library_number();
+
for(i=0;i<nb;i++){
for(i=0;i<nb;i++){
- module = modules[i];
- name[i] = lttv_module_name(module);
+ library = lttv_library_get(i);
+ lttv_library_info(library, &library_info);
+ if(library_info.load_count > 0) g_ptr_array_add(name, library_info.name);
}
}
- unload_module_name =get_unload_module(
name,nb
);
+ unload_module_name =get_unload_module(
(char **)(name->pdata), name->len
);
if(unload_module_name){
for(i=0;i<nb;i++){
if(unload_module_name){
for(i=0;i<nb;i++){
- if(strcmp(unload_module_name, name[i]) == 0){
- lttv_module_unload(modules[i]);
+ library = lttv_library_get(i);
+ lttv_library_info(library, &library_info);
+ if(strcmp(unload_module_name, library_info.name) == 0){
+ lttv_library_unload(library);
break;
}
}
}
break;
}
}
}
- g_
free(name
);
+ g_
ptr_array_free(name, TRUE
);
}
}
@@
-1106,13
+1120,17
@@
on_add_module_search_path_activate (GtkMenuItem *menuitem,
gint id;
MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
gint id;
MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
+ if(remember_plugins_dir[0] != '\0')
+ gtk_dir_selection_set_filename(file_selector, remember_plugins_dir);
id = gtk_dialog_run(GTK_DIALOG(file_selector));
switch(id){
case GTK_RESPONSE_ACCEPT:
case GTK_RESPONSE_OK:
dir = gtk_dir_selection_get_dir (file_selector);
id = gtk_dialog_run(GTK_DIALOG(file_selector));
switch(id){
case GTK_RESPONSE_ACCEPT:
case GTK_RESPONSE_OK:
dir = gtk_dir_selection_get_dir (file_selector);
- lttv_module_path_add(dir);
+ strncpy(remember_plugins_dir,dir,PATH_LENGTH);
+ strncat(remember_plugins_dir,"/",PATH_LENGTH);
+ lttv_library_path_add(dir);
case GTK_RESPONSE_REJECT:
case GTK_RESPONSE_CANCEL:
default:
case GTK_RESPONSE_REJECT:
case GTK_RESPONSE_CANCEL:
default:
@@
-1763,9
+1781,9
@@
void insert_menu_toolbar_item(MainWindow * mw, gpointer user_data)
/* Create a main window
*/
/* Create a main window
*/
-void construct_main_window(MainWindow * parent
, WindowCreationData * win_creation_data
)
+void construct_main_window(MainWindow * parent)
{
{
- g_
critical
("construct_main_window()");
+ g_
debug
("construct_main_window()");
GtkWidget * new_window; /* New generated main window */
MainWindow * new_m_window;/* New main window structure */
GtkNotebook * notebook;
GtkWidget * new_window; /* New generated main window */
MainWindow * new_m_window;/* New main window structure */
GtkNotebook * notebook;
@@
-1788,11
+1806,6
@@
void construct_main_window(MainWindow * parent, WindowCreationData * win_creatio
new_m_window->tab = NULL;
new_m_window->current_tab = NULL;
new_m_window->attributes = LTTV_IATTRIBUTE(g_object_new(LTTV_ATTRIBUTE_TYPE, NULL));
new_m_window->tab = NULL;
new_m_window->current_tab = NULL;
new_m_window->attributes = LTTV_IATTRIBUTE(g_object_new(LTTV_ATTRIBUTE_TYPE, NULL));
- if(parent){
- new_m_window->win_creation_data = parent->win_creation_data;
- }else{
- new_m_window->win_creation_data = win_creation_data;
- }
new_m_window->hash_menu_item = g_hash_table_new_full (g_str_hash, g_str_equal,
main_window_destroy_hash_key,
new_m_window->hash_menu_item = g_hash_table_new_full (g_str_hash, g_str_equal,
main_window_destroy_hash_key,
This page took
0.025483 seconds
and
4
git commands to generate.