def resetPasswordCache(editor):
    context = grt.fromgrt(editor.customData["adminContext"])
    if context:
        handler = PasswordHandler(context.server_profile)
        if context.ctrl_be and context.ctrl_be.password_handler:
            context.ctrl_be.password_handler.pwd_store = {}

        for service_type in ["ssh", "sshkey", "file", "service.startstop", "remoteshell"]:
            details = handler.get_password_parameters(service_type)
            if details and details != "UAC":
                title, service, account = details
                mforms.Utilities.forget_password(service, account)

    mforms.Utilities.show_message("Reset Saved Passwords", "Saved passwords for this connection were deleted.", "OK", "", "")
def handleReconnect(name, sender, args):
    context = grt.fromgrt(sender.customData["adminContext"])
    if context and args['connected']:
        context.handle_reconnect()
 def openAdminSectionSE(editor, section):
     context = grt.fromgrt(editor.customData["adminContext"])
     if context:
         context.open_into_section(section, True)
def openConnectionSettings(editor):
    grt.modules.Workbench.showInstanceManagerFor(editor.connection)
    context = grt.fromgrt(editor.customData["adminContext"])
    if context:
        context.refresh_admin_links()
 def openAdminSectionSE(editor, section):
     context = grt.fromgrt(editor.customData["adminContext"])
     if context:
         context.open_into_section(section, True)
     else:
         log_error("No context found for editor in call to openAdminSection\n")
def openAdminSection(editor, section):
    context = grt.fromgrt(editor.customData["adminContext"])
    if context:
        context.open_into_section(section, True)
    else:
        log_error("No context found for editor in call to openAdminSection\n")
def handleReconnect(name, sender, args):
    context = grt.fromgrt(sender.customData["adminContext"])
    if context and args['connected']:
        context.handle_reconnect()
def openConnectionSettings(editor):
    grt.modules.Workbench.showInstanceManagerFor(editor.connection)
    context = grt.fromgrt(editor.customData["adminContext"])
    if context:
        context.refresh_admin_links()