コード例 #1
0
    def __init__(self):
        QMainWindow.__init__(self)
        self.configuration = Configuration.Configuration()
        menubar = self.menuBar()
        file = menubar.addMenu('&File')
        save = QAction('&Save Template', self)
        load = QAction('&Load Template', self)
        rdir = QAction('&Report Directory', self)
        quit = QAction('&Quit', self)
        self.about_mdqc_menu = QAction('&About MDQC', self)
        self.about_mdqc_menu.setShortcut('CTRL+,')

        tool = menubar.addMenu('&Tools')
        self.exif = QAction('&ExifTool', self)
        self.mnfo = QAction('&MediaInfo', self)
        self.tgroup = QActionGroup(self)
        self.exif.setCheckable(True)
        self.exif.setChecked(True)
        self.mnfo.setCheckable(True)
        self.exif.setActionGroup(self.tgroup)
        self.mnfo.setActionGroup(self.tgroup)
        self.tgroup.triggered.connect(self.onToolChange)

        file.addAction(self.about_mdqc_menu)
        file.addAction(save)
        file.addAction(load)
        file.addAction(rdir)
        file.addAction(quit)
        tool.addAction(self.exif)
        tool.addAction(self.mnfo)
        tool.triggered.connect(self.clearer)
        self.about_mdqc_menu.triggered.connect(self.aboutMDQC)
        save.triggered.connect(self.saveTemplate)
        load.triggered.connect(self.loadTemplate)
        rdir.triggered.connect(self.reportDir)
        quit.triggered.connect(qApp.quit)

        self.fbox = QLineEdit(self)
        self.dbox = QLineEdit(self)
        self.rbut = QPushButton("Metadata Rules")
        self.dbut = QPushButton("Scan Rules")
        self.scan = QPushButton("Begin Test")
        self.rd = QPushButton("...")
        self.dd = QPushButton("...")
        self.rd.setFixedSize(QSize(30, 20))
        self.dd.setFixedSize(QSize(30, 20))
        self.widget = QWidget(self)
        self.setWindowTitle("Metadata Quality Control")
        self.layout = QGridLayout(self.widget)
        self.layout.setContentsMargins(10, 10, 10, 10)

        # visible incase of mediainfo
        self.whichMediaFile = QLabel("File Type:")
        self.layout.addWidget(self.whichMediaFile, 0, 0)
        self.mediaFileType = QComboBox(self)
        self.mediaFileType.addItem("Original File")
        self.mediaFileType.addItem("MediaInfo File")
        self.layout.addWidget(self.mediaFileType, 0, 1)
        self.toggleMediaInfo(0)


        self.layout.addWidget(QLabel("Reference File:"), 1, 0)
        self.layout.addWidget(self.fbox, 1, 1)
        self.layout.addWidget(self.rd, 1, 2)
        self.layout.addWidget(self.rbut, 1, 3)

        self.layout.addWidget(QLabel("Directory to Scan:"), 2, 0)
        self.layout.addWidget(self.dbox, 2, 1)
        self.layout.addWidget(self.dd, 2, 2)
        self.layout.addWidget(self.dbut, 2, 3)

        #Start GUI for base file
        self.csvSelectInput = QLineEdit(self)
        self.layout.addWidget(QLabel("Base filenames:"), 3, 0);
        self.layout.addWidget(self.csvSelectInput, 3, 1)
        self.csvFileSelector = QPushButton("...")
        self.csvFileSelector.setFixedSize(QSize(30, 20))
        self.layout.addWidget(self.csvFileSelector, 3, 2)
        self.layout.addWidget(QLabel("Load CSV file"), 3, 3);
        self.csvFileSelector.clicked.connect(self.setCsvFile)
        #End GUI for base filenames

        self.layout.addWidget(self.scan, 4, 2, 1, 2)



        self.rbut.clicked.connect(self.validate)
        self.dbut.clicked.connect(self.dirrules)
        self.rd.clicked.connect(self.setr)
        self.dd.clicked.connect(self.setd)
        self.scan.clicked.connect(self.scanner)

        self.setWindowIcon(QIcon(self.configuration.getLogoSignSmall()))

        self.setCentralWidget(self.widget)

        self.about_mdqc_gui = AboutMDQCGUI.AboutMDQCGUI(self)
        self.setWindowTitle(self.configuration.getApplicationName() +' '+ self.configuration.getApplicationVersion())
コード例 #2
0
ファイル: MDQC.py プロジェクト: CronWorks/mdqc
    def __init__(self):
        QMainWindow.__init__(self)
        self.configuration = Configuration.Configuration()
        menubar = self.menuBar()
        file = menubar.addMenu('&File')
        save = QAction('&Save Template', self)
        load = QAction('&Load Template', self)
        rdir = QAction('&Report Directory', self)
        quit = QAction('&Quit', self)
        self.about_mdqc_menu = QAction('&About MDQC', self)
        self.about_mdqc_menu.setShortcut('CTRL+,')

        tool = menubar.addMenu('&Tools')
        self.exif = QAction('&ExifTool', self)
        self.mnfo = QAction('&MediaInfo', self)
        tgroup = QActionGroup(self)
        self.exif.setCheckable(True)
        self.exif.setChecked(True)
        self.mnfo.setCheckable(True)
        self.exif.setActionGroup(tgroup)
        self.mnfo.setActionGroup(tgroup)

        file.addAction(self.about_mdqc_menu)
        file.addAction(save)
        file.addAction(load)
        file.addAction(rdir)
        file.addAction(quit)
        tool.addAction(self.exif)
        tool.addAction(self.mnfo)
        tool.triggered.connect(self.clearer)
        self.about_mdqc_menu.triggered.connect(self.aboutMDQC)
        save.triggered.connect(self.saveTemplate)
        load.triggered.connect(self.loadTemplate)
        rdir.triggered.connect(self.reportDir)
        quit.triggered.connect(qApp.quit)

        self.fbox = QLineEdit(self)
        self.dbox = QLineEdit(self)
        self.rbut = QPushButton("Metadata Rules")
        self.dbut = QPushButton("Scan Rules")
        self.scan = QPushButton("Begin Test")
        self.rd = QPushButton("...")
        self.dd = QPushButton("...")
        self.rd.setFixedSize(QSize(30, 20))
        self.dd.setFixedSize(QSize(30, 20))
        self.widget = QWidget(self)
        self.setWindowTitle("Metadata Quality Control")
        self.layout = QGridLayout(self.widget)
        self.layout.setContentsMargins(10, 10, 10, 10)

        self.layout.addWidget(QLabel("Reference File:"), 0, 0)
        self.layout.addWidget(self.fbox, 0, 1)
        self.layout.addWidget(self.rd, 0, 2)
        self.layout.addWidget(self.rbut, 0, 3)

        self.layout.addWidget(QLabel("Directory to Scan:"), 1, 0)
        self.layout.addWidget(self.dbox, 1, 1)
        self.layout.addWidget(self.dd, 1, 2)
        self.layout.addWidget(self.dbut, 1, 3)

        self.layout.addWidget(self.scan, 2, 2, 1, 2)

        self.rbut.clicked.connect(self.validate)
        self.dbut.clicked.connect(self.dirrules)
        self.rd.clicked.connect(self.setr)
        self.dd.clicked.connect(self.setd)
        self.scan.clicked.connect(self.scanner)

        print(self.configuration.getLogoSignSmall())
        self.setWindowIcon(QIcon(self.configuration.getLogoSignSmall()))

        self.setCentralWidget(self.widget)

        self.about_mdqc_gui = AboutMDQCGUI.AboutMDQCGUI(self)
        self.setWindowTitle(self.configuration.getApplicationName() + ' ' +
                            self.configuration.getApplicationVersion())
コード例 #3
0
 def aboutMDQC(self):
     self.about_mdqc_gui.Cancel()
     self.about_mdqc_gui = AboutMDQCGUI.AboutMDQCGUI(self)
     self.about_mdqc_gui.LaunchDialog()
コード例 #4
0
ファイル: MDQC.py プロジェクト: priya-gitTest/mdqc
    def __init__(self):
        QMainWindow.__init__(self)
        self.configuration = Configuration.Configuration()
        menubar = self.menuBar()

        #check if output dir available
        testLogpath = reportdir + str(sep) + "mdqc.log"
        try:
            open(path.abspath(testLogpath), 'w')

            print "Dirs created at passed -> " + testLogpath
        except Exception as e:
            print(e)
            print "Dirs created at failed -> " + testLogpath
            global isReportDir
            isReportDir = "reports" + str(sep)
            global reportdir
            reportdir = path.expanduser('~') + str(sep) + "Desktop" + str(
                sep) + "MDQC-0.4" + str(sep)

            if not os.path.exists(reportdir):
                os.makedirs(reportdir)
            if not os.path.exists(reportdir + "reports"):
                os.makedirs(reportdir + "reports")

            print "Dirs created at -> " + reportdir

        file = menubar.addMenu('&File')
        save = QAction('&Save Template', self)
        load = QAction('&Load Template', self)
        rdir = QAction('&Report Directory', self)
        quit = QAction('&Quit', self)
        tool = menubar.addMenu('&Tools')
        self.exif = QAction('&ExifTool', self)
        self.mnfo = QAction('&MediaInfo', self)
        self.about_mdqc_menu = QAction('&About MDQC', self)
        self.about_mdqc_menu.setShortcut('CTRL+,')

        self.tgroup = QActionGroup(self)
        self.exif.setActionGroup(self.tgroup)
        self.mnfo.setActionGroup(self.tgroup)
        self.tgroup.triggered.connect(self.onToolChange)
        self.exif.setCheckable(True)
        self.exif.setChecked(True)
        self.mnfo.setCheckable(True)
        file.addAction(self.about_mdqc_menu)
        file.addAction(save)
        file.addAction(load)
        file.addAction(rdir)
        file.addAction(quit)
        tool.addAction(self.exif)
        tool.addAction(self.mnfo)

        save.triggered.connect(self.saveTemplate)
        load.triggered.connect(self.loadTemplate)
        rdir.triggered.connect(self.reportDir)
        self.about_mdqc_menu.triggered.connect(self.aboutMDQC)

        quit.triggered.connect(qApp.quit)

        self.fbox = QLineEdit(self)
        self.dbox = QLineEdit(self)
        self.rbut = QPushButton("Metadata Rules")
        self.dbut = QPushButton("Scan Rules")
        self.scan = QPushButton("Begin Test")
        self.rd = QPushButton("...")
        self.dd = QPushButton("...")
        self.rd.setFixedSize(QSize(30, 20))
        self.dd.setFixedSize(QSize(30, 20))
        self.widget = QWidget(self)
        # self.setWindowTitle("Metadata Quality Control")
        self.layout = QGridLayout(self.widget)
        self.layout.setContentsMargins(10, 10, 10, 10)

        # visible incase of mediainfo
        self.whichMediaFile = QLabel("File Type:")
        self.layout.addWidget(self.whichMediaFile, 0, 0)
        self.mediaFileType = QComboBox(self)
        self.mediaFileType.addItem("Original File")
        self.mediaFileType.addItem("MediaInfo File")
        self.layout.addWidget(self.mediaFileType, 0, 1)
        self.toggleMediaInfo(0)

        self.layout.addWidget(QLabel("Reference File:"), 1, 0)
        self.layout.addWidget(self.fbox, 1, 1)
        self.layout.addWidget(self.rd, 1, 2)
        self.layout.addWidget(self.rbut, 1, 3)

        self.layout.addWidget(QLabel("Directory to Scan:"), 2, 0)
        self.layout.addWidget(self.dbox, 2, 1)
        self.layout.addWidget(self.dd, 2, 2)
        self.layout.addWidget(self.dbut, 2, 3)

        #Start GUI for base file
        self.csvSelectInput = QLineEdit(self)
        self.layout.addWidget(QLabel("Base filenames:"), 3, 0)
        self.layout.addWidget(self.csvSelectInput, 3, 1)
        self.csvFileSelector = QPushButton("...")
        self.csvFileSelector.setFixedSize(QSize(30, 20))
        self.layout.addWidget(self.csvFileSelector, 3, 2)
        self.layout.addWidget(QLabel("Load CSV file"), 3, 3)
        self.csvFileSelector.clicked.connect(self.setCsvFile)
        #End GUI for base filenames

        self.layout.addWidget(self.scan, 4, 2, 1, 2)

        self.rbut.clicked.connect(self.validate)
        self.dbut.clicked.connect(self.dirrules)
        self.rd.clicked.connect(self.setr)
        self.dd.clicked.connect(self.setd)
        self.scan.clicked.connect(self.scanner)

        self.setCentralWidget(self.widget)
        self.about_mdqc_gui = AboutMDQCGUI.AboutMDQCGUI(self)
        try:
            self.setWindowIcon(
                QIcon(
                    path.join(getcwd() + str(sep),
                              'assets' + str(sep) + 'avpreserve-2.png')))
        except:
            try:
                self.setWindowIcon(
                    QIcon(
                        path.join(sys._MEIPASS,
                                  'assets' + (str(sep)) + 'avpreserve-2.png')))
            except:
                pass
            pass

        self.setWindowTitle(self.configuration.getApplicationName() + ' ' +
                            self.configuration.getApplicationVersion())