Exemplo n.º 1
0
    def move_copy_dialog(self, copy):
        """dialog for copy or move a file

        Args:
            copy (boolean): True to copy, False to move
        """

        if copy:
            libelle = "Move to"
        else:
            libelle = "Copy to"

        if not self.index == -1:
            directory = QFileDialog.getExistingDirectory(
                self, libelle, self.images[self.index],
                QFileDialog.ShowDirsOnly | QFileDialog.DontUseNativeDialog)
            if directory:
                file = os.path.join(directory,
                                    os.path.basename(self.images[self.index]))
                if not os.path.isfile(file):
                    self.move_copy_file(self.images[self.index], file, copy)
                else:
                    dialog = ImageDialog(self.images[self.index], file)
                    result = dialog.exec_()
                    if result == QDialog.Accepted:
                        self.move_copy_file(self.images[self.index], file,
                                            copy)
                    elif result == 3:
                        # renamme
                        self.move_copy_file(
                            self.images[self.index],
                            os.path.join(
                                directory,
                                os.path.basename(
                                    dialog.edit_file_name.text())), copy)
Exemplo n.º 2
0
 def show():
     dlg = ImageDialog(obj.data, parent=kw.get("parent"))
     dlg.show()
Exemplo n.º 3
0
 def show():
     dlg = ImageDialog(obj.data)
     dlg.raise_()
     dlg.exec_()
Exemplo n.º 4
0
 def show():
     dlg = ImageDialog(obj.data, parent=kw.get("parent"))
     dlg.show()
Exemplo n.º 5
0
 def show():
     dlg = ImageDialog(obj.data)
     dlg.raise_()
     dlg.exec_()