1
0
réplica de https://github.com/arsenetar/dupeguru.git synced 2026-06-22 14:57:51 +00:00

[#34 state:fixed] qt base: Implemented "open on double click".

--HG--
extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%4089
Este commit está contenido en:
hsoft
2009-06-19 11:14:27 +00:00
padre 3f5a5687f9
commit 8946ad02ac
Se han modificado 3 ficheros con 9 adiciones y 0 borrados

Ver fichero

@@ -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

Ver fichero

@@ -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

Ver fichero

@@ -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)