def generate_upgrade_image(upgrade, disabled=False): image = pygame.image.load( resource_path("assets/up-back-iron.png")).convert_alpha() dither = pygame.image.load( resource_path("assets/dither.png")).convert_alpha() try: icon = pygame.image.load( resource_path("assets/upgrades/%s.png" % upgrade.icon)).convert_alpha() except: print("UPGRADE ICON NOT FOUND:", upgrade.icon) category_icons = { 'buildings': 'i-up-building', 'tech': 'i-up-tech', 'ships': 'i-up-ship' } category_icon = pygame.image.load( resource_path("assets/%s.png" % category_icons[upgrade.category])).convert_alpha() image.blit(icon, (4, 5)) image.blit(category_icon, (0, 0)) if disabled: #disabled_image = pygame.Surface(image.get_size(), pygame.SRCALPHA) #disabled_image.fill((0,0,0,128)) image.blit(dither, (0, 0), (0, 0, *image.get_size())) return image
def make_minimap(self, x, y): background = pygame.sprite.Sprite() background.image = pygame.Surface((42, 34)) background.rect = (x, y, 42, 34) background.image.fill(game.BGCOLOR) self.popup_sprites.append(background) ts = tilemap.Tilemap( 2, 20, 16, pygame.image.load(resource_path('assets/minitiles.png'))) ts.load( resource_path('levels/%s_tiles.csv' % LEVELS[self.selected_level][0])) ts.rect = (x + 1, y + 1, ts.rect[2], ts.rect[3]) self.popup_sprites.append(ts) ts = tilemap.Tilemap(2, 20, 16, pygame.image.load( resource_path('assets/miniobjects.png')), use_zero=True) ts.load( resource_path('levels/%s_objects.csv' % LEVELS[self.selected_level][0])) ts.rect = (x + 1, y + 1, ts.rect[2], ts.rect[3]) self.popup_sprites.append(ts)
def __init__(self, pos, civ): super().__init__(pos) self.civ = civ self.images = {n : pygame.image.load(resource_path("assets/i-%s.png" % n)) for n in ORDER} self._percent_o2_use = pygame.image.load(resource_path("assets/percent_o2_use.png")) self.expand_timer = 0 self.target_y = self.pos.y
def __init__(self, pos): super().__init__(pos) self.full_image = pygame.image.load(resource_path("assets/o2-full.png")).convert_alpha() self.empty_image = pygame.image.load(resource_path("assets/o2-empty.png")).convert_alpha() self.o2 = O2_MAX self.blink_time = 0 self._generate_image()
def __init__(self, planet): super().__init__(V2(0, 0)) self.planet = planet self._num_ships = 0 self.visible = False self.pos = planet.pos + V2(3, 3) self.time = 0 self.ship_img = pygame.image.load( resource_path("assets/i-fighter.png")).convert_alpha() self.hourglass_frames = pygame.image.load( resource_path("assets/hourglass.png")).convert_alpha() self._generate_image()
def __init__(self, pos, name): super().__init__(pos) self.name = name self.time = -self.TOTAL_TIME self.offset = (0.5, 0) self.dither_image = pygame.image.load(resource_path("assets/dither_white.png")).convert_alpha() self._generate_image()
def main(): if len(sys.argv) == 1: from PyQt5 import QtWidgets, QtGui, QtCore from resources import resource_path import handlerInterface app = QtWidgets.QApplication(sys.argv) splash_pix = QtGui.QPixmap(resource_path('logo.png')) splash = QtWidgets.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint) splash.setMask(splash_pix.mask()) splash.show() window = handlerInterface.Application() window.show() splash.finish(window) sys.exit(app.exec_()) else: parser = create_parser() namespace = parser.parse_args(sys.argv[1:]) blacklist = Blacklist(namespace.prefix, namespace.rule) if namespace.command == 'import': blacklist.import_tmg(namespace.source, set(['COPYRIGHT', 'global_usage'] + namespace.exceptions if namespace.exceptions is not None else ['COPYRIGHT', 'global_usage']), set(namespace.exceptionsDomains + ['']), namespace.maxSize) elif namespace.command == 'clean': blacklist.clean() else: parser.print_help()
def enter(self): self.defeat_image = pygame.image.load( resource_path("assets/defeat.png")) self.defeat_t = 0 self.angle = 0 self.scale = 0 sound.play("defeat")
def set_sprite_sheet(self, sprite_sheet, frame_width=None): if isinstance(sprite_sheet, str): self._sheet = pygame.image.load( resource_path(sprite_sheet)).convert_alpha() else: self._sheet = sprite_sheet self._sheet_width = self._sheet.get_width() self._height = self._sheet.get_height() self._frame_width = frame_width or 0 if self._frame_width == 0: if self._sheet: # If no frame width, it should just be the image width. self._frame_width = self._sheet.get_width() else: # No image, this is invisible self._frame_width = 1 self._width = self._frame_width self._recalc_rect() self._num_frames = self._sheet_width // self._frame_width try: self._frame = self._frame % self._num_frames except: print(self._sheet_width, self._frame_width) self._update_image()
def save(self): data = { 'level_state': self.level_state, 'highscores': self.highscores, 'settings': self.settings } json.dump(data, open(resource_path(FILENAME), "w"))
def init(): pygame.mixer.init() for s, fn in SOUNDFILES.items(): SOUNDS[s] = pygame.mixer.Sound(resource_path(fn)) for name in [ 'laser1', 'laser2', 'laser3', 'explosion1', 'explosion2', 'control', 'upgrade2', 'hit', 'talk1', 'talk2', 'talk3', 'short3', 'goodcapture', 'badcapture', 'exp1', 'exp2', 'exp3', 'exp4', 'radar', 'msg1', 'msg2', 'recall', 'cancel', ]: load_sound(name, "assets/sounds/%s.wav" % name) pygame.mixer.music.set_endevent(MUSIC_ENDEVENT)
def __init__(self, pos, sheet, frame_width): SpriteBase.__init__(self, pos) self._sheet = pygame.image.load(resource_path(sheet)).convert_alpha() self._frame_width = frame_width self._frame = 0 self._angle = 0 self._update_image()
def _generate_image(self, hover=False): w = 240 h = 31 pad = 4 resource_color = RESOURCE_COLORS[self.upgrade.resource_type] upgrade_color = UPGRADE_CATEGORY_COLORS[self.upgrade.category] self.image = pygame.Surface((w,h), pygame.SRCALPHA) if hover: pygame.draw.rect(self.image, PICO_BLACK, (0,0,w,h), 0) text_color = PICO_WHITE else: pygame.draw.rect(self.image, upgrade_color, (0,0,w,h), 0) text_color = PICO_BLACK pygame.draw.rect(self.image, resource_color, (pad+1,pad,21,23), 0) pygame.draw.rect(self.image, resource_color, (pad,pad+1,23,21), 0) try: icon = pygame.image.load(resource_path("assets/upgrades/%s.png" % self.upgrade.icon)).convert_alpha() self.image.blit(icon, (pad + 2, pad + 2)) except: print(self.upgrade.icon) text.FONTS["small"].render_to(self.image, (31 + pad, pad + 1), self.upgrade.title, text_color) text.FONTS["small"].render_to(self.image, (31 + pad, pad + 14), self.upgrade.description, text_color) self._width = w self._height = h self._recalc_rect()
def load_shapes(self, name): try: data = json.load( open(resource_path("assets/buildings/%s.json" % name))) self.shapes = [{ 'points': [V2(*pt) for pt in shape['points']], 'color': shape['color'], 'blink': shape['blink'] } for shape in data] except: data = json.load( open(resource_path("assets/buildings/default.json"))) self.shapes = [{ 'points': [V2(*pt) for pt in shape['points']], 'color': shape['color'], 'blink': shape['blink'] } for shape in data]
def __init__(self, offer, pos, width, height): super().__init__(pos) self.offer = offer self.icon_sheet = pygame.image.load( resource_path("assets/reward_icons.png")).convert_alpha() self._width = width self._height = height self._generate_image()
def __init__(self, sheet, width): pygame.sprite.Sprite.__init__(self) self._sheet = pygame.image.load(resource_path(sheet)).convert_alpha() self._frame = 0 self._frame_width = width self._update_image() self.rect = (0, 0, width, self._sheet.get_size()[1]) self._num_frames = self._sheet.get_size()[0] // self._frame_width
def load(self): gx, gy = game.RES[0] // game.TILESIZE, game.RES[1] // game.TILESIZE self.tilemap = tilemap.Tilemap( game.TILESIZE, gx, gy, pygame.image.load( resource_path("assets/tiles.png")).convert_alpha()) self.background_group = pygame.sprite.Group() self.background_group.add(self.tilemap) self.game_group = pygame.sprite.LayeredUpdates() self.ui_group = pygame.sprite.Group() self.tutorial_group = pygame.sprite.Group() self.tanks = [] self.overlay = framesprite.FrameSprite("assets/gameoverlay.png", 240) self.ui_group.add(self.overlay) self.worker_queue = tilemap.Tilemap( 12, 20, 1, pygame.image.load( resource_path("assets/workericon.png")).convert_alpha()) self.worker_queue.rect = (2, 1, 240, 12) self.ui_group.add(self.worker_queue) self.animatedsprites = [] self.road_grid = [] self.object_grid = [] self.factories = [] self.cityhalls = [] for row in range(gy): self.object_grid.append([]) self.road_grid.append([]) for col in range(gx): self.object_grid[-1].append(None) self.road_grid[-1].append(False) try: self.tilemap.load("levels/%s_tiles.csv" % self.level_file) self.load_objects("levels/%s_objects.csv" % self.level_file) except Exception as e: traceback.print_exc() self.tilemap.load("levels/empty_tiles.csv") self.load_objects("levels/empty_objects.csv") self.level_file = "empty" self.queued_workers = 0 self.start_tile = None
def enter(self): self.victory_image = pygame.image.load( resource_path("assets/victory.png")) self.victory_t = 0 self.angle = 0 self.scale = 0 self.num_stars = self.scene.game.record_victory(self.num_steps) sound.play_music('victory', 0) self.stars = []
def __init__(self, pos): super().__init__(pos) self.blobs = [] self.time = 0 self.update_timer = 0 self.next_blob_timer = 0 self.mask = pygame.image.load( resource_path("assets/cloudmask.png")).convert_alpha() for i in range(200): self.step(0.5)
def setup_logging(default_path=resource_path('logging.yml'), default_level=logging.INFO): path = default_path if os.path.exists(path): with open(path, 'rt') as f: config = yaml.safe_load(f.read()) logging.config.dictConfig(config) else: logging.basicConfig(level=default_level) return logging.getLogger('logger')
def __init__(self, pos, upgrade, onclick, onhoverchange, time=0): super().__init__(pos) self.upgrade = upgrade self.onclick_callback = onclick self.onhoverchange = onhoverchange self.selectable = True self.time = time self.dither_image = pygame.image.load( resource_path("assets/dither_white.png")).convert_alpha() self._generate_image()
def __init__(self, target, speed=3): super().__init__(target.pos) self.speed = speed self.target = target self.offset = tuple(target.offset[::]) self.layer = target.layer + 1 self.time = 0 self.dither_image = pygame.image.load( resources.resource_path( "assets/dither_white.png")).convert_alpha() self._generate_image()
def __init__(self, pos, img): spritebase.SpriteBase.__init__(self, pos) if isinstance(img, str): self.image = pygame.image.load(resource_path(img)).convert_alpha() else: self.image = img self._width = 0 self._height = 0 if self.image: self._width = self.image.get_rect()[2] self._height = self.image.get_rect()[3] self._recalc_rect()
def load(self, filename): with open(resource_path(filename)) as f: reader = csv.reader(f) for y,row in enumerate(reader): for x,cell in enumerate(row): #if cell == -1: cell = 0 self._grid[y][x] = int(cell) self._dirty_rects = [pygame.Rect( 0, 0, self.tile_size * self.num_columns, self.tile_size * self.num_rows )] self.update_image()
def __init__(self, pos, icon, text, color): SpriteBase.__init__(self, pos) if icon: self.icon = pygame.image.load(resource_path(icon)).convert_alpha() else: self.icon = None self.text = text self.color = color self.offset = (0.5,0.5) self._generate_image() self.time = 0 self.layer = -1
def redraw(self): xmin, xmax, ymin, ymax = 0,0,0,0 outerpad = 3 for ci in self._controls: control = ci['control'] pos = ci['pos'] xmax = max(pos.x + control.width, xmax) ymax = max(pos.y + control.height, ymax) tab_width = 0 if self.tab: icon_offset = 0 icon = None if 'icon' in self.tab: icon = pygame.image.load(resources.resource_path(self.tab['icon'])) icon_offset = icon.get_width() + 4 tab_foreground = PICO_BLACK if sum(self.tab['color']) < 90 * 3: tab_foreground = PICO_WHITE tab_text = text.render_multiline(self.tab['text'], 'small', tab_foreground) tab_width = tab_text.get_size()[0] + 8 + icon_offset box_width = xmax + self.padding * 2 box_height = ymax + self.padding * 2 tab_offset = 0 if self.tab: tab_offset = 14 total_height = box_height + tab_offset self.image = pygame.Surface((box_width, box_height + tab_offset), pygame.SRCALPHA) pygame.draw.rect(self.image, PICO_DARKBLUE, (outerpad,outerpad + tab_offset, box_width - outerpad * 2, box_height - outerpad * 2), 0) self._width = box_width self._height = box_height + tab_offset # pygame.draw.rect(self.image, PICO_WHITE, (0, tab_offset, 1, box_height), 1) if self.tab: pygame.draw.rect(self.image, self.tab['color'], (outerpad, outerpad, tab_width, tab_offset), 0) # pygame.draw.rect(self.image, PICO_WHITE, (0, 0, 1, tab_offset + 1), 1) if 'icon' in self.tab: self.image.blit(icon, (4 + outerpad,4 + outerpad)) self.image.blit(tab_text, (4 + icon_offset + outerpad, 4 + outerpad)) self._background_offset = V2(self.padding, self.padding + tab_offset) pygame.draw.line(self.image, PICO_WHITE, (0,0), (4,0)) pygame.draw.line(self.image, PICO_WHITE, (0,0), (0,4)) pygame.draw.line(self.image, PICO_WHITE, (box_width - 4, total_height-1), (box_width, total_height-1)) pygame.draw.line(self.image, PICO_WHITE, (box_width - 1, total_height-4), (box_width - 1, total_height)) self._reposition_children() self._recalc_rect()
def save(self): data = { 'run_state': self.run_state, 'level_state': self.level_state, 'highscores': self.highscores, 'settings': self.settings, 'achievements': self.achievements, 'intel': self.intel, 'victories': self.victories, 'tutorial_complete': self.tutorial_complete } json.dump(data, open(resource_path(FILENAME), "w"))
def __init__(self, pos, sector_title, reward_name): super().__init__(pos) self.sector_title = sector_title self.reward_name = reward_name self.icon_sheet = pygame.image.load( resource_path("assets/reward_icons.png")).convert_alpha() if self.reward_name: self._generate_image() else: self._generate_image_noreward() self.initial_pos = self.pos self.target_pos = V2(self.pos.x, 8) self.t = 0
def __init__(self): global SAVE_OBJ try: data = json.load(open(resource_path(FILENAME), "r")) except: data = {} self.level_state = { int(k): v for k, v in data.get("level_state", {}).items() } self.settings = data.get("settings", DEFAULT_SETTINGS) SAVE_OBJ = self
def load_objects(self, filename): for y, row in enumerate(self.tilemap._grid): for x, cell in enumerate(row): if cell in game.ROADTILES: self.road_grid[y][x] = True with open(resource_path(filename)) as f: reader = csv.reader(f) for y, row in enumerate(reader): for x, cell in enumerate(row): cell = int(cell) o = None tmd = self.tilemap._grid[y][x] self.place_obj_by_index(cell, x, y)
def setupUi(self, AutoUploadTMG): AutoUploadTMG.setObjectName("AutoUploadTMG") AutoUploadTMG.resize(441, 776) font = QtGui.QFont() font.setFamily("MS Shell Dlg 2") AutoUploadTMG.setFont(font) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(resource_path("icon_64.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) AutoUploadTMG.setWindowIcon(icon) AutoUploadTMG.setAutoFillBackground(False) AutoUploadTMG.setStyleSheet("") AutoUploadTMG.setIconSize(QtCore.QSize(64, 64)) AutoUploadTMG.setToolButtonStyle(QtCore.Qt.ToolButtonFollowStyle) self.centralwidget = QtWidgets.QWidget(AutoUploadTMG) self.centralwidget.setStyleSheet("") self.centralwidget.setObjectName("centralwidget") self.gridLayout_3 = QtWidgets.QGridLayout(self.centralwidget) self.gridLayout_3.setObjectName("gridLayout_3") self.param_area = QtWidgets.QGroupBox(self.centralwidget) self.param_area.setStyleSheet("") self.param_area.setObjectName("param_area") self.gridLayout = QtWidgets.QGridLayout(self.param_area) self.gridLayout.setObjectName("gridLayout") self.verticalLayout_9 = QtWidgets.QVBoxLayout() self.verticalLayout_9.setObjectName("verticalLayout_9") self.horizontalLayout_5 = QtWidgets.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.label_3 = QtWidgets.QLabel(self.param_area) font = QtGui.QFont() font.setFamily("MS Shell Dlg 2") self.label_3.setFont(font) self.label_3.setStyleSheet("") self.label_3.setAlignment(QtCore.Qt.AlignCenter) self.label_3.setObjectName("label_3") self.horizontalLayout_5.addWidget(self.label_3) self.label_4 = QtWidgets.QLabel(self.param_area) self.label_4.setStyleSheet("color: rgb(255, 255, 255);") self.label_4.setText("") self.label_4.setAlignment(QtCore.Qt.AlignCenter) self.label_4.setObjectName("label_4") self.horizontalLayout_5.addWidget(self.label_4) self.verticalLayout_9.addLayout(self.horizontalLayout_5) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.SHL_prefix = QtWidgets.QLineEdit(self.param_area) self.SHL_prefix.setStyleSheet("color: rgb(17, 74, 141);") self.SHL_prefix.setAlignment(QtCore.Qt.AlignCenter) self.SHL_prefix.setObjectName("SHL_prefix") self.horizontalLayout.addWidget(self.SHL_prefix) self.shallalist_check = QtWidgets.QCheckBox(self.param_area) self.shallalist_check.setStyleSheet("") self.shallalist_check.setObjectName("shallalist_check") self.horizontalLayout.addWidget(self.shallalist_check) self.verticalLayout_9.addLayout(self.horizontalLayout) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.DGNC_prefix = QtWidgets.QLineEdit(self.param_area) self.DGNC_prefix.setStyleSheet("color: rgb(17, 74, 141);") self.DGNC_prefix.setAlignment(QtCore.Qt.AlignCenter) self.DGNC_prefix.setObjectName("DGNC_prefix") self.horizontalLayout_2.addWidget(self.DGNC_prefix) self.digincore_check = QtWidgets.QCheckBox(self.param_area) self.digincore_check.setStyleSheet("") self.digincore_check.setObjectName("digincore_check") self.horizontalLayout_2.addWidget(self.digincore_check) self.verticalLayout_9.addLayout(self.horizontalLayout_2) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.label_5 = QtWidgets.QLabel(self.param_area) self.label_5.setStyleSheet("") self.label_5.setAlignment(QtCore.Qt.AlignCenter) self.label_5.setObjectName("label_5") self.horizontalLayout_3.addWidget(self.label_5) self.choice_ruleName = QtWidgets.QComboBox(self.param_area) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.choice_ruleName.sizePolicy().hasHeightForWidth()) self.choice_ruleName.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setBold(False) font.setWeight(50) self.choice_ruleName.setFont(font) self.choice_ruleName.setAccessibleName("") self.choice_ruleName.setStyleSheet("color: rgb(17, 74, 141);\n" "selection-color: rgb(17, 74, 141);\n" "gridline-color: rgb(17, 74, 141);") self.choice_ruleName.setEditable(True) self.choice_ruleName.setCurrentText("") self.choice_ruleName.setModelColumn(0) self.choice_ruleName.setObjectName("choice_ruleName") self.horizontalLayout_3.addWidget(self.choice_ruleName) self.verticalLayout_9.addLayout(self.horizontalLayout_3) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.label = QtWidgets.QLabel(self.param_area) self.label.setStyleSheet("") self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setObjectName("label") self.horizontalLayout_4.addWidget(self.label) self.part_size = QtWidgets.QSpinBox(self.param_area) self.part_size.setStyleSheet("color: rgb(17, 74, 141);") self.part_size.setInputMethodHints(QtCore.Qt.ImhDigitsOnly|QtCore.Qt.ImhMultiLine|QtCore.Qt.ImhPreferNumbers) self.part_size.setAlignment(QtCore.Qt.AlignCenter) self.part_size.setMinimum(5000) self.part_size.setMaximum(600000) self.part_size.setProperty("value", 500000) self.part_size.setDisplayIntegerBase(10) self.part_size.setObjectName("part_size") self.horizontalLayout_4.addWidget(self.part_size) self.verticalLayout_9.addLayout(self.horizontalLayout_4) self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.label_11 = QtWidgets.QLabel(self.param_area) self.label_11.setStyleSheet("") self.label_11.setAlignment(QtCore.Qt.AlignCenter) self.label_11.setObjectName("label_11") self.verticalLayout.addWidget(self.label_11) self.exceptionsDomains = QtWidgets.QPlainTextEdit(self.param_area) self.exceptionsDomains.setStyleSheet("color: rgb(17, 74, 141);") self.exceptionsDomains.setObjectName("exceptionsDomains") self.verticalLayout.addWidget(self.exceptionsDomains) self.verticalLayout_9.addLayout(self.verticalLayout) self.gridLayout.addLayout(self.verticalLayout_9, 0, 0, 1, 1) self.gridLayout_3.addWidget(self.param_area, 0, 0, 1, 1) self.current_status = QtWidgets.QGroupBox(self.centralwidget) self.current_status.setStyleSheet("") self.current_status.setObjectName("current_status") self.gridLayout_2 = QtWidgets.QGridLayout(self.current_status) self.gridLayout_2.setObjectName("gridLayout_2") self.verticalLayout_5 = QtWidgets.QVBoxLayout() self.verticalLayout_5.setObjectName("verticalLayout_5") self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.label_6 = QtWidgets.QLabel(self.current_status) self.label_6.setAlignment(QtCore.Qt.AlignCenter) self.label_6.setObjectName("label_6") self.verticalLayout_3.addWidget(self.label_6) self.domainNameSetsMemory = QtWidgets.QListWidget(self.current_status) self.domainNameSetsMemory.setStyleSheet("color: rgb(17, 74, 141);") self.domainNameSetsMemory.setObjectName("domainNameSetsMemory") self.verticalLayout_3.addWidget(self.domainNameSetsMemory) self.horizontalLayout_6.addLayout(self.verticalLayout_3) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.label_7 = QtWidgets.QLabel(self.current_status) self.label_7.setAlignment(QtCore.Qt.AlignCenter) self.label_7.setObjectName("label_7") self.verticalLayout_2.addWidget(self.label_7) self.domainNameSetsTMG = QtWidgets.QListWidget(self.current_status) self.domainNameSetsTMG.setStyleSheet("color: rgb(17, 74, 141);") self.domainNameSetsTMG.setObjectName("domainNameSetsTMG") self.verticalLayout_2.addWidget(self.domainNameSetsTMG) self.horizontalLayout_6.addLayout(self.verticalLayout_2) self.verticalLayout_5.addLayout(self.horizontalLayout_6) self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") self.label_8 = QtWidgets.QLabel(self.current_status) self.label_8.setAlignment(QtCore.Qt.AlignCenter) self.label_8.setObjectName("label_8") self.verticalLayout_4.addWidget(self.label_8) self.operations = QtWidgets.QListWidget(self.current_status) self.operations.setStyleSheet("color: rgb(17, 74, 141);") self.operations.setObjectName("operations") self.verticalLayout_4.addWidget(self.operations) self.verticalLayout_5.addLayout(self.verticalLayout_4) self.gridLayout_2.addLayout(self.verticalLayout_5, 0, 0, 1, 1) self.horizontalLayout_7 = QtWidgets.QHBoxLayout() self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.verticalLayout_6 = QtWidgets.QVBoxLayout() self.verticalLayout_6.setObjectName("verticalLayout_6") self.procedure_name = QtWidgets.QLabel(self.current_status) self.procedure_name.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.procedure_name.setObjectName("procedure_name") self.verticalLayout_6.addWidget(self.procedure_name) self.label_2 = QtWidgets.QLabel(self.current_status) self.label_2.setObjectName("label_2") self.verticalLayout_6.addWidget(self.label_2) self.horizontalLayout_7.addLayout(self.verticalLayout_6) self.verticalLayout_7 = QtWidgets.QVBoxLayout() self.verticalLayout_7.setObjectName("verticalLayout_7") self.progressBar_download = QtWidgets.QProgressBar(self.current_status) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(17, 74, 141)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.HighlightedText, brush) brush = QtGui.QBrush(QtGui.QColor(17, 74, 141)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.HighlightedText, brush) brush = QtGui.QBrush(QtGui.QColor(17, 74, 141)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.HighlightedText, brush) self.progressBar_download.setPalette(palette) self.progressBar_download.setStyleSheet("selection-color: rgb(17, 74, 141);") self.progressBar_download.setMaximum(100) self.progressBar_download.setProperty("value", 24) self.progressBar_download.setObjectName("progressBar_download") self.verticalLayout_7.addWidget(self.progressBar_download) self.progressBar = QtWidgets.QProgressBar(self.current_status) self.progressBar.setMaximum(100) self.progressBar.setProperty("value", 24) self.progressBar.setObjectName("progressBar") self.verticalLayout_7.addWidget(self.progressBar) self.horizontalLayout_7.addLayout(self.verticalLayout_7) self.gridLayout_2.addLayout(self.horizontalLayout_7, 1, 0, 1, 1) self.gridLayout_3.addWidget(self.current_status, 1, 0, 1, 1) AutoUploadTMG.setCentralWidget(self.centralwidget) self.statusBar = QtWidgets.QStatusBar(AutoUploadTMG) self.statusBar.setObjectName("statusBar") AutoUploadTMG.setStatusBar(self.statusBar) self.menuBar = QtWidgets.QMenuBar(AutoUploadTMG) self.menuBar.setGeometry(QtCore.QRect(0, 0, 441, 21)) self.menuBar.setObjectName("menuBar") self.menu = QtWidgets.QMenu(self.menuBar) self.menu.setObjectName("menu") AutoUploadTMG.setMenuBar(self.menuBar) self.action_import = QtWidgets.QAction(AutoUploadTMG) self.action_import.setObjectName("action_import") self.action_refresh = QtWidgets.QAction(AutoUploadTMG) self.action_refresh.setObjectName("action_refresh") self.action_clean = QtWidgets.QAction(AutoUploadTMG) self.action_clean.setObjectName("action_clean") self.menu.addAction(self.action_import) self.menu.addAction(self.action_refresh) self.menu.addAction(self.action_clean) self.menuBar.addAction(self.menu.menuAction()) self.retranslateUi(AutoUploadTMG) self.domainNameSetsMemory.setCurrentRow(-1) self.action_clean.triggered.connect(AutoUploadTMG.start_thread_clean) self.choice_ruleName.activated['QString'].connect(AutoUploadTMG.start_refresh_information) self.action_import.triggered.connect(AutoUploadTMG.start_thread_import) self.action_refresh.triggered.connect(AutoUploadTMG.start_refresh_information) self.shallalist_check.stateChanged['int'].connect(AutoUploadTMG.can_choice_action) self.digincore_check.stateChanged['int'].connect(AutoUploadTMG.can_choice_action) QtCore.QMetaObject.connectSlotsByName(AutoUploadTMG)