Browse Source

Merge pull request #218 from jsheunis/add-icon

Add Kaboom button icon
Michael Hanke 1 year ago
parent
commit
bf7051c1d0

+ 6 - 1
datalad_gooey/dataladcmd_exec.py

@@ -8,6 +8,7 @@ from typing import (
 
 from PySide6.QtCore import (
     QObject,
+    Qt,
     Signal,
     Slot,
 )
@@ -19,6 +20,8 @@ from datalad.interface.base import Interface
 from datalad.support.exceptions import CapturedException
 from datalad.utils import get_wrapped_class
 
+from .resource_provider import gooey_resources
+
 # lazy import
 dlapi = None
 
@@ -189,7 +192,9 @@ class GooeyDataladCmdExec(QObject):
             exec_params: dict):
         # thread_id, cmdname, cmdargs/kwargs, exec_params
         aw = self._activity_widget
-        aw.setText(f"KABOOM {cmdname}")
+        aw.setIcon(gooey_resources.get_best_icon('kaboom'))
+        aw.setText(f" {cmdname}")
+        aw.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
         aw.show()
 
     def _disable_activity_widget(

+ 1 - 0
datalad_gooey/resource_provider.py

@@ -20,6 +20,7 @@ class GooeyResources:
         'deleted': 'untracked',
         'unknown': 'untracked',
         'added': 'modified',
+        'kaboom': 'kaboom',
     }
 
     def __init__(self):

+ 56 - 0
datalad_gooey/resources/icons/kaboom.svg

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   width="81.872894mm"
+   height="66.534332mm"
+   viewBox="0 0 81.872894 66.534332"
+   version="1.1"
+   id="svg4395"
+   inkscape:version="1.1.1 (c3084ef, 2021-09-22)"
+   sodipodi:docname="kaboom.svg"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <sodipodi:namedview
+     id="namedview4397"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     inkscape:pagecheckerboard="0"
+     inkscape:document-units="mm"
+     showgrid="false"
+     inkscape:zoom="0.33765421"
+     inkscape:cx="302.0842"
+     inkscape:cy="171.77337"
+     inkscape:window-width="1312"
+     inkscape:window-height="786"
+     inkscape:window-x="565"
+     inkscape:window-y="1465"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="layer1" />
+  <defs
+     id="defs4392" />
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-69.974073,-86.390392)">
+    <g
+       id="g6133">
+      <path
+         style="fill:#5e5f5e;fill-opacity:1;stroke-width:0.176389"
+         d="m 74.952443,152.7841 c -1.10177,-0.26303 -2.29417,-0.97915 -3.2558,-1.95534 -1.28449,-1.30394 -1.85647,-2.89571 -1.69625,-4.72052 0.0985,-1.12189 0.46558,-1.90754 7.16693,-15.33898 l 7.06312,-14.15652 5.646,2.82407 c 3.1053,1.55324 5.646,2.86469 5.646,2.91434 0,0.0496 -3.1065,6.30018 -6.90335,13.89009 -6.77475,13.54276 -6.92359,13.81967 -7.9899,14.86568 -0.88245,0.86565 -1.30934,1.139 -2.27258,1.45521 -1.18852,0.39016 -2.37544,0.46756 -3.40417,0.22197 z m 31.770697,-29.71507 c -1.0958,-0.363 -33.945657,-16.83386 -34.810127,-17.45373 -0.81629,-0.58533 -1.47542,-1.56185 -1.75298,-2.59714 -0.36271,-1.35285 -0.009,-2.3484 2.88373,-8.114726 2.85079,-5.68289 3.26873,-6.31105 4.71219,-7.08235 l 0.74496,-0.39807 h 8.99584 8.99583 l 11.096187,5.55625 c 7.37619,3.69351 11.2928,5.74937 11.68268,6.13231 0.65691,0.645219 1.11621,1.445146 1.30283,2.268996 0.31269,1.38045 -0.0354,2.245 -4.49045,11.15368 -2.36609,4.73142 -4.51591,8.8568 -4.77736,9.16753 -1.07901,1.28233 -3.05778,1.87261 -4.58333,1.36725 z"
+         id="path4468"
+         sodipodi:nodetypes="sssscssssssssscscccsssscs" />
+      <path
+         style="fill:#ffa200;fill-opacity:0.901747;stroke-width:0.176389"
+         d="m 130.50129,142.60749 c -0.48311,-0.29168 -1.5943,-1.7919 -4.53225,-6.11904 -2.27061,-3.34425 -3.99793,-5.72291 -4.14593,-5.70928 -0.13953,0.0128 -2.97515,1.56066 -6.30138,3.43958 -5.5452,3.13238 -6.11855,3.41623 -6.90048,3.41623 -0.7403,0 -0.92068,-0.076 -1.36749,-0.57605 -0.37766,-0.42267 -0.51329,-0.75142 -0.5094,-1.23472 0.003,-0.36227 0.54497,-2.43939 1.20459,-4.61582 1.05248,-3.47267 1.25158,-3.97806 1.62631,-4.12807 2.37695,-0.95151 3.2524,-1.57315 4.44225,-3.15434 0.84455,-1.12234 8.99804,-17.35054 9.59601,-19.09934 0.79802,-2.3338 0.68501,-4.872144 -0.30313,-6.809064 -0.34946,-0.68499 -0.35213,-0.73659 -0.0615,-1.18686 1.65846,-2.56933 6.56109,-9.57371 6.96554,-9.95165 1.01736,-0.95068 2.90477,-0.43827 3.24664,0.88143 0.0692,0.26707 0.61927,3.50184 1.22242,7.18837 l 1.09663,6.702774 0.53031,0.053 c 0.29167,0.0292 3.48763,-0.14768 7.10213,-0.39296 7.07988,-0.48045 7.2438,-0.47234 8.01784,0.39665 0.49083,0.55103 0.56123,1.76391 0.14005,2.41275 -0.18892,0.29105 -2.41577,2.73727 -4.94855,5.43607 -2.53278,2.6988 -4.60506,4.97654 -4.60506,5.06164 0,0.0851 2.11193,2.47154 4.69319,5.30321 2.58125,2.83166 4.8051,5.41631 4.94187,5.74366 0.41102,0.98371 -0.11401,2.15675 -1.14311,2.554 -0.26785,0.1034 -2.94912,-0.008 -7.53906,-0.31426 -3.91785,-0.26111 -7.16821,-0.42988 -7.22303,-0.37506 -0.0548,0.0548 -0.57396,3.17861 -1.15364,6.94176 -0.57967,3.76314 -1.15069,7.03899 -1.26891,7.27967 -0.51729,1.05305 -1.83459,1.45237 -2.82287,0.85571 z"
+         id="path4468-7"
+         sodipodi:nodetypes="sscssscssssscsssccsssssssscsssss" />
+    </g>
+  </g>
+</svg>

+ 1 - 1
datalad_gooey/resources/ui/main_window.ui

@@ -216,7 +216,7 @@
            <item>
             <widget class="QPushButton" name="clearErrorLogPB">
              <property name="text">
-              <string>Clear log</string>
+              <string>Clear Log</string>
              </property>
             </widget>
            </item>