def __init__(self, manager, app_preference_widget=None): super(KikoExporterDialog, self).__init__() self._manager = manager facade = self._manager.facade self._image_generation = facade.supports_image_generation() app_name = facade.get_app_name().capitalize() self.setWindowTitle(app_name + ' Kiko Exporter') self._layout = create_box_layout(ORIENTATION.VERTICAL) self.setLayout(self._layout) self._app_preference_widget = app_preference_widget if app_preference_widget: tab_widget = QtWidgets.QTabWidget(self) self._layout.addWidget(tab_widget) self._layout.setContentsMargins(0, 0, 0, 0) widget = QtWidgets.QWidget(self) self._layout = create_box_layout(ORIENTATION.VERTICAL) widget.setLayout(self._layout) tab_widget.addTab(widget, "Export") tab_widget.addTab(app_preference_widget, app_name + " Preferences") self.resize(500, 400) self._build_widgets() self._initialize_widgets() self._connect_signals()
def _build_mapping(self): widget = QtWidgets.QWidget() v_layout = create_box_layout(ORIENTATION.VERTICAL, margin=5, spacing=10) widget.setLayout(v_layout) self._tab_widget.addTab(widget, "Mapping") v_layout.addWidget(QtWidgets.QLabel('Channel and Item mapping takes ' 'precedence over name management.')) v_layout.addWidget(create_separator(ORIENTATION.HORIZONTAL)) self._mapping = DataTreeAndSearchWidget(parent=self, facade=self._manager.facade) v_layout.addWidget(self._mapping)
def _build_string(self): widget = QtWidgets.QWidget() v_layout = create_box_layout(ORIENTATION.VERTICAL, margin=5, spacing=10) widget.setLayout(v_layout) self._tab_widget.addTab(widget, "Names") h_layout1 = create_box_layout(ORIENTATION.HORIZONTAL, margin=0, spacing=0) h_layout1.addWidget(create_label("String Replacement: ", width=115)) self._str_repl_table = QtWidgets.QTableWidget(self) self._str_repl_table.setRowCount(1) self._str_repl_table.setColumnCount(2) self._str_repl_table.setHorizontalHeaderLabels(["From", "To"]) self._str_repl_table.setColumnWidth(0, 125) self._str_repl_table.horizontalHeader().setStretchLastSection(True) self._str_repl_table.horizontalHeader().setSectionsClickable(False) self._str_repl_table.verticalHeader().setVisible(False) self._str_repl_table.setAlternatingRowColors(True) self._str_repl_table.setSelectionMode( QtWidgets.QAbstractItemView.SingleSelection) self._str_repl_table.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) h_layout1.addWidget(self._str_repl_table) v_layout.addLayout(h_layout1) self._str_repl_menu = QtWidgets.QMenu(self) self._str_repl_add_row = self._str_repl_menu.addAction("Add Row") self._str_repl_del_row = self._str_repl_menu.addAction("Delete Row") self._str_repl_del_all = self._str_repl_menu.addAction("Delete All") h_layout2 = create_box_layout(ORIENTATION.HORIZONTAL, margin=0, spacing=0) h_layout2.addWidget(create_label("Prefix To Add: ", width=115)) self._prefix = QtWidgets.QLineEdit() h_layout2.addWidget(self._prefix) v_layout.addLayout(h_layout2) h_layout3 = create_box_layout(ORIENTATION.HORIZONTAL, margin=0, spacing=0) h_layout3.addWidget(create_label("Suffix To Add: ", width=115)) self._suffix = QtWidgets.QLineEdit() h_layout3.addWidget(self._suffix) v_layout.addLayout(h_layout3)
def _build_tab_import(self): widget = QtWidgets.QWidget() v_layout = create_box_layout(ORIENTATION.VERTICAL, margin=5, spacing=10) widget.setLayout(v_layout) self._tab_widget.addTab(widget, "Import") v_layout.addSpacing(10) self._apply, self._insert, self._replace = create_radio_buttons( None, ['Apply', 'Insert', 'Replace'], self, v_layout, width=60, add_stretch=False) v_layout.addWidget(create_separator(ORIENTATION.HORIZONTAL)) h_layout1 = create_box_layout(ORIENTATION.HORIZONTAL, margin=0, spacing=0) h_layout1.addSpacing(18) h_layout1.addWidget(create_label("Frame value: ", width=116)) self._frame_value = QtWidgets.QSpinBox(self) h_layout1.addWidget(self._frame_value) v_layout.addLayout(h_layout1) h_layout2 = create_box_layout(ORIENTATION.HORIZONTAL, margin=0, spacing=5) self._enable_frame_range = QtWidgets.QCheckBox("") self._enable_frame_range.setFixedWidth(13) h_layout2.addWidget(self._enable_frame_range) self._frame_range = FrameRange(self, width=111) h_layout2.addWidget(self._frame_range) v_layout.addLayout(h_layout2) self._hierarchy = QtWidgets.QCheckBox("Hierarchy") self._hierarchy.setVisible(self._manager.facade.support_hierarchy()) v_layout.addWidget(self._hierarchy) v_layout.addWidget(create_separator(ORIENTATION.HORIZONTAL)) h_layout3 = create_box_layout(ORIENTATION.HORIZONTAL, margin=0, spacing=5) self._enable_channel_op_priority = QtWidgets.QCheckBox("Channel Op " "Priority") self._enable_channel_op_priority.setFixedWidth(130) h_layout3.addWidget(self._enable_channel_op_priority) self._channel_op_priority = QtWidgets.QListWidget(self) self._channel_op_priority.setDragDropMode( QtWidgets.QAbstractItemView.InternalMove) h_layout3.addWidget(self._channel_op_priority) v_layout.addLayout(h_layout3) h_layout4 = create_box_layout(ORIENTATION.HORIZONTAL, margin=0, spacing=5) self._enable_item_op_priority = QtWidgets.QCheckBox("Item Op Priority") self._enable_item_op_priority.setFixedWidth(130) h_layout4.addWidget(self._enable_item_op_priority) self._item_op_priority = QtWidgets.QListWidget(self) self._item_op_priority.setDragDropMode( QtWidgets.QAbstractItemView.InternalMove) h_layout4.addWidget(self._item_op_priority) v_layout.addLayout(h_layout4) self._scale_fps = QtWidgets.QCheckBox("Scale FPS") v_layout.addWidget(self._scale_fps) self._ignore_item_chunks = QtWidgets.QCheckBox("Ignore Item Chunks") v_layout.addWidget(self._ignore_item_chunks) v_layout.addStretch(1)