implements correct behavior of content button and move help windows to the center...
[lttv.git] / lttv / modules / gui / lttvwindow / lttvwindow / callbacks.c
index 7243082e325ea8a209f061d5700301b2274ef643..e00a724458900297258677e309575a8fc8592d0f 100644 (file)
@@ -628,7 +628,8 @@ void delete_viewer(GtkWidget * widget, gpointer user_data)
   g_object_set_data(G_OBJECT(tab->viewer_container), "focused_viewer", NULL);
 }
 
-
+#if UNFINISHED_FEATURE
+/* TODO ybrosseau 2012-03-15: Function is half implemented. Should be removed */
 /* open_traceset will open a traceset saved in a file
  * Right now, it is not finished yet, (not working)
  * FIXME
@@ -665,7 +666,7 @@ void open_traceset(GtkWidget * widget, gpointer user_data)
   }
 
 }
-
+#endif
 /* lttvwindow_process_pending_requests
  *
  * Process requests for parts of the trace from viewers.
@@ -908,7 +909,9 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
         tfc = lttv_traceset_context_get_current_tfc(tsc);
         g_assert(g_slist_length(list_in)>0);
         EventsRequest *events_request = g_slist_nth_data(list_in, 0);
+#ifdef DEBUG
         guint seek_count;
+#endif
 
         /* 1.2.1 If first request in list_in is a time request */
         if(events_request->start_position == NULL) {
@@ -923,7 +926,9 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
                                                   events_request->start_time);
 
             /* Process the traceset with only state hooks */
+#ifdef DEBUG
             seek_count =
+#endif //DEBUG
                lttv_process_traceset_middle(tsc,
                                             events_request->start_time,
                                             G_MAXUINT, NULL);
@@ -967,7 +972,9 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
                                                   pos_time);
 
             /* Process the traceset with only state hooks */
+#ifdef DEBUG
             seek_count =
+#endif
                lttv_process_traceset_middle(tsc,
                                             ltt_time_infinite,
                                             G_MAXUINT,
@@ -2232,7 +2239,9 @@ void
 on_open_activate                       (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
+#ifdef UNFINISHED_FEATURE
   open_traceset((GtkWidget*)menuitem, user_data);
+#endif
 }
 
 
@@ -2908,6 +2917,18 @@ void
 on_content_activate                    (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
+  char* filename = NULL,
+                  *path;
+  GdkScreen *screen;
+  const char* relativePath = "doc/user/user_guide/html/index.html";
+  filename = g_build_filename (g_get_current_dir(), relativePath, NULL);
+  path = g_strdup_printf ("ghelp://%s", filename);
+
+  screen = gdk_screen_get_default();
+  gtk_show_uri (screen, path, gtk_get_current_event_time(), NULL);
+
+  g_free(filename);
+  g_free(path);
   g_info("Content\n");
 }
 
@@ -2929,7 +2950,6 @@ on_about_activate                      (GtkMenuItem     *menuitem,
   GtkWidget *window_widget = main_window->mwindow;
   GtkWidget *about_widget = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   GtkWindow *about_window = GTK_WINDOW(about_widget);
-  gint window_width, window_height;
   
   gtk_window_set_title(about_window, "About Linux Trace Toolkit");
 
@@ -2939,16 +2959,12 @@ on_about_activate                      (GtkMenuItem     *menuitem,
   gtk_window_set_modal(about_window, FALSE);
 
   /* Put the about window at the center of the screen */
-  gtk_window_get_size(about_window, &window_width, &window_height);
-  gtk_window_move (about_window,
-                   (gdk_screen_width() - window_width)/2,
-                   (gdk_screen_height() - window_height)/2);
+  gtk_window_set_position(about_window, GTK_WIN_POS_CENTER_ALWAYS);
+
   GtkWidget *vbox = gtk_vbox_new(FALSE, 1);
 
   gtk_container_add(GTK_CONTAINER(about_widget), vbox);
 
-    
   /* Text to show */
   GtkWidget *label1 = gtk_label_new("");
   gtk_misc_set_padding(GTK_MISC(label1), 10, 20);
@@ -3022,7 +3038,9 @@ void
 on_button_open_clicked                 (GtkButton       *button,
                                         gpointer         user_data)
 {
+#ifdef UNFINISHED_FEATURE
   open_traceset((GtkWidget*)button, user_data);
+#endif
 }
 
 
@@ -3710,8 +3728,7 @@ MainWindow *construct_main_window(MainWindow * parent)
   LttvIAttribute *attributes =
          LTTV_IATTRIBUTE(g_object_new(LTTV_ATTRIBUTE_TYPE, NULL));
   LttvAttributeValue value;
-  Tab *new_tab;
-         
+
   new_m_window = g_new(MainWindow, 1);
 
   // Add the object's information to the module's array 
@@ -3772,7 +3789,6 @@ MainWindow *construct_main_window(MainWindow * parent)
            "Tab_Plugin",
            ptab,
           (GDestroyNotify)tab_destructor);
-    new_tab = ptab->tab;
   } else {
     LttvPluginTab *ptab = g_object_new(LTTV_TYPE_PLUGIN_TAB, NULL);
     init_tab(ptab->tab, new_m_window, NULL, notebook, "Traceset");
@@ -3782,7 +3798,6 @@ MainWindow *construct_main_window(MainWindow * parent)
            "Tab_Plugin",
            ptab,
           (GDestroyNotify)tab_destructor);
-    new_tab = ptab->tab;
   }
 
   /* Insert default viewers */
This page took 0.030998 seconds and 4 git commands to generate.