def _add_new_folder(self):
        path = self.model().filePath(self.currentIndex())
        result = QInputDialog.getText(self, self.tr("New Folder"),
            self.tr("Enter the Folder Name:"))
        folderName = result[0]

        if result[1] and folderName.strip() != '':
            folderName = os.path.join(path, folderName)
            file_manager.create_folder(folderName)
Exemplo n.º 2
0
    def _add_new_folder(self, path=''):
        #FIXME: We need nfilesystem support for this
        if not path:
            path = self.model().filePath(self.currentIndex())
        result = QInputDialog.getText(self, self.tr("New Folder"),
            self.tr("Enter the Folder Name:"))
        folderName = result[0]

        if result[1] and folderName.strip() != '':
            folderName = os.path.join(path, folderName)
            file_manager.create_folder(folderName)
Exemplo n.º 3
0
    def _add_new_folder(self, path=''):
        #FIXME: We need nfilesystem support for this
        if not path:
            path = self.model().filePath(self.currentIndex())
        result = QInputDialog.getText(self, translations.TR_ADD_NEW_FOLDER,
            translations.TR_ENTER_NEW_FOLDER_NAME + ": ")
        folderName = result[0]

        if result[1] and folderName.strip() != '':
            folderName = os.path.join(path, folderName)
            file_manager.create_folder(folderName)
Exemplo n.º 4
0
    def _add_new_folder(self, path=''):
        #FIXME: We need nfilesystem support for this
        if not path:
            path = self.model().filePath(self.currentIndex())
        result = QInputDialog.getText(self, self.tr("New Folder"),
                                      self.tr("Enter the Folder Name:"))
        folderName = result[0]

        if result[1] and folderName.strip() != '':
            folderName = os.path.join(path, folderName)
            file_manager.create_folder(folderName)
Exemplo n.º 5
0
    def _add_new_folder(self, path=''):
        #FIXME: We need nfilesystem support for this
        if not path:
            path = self.model().filePath(self.currentIndex())
        result = QInputDialog.getText(
            self, translations.TR_ADD_NEW_FOLDER,
            translations.TR_ENTER_NEW_FOLDER_NAME + ": ")
        folderName = result[0]

        if result[1] and folderName.strip() != '':
            folderName = os.path.join(path, folderName)
            file_manager.create_folder(folderName)
Exemplo n.º 6
0
    def _add_new_folder(self):
        item = self.currentItem()
        if item.parent() is None:
            pathForFolder = item.path
        else:
            pathForFolder = os.path.join(item.path, item.text(0))
        result = QInputDialog.getText(self, self.tr("New Folder"),
                                      self.tr("Enter the Folder Name:"))
        folderName = result[0]

        if result[1] and folderName.strip() != '':
            folderName = os.path.join(pathForFolder, folderName)
            file_manager.create_folder(folderName)
            name = file_manager.get_basename(folderName)
            subitem = ProjectItem(item, name, pathForFolder)
            subitem.setToolTip(0, name)
            subitem.setIcon(0, QIcon(":img/tree-folder"))
Exemplo n.º 7
0
    def _add_new_folder(self):
        item = self.currentItem()
        if item.parent() is None:
            pathForFolder = item.path
        else:
            pathForFolder = os.path.join(item.path, item.text(0))
        result = QInputDialog.getText(self, self.tr("New Folder"),
            self.tr("Enter the Folder Name:"))
        folderName = result[0]

        if result[1] and folderName.strip() != '':
            folderName = os.path.join(pathForFolder, folderName)
            file_manager.create_folder(folderName)
            name = file_manager.get_basename(folderName)
            subitem = ProjectItem(item, name, pathForFolder)
            subitem.setToolTip(0, name)
            subitem.setIcon(0, QIcon(":img/tree-folder"))
Exemplo n.º 8
0
 def _create(self, path):
     """Open the item received."""
     if self._create_file_operation:
         path = os.path.join(self._base_path, path)
         folder = os.path.split(path)[0]
         if not os.path.exists(folder):
             file_manager.create_folder(folder)
         ninjaide = IDE.getInstance()
         current_nfile = ninjaide.get_or_create_nfile(path)
         current_nfile.create()
         main_container = IDE.get_service('main_container')
         if main_container:
             main_container.open_file(path)
     else:
         path = os.path.join(self._base_path, path)
         if not os.path.exists(path):
             file_manager.create_folder(path)
     self.hide()
Exemplo n.º 9
0
    def _create(self, path):
        """Open the item received"""

        if self._create_file_operation:
            path = os.path.join(self._base_path, path)
            folder = os.path.split(path)[0]
            if not os.path.exists(folder):
                file_manager.create_folder(folder)
            ide = IDE.get_service("ide")
            current_nfile = ide.get_or_create_nfile(path)
            current_nfile.create()
            main_container = IDE.get_service("main_container")
            main_container.open_file(path)
        else:
            path = os.path.join(self._base_path, path)
            if not os.path.exists(path):
                file_manager.create_folder(path)
        self.close()
Exemplo n.º 10
0
 def _create(self, path):
     """Open the item received."""
     if self._create_file_operation:
         path = os.path.join(self._base_path, path)
         folder = os.path.split(path)[0]
         if not os.path.exists(folder):
             file_manager.create_folder(folder)
         ninjaide = IDE.get_service('ide')
         current_nfile = ninjaide.get_or_create_nfile(path)
         current_nfile.create()
         main_container = IDE.get_service('main_container')
         if main_container:
             main_container.open_file(path)
     else:
         path = os.path.join(self._base_path, path)
         if not os.path.exists(path):
             file_manager.create_folder(path)
     self.hide()
Exemplo n.º 11
0
    def _create(self, path):
        """Open the item received"""

        if self._create_file_operation:
            path = os.path.join(self._base_path, path)
            folder = os.path.split(path)[0]
            if not os.path.exists(folder):
                file_manager.create_folder(folder)
            ide = IDE.get_service("ide")
            current_nfile = ide.get_or_create_nfile(path)
            current_nfile.create()
            main_container = IDE.get_service("main_container")
            main_container.open_file(path)
        else:
            path = os.path.join(self._base_path, path)
            if not os.path.exists(path):
                file_manager.create_folder(path)
        self.close()