# -*- coding: utf-8 -*- import os from PySide import QtGui, QtCore from kousen.ui.uiloader import UiLoader __form_class__, __base_class__ = UiLoader.loadUiType(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'messagebox.ui')) class MessageBox(__form_class__, __base_class__): def __init__(self, parent, message, details=None, title="Kousen", pixmap=None, buttons=[]): """ Base Constructor of the MessageBox. @param parent The MessageBox's parent window @param message The MessageBox's main message @param details The raw text to display in the additional details message. A value of None will remove the section. @param title The MessageBox's window title @param pixmap The MessageBox's icon @param buttons The MessageBox's list of available buttons """ super(MessageBox, self).__init__(parent, QtCore.Qt.MSWindowsFixedSizeDialogHint | QtCore.Qt.WindowTitleHint) self.setupUi(self) self.setVisible(False) self.setWindowTitle(title) self._setIcon(pixmap) self._setButtons(buttons) self._setDetails(details) self._setMessage(message) self._setMinSize()
# -*- coding: utf-8 -*- import os from PySide import QtGui, QtCore from kousen.ui.uiloader import UiLoader from kousen.ui.views import TreeView __form_class__, __base_class__ = UiLoader.loadUiType(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'filteredview.ui')) class FilteredView(__base_class__, __form_class__): """ The FilteredView class provides associates a filter widget with a view widget. The Qt method of filtering uses proxy models inserted between the view and the source model view -> proxy n -> ... -> proxy 0 -> source While the model contains the original data, each proxy alters the index mapping and presents this mapping to the view. Qt manages this quite well, this relationship needs to be accounted for when querying the data or setting selection. """ viewUpdating = QtCore.Signal() viewUpdated = QtCore.Signal() def __init__(self, view = None, parent=None): """ Constructor @param view The initial instance the QAbstractItemView view widget @param parent The parent of this widget. """ super(FilteredView, self).__init__(parent) self.setupUi(self) self._stack = [] self.actionReload.triggered.connect(self._reload)
# -*- coding: utf-8 -*- import os from PySide import QtGui, QtCore from kousen.core.proxymodel import TreeColumnFilterProxyModel from kousen.scenegraph import SceneGraphType, SceneGraphTypeTreeModel from kousen.ui.uiloader import UiLoader from kousen.scenegraph import SceneGraphType, SceneGraphTypeTreeModel from kousen.gl.glcamera import * from kousen.gl.glhud import * from kousen.gl.glprimitive import * from kousen.gl.glquadric import * from kousen.gl.gltransform import * __form_class__, __base_class__ = UiLoader.loadUiType( os.path.join(os.path.dirname(os.path.abspath(__file__)), 'itemdialog.ui')) class ItemDialog(__form_class__, __base_class__): def __init__(self, parent): """ Base Constructor of the ItemDialog. @param parent The ItemDialog's parent window """ super(ItemDialog, self).__init__( parent, QtCore.Qt.MSWindowsFixedSizeDialogHint | QtCore.Qt.WindowTitleHint) self.setupUi(self) def setupUi(self, widget): super(ItemDialog, self).setupUi(widget)
# -*- coding: utf-8 -*- import os from PySide import QtGui, QtCore from kousen.core.proxymodel import TreeColumnFilterProxyModel from kousen.scenegraph import SceneGraphType, SceneGraphTypeTreeModel from kousen.ui.uiloader import UiLoader from kousen.scenegraph import SceneGraphType, SceneGraphTypeTreeModel from kousen.gl.glcamera import * from kousen.gl.glhud import * from kousen.gl.glprimitive import * from kousen.gl.glquadric import * from kousen.gl.gltransform import * __form_class__, __base_class__ = UiLoader.loadUiType(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'itemdialog.ui')) class ItemDialog(__form_class__, __base_class__): def __init__(self, parent): """ Base Constructor of the ItemDialog. @param parent The ItemDialog's parent window """ super(ItemDialog, self).__init__(parent, QtCore.Qt.MSWindowsFixedSizeDialogHint | QtCore.Qt.WindowTitleHint) self.setupUi(self) def setupUi(self, widget): super(ItemDialog, self).setupUi(widget) def show_(self): """ Method to display the ItemDialog using the correct internal PySide details
# -*- coding: utf-8 -*- import os from PySide import QtGui, QtCore from kousen.core.propertymodel import PropertyItem, PropertyModel from kousen.core.proxymodel import TreeColumnFilterProxyModel from kousen.scenegraph import AbstractSceneGraphModel, VirtualScreen, CameraNode, CameraHUDNode, CubeNode, GridNode from kousen.ui.itemdialog import ItemCreationDialog from kousen.ui.uiloader import UiLoader from kousen.ui.editorfactory import ItemEditorFactoryDelegate from kousen.core.undomodel import UndoMacro __form_class__, __base_class__ = UiLoader.loadUiType(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'mainwindow.ui')) class MainWindow(__form_class__, __base_class__): """ The UI Main Window class handling all of the core UI logic. """ __ui_file__ = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'mainwindow.ui') def __init__(self, parent=None): """ Constructor. """ super(MainWindow, self).__init__(parent) self._sceneGraph = None self.setupUi(self) def setupUi(self, widget): """ Initializes the local state of the UI class.
# -*- coding: utf-8 -*- import os from PySide import QtGui, QtCore from kousen.core.propertymodel import PropertyItem, PropertyModel from kousen.core.proxymodel import TreeColumnFilterProxyModel from kousen.scenegraph import AbstractSceneGraphModel, VirtualScreen, CameraNode, CameraHUDNode, CubeNode, GridNode from kousen.ui.itemdialog import ItemCreationDialog from kousen.ui.uiloader import UiLoader from kousen.ui.editorfactory import ItemEditorFactoryDelegate from kousen.core.undomodel import UndoMacro __form_class__, __base_class__ = UiLoader.loadUiType( os.path.join(os.path.dirname(os.path.abspath(__file__)), 'mainwindow.ui')) class MainWindow(__form_class__, __base_class__): """ The UI Main Window class handling all of the core UI logic. """ __ui_file__ = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'mainwindow.ui') def __init__(self, parent=None): """ Constructor. """ super(MainWindow, self).__init__(parent) self._sceneGraph = None self.setupUi(self) def setupUi(self, widget):