mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-04 03:27:00 -05:00 
			
		
		
		
	Book list: Press Shift+F2 to clear the contents of the current date like cell before editing it
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
		
						commit
						f8670c524c
					
				@ -223,7 +223,11 @@ class DateDelegate(QStyledItemDelegate, UpdateEditorGeometry):  # {{{
 | 
			
		||||
        return DateTimeEdit(parent, self.format)
 | 
			
		||||
 | 
			
		||||
    def setEditorData(self, editor, index):
 | 
			
		||||
        QStyledItemDelegate.setEditorData(self, editor, index)
 | 
			
		||||
        if QApplication.keyboardModifiers() == Qt.ShiftModifier:
 | 
			
		||||
            val = UNDEFINED_QDATETIME
 | 
			
		||||
        else:
 | 
			
		||||
            val = index.data(Qt.EditRole)
 | 
			
		||||
        editor.setDateTime(val)
 | 
			
		||||
 | 
			
		||||
# }}}
 | 
			
		||||
 | 
			
		||||
@ -393,6 +397,9 @@ class CcDateDelegate(QStyledItemDelegate, UpdateEditorGeometry):  # {{{
 | 
			
		||||
        return DateTimeEdit(parent, self.format)
 | 
			
		||||
 | 
			
		||||
    def setEditorData(self, editor, index):
 | 
			
		||||
        if QApplication.keyboardModifiers() == Qt.ShiftModifier:
 | 
			
		||||
            val = UNDEFINED_QDATETIME
 | 
			
		||||
        else:
 | 
			
		||||
            m = index.model()
 | 
			
		||||
            # db col is not named for the field, but for the table number. To get it,
 | 
			
		||||
            # gui column -> column label -> table number -> db column
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user