mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
[#34 state:fixed] qt base: Implemented "open on double click".
--HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%4089
This commit is contained in:
parent
3f5a5687f9
commit
8946ad02ac
@ -12,6 +12,7 @@ import traceback
|
||||
from PyQt4.QtCore import Qt, QTimer, QObject, QCoreApplication, QUrl, SIGNAL
|
||||
from PyQt4.QtGui import QProgressDialog, QDesktopServices, QFileDialog, QDialog, QMessageBox
|
||||
|
||||
import hsfs as fs
|
||||
from hsutil import job
|
||||
from hsutil.reg import RegistrationRequired
|
||||
|
||||
|
@ -39,6 +39,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.connect(self.menuColumns, SIGNAL('triggered(QAction*)'), self.columnToggled)
|
||||
self.connect(QCoreApplication.instance(), SIGNAL('aboutToQuit()'), self.application_will_terminate)
|
||||
self.connect(self.resultsModel, SIGNAL('modelReset()'), self.resultsReset)
|
||||
self.connect(self.resultsView, SIGNAL('doubleClicked()'), self.resultsDoubleClicked)
|
||||
|
||||
def _setupUi(self):
|
||||
self.setupUi(self)
|
||||
@ -293,6 +294,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
def resultsChanged(self):
|
||||
self.resultsView.model().reset()
|
||||
|
||||
def resultsDoubleClicked(self):
|
||||
self.app.open_selected()
|
||||
|
||||
def resultsReset(self):
|
||||
self.resultsView.expandAll()
|
||||
dupe = self.app.selected_dupe
|
||||
|
@ -189,6 +189,10 @@ class ResultsView(QTreeView):
|
||||
return
|
||||
QTreeView.keyPressEvent(self, event)
|
||||
|
||||
def mouseDoubleClickEvent(self, event):
|
||||
self.emit(SIGNAL('doubleClicked()'))
|
||||
# We don't call the superclass' method because the default behavior is to rename the cell.
|
||||
|
||||
def setModel(self, model):
|
||||
assert isinstance(model, ResultsModel)
|
||||
QTreeView.setModel(self, model)
|
||||
|
Loading…
x
Reference in New Issue
Block a user