Skip to content

ENH: indicate when a PyDMShellCommand's cmd is currently running by changing the button's appearance and disabling the button. #1249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 5, 2025
208 changes: 208 additions & 0 deletions examples/shell_command/shell_command.ui
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,62 @@
<property name="text">
<string>Run Shell Command</string>
</property>
<property name="alarmSensitiveContent" stdset="0">
<bool>false</bool>
</property>
<property name="alarmSensitiveBorder" stdset="0">
<bool>true</bool>
</property>
<property name="PyDMToolTip" stdset="0">
<string/>
</property>
<property name="channel" stdset="0">
<string/>
</property>
<property name="PyDMIcon" stdset="0">
<string/>
</property>
<property name="showConfirmDialog" stdset="0">
<bool>false</bool>
</property>
<property name="runCommandsInFullShell" stdset="0">
<bool>false</bool>
</property>
<property name="confirmMessage" stdset="0">
<string>Are you sure you want to proceed?</string>
</property>
<property name="environmentVariables" stdset="0">
<string/>
</property>
<property name="showIcon" stdset="0">
<bool>true</bool>
</property>
<property name="redirectCommandOutput" stdset="0">
<bool>true</bool>
</property>
<property name="allowMultipleExecutions" stdset="0">
<bool>false</bool>
</property>
<property name="titles" stdset="0">
<stringlist/>
</property>
<property name="commands" stdset="0">
<stringlist>
<string>echo &quot;Hello World!&quot;</string>
</stringlist>
</property>
<property name="passwordProtected" stdset="0">
<bool>false</bool>
</property>
<property name="password" stdset="0">
<string/>
</property>
<property name="protectedPassword" stdset="0">
<string/>
</property>
<property name="showCurrentlyRunningIndication" stdset="0">
<bool>false</bool>
</property>
</widget>
</item>
<item>
Expand All @@ -65,14 +110,130 @@
<property name="text">
<string>Run Invalid Command</string>
</property>
<property name="alarmSensitiveContent" stdset="0">
<bool>false</bool>
</property>
<property name="alarmSensitiveBorder" stdset="0">
<bool>true</bool>
</property>
<property name="PyDMToolTip" stdset="0">
<string/>
</property>
<property name="channel" stdset="0">
<string/>
</property>
<property name="PyDMIcon" stdset="0">
<string/>
</property>
<property name="showConfirmDialog" stdset="0">
<bool>false</bool>
</property>
<property name="runCommandsInFullShell" stdset="0">
<bool>false</bool>
</property>
<property name="confirmMessage" stdset="0">
<string>Are you sure you want to proceed?</string>
</property>
<property name="environmentVariables" stdset="0">
<string/>
</property>
<property name="showIcon" stdset="0">
<bool>true</bool>
</property>
<property name="allowMultipleExecutions" stdset="0">
<bool>false</bool>
</property>
<property name="titles" stdset="0">
<stringlist/>
</property>
<property name="commands" stdset="0">
<stringlist>
<string>fooo</string>
</stringlist>
</property>
<property name="passwordProtected" stdset="0">
<bool>false</bool>
</property>
<property name="password" stdset="0">
<string/>
</property>
<property name="protectedPassword" stdset="0">
<string/>
</property>
<property name="showCurrentlyRunningIndication" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="PyDMShellCommand" name="PyDMShellCommand_4">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Run Long-running Command</string>
</property>
<property name="alarmSensitiveContent" stdset="0">
<bool>false</bool>
</property>
<property name="alarmSensitiveBorder" stdset="0">
<bool>true</bool>
</property>
<property name="PyDMToolTip" stdset="0">
<string/>
</property>
<property name="channel" stdset="0">
<string/>
</property>
<property name="PyDMIcon" stdset="0">
<string/>
</property>
<property name="showConfirmDialog" stdset="0">
<bool>false</bool>
</property>
<property name="runCommandsInFullShell" stdset="0">
<bool>true</bool>
</property>
<property name="confirmMessage" stdset="0">
<string>Are you sure you want to proceed?</string>
</property>
<property name="environmentVariables" stdset="0">
<string/>
</property>
<property name="showIcon" stdset="0">
<bool>true</bool>
</property>
<property name="stdout" stdset="0">
<enum>PyDMShellCommand::SHOW</enum>
</property>
<property name="stderr" stdset="0">
<enum>PyDMShellCommand::SHOW</enum>
</property>
<property name="allowMultipleExecutions" stdset="0">
<bool>false</bool>
</property>
<property name="titles" stdset="0">
<stringlist>
<string></string>
</stringlist>
</property>
<property name="commands" stdset="0">
<stringlist>
<string>for i in {1..5}; do echo $i; sleep 1; done</string>
</stringlist>
</property>
<property name="passwordProtected" stdset="0">
<bool>false</bool>
</property>
<property name="password" stdset="0">
<string/>
</property>
<property name="protectedPassword" stdset="0">
<string/>
</property>
<property name="showCurrentlyRunningIndication" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -106,21 +267,68 @@
<property name="text">
<string>Multiple Shell Command Menu</string>
</property>
<property name="alarmSensitiveContent" stdset="0">
<bool>false</bool>
</property>
<property name="alarmSensitiveBorder" stdset="0">
<bool>true</bool>
</property>
<property name="PyDMToolTip" stdset="0">
<string/>
</property>
<property name="channel" stdset="0">
<string/>
</property>
<property name="PyDMIcon" stdset="0">
<string/>
</property>
<property name="showConfirmDialog" stdset="0">
<bool>false</bool>
</property>
<property name="runCommandsInFullShell" stdset="0">
<bool>true</bool>
</property>
<property name="confirmMessage" stdset="0">
<string>Are you sure you want to proceed?</string>
</property>
<property name="environmentVariables" stdset="0">
<string/>
</property>
<property name="showIcon" stdset="0">
<bool>true</bool>
</property>
<property name="redirectCommandOutput" stdset="0">
<bool>true</bool>
</property>
<property name="allowMultipleExecutions" stdset="0">
<bool>false</bool>
</property>
<property name="titles" stdset="0">
<stringlist>
<string>Print &quot;Hello, World!&quot; to terminal</string>
<string>Print current working directory to terminal</string>
<string>Run Long-running Command</string>
</stringlist>
</property>
<property name="commands" stdset="0">
<stringlist>
<string>echo &quot;Hello, World!&quot;</string>
<string>pwd</string>
<string>for i in {1..5}; do echo $i; sleep 1; done</string>
</stringlist>
</property>
<property name="passwordProtected" stdset="0">
<bool>false</bool>
</property>
<property name="password" stdset="0">
<string/>
</property>
<property name="protectedPassword" stdset="0">
<string/>
</property>
<property name="showCurrentlyRunningIndication" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
Expand Down
Loading
Loading