Quick bug fix that was rendering debugger unusable.
authorchudy@google.com <chudy@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 19 Jul 2012 13:41:27 +0000 (13:41 +0000)
committerchudy@google.com <chudy@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 19 Jul 2012 13:41:27 +0000 (13:41 +0000)
Review URL: https://codereview.appspot.com/6422050

git-svn-id: http://skia.googlecode.com/svn/trunk@4668 2bbb7eff-a529-9590-31e7-b0007b416f81

debugger/QT/SkDebuggerGUI.cpp
debugger/QT/SkDebuggerGUI.h
gyp/debugger.gyp

index ea9d687b85b9dc84488906d531dcff1a0dcb687e..7448aeb280c8ba5189fb6c647d6a97fac40b0ade 100644 (file)
@@ -44,6 +44,7 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
     , fBreakpointsActivated(false)
     , fDeletesActivated(false)
     , fPause(false)
+    , fLoading(false)
 {
     setupUi(this);
     connect(&fListWidget, SIGNAL(currentItemChanged(QListWidgetItem*,
@@ -90,7 +91,11 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
     connect(&fActionShowDeletes, SIGNAL(triggered()), this, SLOT(showDeletes()));
 
     fInspectorWidget.setDisabled(true);
-    fMenuBar.setDisabled(true);
+    //fMenuBar.setDisabled(true);
+    fMenuEdit.setDisabled(true);
+    fMenuNavigate.setDisabled(true);
+    fMenuView.setDisabled(true);
+
 }
 
 SkDebuggerGUI::~SkDebuggerGUI() {
@@ -257,28 +262,30 @@ void SkDebuggerGUI::pauseDrawing(bool isPaused) {
 }
 
 void SkDebuggerGUI::registerListClick(QListWidgetItem *item) {
-    int currentRow = fListWidget.currentRow();
-    if (!fPause) {
-        fCanvasWidget.drawTo(currentRow);
-    }
-    std::vector<std::string> *v = fCanvasWidget.getCurrentCommandInfo(
-            currentRow);
-
-    /* TODO(chudy): Add command type before parameters. Rename v
-     * to something more informative. */
-    if (v) {
-        std::vector<std::string>::iterator it;
-
-        QString info;
-        info.append("<b>Parameters: </b><br/>");
-        for (it = v->begin(); it != v->end(); ++it) {
-            info.append(QString((*it).c_str()));
-            info.append("<br/>");
+    if(!fLoading) {
+        int currentRow = fListWidget.currentRow();
+        if (!fPause) {
+            fCanvasWidget.drawTo(currentRow);
+        }
+        std::vector<std::string> *v = fCanvasWidget.getCurrentCommandInfo(
+                currentRow);
+
+        /* TODO(chudy): Add command type before parameters. Rename v
+         * to something more informative. */
+        if (v) {
+            std::vector<std::string>::iterator it;
+
+            QString info;
+            info.append("<b>Parameters: </b><br/>");
+            for (it = v->begin(); it != v->end(); ++it) {
+                info.append(QString((*it).c_str()));
+                info.append("<br/>");
+            }
+            fInspectorWidget.setDetailText(info);
+            fInspectorWidget.setDisabled(false);
+            fInspectorWidget.setMatrix(fCanvasWidget.getCurrentMatrix());
+            fInspectorWidget.setClip(fCanvasWidget.getCurrentClip());
         }
-        fInspectorWidget.setDetailText(info);
-        fInspectorWidget.setDisabled(false);
-        fInspectorWidget.setMatrix(fCanvasWidget.getCurrentMatrix());
-        fInspectorWidget.setClip(fCanvasWidget.getCurrentClip());
     }
 }
 
@@ -528,7 +535,9 @@ void SkDebuggerGUI::setupDirectoryWidget() {
 }
 
 void SkDebuggerGUI::loadPicture(QString fileName) {
+    fLoading = true;
     fCanvasWidget.loadPicture(fileName);
+    std::string cocks = fileName.toStdString();
     std::vector<std::string> *cv = fCanvasWidget.getDrawCommands();
     /* fDebugCanvas is reinitialized every load picture. Need it to retain value
      * of the visibility filter. */
@@ -538,7 +547,11 @@ void SkDebuggerGUI::loadPicture(QString fileName) {
     setupComboBox(cv);
     fInspectorWidget.setDisabled(false);
     fSettingsWidget.setDisabled(false);
-    fMenuBar.setDisabled(false);
+    fMenuEdit.setDisabled(false);
+    fMenuNavigate.setDisabled(false);
+    fMenuView.setDisabled(false);
+    fLoading = false;
+    actionPlay();
 }
 
 void SkDebuggerGUI::setupListWidget(std::vector<std::string>* cv) {
index b1ecb88c514ddb009c7da255c6dd1b403b8f1b8d..0621d7c83e5d243b92f94c9ebc9aced334836aea 100644 (file)
@@ -222,6 +222,7 @@ private:
     bool fDeletesActivated;
     bool fPause;
     int fPausedRow;
+    bool fLoading;
 
     /**
         Creates the entire UI.
index ff3bd1b55bf4da23b9295a1ec4dbcb5222bd76bb..a98e809f8485627659a50dfc4b8cfd5c273dbfd9 100644 (file)
@@ -51,8 +51,8 @@
           ],
           'link_settings': {
             'libraries' : [
-              '/usr/lib/libQtCore.so',
-              '/usr/lib/libQtGui.so',
+              '-lQtCore',
+              '-lQtGui',
             ],
           },
         }],
@@ -95,4 +95,4 @@
 # tab-width:2
 # indent-tabs-mode:nil
 # End:
-# vim: set expandtab tabstop=2 shiftwidth=2:
\ No newline at end of file
+# vim: set expandtab tabstop=2 shiftwidth=2: