View Issue Details

IDProjectCategoryView StatusLast Update
0004648Slicer4Core: GUIpublic2018-12-12 14:19
ReporterandinetAssigned Tolassoan 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionno change required 
Product Version 
Target VersionFixed in Version 
Summary0004648: Add "Restart Slicer" shortcut and meny entry
Description

In addition of the existing "Exit", a new entry named "Restart" could be added.

Shortcut could be "CTRL-R"

TagsNo tags attached.

Activities

lassoan

lassoan

2018-12-12 14:17

developer   ~0016217

Last edited: 2018-12-12 14:18

View 2 revisions

Restart button is available in all scripted modules. I usually restart by calling restart() method using python console (hit Ctrl-3, type "rest" then hit Tab and Enter), it just takes 1-2 seconds and only requires keyboard.

Finally, you can add your own shortcut for restart as described in the script repository, by adding this to the application startup script (https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Customize_keyboard_shortcuts):

shortcuts = [
    ('Ctrl+b', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpRedSliceView)),
    ('Ctrl+n', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpYellowSliceView)),
    ('Ctrl+m', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpGreenSliceView)),
    ('Ctrl+,', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutFourUpView)),
    ('Ctrl+Shift+r', slicer.util.restart)
    ]

for (shortcutKey, callback) in shortcuts:
    shortcut = qt.QShortcut(slicer.util.mainWindow())
    shortcut.setKey(qt.QKeySequence(shortcutKey))
    shortcut.connect( 'activated()', callback)
lassoan

lassoan

2018-12-12 14:19

developer   ~0016218

The provided alternative solutions should be cover most use cases. Reopen the issue if you would like to have additional methods to restart the application.

Issue History

Date Modified Username Field Change
2018-10-29 06:16 jcfr New Issue
2018-10-29 06:16 jcfr Reporter jcfr => andinet
2018-12-12 14:17 lassoan Note Added: 0016217
2018-12-12 14:18 lassoan Note Edited: 0016217 View Revisions
2018-12-12 14:19 lassoan Assigned To => lassoan
2018-12-12 14:19 lassoan Status new => resolved
2018-12-12 14:19 lassoan Resolution open => no change required
2018-12-12 14:19 lassoan Note Added: 0016218