def comment_char_checker(dummy, document): doc_type = document.highlightingMode() result = common.isKnownCommentStyle(doc_type) if not result: ui.popup( "Oops!", "Don't know how comments look like for " + doc_type + " documents!", "face-uncertain") return result
def comment_char_checker(dummy, document): doc_type = document.highlightingMode() result = common.isKnownCommentStyle(doc_type) if not result: ui.popup( "Oops!" , "Don't know how comments look like for " + doc_type + " documents!" , "face-uncertain" ) return result
def comment_char_checker(dummy, document): doc_type = document.highlightingMode() result = common.isKnownCommentStyle(doc_type) if not result: kate.ui.popup( i18nc('@title:window', 'Sorry...') , i18nc( '@info:tooltip placeholder is a mime-type' , '<command>%1</command> is unsupported document type.', doc_type ) , 'dialog-information' ) return result
def toggleSelectionSensitiveActions(view): doc_type = view.document().highlightingMode() clnt = kate.getXmlGuiClient() has_selection = view.selection() if doc_type in ['C++', 'C++/Qt4', 'JavaScript'] and not has_selection: clnt.stateChanged('doxygen_actions') else: clnt.stateChanged('doxygen_actions', KXMLGUIClient.StateReverse) if common.isKnownCommentStyle(doc_type) and not has_selection: clnt.stateChanged('comment_actions_no_selection') else: clnt.stateChanged('comment_actions_no_selection', KXMLGUIClient.StateReverse)
def toggleDocTypeSeisitiveActions(): view = kate.activeView() if view is None: return doc_type = view.document().highlightingMode() kate.kDebug('toggleDocTypeSeisitiveActions: doc_type={}'.format(doc_type)) clnt = kate.getXmlGuiClient() if doc_type in ['C++', 'C++/Qt4', 'C']: clnt.stateChanged('if0_actions') else: clnt.stateChanged('if0_actions', KXMLGUIClient.StateReverse) if common.isKnownCommentStyle(doc_type): clnt.stateChanged('comment_actions') else: clnt.stateChanged('comment_actions', KXMLGUIClient.StateReverse)