Пример #1
0
 def fillInfo2(self, names, node, types, info, nbrItem,  oneNode):
     self.vboxlayout.removeWidget(self.buttonClose)
     self.valueName.setText(names)
     
     if node.name == "" :
         self.valuePath.setText("/")
     else :
         self.valuePath.setText(node.path + "/" + node.name)
     
     if nbrItem == 1 :
         if oneNode.is_file :
             self.valueSize.setText(str(DFF_Utils.formatSize(info['size'])) + " ( "+str(info['size']) + " bytes ), dump size : "+ str(oneNode.attr.size))
         else :
             self.valueSize.setText(str(DFF_Utils.formatSize(info['size'])) + " ( "+str(info['size']) + " bytes ) ")
         if types == 1 :
             # One Directory
             self.valueType.setText(QApplication.translate("DFF_PropertyDialog", "Folder", None, QApplication.UnicodeUTF8))
         if types == 2 :
             # One Files
             self.valueType.setText(QApplication.translate("DFF_PropertyDialog", "File", None, QApplication.UnicodeUTF8))
         self.addAttr(oneNode)
     else :
         self.valueSize.setText(str(info['item']) +QApplication.translate("DFF_PropertyDialog", " items, totalling ", None,QApplication.UnicodeUTF8) + str(DFF_Utils.formatSize(info['size'])))
         if types == 1 :
             self.valueType.setText(QApplication.translate("DFF_PropertyDialog", "Folders", None,QApplication.UnicodeUTF8))
         if types == 2 :
             self.valueType.setText(QApplication.translate("DFF_PropertyDialog", "Files", None, QApplication.UnicodeUTF8))
         if types == 0 :
             self.valueType.setText(QApplication.translate("DFF_PropertyDialog", "---", None, QApplication.UnicodeUTF8))
     
     self.vboxlayout.addWidget(self.buttonClose)
     qsize = self.vboxlayout.minimumSize()
     self.resize(qsize.width(), qsize.height())
     self.vboxlayout.update()
Пример #2
0
    def fillInfo2(self, names, node, types, info, nbrItem, oneNode):
        self.vboxlayout.removeWidget(self.buttonClose)
        self.valueName.setText(names)

        if node.name == "":
            self.valuePath.setText("/")
        else:
            self.valuePath.setText(node.path + "/" + node.name)

        if nbrItem == 1:
            if oneNode.is_file:
                self.valueSize.setText(
                    str(DFF_Utils.formatSize(info['size'])) + " ( " +
                    str(info['size']) + " bytes ), dump size : " +
                    str(oneNode.attr.size))
            else:
                self.valueSize.setText(
                    str(DFF_Utils.formatSize(info['size'])) + " ( " +
                    str(info['size']) + " bytes ) ")
            if types == 1:
                # One Directory
                self.valueType.setText(
                    QApplication.translate("DFF_PropertyDialog", "Folder",
                                           None, QApplication.UnicodeUTF8))
            if types == 2:
                # One Files
                self.valueType.setText(
                    QApplication.translate("DFF_PropertyDialog", "File", None,
                                           QApplication.UnicodeUTF8))
            self.addAttr(oneNode)
        else:
            self.valueSize.setText(
                str(info['item']) + QApplication.translate(
                    "DFF_PropertyDialog", " items, totalling ", None,
                    QApplication.UnicodeUTF8) +
                str(DFF_Utils.formatSize(info['size'])))
            if types == 1:
                self.valueType.setText(
                    QApplication.translate("DFF_PropertyDialog", "Folders",
                                           None, QApplication.UnicodeUTF8))
            if types == 2:
                self.valueType.setText(
                    QApplication.translate("DFF_PropertyDialog", "Files", None,
                                           QApplication.UnicodeUTF8))
            if types == 0:
                self.valueType.setText(
                    QApplication.translate("DFF_PropertyDialog", "---", None,
                                           QApplication.UnicodeUTF8))

        self.vboxlayout.addWidget(self.buttonClose)
        qsize = self.vboxlayout.minimumSize()
        self.resize(qsize.width(), qsize.height())
        self.vboxlayout.update()
Пример #3
0
 def Load(self):
     self.listMenuAction = []
     setags = DFF_Utils.getSetTags()
     for tags in setags:
         if not tags == "builtins":
             self.listMenuAction.append(
                 self.parent.menuModules.addMenu(
                     MenuModules(self.parent, self.mainWindow, tags,
                                 self.selectItem)))
Пример #4
0
  def run(self):
     while(True):
       self.mutex.lock()
       self.currentNodeDir = self.nodeParent
       list = self.list
       self.mutex.unlock()

       for itemVFS in list:
       	    items = []
	    if self.restart:
		break
	    if self.abort:
		return 

            items.append(NodeItem(itemVFS))
            items[0].setText(QApplication.translate("MainWindow", str(itemVFS.name), None, QApplication.UnicodeUTF8))
            if not itemVFS.next.empty() or not itemVFS.is_file:
#XXX
                if not itemVFS.is_file :
                    icon = ":folder.png"
                else :
                    icon = ":folder.png"
#                    items[0].setIcon(QIcon(":dff_partition.png"))
            else :
                    icon = ":file.png"
            items.append(QStandardItem())
            if itemVFS.is_file == 0 :
                items[1].setText(QApplication.translate("ListModel", "", None, QApplication.UnicodeUTF8))
            else :
                items[1].setText(DFF_Utils.formatSize(itemVFS.attr.size))
            items.append(QStandardItem(""))
            items.append(QStandardItem(""))
            items.append(QStandardItem(""))
            items.append(QStandardItem(""))
            time = itemVFS.attr.time
            for i in time :
                items[self.ListModel.timeHeader[str(i)]].setText(str(time[i].get_time()))
	    items[5].setText(itemVFS.fsobj.name)           
	    
            for i in range(0, 6):
              items[i].setEditable(False)
              items[i].setCheckable(False)
            
            self.emit(SIGNAL("addItem"), items, icon)
	    sleep(0.001)

       if not self.restart:
          self.emit(SIGNAL("resizeList"))

       self.mutex.lock()

       if not self.restart:
          self.condition.wait(self.mutex)

       self.restart = False
       self.mutex.unlock()		
Пример #5
0
 def indexWithNode(self, node):
     theItem = self.rootItemVFS
     list = DFF_Utils.getPath(node).split('/')
     for j in range(0, len(list)):
         for i in range(0,  theItem.childCount()) :
             if theItem.child(i):
                 if str(theItem.child(i).node.name) == str(list[j]):
                     theItem = theItem.child(i)
                     i = theItem.childCount()
     return self.createIndex(theItem.childNumber(), 0,  theItem)
Пример #6
0
 def indexWithNode(self, node):
     theItem = self.rootItemVFS
     list = DFF_Utils.getPath(node).split('/')
     for j in range(0, len(list)):
         for i in range(0, theItem.childCount()):
             if theItem.child(i):
                 if str(theItem.child(i).node.name) == str(list[j]):
                     theItem = theItem.child(i)
                     i = theItem.childCount()
     return self.createIndex(theItem.childNumber(), 0, theItem)
Пример #7
0
 def extractFolder(self):
     if self.__mainWindow.DFF_CONFIG.extractFolder == "":
         sDirName = QFileDialog.getExistingDirectory(
             self,
             QApplication.translate("MainWindow",
                                    "Choose Your Directory For Extraction",
                                    None, QApplication.UnicodeUTF8),
             "/home",
             QFileDialog.ShowDirsOnly | QFileDialog.DontResolveSymlinks)
         if (sDirName):
             self.__mainWindow.DFF_CONFIG.extractFolder = sDirName
         else:
             return
     tmp = [self.getCurrentNode()]
     DFF_Utils().execExtract(tmp,
                             self.__mainWindow.DFF_CONFIG.extractFolder)
Пример #8
0
    def reloadAllArguments(self, nameModule, type):
        self.deleteAllArguments()
        if self.argumentsContainer == None:
            self.argumentsContainer = QWidget(self)

        iterator = 0
        args = DFF_Utils.getArgs(nameModule)
        vars_db = self.env.vars_db
        for arg in args:
            label = QLabel(arg.name + " ( " + str(arg.type) + " ) " + ":",
                           self.argumentsContainer)
            label.setMinimumSize(QSize(80, 28))
            label.setMaximumSize(QSize(120, 28))
            list = self.env.getValuesInDb(arg.name, arg.type)
            if arg.type == "node":
                value = NodeComboBox(self.argumentsContainer)

                for i in range(0, len(list)):
                    value.addPath(list[i])
                button = PushButton(
                    self.argumentsContainer, value, arg.name,
                    self.__mainWindow.QSelectNodes, self.__mainWindow.
                    dockNodeTree.treeItemModel.rootItemVFS.node)
                currentItem = self.__mainWindow.dockNodeTree.treeView.getCurrentItem(
                )
                value.addPath(currentItem.node)

                if self.__nodesSelected:
                    list = self.__nodesSelected
                    for i in range(0, len(self.__nodesSelected)):
                        value.addPath(self.__nodesSelected[i])

            elif arg.type == "int":
                value = StringComboBox(self.argumentsContainer)
                value.setEditable(True)
                for i in range(0, len(list)):
                    value.addPath(str(list[i]))
                button = None

            elif arg.type == "string":
                value = StringComboBox(self.argumentsContainer)
                value.setEditable(True)
                for i in range(0, len(list)):
                    value.addPath(list[i])
                button = None

            elif arg.type == "path":
                value = StringComboBox(self.argumentsContainer)
                value.setEditable(True)
                for i in range(0, len(list)):
                    value.addPath(list[i])
                button = PushButton(self.argumentsContainer, value, arg.name)

            elif arg.type == "bool":
                value = BoolComboBox(self.argumentsContainer)
                button = None

            if arg.optional:
                checkBox = CheckBoxWidgetEnable(self.argumentsContainer, label,
                                                value, button)
            else:
                checkBox = None

            self.gridArgs.addWidget(label, iterator, 0)
            if value != None:
                self.gridArgs.addWidget(value, iterator, 1)
            if button != None:
                self.gridArgs.addWidget(button, iterator, 2)
            if checkBox != None:
                self.gridArgs.addWidget(checkBox, iterator, 3)

            value.setCurrentIndex(value.count() - 1)
            self.labelArgs[arg] = label
            self.valueArgs[arg] = value
            self.checkBoxArgs[arg] = checkBox
            self.browserButtons[arg] = button
            iterator = iterator + 1
Пример #9
0
 def refreshQMenuModules(self):
     setags = DFF_Utils.getSetTags()
     for menu in self.listMenuAction:
         self.parent.menuModules.removeAction(menu)
     self.Load()
Пример #10
0
    def reloadAllArguments(self, nameModule, type):
        self.deleteAllArguments()
        if self.argumentsContainer == None :
            self.argumentsContainer = QWidget(self)

        iterator = 0
        args = DFF_Utils.getArgs(nameModule)
        vars_db = self.env.vars_db
        for arg in args:
            label = QLabel(arg.name + " ( "+ str(arg.type) + " ) " + ":", self.argumentsContainer)
            label.setMinimumSize(QSize(80,  28))
            label.setMaximumSize(QSize(120,  28))
            list = self.env.getValuesInDb(arg.name,  arg.type)
            if arg.type == "node" :
                value = NodeComboBox(self.argumentsContainer)
                
                for i in range(0, len(list)) :
                    value.addPath(list[i])
                button = PushButton(self.argumentsContainer, value, arg.name, self.__mainWindow.QSelectNodes , self.__mainWindow.dockNodeTree.treeItemModel.rootItemVFS.node)
                currentItem = self.__mainWindow.dockNodeTree.treeView.getCurrentItem()
                value.addPath(currentItem.node)
                
                if self.__nodesSelected  :
                    list = self.__nodesSelected
                    for i in range(0,  len(self.__nodesSelected)):
                        value.addPath(self.__nodesSelected[i])

            elif arg.type == "int":
                value = StringComboBox(self.argumentsContainer)
                value.setEditable(True)
                for i in range(0, len(list)) :
                    value.addPath(str(list[i]))
                button = None
            
            elif arg.type == "string":
                value = StringComboBox(self.argumentsContainer)
                value.setEditable(True)
                for i in range(0, len(list)) :
                    value.addPath(list[i])
                button = None
                    
            elif arg.type == "path" :
                value = StringComboBox(self.argumentsContainer)
                value.setEditable(True)
                for i in range(0, len(list)) :
                    value.addPath(list[i])
                button = PushButton(self.argumentsContainer,  value, arg.name)
            
            elif arg.type == "bool" :
                value = BoolComboBox(self.argumentsContainer)
                button = None
                    
            if arg.optional :
                checkBox =  CheckBoxWidgetEnable(self.argumentsContainer, label, value,  button)
            else :
                checkBox = None
            
            self.gridArgs.addWidget(label, iterator, 0)
            if value != None :
                self.gridArgs.addWidget(value, iterator, 1)
            if button != None:
                self.gridArgs.addWidget(button, iterator, 2)
            if checkBox != None :
                self.gridArgs.addWidget(checkBox, iterator, 3)

            value.setCurrentIndex(value.count() - 1)
            self.labelArgs[arg] = label
            self.valueArgs[arg] = value
            self.checkBoxArgs[arg] = checkBox
            self.browserButtons[arg] = button
            iterator = iterator + 1
Пример #11
0
Файл: menu.py Проект: alepee/dff
   def refreshQMenuModules(self):
        setags = DFF_Utils.getSetTags()
	for menu in self.listMenuAction:
	   self.parent.menuModules.removeAction(menu)
	self.Load()
Пример #12
0
Файл: menu.py Проект: alepee/dff
 def Load(self):   
     self.listMenuAction = []
     setags = DFF_Utils.getSetTags()
     for tags in setags:
        if not tags == "builtins":
          self.listMenuAction.append(self.parent.menuModules.addMenu(MenuModules(self.parent, self.mainWindow, tags, self.selectItem)))