Example #1
0
    def new_package(self):
        """ Create a new user package """

        dialog = NewPackage(self.pkgmanager.keys(), parent=self)
        ret = dialog.exec_()

        if (ret > 0):
            (name, metainfo, path) = dialog.get_data()

            self.pkgmanager.create_user_package(name, metainfo, path)
            self.reinit_treeview()
Example #2
0
    def new_package(self):
        """ Create a new user package """

        dialog = NewPackage(self.pkgmanager.keys(), parent=self)
        ret = dialog.exec_()

        if(ret > 0):
            (name, metainfo, path) = dialog.get_data()

            self.pkgmanager.create_user_package(name, metainfo, path)
            self.reinit_treeview()
Example #3
0
    def duplicate_package(self):
        """ Duplicate a package """

        pkg = self.get_current_pkg()
        pman = self.model().pman # pkgmanager

        if(not pkg.is_directory()):
            qt.QtGui.QMessageBox.warning(self, "Error",
                                         "Cannot duplicate old style package\n")
            return

        dialog = NewPackage(list(pman.keys()), parent=self, metainfo=pkg.metainfo)
        ret = dialog.exec_()

        if(ret > 0):
            (name, metainfo, path) = dialog.get_data()

            newpkg = pman.create_user_package(name, metainfo, path)
            newpkg.clone_from_package(pkg)
            pman.add_package(newpkg)
            self.reinit_treeview()
Example #4
0
    def duplicate_package(self):
        """ Duplicate a package """

        pkg = self.get_current_pkg()
        pman = self.model().pman # pkgmanager

        if(not pkg.is_directory()):
            QtGui.QMessageBox.warning(self, "Error",
                                             "Cannot duplicate old style package\n")
            return


        dialog = NewPackage(pman.keys(), parent = self, metainfo=pkg.metainfo)
        ret = dialog.exec_()

        if(ret>0):
            (name, metainfo, path) = dialog.get_data()

            newpkg = pman.create_user_package(name, metainfo, path)
            newpkg.clone_from_package(pkg)
            pman.add_package(newpkg)