Changeset 11462:fbd2b8d69e16 in orange


Ignore:
Timestamp:
04/11/13 18:14:46 (12 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Override the 'Quit' keyboard shortcut when a popup window is shown.

Location:
Orange/OrangeCanvas
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/application/canvasmain.py

    r11446 r11462  
    13341334        """Quit the application. 
    13351335        """ 
    1336         self.close() 
     1336        if QApplication.activePopupWidget(): 
     1337            # On OSX the actions in the global menu bar are triggered 
     1338            # even if an popup widget is running it's own event loop 
     1339            # (in exec_) 
     1340            log.debug("Ignoring a quit shortcut during an active " 
     1341                      "popup dialog.") 
     1342        else: 
     1343            self.close() 
    13371344 
    13381345    def select_all(self): 
  • Orange/OrangeCanvas/document/quickmenu.py

    r11420 r11462  
    2121    QStandardItemModel, QSortFilterProxyModel, QStyleOptionToolButton, 
    2222    QStylePainter, QStyle, QApplication, QStyledItemDelegate, 
    23     QStyleOptionViewItemV4, QSizeGrip 
     23    QStyleOptionViewItemV4, QSizeGrip, QKeySequence 
    2424) 
    2525 
     
    948948        FramelessWindow.keyPressEvent(self, event) 
    949949        event.accept() 
     950 
     951    def event(self, event): 
     952        if event.type() == QEvent.ShortcutOverride: 
     953            log.debug("Overriding shortcuts") 
     954            event.accept() 
     955            return True 
     956        return FramelessWindow.event(self, event) 
    950957 
    951958    def eventFilter(self, obj, event): 
Note: See TracChangeset for help on using the changeset viewer.