Can anyone help me on this?<div>Still stuck.</div><div><br></div><div>Thanks.<br>
<br><br><div class="gmail_quote">On Tue, Sep 11, 2012 at 10:12 AM, zw g <span dir="ltr"><<a href="mailto:pekingmaster@gmail.com" target="_blank">pekingmaster@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Anyone? Some suggestion would be fine.<div>Thanks.<div><div class="h5"><br clear="all"><br>
<br><br><div class="gmail_quote">On Sat, Sep 8, 2012 at 8:17 PM, zw g <span dir="ltr"><<a href="mailto:pekingmaster@gmail.com" target="_blank">pekingmaster@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear list,<br><br><br>How can i copy files between applications on GNOME/Unity desktop(with Nautilus file manager)?<br><br>The below code works fine on KDE & Mac OS X(Finder), but not work on GNOME/Unity-based desktop.<br>
The section marked with <b>bold</b> were the part i used for copy & paster files. (Paste the files i copied from my PyQt app to somewhere on the filesystem, /home/myuser/, etc.)<br clear="all"><br><br> def buildContextMenu(self):<br>
self.contextMenu = QMenu(self)<br> copyAction = QAction(self.trUtf8('Copy'), self)<br> self.contextMenu.addAction(copyAction)<br><br> self.connect(copyAction, SIGNAL('triggered()'), self.copy2clipboard)<br>
<br> def copy2clipboard(self):<br> selectedList = self.selectedIndexes()<br> if selectedList:<br> paths = []<br> for i in selectedList:<br> p = unicode(i.model().filePath(i))<br>
if p not in paths:<br> paths.append(p)<br><b><br> urls = [QUrl.fromLocalFile(i) for i in paths]<br><br> mime_data = QMimeData()<br> mime_data.setUrls(urls)<br>
<br> clipboard = QApplication.clipboard()<br> clipboard.setMimeData(mime_data)</b><br><br><br>Any help would be appreciated.<br>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>