Click to open in book details on device view now opens the actual file instead of the folder containing it

This commit is contained in:
Kovid Goyal 2010-06-15 11:06:21 -06:00
parent 6d80e2093c
commit 9e31b075da
2 changed files with 2 additions and 6 deletions

View File

@ -258,8 +258,7 @@ class BookDetails(QWidget):
id_, fmt = val.split(':') id_, fmt = val.split(':')
self.view_specific_format.emit(int(id_), fmt) self.view_specific_format.emit(int(id_), fmt)
elif typ == 'devpath': elif typ == 'devpath':
path = os.path.dirname(val) QDesktopServices.openUrl(QUrl.fromLocalFile(val))
QDesktopServices.openUrl(QUrl.fromLocalFile(path))
def mouseReleaseEvent(self, ev): def mouseReleaseEvent(self, ev):
@ -275,8 +274,6 @@ class BookDetails(QWidget):
self.setToolTip('<p>'+_('Click to open Book Details window') + self.setToolTip('<p>'+_('Click to open Book Details window') +
'<br><br>' + _('Path') + ': ' + data.get(_('Path'), '')) '<br><br>' + _('Path') + ': ' + data.get(_('Path'), ''))
def reset_info(self): def reset_info(self):
self.show_data({}) self.show_data({})

View File

@ -239,8 +239,7 @@ class StatusBar(QStatusBar, StatusBarInterface, BookDetailsInterface):
id_, fmt = val.split(':') id_, fmt = val.split(':')
self.view_specific_format.emit(int(id_), fmt) self.view_specific_format.emit(int(id_), fmt)
elif typ == 'devpath': elif typ == 'devpath':
path = os.path.dirname(val) QDesktopServices.openUrl(QUrl.fromLocalFile(val))
QDesktopServices.openUrl(QUrl.fromLocalFile(path))
def resizeEvent(self, ev): def resizeEvent(self, ev):