def __init__(self, main_model, main_ctrl): """ Args: main_ctrl (auri.controllers.main_controller.MainController): main_model (auri.models.main_model.MainModel): """ self.model = main_model self.main_ctrl = main_ctrl super(MainView, self).__init__() self.main_layout = QtWidgets.QVBoxLayout() self.scrollable_layout = QtWidgets.QVBoxLayout() self.scrollable_layout.addStretch(1) self.category_combobox = QtWidgets.QComboBox() self.subcategory_combobox = QtWidgets.QComboBox() self.script_selector_dialog = ScriptSelectorView( self.model.scripts, self.model) self.script_selector = push_button("Scripts", self.open_script_selector) self.add_btn = push_button( "Add", partial(self.main_ctrl.add_selected_script, self)) self.main_ctrl.setup(self.category_combobox, self.subcategory_combobox, self.script_selector) self.setup_ui()
def __init__(self, window_title="Message", message="ENTER A MESSAGE"): super(MessageBoxView, self).__init__() self.setWindowTitle(window_title) self.setModal(1) self.setMinimumWidth(250) self.setMinimumHeight(150) self.main_layout = QtWidgets.QVBoxLayout() self.message = QtWidgets.QLabel(message) self.ok_btn = push_button("Ok", self.ok_pressed) self.setup_ui() if get_application() is "standalone" or get_application() is "houdini": self.setStyleSheet(get_houdini_style())
def __init__(self): super(AboutView, self).__init__() self.setWindowTitle("About Auri") self.setModal(1) self.setFixedSize(400, 300) self.main_layout = QtWidgets.QVBoxLayout() self.about_text = QtWidgets.QLabel() self.ok_btn = push_button("Ok", self.ok_pressed) # self.cancel_btn = push_button("Cancel", self.cancel_pressed) self.setup_ui() if get_application() is "standalone" or get_application() is "houdini": self.setStyleSheet(get_houdini_style())
def setup_properties_ui(self): def create_scroll_area(): scroll_area = QtWidgets.QScrollArea() scroll_area.setWidgetResizable(1) scroll_area.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) scrollable_widget = QtWidgets.QWidget() scrollable_widget.setLayout(self.scrollable_layout) scroll_area.setWidget(scrollable_widget) return scroll_area properties_layout = QtWidgets.QVBoxLayout() properties_grp = grpbox("Properties", properties_layout) properties_layout.addWidget(create_scroll_area()) self.main_layout.addWidget(properties_grp)
def __init__(self, scripts, main_model): """ Args: main_model (auri.models.main_model.MainModel): """ self.model = main_model self.scripts = scripts super(ScriptSelectorView, self).__init__() self.setWindowTitle("Script Selection") self.setModal(1) self.main_layout = QtWidgets.QVBoxLayout() self.script_list = QtWidgets.QListView() self.ok_btn = push_button("Ok", self.ok_pressed) self.cancel_btn = push_button("Cancel", self.cancel_pressed) self.setup_ui() if get_application() is "standalone" or get_application() is "houdini": self.setStyleSheet(get_houdini_style())
def __init__(self, script_view, project_model, main_model): """ Args: script_view (auri.views.script_module_view.ScriptModuleView): project_model (auri.models.project_model.ProjectModel): main_model (auri.models.main_model.MainModel): """ self.script_view = script_view self.project_model = project_model self.main_model = main_model super(EditScriptView, self).__init__() self.setWindowTitle("Edit Script") self.setModal(1) self.setMinimumWidth(250) self.setMinimumHeight(150) self.main_layout = QtWidgets.QVBoxLayout() self.new_name = QtWidgets.QLineEdit() self.ok_btn = push_button("Ok", self.ok_pressed) self.cancel_btn = push_button("Cancel", self.cancel_pressed) self.message_box = None self.setup_ui()
def grpbox(title, lyt=None): if lyt is None: lyt = QtWidgets.QVBoxLayout() g = QtWidgets.QGroupBox(title=title) g.setLayout(lyt) return g