projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
git-svn-id: http://ltt.polymtl.ca/svn@471 04897980-b3bd-0310-b5e0-8ef037075253
[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 5e7b4e12e62db26c34b052aa6781a5abc2258a8b..f7eaa26b6b7e10afb4825df6f9285f4dbdeb41b9 100644
(file)
--- a/
ltt/branches/poly/lttv/modules/gui/main/src/callbacks.c
+++ b/
ltt/branches/poly/lttv/modules/gui/main/src/callbacks.c
@@
-26,10
+26,10
@@
#include "callbacks.h"
#include "interface.h"
#include "support.h"
#include "callbacks.h"
#include "interface.h"
#include "support.h"
-#include <lttv/main
W
indow.h>
+#include <lttv/main
w
indow.h>
#include <lttv/menu.h>
#include <lttv/toolbar.h>
#include <lttv/menu.h>
#include <lttv/toolbar.h>
-#include <lttv/gtk
TraceS
et.h>
+#include <lttv/gtk
traces
et.h>
#include <lttv/module.h>
#include <lttv/gtkdirsel.h>
#include <lttv/iattribute.h>
#include <lttv/module.h>
#include <lttv/gtkdirsel.h>
#include <lttv/iattribute.h>
@@
-189,7
+189,7
@@
void get_label_string (GtkWidget * text, gchar * label)
strcpy(label,gtk_entry_get_text(entry));
}
strcpy(label,gtk_entry_get_text(entry));
}
-
void
get_label(MainWindow * mw, gchar * str, gchar* dialogue_title, gchar * label_str)
+
gboolean
get_label(MainWindow * mw, gchar * str, gchar* dialogue_title, gchar * label_str)
{
GtkWidget * dialogue;
GtkWidget * text;
{
GtkWidget * dialogue;
GtkWidget * text;
@@
-220,8
+220,9
@@
void get_label(MainWindow * mw, gchar * str, gchar* dialogue_title, gchar * labe
case GTK_RESPONSE_REJECT:
default:
gtk_widget_destroy(dialogue);
case GTK_RESPONSE_REJECT:
default:
gtk_widget_destroy(dialogue);
-
break
;
+
return FALSE
;
}
}
+ return TRUE;
}
MainWindow * get_window_data_struct(GtkWidget * widget)
}
MainWindow * get_window_data_struct(GtkWidget * widget)
@@
-641,23
+642,25
@@
on_clone_traceset_activate (GtkMenuItem *menuitem,
create_new_window((GtkWidget*)menuitem, user_data, TRUE);
}
create_new_window((GtkWidget*)menuitem, user_data, TRUE);
}
-
-void
-on_tab_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
+void create_new_tab(GtkWidget* widget, gpointer user_data){
gchar label[PATH_LENGTH];
gchar label[PATH_LENGTH];
- MainWindow * mw_data = get_window_data_struct(
(GtkWidget*)menuitem
);
- GtkNotebook * notebook = (GtkNotebook *)lookup_widget(
(GtkWidget*)menuitem
, "MNotebook");
+ MainWindow * mw_data = get_window_data_struct(
widget
);
+ GtkNotebook * notebook = (GtkNotebook *)lookup_widget(
widget
, "MNotebook");
if(notebook == NULL){
g_printf("Notebook does not exist\n");
return;
}
strcpy(label,"Page");
if(notebook == NULL){
g_printf("Notebook does not exist\n");
return;
}
strcpy(label,"Page");
- get_label(mw_data, label,"Get the name of the tab","Please input tab's name");
+ if(get_label(mw_data, label,"Get the name of the tab","Please input tab's name"))
+ create_tab (mw_data, mw_data, notebook, label);
+}
- create_tab (mw_data, mw_data, notebook, label);
+void
+on_tab_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ create_new_tab((GtkWidget*)menuitem, user_data);
}
}
@@
-1013,9
+1016,15
@@
void
on_button_new_clicked (GtkButton *button,
gpointer user_data)
{
on_button_new_clicked (GtkButton *button,
gpointer user_data)
{
- create_new_window((GtkWidget*)button, user_data,
FALS
E);
+ create_new_window((GtkWidget*)button, user_data,
TRU
E);
}
}
+void
+on_button_new_tab_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ create_new_tab((GtkWidget*)button, user_data);
+}
void
on_button_open_clicked (GtkButton *button,
void
on_button_open_clicked (GtkButton *button,
@@
-1124,10
+1133,19
@@
void
on_MWindow_destroy (GtkObject *object,
gpointer user_data)
{
on_MWindow_destroy (GtkObject *object,
gpointer user_data)
{
- MainWindow *Main_Window = (MainWindow*)user_data;
-
+ MainWindow *Main_Window = get_window_data_struct((GtkWidget*)object);
+ GtkWidget *widget;
+ Tab *tab = Main_Window->tab;
+
g_printf("There are : %d windows\n",g_slist_length(g_main_window_list));
g_printf("There are : %d windows\n",g_slist_length(g_main_window_list));
+ while(tab){
+ while(tab->multi_vpaned->num_children){
+ gtk_multi_vpaned_widget_delete(tab->multi_vpaned);
+ }
+ tab = tab->next;
+ }
+
g_win_count--;
if(g_win_count == 0)
gtk_main_quit ();
g_win_count--;
if(g_win_count == 0)
gtk_main_quit ();
@@
-1607,7
+1625,7
@@
void construct_main_window(MainWindow * parent, WindowCreationData * win_creatio
}
//for now there is no name field in LttvTraceset structure
//Use "Traceset" as the label for the default tab
}
//for now there is no name field in LttvTraceset structure
//Use "Traceset" as the label for the default tab
- create_tab(
NULL
, new_m_window, notebook,"Traceset");
+ create_tab(
parent
, new_m_window, notebook,"Traceset");
g_object_set_data_full(
G_OBJECT(new_m_window->mwindow),
g_object_set_data_full(
G_OBJECT(new_m_window->mwindow),
@@
-1649,8
+1667,9
@@
void tab_destructor(Tab * tab_instance)
ref_count = lttv_trace_get_ref_number(trace);
if(ref_count <= 1){
ltt_trace_close(lttv_trace(trace));
ref_count = lttv_trace_get_ref_number(trace);
if(ref_count <= 1){
ltt_trace_close(lttv_trace(trace));
+ lttv_trace_destroy(trace);
}
}
- lttv_trace_destroy(trace);
+
//
lttv_trace_destroy(trace);
}
}
lttv_traceset_destroy(tab_instance->traceset_info->traceset);
}
}
lttv_traceset_destroy(tab_instance->traceset_info->traceset);
This page took
0.024827 seconds
and
4
git commands to generate.