Example #1
0
 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
Example #2
0
 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
Example #3
0
 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
Example #4
0
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)
Example #5
0
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)