Code

Merge from trunk.
authorJon A. Cruz <jon@joncruz.org>
Sat, 18 Dec 2010 06:03:56 +0000 (22:03 -0800)
committerJon A. Cruz <jon@joncruz.org>
Sat, 18 Dec 2010 06:03:56 +0000 (22:03 -0800)
1  2 
src/verbs.cpp
src/widgets/desktop-widget.cpp

diff --combined src/verbs.cpp
index c1726ecd412b5bbc46f9b78a0272a85262cefab4,4cdad7d36cc8aa5692de64d1b294e5979529e397..00a82624bddac847137f697289181fa21b99f4f6
@@@ -2314,7 -2314,7 +2314,7 @@@ Verb *Verb::_base_verbs[] = 
      new EditVerb(SP_VERB_EDIT_CLEAR_ALL, "EditClearAll", N_("Clea_r All"),
                   N_("Delete all objects from document"), NULL),
      new EditVerb(SP_VERB_EDIT_SELECT_ALL, "EditSelectAll", N_("Select Al_l"),
 -                 N_("Select all objects or all nodes"), GTK_STOCK_SELECT_ALL),
 +                 N_("Select all objects or all nodes"), "fooble"),//GTK_STOCK_SELECT_ALL),
      new EditVerb(SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, "EditSelectAllInAllLayers", N_("Select All in All La_yers"),
                   N_("Select all objects in all visible and unlocked layers"), INKSCAPE_ICON_EDIT_SELECT_ALL_LAYERS),
      new EditVerb(SP_VERB_EDIT_INVERT, "EditInvert", N_("In_vert Selection"),
                    N_("Raise the current layer"), INKSCAPE_ICON_LAYER_RAISE),
      new LayerVerb(SP_VERB_LAYER_LOWER, "LayerLower", N_("_Lower Layer"),
                    N_("Lower the current layer"), INKSCAPE_ICON_LAYER_LOWER),
-     new LayerVerb(SP_VERB_LAYER_DUPLICATE, "LayerDuplicate", N_("Duplicate Current Layer"),
+     new LayerVerb(SP_VERB_LAYER_DUPLICATE, "LayerDuplicate", N_("D_uplicate Current Layer"),
                    N_("Duplicate an existing layer"), NULL),
      new LayerVerb(SP_VERB_LAYER_DELETE, "LayerDelete", N_("_Delete Current Layer"),
                    N_("Delete the current layer"), INKSCAPE_ICON_LAYER_DELETE),
index 57e58cd5e4d4795f98c8eb8c9bd3017b7b7353aa,3509a1040d20dc1789ccfe86511e8bbbfc4129ad..4620b15328e0137603f11dcf50078cf0426513a5
@@@ -56,6 -56,7 +56,7 @@@
  #include "ui/widget/layer-selector.h"
  #include "ui/widget/selected-style.h"
  #include "ui/uxmanager.h"
+ #include "util/ege-appear-time-tracker.h"
  
  // We're in the "widgets" directory, so no need to explicitly prefix these:
  #include "button.h"
@@@ -73,6 -74,7 +74,7 @@@ using Inkscape::round
  using Inkscape::UnitTracker;
  using Inkscape::UI::UXManager;
  using Inkscape::UI::ToolboxFactory;
+ using ege::AppearTimeTracker;
  
  #ifdef WITH_INKBOARD
  #endif
@@@ -121,30 -123,6 +123,30 @@@ static void sp_dtw_sticky_zoom_toggled 
  
  SPViewWidgetClass *dtw_parent_class;
  
 +static GTimer *baseTimer = 0;
 +static bool timeReported = false;
 +
 +static void timeGoing(gchar const* id)
 +{
 +    if ( !baseTimer ) {
 +        g_message("Starting time at point [%s]", id);
 +        baseTimer = g_timer_new();
 +    }
 +}
 +
 +static void checkTime(gchar const* msg)
 +{
 +    if ( baseTimer && !timeReported ) {
 +        timeReported = true;
 +        g_timer_stop(baseTimer);
 +        gulong msCount = 0;
 +        gdouble secs = g_timer_elapsed( baseTimer, &msCount );
 +        g_message("Time ended at %2.3f with [%s]", secs, msg);
 +    }
 +}
 +
 +
 +
  class CMSPrefWatcher {
  public:
      CMSPrefWatcher() :
@@@ -267,6 -245,8 +269,8 @@@ SPDesktopWidget::window_get_pointer(
      return Geom::Point(x,y);
  }
  
+ static GTimer *overallTimer = 0;
  /**
   * Registers SPDesktopWidget class and returns its type number.
   */
@@@ -274,7 -254,6 +278,7 @@@ GType SPDesktopWidget::getType(void
  {
      static GtkType type = 0;
      if (!type) {
 +        timeGoing("SPDesktopWidget::getType");
          GTypeInfo info = {
              sizeof(SPDesktopWidgetClass),
              0, // base_init
              0 // value_table
          };
          type = g_type_register_static(SP_TYPE_VIEW_WIDGET, "SPDesktopWidget", &info, static_cast<GTypeFlags>(0));
+         // Begin a timer to watch for the first desktop to appear on-screen
+         overallTimer = g_timer_new();
      }
      return type;
  }
  static void
  sp_desktop_widget_class_init (SPDesktopWidgetClass *klass)
  {
 +    timeGoing("sp_desktop_widget_class_init");
      dtw_parent_class = (SPViewWidgetClass*)gtk_type_class (SP_TYPE_VIEW_WIDGET);
  
      GtkObjectClass *object_class = (GtkObjectClass *) klass;
   */
  void SPDesktopWidget::init( SPDesktopWidget *dtw )
  {
 +    timeGoing("SPDesktopWidget::init");
      GtkWidget *widget;
      GtkWidget *tbl;
      GtkWidget *canvas_tbl;
  
      gtk_widget_grab_focus (GTK_WIDGET(dtw->canvas));
  
-     {
-         g_message("FIRE UP");
-         gtk_widget_add_events( eventbox, GDK_STRUCTURE_MASK );
-         gboolean fooMap(GtkWidget *widget, GdkEvent *event, gpointer userData);
-         g_signal_connect( G_OBJECT(eventbox), "map-event", G_CALLBACK(fooMap), dtw );
-         void fooReal(GtkWidget *widget, gpointer userData);
-         g_signal_connect( G_OBJECT(eventbox), "map-event", G_CALLBACK(fooReal), dtw );
+     // If this is the first desktop created, report the time it takes to show up
+     if ( overallTimer ) {
+         if ( prefs->getBool("/dialogs/debug/trackAppear", false) ) {
+             // Time tracker takes ownership of the timer.
+             AppearTimeTracker *tracker = new AppearTimeTracker(overallTimer, GTK_WIDGET(dtw), "first SPDesktopWidget");
+             tracker->setAutodelete(true);
+         } else {
+             g_timer_destroy(overallTimer);
+         }
+         overallTimer = 0;
      }
  }
  
- gboolean fooMap(GtkWidget *widget, GdkEvent *event, gpointer userData) {
-     checkTime( "MAP");
-     return FALSE;
- }
- void fooReal(GtkWidget *widget, gpointer userData)
- {
-     checkTime("REALIZE");
- }
  /**
   * Called before SPDesktopWidget destruction.
   */