Esempio n. 1
0
class AssignCOGsDlg(QtGui.QDialog):
    def __init__(self, preferences, parent=None):
        QtGui.QWidget.__init__(self, parent)

        # initialize GUI
        self.ui = Ui_AssignCOGsDlg()
        self.ui.setupUi(self)

        self.centerWindow()

        self.preferences = preferences

        QtCore.QObject.connect(self.ui.btnLoadProfiles,
                               QtCore.SIGNAL("clicked()"), self.loadProfiles)
        QtCore.QObject.connect(self.ui.btnCreateProfile,
                               QtCore.SIGNAL("clicked()"), self.createProfile)
        QtCore.QObject.connect(self.ui.btnCancel, QtCore.SIGNAL("clicked()"),
                               self.accept)

        self.inputProfile = []

    def loadProfiles(self):
        self.inputProfile = QtGui.QFileDialog.getOpenFileName(
            self, 'Load profile', self.preferences['Last directory'],
            'IMG/M profiles (*.xls *.tsv);;All files (*.*)')
        if self.inputProfile != '':
            self.preferences['Last directory'] = self.inputProfile[
                0:self.inputProfile.lastIndexOf('/')]
            self.ui.txtInputProfile.setText(self.inputProfile)
            self.ui.btnCreateProfile.setEnabled(True)

    def createProfile(self):
        # get filename to save STAMP profile to
        stampFilename = QtGui.QFileDialog.getSaveFileName(
            self, 'Save STAMP profile...', self.preferences['Last directory'],
            'STAMP profile file(*.spf);;All files(*.*)')
        if stampFilename == '':
            return

        self.preferences['Last directory'] = stampFilename[0:stampFilename.
                                                           lastIndexOf('/')]

        cogIO = COG_IO()
        cogIO.appendCategories(str(self.inputProfile),
                               str(self.ui.cboMultiCogTreatment.currentText()),
                               str(stampFilename), self.preferences)

        self.accept()

    def centerWindow(self):
        screen = QtGui.QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width() - size.width()) / 2,
                  (screen.height() - size.height()) / 2)
Esempio n. 2
0
class AssignCOGsDlg(QtGui.QDialog):
    def __init__(self, preferences, parent=None):
        QtGui.QWidget.__init__(self, parent)

        # initialize GUI
        self.ui = Ui_AssignCOGsDlg()
        self.ui.setupUi(self)

        self.centerWindow()

        self.preferences = preferences

        QtCore.QObject.connect(self.ui.btnLoadProfiles, QtCore.SIGNAL("clicked()"), self.loadProfiles)
        QtCore.QObject.connect(self.ui.btnCreateProfile, QtCore.SIGNAL("clicked()"), self.createProfile)
        QtCore.QObject.connect(self.ui.btnCancel, QtCore.SIGNAL("clicked()"), self.accept)

        self.inputProfile = []

    def loadProfiles(self):
        self.inputProfile = QtGui.QFileDialog.getOpenFileName(
            self, "Load profile", self.preferences["Last directory"], "IMG/M profiles (*.xls *.tsv);;All files (*.*)"
        )
        if self.inputProfile != "":
            self.preferences["Last directory"] = self.inputProfile[0 : self.inputProfile.lastIndexOf("/")]
            self.ui.txtInputProfile.setText(self.inputProfile)
            self.ui.btnCreateProfile.setEnabled(True)

    def createProfile(self):
        # get filename to save STAMP profile to
        stampFilename = QtGui.QFileDialog.getSaveFileName(
            self,
            "Save STAMP profile...",
            self.preferences["Last directory"],
            "STAMP profile file(*.spf);;All files(*.*)",
        )
        if stampFilename == "":
            return

        self.preferences["Last directory"] = stampFilename[0 : stampFilename.lastIndexOf("/")]

        cogIO = COG_IO()
        cogIO.appendCategories(
            str(self.inputProfile),
            str(self.ui.cboMultiCogTreatment.currentText()),
            str(stampFilename),
            self.preferences,
        )

        self.accept()

    def centerWindow(self):
        screen = QtGui.QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2)
Esempio n. 3
0
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        # initialize GUI
        self.ui = Ui_AssignCOGsDlg()
        self.ui.setupUi(self)

        self.centerWindow()

        QtCore.QObject.connect(self.ui.btnLoadProfiles,
                               QtCore.SIGNAL("clicked()"), self.loadProfiles)
        QtCore.QObject.connect(self.ui.btnCreateProfile,
                               QtCore.SIGNAL("clicked()"), self.createProfile)
        QtCore.QObject.connect(self.ui.btnCancel, QtCore.SIGNAL("clicked()"),
                               self.accept)

        self.inputProfile = []
Esempio n. 4
0
	def __init__(self, preferences, parent=None):
		QtGui.QWidget.__init__(self, parent)
		
		# initialize GUI
		self.ui = Ui_AssignCOGsDlg()
		self.ui.setupUi(self)

		self.centerWindow()
		
		self.preferences = preferences
		
		QtCore.QObject.connect(self.ui.btnLoadProfiles, QtCore.SIGNAL("clicked()"), self.loadProfiles)
		QtCore.QObject.connect(self.ui.btnCreateProfile, QtCore.SIGNAL("clicked()"), self.createProfile)
		QtCore.QObject.connect(self.ui.btnCancel, QtCore.SIGNAL("clicked()"), self.accept)
		
		self.inputProfile = []