Пример #1
0
 def cleanup_ui(self, parent_ui):
     self.parent_ui = parent_ui
     dock = parent_ui.ui.knitting_options_dock
     cleaner = QtCore.QObjectCleanupHandler()
     cleaner.add(self.qwidget)
     self.__qw = QtGui.QWidget()
     dock.setWidget(self.__qw)
 def cleanup_ui(self, parent_ui):
     """Cleans up UI elements inside knitting option dock."""
     #dock = parent_ui.knitting_options_dock
     dock = self.dock
     cleaner = QtCore.QObjectCleanupHandler()
     cleaner.add(dock.widget())
     self.__qw = QtGui.QWidget()
     dock.setWidget(self.__qw)
     self.unset_translator()
Пример #3
0
    def __init__(self):
        widgets.MainWindow.__init__(
            self,
            "Matcol Editor",
        )

        self.resize(450, 500)

        self.matcol_data = MatcolFile()
        self.file_src = ""
        self.widgets = []
        self.tooltips = config.read_config("ovl_util/tooltips/matcol.txt")
        self.games = ("Jurassic World Evolution", "Planet Zoo")
        self.default_fgms = config.read_list(
            "ovl_util/tooltips/matcol-fgm-names.txt")

        mainMenu = self.menuBar()
        fileMenu = mainMenu.addMenu('File')
        helpMenu = mainMenu.addMenu('Help')
        button_data = ( (fileMenu, "Open", self.open_materialcollection, "CTRL+O", ""), \
            (fileMenu, "Save", self.save_materialcollection, "CTRL+S", ""), \
            (fileMenu, "Exit", self.close, "", ""), \
            (helpMenu, "Report Bug", self.report_bug, "", ""), \
            (helpMenu, "Documentation", self.online_support, "", ""), \
            )
        self.add_to_menu(button_data)

        self.cleaner = QtCore.QObjectCleanupHandler()

        self.scrollarea = QtWidgets.QScrollArea(self)
        self.scrollarea.setWidgetResizable(True)
        self.setCentralWidget(self.scrollarea)

        # the actual scrollable stuff
        self.widget = QtWidgets.QWidget()
        self.scrollarea.setWidget(self.widget)

        self.game_container = widgets.LabelCombo("Game:", self.games)
        # self.game_container.entry.currentIndexChanged.connect(self.game_changed)
        self.game_container.entry.setEditable(False)
        self.materialcollection_container = widgets.LabelEdit("MATCOL:")
        self.tex_container = QtWidgets.QGroupBox("Slots")
        self.attrib_container = QtWidgets.QGroupBox("Attributes")

        self.vbox = QtWidgets.QVBoxLayout()
        self.vbox.addWidget(self.game_container)
        self.vbox.addWidget(self.materialcollection_container)
        self.vbox.addWidget(self.tex_container)
        self.vbox.addWidget(self.attrib_container)
        self.vbox.addStretch(1)
        self.widget.setLayout(self.vbox)

        self.tex_grid = self.create_grid()
        self.attrib_grid = self.create_grid()

        self.tex_container.setLayout(self.tex_grid)
        self.attrib_container.setLayout(self.attrib_grid)
Пример #4
0
	def __init__(self):
		widgets.MainWindow.__init__(self, "FGM Editor", )
		
		self.resize(450, 500)

		self.fgm_data = FgmFile()
		self.widgets = []
		self.tooltips = config.read_config("util/tooltips/fgm.txt")
		self.shaders = {}
		for game in games:
			self.shaders[game] = config.read_list(f"util/tooltips/fgm-shaders-{game.lower().replace(' ', '-')}.txt")

		self.cleaner = QtCore.QObjectCleanupHandler()

		self.scrollarea = QtWidgets.QScrollArea(self)
		self.scrollarea.setWidgetResizable(True)
		self.setCentralWidget(self.scrollarea)

		# the actual scrollable stuff
		self.widget = QtWidgets.QWidget()
		self.scrollarea.setWidget(self.widget)

		self.game_container = widgets.LabelCombo("Game:", games)
		self.game_container.entry.currentIndexChanged.connect(self.game_changed)
		self.game_container.entry.setEditable(False)
		self.file_widget = widgets.FileWidget(self, self.cfg, dtype="FGM")
		self.shader_container = widgets.LabelCombo("Shader:", ())
		self.shader_container.entry.activated.connect(self.shader_changed)
		self.tex_container = QtWidgets.QGroupBox("Textures")
		self.attrib_container = QtWidgets.QGroupBox("Attributes")

		vbox = QtWidgets.QVBoxLayout()
		vbox.addWidget(self.file_widget)
		vbox.addWidget(self.game_container)
		vbox.addWidget(self.shader_container)
		vbox.addWidget(self.tex_container)
		vbox.addWidget(self.attrib_container)
		vbox.addStretch(1)
		self.widget.setLayout(vbox)

		self.tex_grid = self.create_grid()
		self.attrib_grid = self.create_grid()

		self.tex_container.setLayout(self.tex_grid)
		self.attrib_container.setLayout(self.attrib_grid)

		mainMenu = self.menuBar()
		fileMenu = mainMenu.addMenu('File')
		helpMenu = mainMenu.addMenu('Help')
		button_data = ( (fileMenu, "Open", self.file_widget.ask_open, "CTRL+O", ""), \
						(fileMenu, "Save", self.save_fgm, "CTRL+S", ""), \
						(fileMenu, "Exit", self.close, "", ""), \
						(helpMenu, "Report Bug", self.report_bug, "", ""), \
						(helpMenu, "Documentation", self.online_support, "", ""), \
						)
		self.add_to_menu(button_data)
Пример #5
0
 def __init__(self, parent=None):
     super().__init__(parent)
     self.setObjectName("FilesTab")
     self.headers = ["Name", "Size", "Last Modification", "Path"]
     self.files = []
     self.ui.treeWidget.setHeaderLabels(self.headers)
     self.ui.treeWidget.header().resizeSection(2, 160)
     self.ui.treeWidget.itemDoubleClicked.connect(
         lambda clicked_item, clicked_col: QDesktopServices.openUrl(
             QUrl.fromLocalFile(clicked_item.text(3))))
     QtCore.QObjectCleanupHandler().add(self.layout())
     self.ui.mainLayout = QtWidgets.QVBoxLayout()
     self.ui.mainLayout.addWidget(self.ui.treeWidget)
     self.setLayout(self.ui.mainLayout)
Пример #6
0
	def __init__(self):
		widgets.MainWindow.__init__(self, "FGM Editor", )
		
		self.resize(800, 600)

		self.fgm_data = FgmFile()
		self.tooltips = config.read_config("ovl_util/tooltips/fgm.txt")
		self.games = [g.value for g in games]
		self.fgm_dict = None

		self.cleaner = QtCore.QObjectCleanupHandler()

		self.scrollarea = QtWidgets.QScrollArea(self)
		self.scrollarea.setWidgetResizable(True)
		self.setCentralWidget(self.scrollarea)

		# the actual scrollable stuff
		self.widget = QtWidgets.QWidget()
		self.scrollarea.setWidget(self.widget)

		self.game_container = widgets.LabelCombo("Game:", self.games)
		self.game_container.entry.currentIndexChanged.connect(self.game_changed)
		self.game_container.entry.setEditable(False)
		self.file_widget = widgets.FileWidget(self, self.cfg, dtype="FGM")

		self.shader_choice = widgets.LabelCombo("Shader:", ())
		self.shader_choice.entry.activated.connect(self.shader_changed)
		self.attribute_choice = widgets.LabelCombo("Attribute:", ())
		self.texture_choice = widgets.LabelCombo("Texture:", ())
		self.attribute_add = QtWidgets.QPushButton("Add Attribute")
		self.attribute_add.clicked.connect(self.add_attribute)
		self.texture_add = QtWidgets.QPushButton("Add Texture")
		self.texture_add.clicked.connect(self.add_texture)

		self.tex_container = ProptertyContainer(self, "Textures")
		self.attrib_container = ProptertyContainer(self, "Attributes")

		self.game_changed()
		# self.populate_choices()
		self.shader_changed()

		vbox = QtWidgets.QVBoxLayout()
		vbox.addWidget(self.file_widget)
		vbox.addWidget(self.game_container)
		vbox.addWidget(self.shader_choice)
		vbox.addWidget(self.attribute_choice)
		vbox.addWidget(self.attribute_add)
		vbox.addWidget(self.texture_choice)
		vbox.addWidget(self.texture_add)
		vbox.addWidget(self.tex_container)
		vbox.addWidget(self.attrib_container)
		vbox.addStretch(1)
		self.widget.setLayout(vbox)

		main_menu = self.menuBar()
		file_menu = main_menu.addMenu('File')
		help_menu = main_menu.addMenu('Help')
		button_data = (
			(file_menu, "Open", self.file_widget.ask_open, "CTRL+O", "dir"),
			(file_menu, "Save", self.save_fgm, "CTRL+S", "save"),
			(file_menu, "Save As", self.save_as_fgm, "CTRL+SHIFT+S", "save"),
			(file_menu, "Exit", self.close, "", "exit"),
			(help_menu, "Report Bug", self.report_bug, "", "report"),
			(help_menu, "Documentation", self.online_support, "", "manual")
		)
		self.add_to_menu(button_data)