File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -629,6 +629,8 @@ def __init__(self, parent):
629
629
630
630
self ._reloadHistory ()
631
631
632
+ self .deleteScut = QShortcut (QKeySequence (Qt .Key_Delete ), self )
633
+ self .deleteScut .activated .connect (self ._deleteItem )
632
634
self .listView .doubleClicked .connect (self ._runHistory )
633
635
self .reloadHistory .clicked .connect (self ._reloadHistory )
634
636
@@ -646,3 +648,12 @@ def _reloadHistory(self):
646
648
647
649
self .listView .setModel (self .model )
648
650
self .listView .scrollToBottom ()
651
+
652
+ def _deleteItem (self ):
653
+ itemsSelected = self .listView .selectionModel ().selectedIndexes ()
654
+ item = itemsSelected [0 ].row ()
655
+ ## Remove item from the command history (just for the current session)
656
+ self .parent .history .pop (item )
657
+ self .parent .historyIndex -= 1
658
+ ## Remove row from the command history dialog
659
+ self .model .removeRow (item )
You can’t perform that action at this time.
0 commit comments