Exemple #1
0
    def setUpClass(cls):
        super(TestCopyPaste, cls).setUpClass()

        # operation_definition_cache.refresh()

        app = QApplication.instance()
        if app is None:
            app = QApplication(sys.argv)
            # Fix issues with combo box that gets cleared too fast
            app.setEffectEnabled(Qt.UI_AnimateCombo, False)
            cls.app = app

        cls.mw = QMainWindow()
        cls.mw.setMinimumSize(1024, 768)
        cls.edit_order_widget = EditOrderPartsWidget(
            None, None, True, cls.remote_documents_service)
        cls.edit_order_widget._show_blank_order(cls.customer.customer_id)

        # -TRACE-
        cls.order_overview_widget = OrderOverviewWidget(None, None, None, True)
        cls.stack = QTabWidget(None)
        cls.stack.addTab(cls.edit_order_widget, "Edit order")
        # -TRACE-
        cls.stack.addTab(cls.order_overview_widget, "Orders overview")

        cls.mw.setCentralWidget(cls.stack)
        cls.mw.show()
        QTest.qWaitForWindowShown(cls.mw)
        cls.app.processEvents()
    def setUpClass(cls):
        super(TestEditOrderPartsDocManager, cls).setUpClass()

        app = QApplication.instance()
        if app is None:
            app = QApplication(sys.argv)
        # Fix issues with combo box that gets cleared too fast
        app.setEffectEnabled(Qt.UI_AnimateCombo, False)
        cls.app = app

        operation_definition_cache.refresh()
        cls.mw = QMainWindow()
        cls.mw.setMinimumSize(1024, 768)
        cls.widget = EditOrderPartsWidget(None, None, False,
                                          cls.remote_documents_service)
        cls.order_overview_widget = OrderOverviewWidget(None, None, None, True)

        cls.temp_dir = tempfile.TemporaryDirectory("horse_doc_mgr")
        configuration.set("DocumentsDatabase", "documents_root",
                          cls.temp_dir.name)

        cls.mw.setCentralWidget(cls.widget)
        cls.mw.show()
        QTest.qWaitForWindowShown(cls.mw)
        cls.app.processEvents()
Exemple #3
0
    def setUpClass(cls):
        super(TestEditOrderPartsComputations, cls).setUpClass()
        app = QApplication.instance()
        if app is None:
            app = QApplication(sys.argv)
        app.setEffectEnabled(Qt.UI_AnimateCombo, False)
        cls.app = app

        cls.mw = QMainWindow()
        cls.mw.setMinimumSize(1024, 768)
        cls.widget = EditOrderPartsWidget(None, None, True,
                                          cls.remote_documents_service)
        cls.mw.setCentralWidget(cls.widget)
        cls.mw.show()
        QTest.qWaitForWindowShown(cls.mw)
        cls.app.processEvents()
Exemple #4
0
    def setUpClass(cls):
        super(TestEditOrderParts, cls).setUpClass()
        app = QApplication.instance()
        if app is None:
            app = QApplication(sys.argv)
        # Fix issues with combo box that gets cleared too fast
        app.setEffectEnabled(Qt.UI_AnimateCombo, False)
        cls.app = app

        operation_definition_cache.refresh()
        cls.mw = QMainWindow()
        cls.mw.setMinimumSize(1024, 768)
        cls.widget = EditOrderPartsWidget(None, None, True,
                                          cls.remote_documents_service)
        cls.order_overview_widget = OrderOverviewWidget(None, None, None, True)
        cls.mw.setCentralWidget(cls.widget)
        cls.mw.show()
        QTest.qWaitForWindowShown(cls.mw)

        cls.app.processEvents()
Exemple #5
0
    def setUpClass(cls):
        super(TestOrderOverview, cls).setUpClass()
        app = QApplication.instance()
        if app is None:
            app = QApplication(sys.argv)
        # Fix issues with combo box that gets cleared too fast
        app.setEffectEnabled(Qt.UI_AnimateCombo, False)
        cls.app = app

        cls.mw = QMainWindow()
        cls.mw.setMinimumSize(1024, 768)
        cls.order_overview_widget = OrderOverviewWidget(None, None, None, True)
        cls.mw.setCentralWidget(cls.order_overview_widget)
        cls.mw.show()

        # This is a big hack to select the "in production" order parts filter
        # on the overview. Without that, the "completed" order parts filter
        # is applied and no order parts gets shown :-(

        cls.order_overview_widget.persistent_filter.get_filters_combo(
        ).setCurrentIndex(1)
        QTest.qWaitForWindowShown(cls.mw)
        cls.app.processEvents()
Exemple #6
0

mainlog.debug("Python {}".format(str(sys.version).replace('\n',' ')))
# mainlog.debug("SQLAlchemy {}".format(sqlalchemy.__version__))
# mainlog.debug("PySide {}".format(PySide.__version__))
# mainlog.debug("QtCore {}".format(PySide.QtCore.__version__))
# mainlog.debug("Console encoding : {}".format(sys.getdefaultencoding()))
mainlog.debug("Locale : {}".format(locale.getdefaultlocale()))
mainlog.debug("Config dir : {}".format(get_data_dir()))
mainlog.debug("Resource dir : {}".format(resource_dir))

app = QApplication(sys.argv)
app.setWindowIcon(QIcon(os.path.join(resource_dir,'win_icon.png')))

# Fix issues with combo box that gets cleared too fast
app.setEffectEnabled(Qt.UI_AnimateCombo, False)

if configuration.font_select == False:
    qss = open( os.path.join(resource_dir,"standard.qss"),"r")
else:
    qss = open( os.path.join(resource_dir,"bigfont.qss"),"r")

app.setStyleSheet(qss.read())
qss.close()

# from PySide.QtGui import QPainter, QBrush,QColor,QPen, QStyleOption, QStyle
# from PySide.QtCore import QTimer

# class SplashScreen(QSplashScreen):
#     def __init__(self,pixmap):
#         super(SplashScreen, self).__init__(pixmap)