def badgeItem(self, badge, alt=False): item = QListWidgetItem(self.badges[badge]["name"]) item.setData(Qt.UserRole, badge) item.setToolTip(self.badges[badge]["description"]) item.setIcon( QIcon("{}\\{}{}".format(self.icons, self.badges[badge]["filename"], "_details" if alt else ""))) return item
def badgeItem(self, badge, alt=False, ext=False): try: lst = self.extbadges if ext else self.badges item = QListWidgetItem(lst[badge]["name"]) item.setData(Qt.UserRole, badge) try: item.setToolTip(lst[badge]["description"]) except: pass try: item.setIcon(QIcon("{}\\{}{}".format(self.icons, lst[badge]["filename"],"_details" if alt else ""))) except: pass return item except: ts3lib.logMessage(format_exc(), ts3defines.LogLevel.LogLevel_ERROR, "pyTSon", 0)
def badgeItem(self, badge, alt=False, ext=False): try: lst = self.extbadges if ext else self.badges item = QListWidgetItem(lst[badge]["name"]) item.setData(Qt.UserRole, badge) path = "{}\\{}".format(self.icons, lst[badge]["filename"]) item.setToolTip( '{}<br/><center><img width="64" height="64" src="{}_details">'. format(lst[badge]["description"], path)) item.setIcon(QIcon("{}{}".format(path, "_details" if alt else ""))) return item except: ts3lib.logMessage(format_exc(), ts3defines.LogLevel.LogLevel_ERROR, "pyTSon", 0) pass
def updateAddonlist(self): if self.pluginsList.currentItem(): cur = self.pluginsList.currentItem().text() else: cur = None self.pluginsList.clear() for a in self.addons.values(): if (self.replist[a["repository"]]["active"] and ("platforms" not in a or pytson.platformstr() in a["platforms"])): item = QListWidgetItem(a["name"], self.pluginsList) item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsUserCheckable | Qt.ItemIsEnabled) item.setData(Qt.UserRole, a["name"]) if a["name"] in self.host.plugins: if a["version"] > self.host.plugins[a["name"]].version: item.setForeground(Qt.red) item.setToolTip(self._tr("Update available")) elif a["version"] == self.host.plugins[a["name"]].version: item.setForeground(Qt.green) item.setToolTip(self._tr("You have this plugin " "installed, no update " "available")) elif a["version"] < self.host.plugins[a["name"]].version: item.setForeground(Qt.gray) item.setToolTip(self._tr("Your local version has a " "greater version number")) if cur and a["name"] == cur: self.pluginsList.setCurrentItem(item) self.pluginsList.sortItems()
def __init__(self, info, parent=None): super(QDialog, self).__init__(parent) setupUi( self, os.path.join(ts3.getPluginPath(), "pyTSon", "scripts", "info", "settings.ui")) self.setAttribute(Qt.WA_DeleteOnClose) self.setWindowTitle("Extended Info Settings") self.chk_debug.setChecked(info.cfg.getboolean('general', 'Debug')) self.chk_colored.setChecked(info.cfg.getboolean('general', 'Colored')) self.chk_arsv.setChecked( info.cfg.getboolean('general', 'Autorequest Server Variables')) self.chk_arcv.setChecked( info.cfg.getboolean('general', 'Autorequest Client Variables')) for name, value in info.cfg['VirtualServerProperties'].items(): _item = QListWidgetItem(self.lst_server) _item.setToolTip(name) _item.setStatusTip('VirtualServerProperties') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText( name.replace('VIRTUALSERVER_', '').replace('_', ' ').title()) for name, value in info.cfg['VirtualServerPropertiesRare'].items(): _item = QListWidgetItem(self.lst_server) _item.setToolTip(name) _item.setStatusTip('VirtualServerPropertiesRare') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText( name.replace('VIRTUALSERVER_', '').replace('_', ' ').title()) for name, value in info.cfg['ChannelProperties'].items(): _item = QListWidgetItem(self.lst_channel) _item.setToolTip(name) _item.setStatusTip('ChannelProperties') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText( name.replace('CHANNEL_', '').replace('_', ' ').title()) for name, value in info.cfg['ChannelPropertiesRare'].items(): _item = QListWidgetItem(self.lst_channel) _item.setToolTip(name) _item.setStatusTip('ChannelPropertiesRare') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText( name.replace('CHANNEL_', '').replace('_', ' ').title()) for name, value in info.cfg['ClientProperties'].items(): _item = QListWidgetItem(self.lst_client) _item.setToolTip(name) _item.setStatusTip('ClientProperties') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText( name.replace('CLIENT_', '').replace('_', ' ').title()) for name, value in info.cfg['ClientPropertiesRare'].items(): _item = QListWidgetItem(self.lst_client) _item.setToolTip(name) _item.setStatusTip('ClientPropertiesRare') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText( name.replace('CLIENT_', '').replace('_', ' ').title()) for name, value in info.cfg['ConnectionProperties'].items(): _item = QListWidgetItem(self.lst_client) _item.setToolTip(name) _item.setStatusTip('ConnectionProperties') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText( name.replace('CONNECTION_', '').replace('_', ' ').title()) for name, value in info.cfg['ConnectionPropertiesRare'].items(): _item = QListWidgetItem(self.lst_client) _item.setToolTip(name) _item.setStatusTip('ConnectionPropertiesRare') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText( name.replace('CONNECTION_', '').replace('_', ' ').title()) self.info = info
def __init__(self,info, parent=None): super(QDialog, self).__init__(parent) setupUi(self, os.path.join(ts3.getPluginPath(), "pyTSon", "scripts", "info", "settings.ui")) self.setWindowTitle("Extended Info Settings") ts3.printMessageToCurrentTab(str(info.cfg.getboolean('general', 'Debug'))) self.chk_debug.setChecked(info.cfg.getboolean('general', 'Debug')) self.chk_colored.setChecked(info.cfg.getboolean('general', 'Colored')) self.chk_arsv.setChecked(info.cfg.getboolean('general', 'Autorequest Server Variables')) self.chk_arcv.setChecked(info.cfg.getboolean('general', 'Autorequest Client Variables')) for name, value in info.cfg['VirtualServerProperties'].items(): _item = QListWidgetItem(self.lst_server) _item.setToolTip(name) _item.setStatusTip('VirtualServerProperties') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText(name.replace('VIRTUALSERVER_', '').replace('_', ' ').title()) for name, value in info.cfg['VirtualServerPropertiesRare'].items(): _item = QListWidgetItem(self.lst_server) _item.setToolTip(name) _item.setStatusTip('VirtualServerPropertiesRare') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText(name.replace('VIRTUALSERVER_', '').replace('_', ' ').title()) for name, value in info.cfg['ChannelProperties'].items(): _item = QListWidgetItem(self.lst_channel) _item.setToolTip(name) _item.setStatusTip('ChannelProperties') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText(name.replace('CHANNEL_', '').replace('_', ' ').title()) for name, value in info.cfg['ChannelPropertiesRare'].items(): _item = QListWidgetItem(self.lst_channel) _item.setToolTip(name) _item.setStatusTip('ChannelPropertiesRare') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText(name.replace('CHANNEL_', '').replace('_', ' ').title()) for name, value in info.cfg['ClientProperties'].items(): _item = QListWidgetItem(self.lst_client) _item.setToolTip(name) _item.setStatusTip('ClientProperties') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText(name.replace('CLIENT_', '').replace('_', ' ').title()) for name, value in info.cfg['ClientPropertiesRare'].items(): _item = QListWidgetItem(self.lst_client) _item.setToolTip(name) _item.setStatusTip('ClientPropertiesRare') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText(name.replace('CLIENT_', '').replace('_', ' ').title()) for name, value in info.cfg['ConnectionProperties'].items(): _item = QListWidgetItem(self.lst_client) _item.setToolTip(name) _item.setStatusTip('ConnectionProperties') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText(name.replace('CONNECTION_', '').replace('_', ' ').title()) for name, value in info.cfg['ConnectionPropertiesRare'].items(): _item = QListWidgetItem(self.lst_client) _item.setToolTip(name) _item.setStatusTip('ConnectionPropertiesRare') if value.lower() == "true": _item.setCheckState(Qt.Checked) else: _item.setCheckState(Qt.Unchecked) _item.setText(name.replace('CONNECTION_', '').replace('_', ' ').title())