Ejemplo n.º 1
0
    def __init__(self, obj, parent=None):
        PicardDialog.__init__(self, parent)
        self.obj = obj
        self.ui = Ui_InfoDialog()
        self.display_existing_artwork = False
        if isinstance(obj, File) and isinstance(obj.parent, Track) or \
                isinstance(obj, Track):
            # Display existing artwork only if selected object is track object
            # or linked to a track object
            self.display_existing_artwork = True

        self.ui.setupUi(self)
        self.ui.buttonBox.accepted.connect(self.accept)
        self.ui.buttonBox.rejected.connect(self.reject)

        # Add the ArtworkTable to the ui
        self.ui.artwork_table = ArtworkTable(self.display_existing_artwork)
        self.ui.artwork_table.setObjectName("artwork_table")
        self.ui.vboxlayout1.addWidget(self.ui.artwork_table)
        if self.display_existing_artwork:
            self.resize(665, 436)
        self.setTabOrder(self.ui.tabWidget, self.ui.artwork_table)
        self.setTabOrder(self.ui.artwork_table, self.ui.buttonBox)

        self.setWindowTitle(_("Info"))
        self.artwork_table = self.ui.artwork_table
        self._display_tabs()
Ejemplo n.º 2
0
 def __init__(self, obj, parent=None):
     PicardDialog.__init__(self, parent)
     self.obj = obj
     self.ui = Ui_InfoDialog()
     self.ui.setupUi(self)
     self.ui.buttonBox.accepted.connect(self.accept)
     self.ui.buttonBox.rejected.connect(self.reject)
     self.setWindowTitle(_("Info"))
     self._display_tabs()
Ejemplo n.º 3
0
 def __init__(self, file, parent=None):
     QtGui.QDialog.__init__(self, parent)
     self.file = file
     self.ui = Ui_InfoDialog()
     self.ui.setupUi(self)
     self.ui.buttonBox.accepted.connect(self.accept)
     self.ui.buttonBox.rejected.connect(self.reject)
     self.setWindowTitle(_("Info") + " - " + file.base_filename)
     self.load_info()
Ejemplo n.º 4
0
 def __init__(self, obj, parent=None):
     PicardDialog.__init__(self, parent)
     self.obj = obj
     self.ui = Ui_InfoDialog()
     self.display_existing_artwork = False
     if isinstance(obj, File) and isinstance(obj.parent, Track) or \
             isinstance(obj, Track):
         #Display existing artwork only if selected object is track object
         #or linked to a track object
         self.display_existing_artwork = True
     self.ui.setupUi(self, self.display_existing_artwork)
     self.ui.buttonBox.accepted.connect(self.accept)
     self.ui.buttonBox.rejected.connect(self.reject)
     self.setWindowTitle(_("Info"))
     self.artwork_table = self.ui.artwork_table
     self._display_tabs()
Ejemplo n.º 5
0
    def __init__(self, obj, parent=None):
        super().__init__(parent)
        self.obj = obj
        self.images = []
        self.existing_images = []
        self.ui = Ui_InfoDialog()
        self.display_existing_artwork = False

        if (isinstance(obj, File) and
                isinstance(obj.parent, Track) or
                isinstance(obj, Track) or
                (isinstance(obj, Album) and obj.get_num_total_files() > 0)):
            # Display existing artwork only if selected object is track object
            # or linked to a track object or it's an album with files
            if (getattr(obj, 'orig_metadata', None) is not None and
                    obj.orig_metadata.images and
                    obj.orig_metadata.images != obj.metadata.images):
                self.display_existing_artwork = True
                self.existing_images = obj.orig_metadata.images

        if obj.metadata.images:
            self.images = obj.metadata.images
        if not self.images and self.existing_images:
            self.images = self.existing_images
            self.existing_images = []
            self.display_existing_artwork = False
        self.ui.setupUi(self)
        self.ui.buttonBox.addButton(
            StandardButton(StandardButton.CLOSE), QtWidgets.QDialogButtonBox.AcceptRole)
        self.ui.buttonBox.accepted.connect(self.accept)

        # Add the ArtworkTable to the ui
        self.ui.artwork_table = ArtworkTable(self.display_existing_artwork)
        self.ui.artwork_table.setObjectName("artwork_table")
        self.ui.vboxlayout1.addWidget(self.ui.artwork_table)
        self.setTabOrder(self.ui.tabWidget, self.ui.artwork_table)
        self.setTabOrder(self.ui.artwork_table, self.ui.buttonBox)

        self.setWindowTitle(_("Info"))
        self.artwork_table = self.ui.artwork_table
        self._display_tabs()
        self.restore_geometry()