Double clicking on URL column opens URL in webbrowser.

This commit is contained in:
Bastian Kleineidam 2009-03-07 10:57:29 +01:00
parent 29e5e2a655
commit 86c2d08c8e
3 changed files with 8 additions and 1 deletions

View file

@ -16,6 +16,7 @@ Features:
- email: Added email syntax checking.
Closes: SF bug #2595437
- gui: Improved progress dialog in GUI client: show active and queued URLs.
- gui: Double clicking on URL column opens the clicked URL in a webbrowser.
- nntp: Output welcome message from NNTP servers as info.

View file

@ -1,2 +1 @@
- [GUI] Add double-click action in tree widget: show URL.
- [GUI] Add right-click action in tree widget: show properties page.

View file

@ -15,6 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
import webbrowser
from PyQt4 import QtCore, QtGui
from .linkchecker_ui_main import Ui_MainWindow
from .progress import LinkCheckerProgress, StatusLogger
@ -67,6 +68,7 @@ class LinkCheckerMain (QtGui.QMainWindow, Ui_MainWindow):
self.connect(self.checker, QtCore.SIGNAL("finished()"), self.set_status_idle)
self.connect(self.checker, QtCore.SIGNAL("terminated()"), self.set_status_idle)
self.connect(self.checker, QtCore.SIGNAL("log_url(PyQt_PyObject)"), self.log_url)
self.connect(self.treeWidget, QtCore.SIGNAL("itemDoubleClicked(QTreeWidgetItem *, int)"), self.item_clicked)
self.connect(self.controlButton, QtCore.SIGNAL("clicked()"), self.start)
self.connect(self.optionsButton, QtCore.SIGNAL("clicked()"), self.options.exec_)
self.connect(self.actionQuit, QtCore.SIGNAL("triggered()"), self.close)
@ -228,6 +230,11 @@ Version 2 or later.</p>
self.treeWidget.addTopLevelItem(item)
self.num += 1
def item_clicked (self, item, column):
if column == 2:
# URL column double clicked
webbrowser.open(str(item.text(column)))
def set_statusbar (self, msg):
"""Show status message in status bar."""
self.statusBar.showMessage(msg)