Esempio n. 1
0
 def step_config_monitor_password_procede(self, curui):
     if curui.get_key() is not None and curui.get_key() == 'set_password':
         if self._change_pwd.get() == self._change_repwd.get():
             try:
                 self.change_pwd(self._change_pwd.get())
                 self._password = self._change_pwd.get()
                 msg = ui.Message(
                     self._get_message('configurePasswordUpdated'))
                 msg.next_step(self.step_menu_main)
                 return msg
             except:
                 return ui.ErrorDialog(
                     self._get_message('configureErrorConnection'))
         else:
             return ui.ErrorDialog(
                 self._get_message('configurePasswordErrNoMatch'))
     elif curui.get_key() is not None and curui.get_key(
     ) == 'remove_password':
         if curui.get_variable().get() == 'yes':
             try:
                 self.change_pwd("")
                 self._password = ""
                 msg = ui.Message(
                     self._get_message('configurePasswordUpdated'))
                 msg.next_step(self.step_menu_main)
                 return msg
             except:
                 return ui.ErrorDialog(
                     self._get_message('configureErrorConnection'))
Esempio n. 2
0
 def step_check_password(self, curui):
     try:
         if curui.get_key() is not None and curui.get_key()=='insert_password':
             self._password=self._ins_pwd.get()
         if not self.check_auth():
             if curui.get_key() is not None and curui.get_key()=='insert_password':
                 return ui.ErrorDialog(self._get_message('configureInvalidPassword'))
             return self.step_password(curui)
         else:
             return self.step_menu_main(curui)
     except:
         return ui.ErrorDialog(self._get_message('configureErrorConnection'))
Esempio n. 3
0
    def step_menu_monitor_desktop_notification(self, curui):
        try:
            chs = ui.Chooser()
            chs.set_message(
                self._get_message('configureDesktopNotification') + "\n\n" +
                self._get_message('warningSpyingTool'))
            chs.add("visible", self._get_message('desktopNotificationVisible'))
            chs.add("autohide",
                    self._get_message('desktopNotificationAutoHide'))
            chs.add("none", self._get_message('desktopNotificationNone'))

            appv = self.get_config("monitor_desktop_notification")
            if appv == "autohide":
                chs.set_variable(ui.VarString("autohide"))
            elif appv == "none":
                chs.set_variable(ui.VarString("none"))
            else:
                chs.set_variable(ui.VarString("visible"))

            chs.prev_step(self.step_menu_monitor)
            chs.next_step(self.step_menu_monitor_desktop_notification_procede)
            return chs
        except:
            return ui.ErrorDialog(
                self._get_message('configureErrorConnection'))
Esempio n. 4
0
 def step_check_install_code(self, curui):
     if curui.get_key() is not None and curui.get_key() == 'tryAgain':
         if curui.get_variable().get() == 'configureLater':
             return self.step_menu_main(curui)
         elif curui.get_variable().get() == 'configProxy':
             curui.set_key("installCode")
             return self.step_configure_proxy_type(curui)
         elif curui.get_variable().get() == 'reEnterCode':
             return self.step_menu_agent_install_key_selected(curui)
     msg = self._get_message('checkInstallCode')
     self._uinterface.wait_message(msg)
     key = self._install_code.get()
     try:
         self.install_key(key)
         msg = ui.Message(self._get_message('configureKeyInstalled'))
         msg.next_step(self.step_menu_main)
         return msg
     except Exception as e:
         s = str(e)
         if s == "INVALID_CODE":
             chs = ui.Chooser()
             chs.set_key("tryAgain")
             chs.set_message(self._get_message('errorInvalidCode'))
             chs.add("reEnterCode", self._get_message('reEnterCode'))
             chs.add("configureLater", self._get_message('configureLater'))
             chs.set_variable(ui.VarString("reEnterCode"))
             chs.prev_step(self.step_menu_agent_install_key_selected)
             chs.next_step(self.step_check_install_code)
             return chs
         elif s == "CONNECT_ERROR":
             chs = ui.Chooser()
             chs.set_key("tryAgain")
             chs.set_message(self._get_message('errorConnectionQuestion'))
             chs.add("configProxy", self._get_message('yes'))
             chs.add("noTryAgain", self._get_message('noTryAgain'))
             chs.add("configureLater", self._get_message('configureLater'))
             chs.set_variable(ui.VarString("noTryAgain"))
             chs.prev_step(self.step_menu_agent_install_key_selected)
             chs.next_step(self.step_check_install_code)
             return chs
         elif s == "REQUEST_TIMEOUT":
             return ui.ErrorDialog(
                 self._get_message('configureErrorConnection'))
         else:
             return ui.ErrorDialog(s)
Esempio n. 5
0
 def step_menu_monitor_selected(self, curui):
     try:
         if curui.get_variable().get() == "configurePassword":
             return self.step_menu_monitor_password(curui)
         elif curui.get_variable().get() == "configureDesktopNotification":
             return self.step_menu_monitor_desktop_notification(curui)
     except:
         return ui.ErrorDialog(
             self._get_message('configureErrorConnection'))
Esempio n. 6
0
 def step_menu_agent_remove_key_selected(self, curui):
     if curui.get_variable().get()=='yes':
         try:
             self._uinterface.wait_message(self._get_message('configureUninstallationKey'),  0)
             self.uninstall_key()
         except:
                 return ui.ErrorDialog(self._get_message('configureErrorConnection'))
         return self.step_menu_agent_install_key_selected(curui)
     else:
         return self.step_menu_agent(curui)
Esempio n. 7
0
 def step_menu_monitor_procede(self, curui):
     try:
         if curui.get_variable().get()=='yes':
             self.set_config("monitor_tray_icon", "True")
         else:
             self.set_config("monitor_tray_icon", "False")
         msg = ui.Message(self._get_message('configureTrayIconOK'))
         msg.next_step(self.step_menu_main)
         return msg
     except:
         return ui.ErrorDialog(self._get_message('configureErrorConnection'))
Esempio n. 8
0
 def step_menu_agent_disable_procede(self, curui):
     if curui.get_variable().get()=='yes':
         try:
             self.set_config("enabled", "False")
             msg = ui.Message(self._get_message('configureAgentDisabled'))
             msg.next_step(self.step_menu_main)
             return msg
         except:
                 return ui.ErrorDialog(self._get_message('configureErrorConnection'))
     else:
         return self.step_menu_agent(curui)
Esempio n. 9
0
 def step_menu_monitor_desktop_notification_procede(self, curui):
     try:
         self.set_config("monitor_desktop_notification",
                         curui.get_variable().get())
         msg = ui.Message(
             self._get_message('configureDesktopNotificationOK') + "\n\n" +
             self._get_message('warningLoginLogout'))
         msg.next_step(self.step_menu_main)
         return msg
     except:
         return ui.ErrorDialog(
             self._get_message('configureErrorConnection'))
Esempio n. 10
0
 def step_configure_proxy_set(self, curui):
     ar = curui.get_key().split('_')
     curui.set_key(ar[0])
     if len(ar) == 2 and ar[1] == 'tryAgain':
         if curui.get_variable() is not None and curui.get_variable().get(
         ) == 'configureLater':
             if curui.get_key() == "menuProxy":
                 return self.step_menu_main(curui)
             elif curui.get_key() == "installCode":
                 return self.step_menu_agent_install_key_selected(curui)
     try:
         if self._proxy_type.get() == 'HTTP' or self._proxy_type.get(
         ) == 'SOCKS4' or self._proxy_type.get(
         ) == 'SOCKS4A' or self._proxy_type.get() == 'SOCKS5':
             try:
                 int(self._proxy_port.get())
             except:
                 return ui.ErrorDialog(
                     self._get_message("validInteger").format(
                         self._get_message('proxyPort')))
         sret = self.send_req(
             "set_proxy", {
                 'type': self._proxy_type.get(),
                 'host': self._proxy_host.get(),
                 'port': self._proxy_port.get(),
                 'user': self._proxy_user.get(),
                 'password': self._proxy_password.get()
             })
         if sret != "OK":
             raise Exception(sret[6:])
     except:
         chs = ui.Chooser()
         chs.set_key(curui.get_key() + "_tryAgain")
         chs.set_message(self._get_message('errorConnectionConfig'))
         chs.add("noTryAgain", self._get_message('noTryAgain'))
         chs.add("configureLater", self._get_message('configureLater'))
         chs.set_variable(ui.VarString("noTryAgain"))
         if curui.get_key() == "menuProxy":
             chs.prev_step(self.step_menu_main)
         elif curui.get_key() == "installCode":
             chs.prev_step(self.step_menu_agent_install_key_selected)
         chs.next_step(self.step_configure_proxy_set)
         return chs
     if curui.get_key() == "menuProxy":
         msg = ui.Message(self._get_message('configureProxyEnd'))
         msg.next_step(self.step_menu_main)
         return msg
     elif curui.get_key() == "installCode":
         return self.step_check_install_code(curui)
Esempio n. 11
0
 def step_menu_monitor_selected(self, ui):
     try:
         chs = ui.Chooser()
         chs.set_message(self._get_message('configureChooseMonitorTrayIconVisibility'))
         chs.add("yes", self._get_message('yes'))
         chs.add("no", self._get_message('no'))
         if self.get_config("monitor_tray_icon")=="True":
             chs.set_variable(ui.VarString("yes"))
         else:
             chs.set_variable(ui.VarString("no"))
         chs.prev_step(self.step_menu_monitor)
         chs.next_step(self.step_menu_monitor_procede)
         return chs
     except:
         return ui.ErrorDialog(self._get_message('configureErrorConnection'))
Esempio n. 12
0
 def step_menu_main(self, curui):
     try:
         self.read_proxy_info()
     except:
         return ui.ErrorDialog(self._get_message('configureErrorConnection'))
     chs = ui.Chooser()
     chs.set_message(self._get_message('configureChooseOperation'))
     chs.add("configureAgent", self._get_message('configureAgent'))
     chs.add("configureProxy", self._get_message('configureProxy'))
     #chs.add("configureMonitor", self._get_message('configureMonitor'))
     chs.add("configurePassword", self._get_message('configurePassword'))
     #chs.add("configureExit", self._get_message('configureExit'))
     chs.set_variable(self._main_menu_sel)
     chs.next_step(self.step_menu_main_selected)
     return chs
Esempio n. 13
0
 def step_menu_agent(self, curui):
     try:
         self._install_code.set("")
         key = self.get_config("key")
         if key == "":
             return self.step_menu_agent_install_key_selected(curui)
         else:
             chs = ui.Chooser()
             chs.set_message(self._get_message('configureChooseOperation'))
             chs.add("configureChangeInstallKey", self._get_message('configureChangeInstallKey'))
             if self.is_agent_enable():
                 chs.add("configureDisableAgent", self._get_message('configureDisableAgent'))
             else:
                 chs.add("configureEnableAgent", self._get_message('configureEnableAgent'))
             chs.set_variable(self._agent_menu_sel)
             chs.prev_step(self.step_menu_main)
             chs.next_step(self.step_menu_agent_selected)
             return chs
     except:
         return ui.ErrorDialog(self._get_message('configureErrorConnection'))