Example #1
0
 def _create_folder(self):
     DEBUG("Creating a folder...")
     current_item = self.currentItem()
     qinput = QInputDialog(self)
     qinput.setInputMode(QInputDialog.TextInput)
     qinput.setWindowTitle(self.tr("Nueva Carpeta"))
     qinput.setLabelText(self.tr("Nombre:"))
     qinput.resize(400, 100)
     ok = qinput.exec_()
     folder_name = qinput.textValue()
     if ok:
         path = os.path.join(current_item.path, folder_name)
         if os.path.exists(path):
             QMessageBox.information(self, self.tr("Información"),
                                     self.tr("La carpeta ya existe"),
                                     QMessageBox.Yes)
             DEBUG("The folder already exists...")
             return
         # Creo la carpeta
         os.mkdir(path)
         # Agrego el ítem al árbol
         folder_item = TreeItem(current_item, [folder_name])
         folder_item.path = path
         folder_item.isFile = False
         folder_item.setExpanded(True)
Example #2
0
 def _create_folder(self):
     DEBUG("Creating a folder...")
     current_item = self.currentItem()
     qinput = QInputDialog(self)
     qinput.setInputMode(QInputDialog.TextInput)
     qinput.setWindowTitle(self.tr("Nueva Carpeta"))
     qinput.setLabelText(self.tr("Nombre:"))
     qinput.resize(400, 100)
     ok = qinput.exec_()
     folder_name = qinput.textValue()
     if ok:
         path = os.path.join(current_item.path, folder_name)
         if os.path.exists(path):
             QMessageBox.information(self, self.tr("Información"), self.tr("La carpeta ya existe"), QMessageBox.Yes)
             DEBUG("The folder already exists...")
             return
         # Creo la carpeta
         os.mkdir(path)
         # Agrego el ítem al árbol
         folder_item = TreeItem(current_item, [folder_name])
         folder_item.path = path
         folder_item.isFile = False
         folder_item.setExpanded(True)