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

status: use 'url list' mime type

On Windows, this lets me drop files from the status browser
into GVim, Firefox, etc. Hooray.

Changeset 5f042776ca83

Parent cc01b492e6b7

by Steve Borho

Changes to one file · Browse files at 5f042776ca83 Showing diff from parent cc01b492e6b7 Diff from another changeset...

 
5
6
7
 
 
8
9
10
11
12
13
14
 
15
16
17
 
65
66
67
68
 
69
70
71
 
133
134
135
136
 
137
 
138
139
140
 
143
144
145
146
 
147
148
149
150
 
 
 
 
151
152
153
154
 
155
156
157
 
5
6
7
8
9
10
11
12
13
14
15
 
16
17
18
19
 
67
68
69
 
70
71
72
73
 
135
136
137
 
138
139
140
141
142
143
 
146
147
148
 
149
150
151
152
 
153
154
155
156
157
158
159
 
160
161
162
163
@@ -5,13 +5,15 @@
 # This software may be used and distributed according to the terms of the  # GNU General Public License version 2, incorporated herein by reference.   +import os +  from mercurial import ui, hg, util, patch, cmdutil, error, mdiff  from tortoisehg.hgqt import qtlib, htmlui  from tortoisehg.util import paths, hglib  from tortoisehg.util.i18n import _    from PyQt4.QtCore import Qt, QVariant, SIGNAL, QAbstractTableModel -from PyQt4.QtCore import QObject, QEvent, QMimeData, QPoint +from PyQt4.QtCore import QObject, QEvent, QMimeData, QUrl  from PyQt4.QtGui import QWidget, QVBoxLayout, QSplitter, QTreeView  from PyQt4.QtGui import QTextEdit, QFont, QColor, QDrag   @@ -65,7 +67,7 @@
  layout.addWidget(split)   self.setLayout(layout)   - self.tv = WctxFileTree(split) + self.tv = WctxFileTree(root, split)   self.connect(self.tv, SIGNAL('clicked(QModelIndex)'), self.rowSelected)     self.te = QTextEdit(split) @@ -133,8 +135,9 @@
     class WctxFileTree(QTreeView): - def __init__(self, parent=None): + def __init__(self, root, parent=None):   QTreeView.__init__(self, parent) + self.root = root     def keyPressEvent(self, event):   if event.key() == 32: @@ -143,15 +146,18 @@
    def dragObject(self):   rows = set() - fnames = [] + urls = []   for index in self.selectedIndexes():   if index.row() not in rows:   rows.add(index.row()) - fnames.append(self.model().getPath(index)) + path = self.model().getPath(index) + u = QUrl() + u.setPath('file://' + os.path.join(self.root, path)) + urls.append(u)   if rows:   d = QDrag(self)   m = QMimeData() - m.setText(', '.join(fnames)) + m.setUrls(urls)   d.setMimeData(m)   d.start(Qt.CopyAction)