Example #1
0
 def onHotkeyOrCommandEvent(self, keyword, schid=0):
     if not schid: schid = ts3lib.getCurrentServerConnectionHandlerID()
     # (err, status) = ts3lib.getConnectionStatus(schid)
     # if status != ts3defines.ConnectStatus.STATUS_CONNECTION_ESTABLISHED: return
     arguments = []
     if keyword == "yatqa_start": pass
     elif keyword == "yatqa_connect_current":
         (err, ownID) = ts3lib.getClientID(schid)
         (err, ip) = ts3lib.getConnectionVariable(
             schid, ownID,
             ts3defines.ConnectionProperties.CONNECTION_SERVER_IP)
         (err, port) = ts3lib.getServerVariable(
             schid,
             ts3defines.VirtualServerPropertiesRare.VIRTUALSERVER_PORT)
         title = ("{} > {}".format(self.name, ip))
         qport = inputInt(title, "Query Port:", 10011, 1, 65535)
         name = inputBox(title, "Query Login Name:", "serveradmin")
         pw = inputBox(
             title, "Query Login Password:"******"")
         args = ["-c", ip, qport]
         if name and pw: args.extend([name, pw, port])
         else: args.append(port)
         self.yatqa.setArguments(
             args)  # IP Query_Port [User Pass] [Voice_Port]
     elif keyword == "yatqa_stats_current":
         (err, ownID) = ts3lib.getClientID(schid)
         (err, ip) = ts3lib.getConnectionVariable(
             schid, ownID,
             ts3defines.ConnectionProperties.CONNECTION_SERVER_IP)
         (err, port) = ts3lib.getServerVariable(
             schid,
             ts3defines.VirtualServerPropertiesRare.VIRTUALSERVER_PORT)
         self.yatqa.setArguments(["-s", ip, port])  # IP
     elif keyword == "yatqa_blacklist_current":
         (err, ownID) = ts3lib.getClientID(schid)
         (err, ip) = ts3lib.getConnectionVariable(
             schid, ownID,
             ts3defines.ConnectionProperties.CONNECTION_SERVER_IP)
         self.yatqa.setArguments(["-b", ip])  # IP
     elif keyword == "yatqa_lookup_dns":
         (err, host, port, pw) = ts3lib.getServerConnectInfo(schid)
         self.yatqa.setArguments(["-d", host])
     elif keyword == "yatqa_browse_icons":
         (err, suid) = ts3lib.getServerVariable(
             schid, ts3defines.VirtualServerProperties.
             VIRTUALSERVER_UNIQUE_IDENTIFIER)
         self.yatqa.setArguments(["-i", suid])
     elif keyword == "yatqa_permission_editor":
         self.yatqa.setArguments(["-p"])
     elif keyword == "yatqa_connect_default":
         self.yatqa.setArguments(["-a"])
     else:
         return False
     if PluginHost.cfg.getboolean("general", "verbose"):
         print(self.bin, self.yatqa.arguments())
     self.yatqa.start()
     return True
Example #2
0
 def toggleTimer(self, schid):
     if self.timer.isActive():
         self.timer.stop()
     else:
         interval = inputInt(self.name, 'Interval in Milliseconds:')
         self.schid = schid
         if interval < 1:
             self.requested = schid
             ts3lib.requestServerVariables(schid)
         else: self.timer.start(interval)
Example #3
0
 def onMenuItemEvent(self, schid, atype, menuItemID, selectedItemID):
     if atype != ts3defines.PluginMenuType.PLUGIN_MENU_TYPE_GLOBAL or menuItemID != 0:
         return
     if self.timer.isActive():
         self.timer.stop()
         self.schid = 0
     else:
         interval = inputInt(self.name, 'Interval in Milliseconds:')
         self.schid = schid
         if interval < 1: ts3lib.requestServerVariables(schid)
         else: self.timer.start(interval)
Example #4
0
 def toggleTimer(self, schid):
     if self.timer is None:
         self.timer = QTimer()
         self.timer.timeout.connect(self.tick)
     if self.timer.isActive():
         self.timer.stop()
         self.timer = None
         ts3lib.printMessageToCurrentTab('Timer stopped!')
     else:
         step = inputInt(self.name, 'Interval in Milliseconds:', 1000)
         if step: interval = step
         else: interval = 1000
         self.schid = schid
         self.timer.start(interval)
         ts3lib.printMessageToCurrentTab('Timer started!')