def on_tree_double_clicked(self, item, column): #print item, column #print item.text(0), item.data(0, QtCore.Qt.UserRole).toString() if item.text(self.COLS.function).length() > 0: file_path = item.data(self.COLS.icon, QtCore.Qt.UserRole).toString() #print "its a function", file_path fInfo = QtCore.QFileInfo(file_path) dialog = FunctionEditDialog(self, self.main, fInfo.fileName(), item.text(self.COLS.folder), self.paths) self.connect(dialog, QtCore.SIGNAL("refresh"), self.on_refresh) res = dialog.exec_() if res: self.load()
def on_edit_function(self): path = self.tree.currentItem().text(self.COLS.folder) fileinfo = QtCore.QFileInfo(self.tree.currentItem().data(self.COLS.icon, QtCore.Qt.UserRole).toString()) d = FunctionEditDialog(self, self.main, fileinfo.fileName(), path, self.paths ) d.show() self.load()
def on_add_function(self): path = self.tree.currentItem().text(self.COLS.folder) d = FunctionEditDialog(self, self.main, None, path, self.paths ) d.show() self.load()