コード例 #1
0
ファイル: treeflatview.py プロジェクト: rodolfoap/treeline141
 def commitData(self, editor):
     """Change tree based on results of edit operation"""
     text = unicode(editor.text())
     item = globalref.docRef.selection[0]
     if text and text != item.title() and item == self.editedItem and \
                 item.setTitle(text, True):
         QtGui.QListWidget.commitData(self, editor)
         globalref.updateRightView()
     self.editedItem = None
コード例 #2
0
ファイル: treeview.py プロジェクト: BackupTheBerlios/treeline
 def commitData(self, editor):
     """Change tree based on results of edit operation"""
     text = unicode(editor.text())
     item = self.editedItem
     if text and text != item.title() and item.setTitle(text, True):
         QtGui.QTreeWidget.commitData(self, editor)
         self.resizeColumnToContents(0)
         globalref.updateRightView()
     self.editedItem = None
コード例 #3
0
ファイル: treeview.py プロジェクト: rodolfoap/treeline141
 def commitData(self, editor):
     """Change tree based on results of edit operation"""
     text = unicode(editor.text())
     item = self.editedItem
     if text and text != item.title() and item.setTitle(text, True):
         QtGui.QTreeWidget.commitData(self, editor)
         self.resizeColumnToContents(0)
         globalref.updateRightView()
     self.editedItem = None
コード例 #4
0
 def commitData(self, editor):
     """Change tree based on results of edit operation"""
     text = unicode(editor.text())
     item = globalref.docRef.selection[0]
     if text and text != item.title() and item == self.editedItem and \
                 item.setTitle(text, True):
         QtGui.QListWidget.commitData(self, editor)
         globalref.updateRightView()
     self.editedItem = None
コード例 #5
0
ファイル: treeflatview.py プロジェクト: rodolfoap/treeline141
 def changeSelected(self):
     """Set selection based on signal"""
     selections = self.selectedItems()[:]
     if len(selections) > 1 and \
             globalref.options.strData('SelectOrder') == 'tree':
         for item in selections:
             item.loadTempSortKey()
         selections.sort(lambda x, y: cmp(x.tempSortKey, y.tempSortKey))
     globalref.docRef.selection.replace(
         [item.docItemRef for item in selections])
     globalref.updateRightView()
コード例 #6
0
 def changeSelected(self):
     """Set selection based on signal"""
     selections = self.selectedItems()[:]
     if len(selections) > 1 and \
             globalref.options.strData('SelectOrder') == 'tree':
         for item in selections:
             item.loadTempSortKey()
         selections.sort(lambda x,y: cmp(x.tempSortKey, y.tempSortKey))
     globalref.docRef.selection.replace([item.docItemRef for item in
                                         selections])
     globalref.updateRightView()
コード例 #7
0
ファイル: treeview.py プロジェクト: BackupTheBerlios/treeline
 def changeSelected(self):
     """Set selection based on signal"""
     selections = self.selectedItems()[:]
     if len(selections) > 1 and (
         globalref.options.strData("SelectOrder") == "tree" or len(selections) > len(globalref.docRef.selection) + 1
     ):
         # sort if tree order or always for shift-select
         for item in selections:
             item.loadTempSortKey()
         selections.sort(lambda x, y: cmp(x.tempSortKey, y.tempSortKey))
     globalref.docRef.selection.replace([item.docItemRef for item in selections])
     globalref.updateRightView()
コード例 #8
0
ファイル: treeflatview.py プロジェクト: rodolfoap/treeline141
 def updateSelect(self):
     """Update view selection"""
     self.blockSignals(True)
     self.clearSelection()
     selectList = []
     for item in globalref.docRef.selection:
         if hasattr(item.viewData, 'listWidget'):
             try:
                 item.viewData.text()
                 selectList.append(item)
             except RuntimeError:
                 pass
     if len(selectList) < len(globalref.docRef.selection):
         if not selectList and self.item(0):
             selectList = [self.item(0).docItemRef]
         globalref.docRef.selection.replace(selectList)
         globalref.updateRightView()
     if selectList:
         self.setCurrentItem(selectList[-1].viewData)
         globalref.docRef.selection.currentItem = selectList[-1]
         self.scrollToItem(selectList[-1].viewData)
         for node in selectList:
             self.setItemSelected(node.viewData, True)
     self.blockSignals(False)
コード例 #9
0
 def updateSelect(self):
     """Update view selection"""
     self.blockSignals(True)
     self.clearSelection()
     selectList = []
     for item in globalref.docRef.selection:
         if hasattr(item.viewData, 'listWidget'):
             try:
                 item.viewData.text()
                 selectList.append(item)
             except RuntimeError:
                 pass
     if len(selectList) < len(globalref.docRef.selection):
         if not selectList and self.item(0):
             selectList = [self.item(0).docItemRef]
         globalref.docRef.selection.replace(selectList)
         globalref.updateRightView()
     if selectList:
         self.setCurrentItem(selectList[-1].viewData)
         globalref.docRef.selection.currentItem = selectList[-1]
         self.scrollToItem(selectList[-1].viewData)
         for node in selectList:
             self.setItemSelected(node.viewData, True)
     self.blockSignals(False)