Beispiel #1
0
 def __init__(self, field, value, parent=None):
     super(ReferenceWidget, self).__init__(parent)
     self.man = Collection.get_instance()
     self.field = field
     self.setupUi(self)
     self.addValue.hide()
     self.values = []
     self.reload(value)
Beispiel #2
0
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.plugin_manager = PluginManager.get_instance()
        MainWindow.instance = self
        self.collection = Collection.get_instance()

        self.setupUi(self)
        self.showMaximized()
        self.setUnifiedTitleAndToolBarOnMac(True)
        #  TODO clean toolbar code?
        # self.createToolbar()
        self.views = None
        self.view = "dashboard"
        # self.views = self.init_views()
        # self.display_view('dashboard')
        self.statusbar.hide()
        # Menu actions
        self.help_menu = self.menuBar().addMenu("&Help")
        self.about_action = QtGui.QAction(
            "&About", self, statusTip="Show the application's About box", triggered=self.about
        )
        self.help_menu.addAction(self.about_action)
        # Connect menu actions
        self.actionView_Dashboard.triggered.connect(lambda: self.display_view("dashboard"))
        self.connect(
            self.actionQuick_search, QtCore.SIGNAL(_fromUtf8("triggered()")), lambda: self.display_view("quicksearch")
        )
        self.connect(self.actionFullscreen, QtCore.SIGNAL(_fromUtf8("triggered()")), self.switch_fullscreen)
        self.connect(
            self.actionDiscover, QtCore.SIGNAL(_fromUtf8("triggered()")), lambda: self.display_view("discover")
        )
        self.connect(
            self.actionPreferences, QtCore.SIGNAL(_fromUtf8("triggered()")), lambda: self.display_view("preferences")
        )
        self.connect(
            self.actionProperties, QtCore.SIGNAL(_fromUtf8("triggered()")), lambda: self.display_view("properties")
        )
        self.connect(
            self.actionAdvanced_Search, QtCore.SIGNAL(_fromUtf8("triggered()")), lambda: self.display_view("filters")
        )
        self.connect(self.actionImport, QtCore.SIGNAL(_fromUtf8("triggered()")), lambda: self.display_view("import"))
        self.connect(self.actionExport, QtCore.SIGNAL(_fromUtf8("triggered()")), lambda: self.display_view("export"))
Beispiel #3
0
 def test_is_singleton(self):
     """Checks that obtain the instance again returns the existing one"""
     self.assertEquals(self.man, Collection.get_instance())