[aseprite] 192/308: Add an alternative message to debug crashes in compiled versions

Tobias Hansen thansen at moszumanska.debian.org
Tue Mar 8 02:45:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 81d39664a77817349369e602e0f9dd551dd66a08
Author: David Capello <davidcapello at gmail.com>
Date:   Sun Jan 31 19:49:24 2016 -0300

    Add an alternative message to debug crashes in compiled versions
    
    As .dmp files are useful only for official releases (i.e. when we have the
    compiled .exe+.pdb), this is an alternative message to stop receiving
    .dmp files at support at aseprite.org that cannot be used to debug a crash.
---
 data/widgets/send_crash.xml | 20 ++++++++++++++------
 src/app/send_crash.cpp      | 23 ++++++++++++++++++++---
 src/app/send_crash.h        |  3 ++-
 3 files changed, 36 insertions(+), 10 deletions(-)

diff --git a/data/widgets/send_crash.xml b/data/widgets/send_crash.xml
index 1eb8070..c90fa67 100644
--- a/data/widgets/send_crash.xml
+++ b/data/widgets/send_crash.xml
@@ -1,14 +1,22 @@
 <!-- Aseprite -->
-<!-- Copyright (C) 2014 by David Capello -->
+<!-- Copyright (C) 2014, 2016 by David Capello -->
 <gui>
 <window text="Crash Report" id="send_crash">
   <vbox>
 
-    <label text="Please send the following file:" />
-    <link id="filename" text="" url="" />
-    <label text="to this email:" />
-    <entry readonly="true" text="support at aseprite.org" maxsize="256" />
-    <label text="explaining what you was doing when the program crashed." />
+    <vbox id="official">
+      <label text="Please send the following file:" />
+      <link id="filename" text="" url="" />
+      <label text="to this email:" />
+      <entry readonly="true" text="support at aseprite.org" maxsize="256" />
+      <label text="explaining what you was doing when the program crashed." />
+    </vbox>
+
+    <vbox id="dev">
+      <label text="You are using a development version." />
+      <label text="Open the following file to debug your compilation:" />
+      <link id="dev_filename" text="" url="" />
+    </vbox>
 
     <separator horizontal="true" />
 
diff --git a/src/app/send_crash.cpp b/src/app/send_crash.cpp
index 66a1271..9e9cb73 100644
--- a/src/app/send_crash.cpp
+++ b/src/app/send_crash.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2015  David Capello
+// Copyright (C) 2001-2016  David Capello
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License version 2 as
@@ -62,8 +62,20 @@ void SendCrash::notificationClick()
   }
 
   app::gen::SendCrash dlg;
-  dlg.filename()->setText(m_dumpFilename);
-  dlg.filename()->Click.connect(base::Bind(&SendCrash::onClickFilename, this));
+
+  // The current version is a "development" version if the VERSION
+  // macro contains the "dev" word.
+  bool isDev = (std::string(VERSION).find("dev") != std::string::npos);
+  if (isDev) {
+    dlg.official()->setVisible(false);
+    dlg.devFilename()->setText(m_dumpFilename);
+    dlg.devFilename()->Click.connect(base::Bind(&SendCrash::onClickDevFilename, this));
+  }
+  else {
+    dlg.dev()->setVisible(false);
+    dlg.filename()->setText(m_dumpFilename);
+    dlg.filename()->Click.connect(base::Bind(&SendCrash::onClickFilename, this));
+  }
 
   dlg.openWindowInForeground();
   if (dlg.closer() == dlg.deleteFile()) {
@@ -82,4 +94,9 @@ void SendCrash::onClickFilename()
   base::launcher::open_folder(m_dumpFilename);
 }
 
+void SendCrash::onClickDevFilename()
+{
+  base::launcher::open_file(m_dumpFilename);
+}
+
 } // namespace app
diff --git a/src/app/send_crash.h b/src/app/send_crash.h
index c9549f8..18dd4df 100644
--- a/src/app/send_crash.h
+++ b/src/app/send_crash.h
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2015  David Capello
+// Copyright (C) 2001-2016  David Capello
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License version 2 as
@@ -24,6 +24,7 @@ namespace app {
 
   private:
     void onClickFilename();
+    void onClickDevFilename();
 
     std::string m_dumpFilename;
   };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list