Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

status: switch from QTableView to QTreeView

Changeset 5858b05ccc0b

Parent 480b991ef3d1

by Steve Borho

Changes to one file · Browse files at 5858b05ccc0b Showing diff from parent 480b991ef3d1 Diff from another changeset...

 
10
11
12
13
14
 
 
 
15
16
17
 
47
48
49
50
51
52
 
 
 
 
 
 
53
54
55
 
56
57
58
 
62
63
64
65
66
67
68
69
70
71
72
73
74
 
94
95
96
 
 
 
 
97
98
99
100
101
 
 
102
103
104
 
10
11
12
 
 
13
14
15
16
17
18
 
48
49
50
 
 
 
51
52
53
54
55
56
57
58
 
59
60
61
62
 
66
67
68
 
 
 
 
 
 
 
69
70
71
 
91
92
93
94
95
96
97
98
 
 
 
 
99
100
101
102
103
@@ -10,8 +10,9 @@
 from tortoisehg.util import paths, hglib  from tortoisehg.util.i18n import _   -from PyQt4.QtCore import Qt, QAbstractTableModel, QVariant, SIGNAL -from PyQt4.QtGui import QWidget, QVBoxLayout, QSplitter, QTableView, QTextEdit, QFont +from PyQt4.QtCore import Qt, QVariant, SIGNAL, QAbstractTableModel +from PyQt4.QtGui import QWidget, QVBoxLayout, QSplitter, QTreeView +from PyQt4.QtGui import QTextEdit, QFont    # This widget can be used as the basis of the commit tool or any other  # working copy browser. @@ -47,12 +48,15 @@
  self.repo = hg.repository(ui.ui(), path=root)   self.wctx = self.repo[None]   - self.tv = QTableView() - vh = self.tv.verticalHeader() - vh.setVisible(False) + split = QSplitter(Qt.Horizontal) + layout = QVBoxLayout() + layout.addWidget(split) + self.setLayout(layout) + + self.tv = QTreeView(split)   self.connect(self.tv, SIGNAL('clicked(QModelIndex)'), self.rowSelected)   - self.te = QTextEdit() + self.te = QTextEdit(split)   self.te.document().setDefaultStyleSheet(qtlib.thgstylesheet)   self.te.setReadOnly(True)   self.te.setLineWrapMode(QTextEdit.NoWrap) @@ -62,13 +66,6 @@
  f.setPointSize(9)   self.te.setFont(f)   - split = QSplitter(Qt.Horizontal) - split.addWidget(self.tv) - split.addWidget(self.te) - - layout = QVBoxLayout() - layout.addWidget(split) - self.setLayout(layout)   if not parent:   self.setWindowTitle(_('TortoiseHg Status'))   self.resize(650, 400) @@ -94,11 +91,13 @@
    def updateModel(self):   tm = WctxModel(self.wctx) + self.tv.setItemsExpandable(False) + self.tv.setRootIsDecorated(False) + self.tv.setSortingEnabled(True) + self.tv.sortByColumn(1)   self.tv.setModel(tm) - self.tv.resizeColumnsToContents() - self.tv.resizeRowsToContents() - hh = self.tv.horizontalHeader() - hh.setStretchLastSection(True) + self.tv.resizeColumnToContents(0) + self.tv.resizeColumnToContents(1)     def rowSelected(self, index):   pfile = index.sibling(index.row(), 1).data().toString()