From f3037b2fa3000bc804661db73dab8d72d6fce69a Mon Sep 17 00:00:00 2001
From: Bastian Kleineidam
Date: Fri, 5 Nov 2010 15:21:19 +0100
Subject: [PATCH] Added property dialog.
---
linkcheck/gui/Makefile | 3 +-
linkcheck/gui/__init__.py | 16 +-
linkcheck/gui/contextmenu.py | 1 +
linkcheck/gui/linkchecker_ui_properties.py | 78 +++++
linkcheck/gui/properties.py | 28 ++
linkcheck/gui/ui/properties.ui | 361 +++++++++++++++++++++
6 files changed, 485 insertions(+), 2 deletions(-)
create mode 100644 linkcheck/gui/linkchecker_ui_properties.py
create mode 100644 linkcheck/gui/properties.py
create mode 100644 linkcheck/gui/ui/properties.ui
diff --git a/linkcheck/gui/Makefile b/linkcheck/gui/Makefile
index 14b55c63..830b0857 100644
--- a/linkcheck/gui/Makefile
+++ b/linkcheck/gui/Makefile
@@ -5,7 +5,8 @@ UI_FILES = linkchecker_ui_main.py \
linkchecker_ui_options.py \
linkchecker_ui_progress.py \
linkchecker_ui_debug.py \
- linkchecker_ui_editor.py
+ linkchecker_ui_editor.py \
+ linkchecker_ui_properties.py
RC_FILES = linkchecker_rc.py
diff --git a/linkcheck/gui/__init__.py b/linkcheck/gui/__init__.py
index 9ab6f0c8..d0368f9f 100644
--- a/linkcheck/gui/__init__.py
+++ b/linkcheck/gui/__init__.py
@@ -20,6 +20,7 @@ import sys
import webbrowser
from PyQt4 import QtCore, QtGui
from .linkchecker_ui_main import Ui_MainWindow
+from .properties PropertiesDialog
from .progress import LinkCheckerProgress, StatusLogger
from .debug import LinkCheckerDebug
from .logger import GuiLogger, GuiLogHandler
@@ -80,6 +81,7 @@ class LinkCheckerMain (QtGui.QMainWindow, Ui_MainWindow):
self.checker = CheckerThread()
self.contextmenu = ContextMenu(parent=self)
self.editor = EditorWindow(parent=self)
+ self.properties = PropertiesDialog(parent=self)
# Note: we can't use QT assistant here because of the .exe packaging
self.assistant = HelpWindow(self, self.get_qhcpath())
# setup this widget
@@ -294,9 +296,14 @@ Version 2 or later.
self.treeWidget.addTopLevelItem(item)
self.num += 1
+ def view_item_properties (self, item):
+ self.properties.set_item(item)
+ self.properties.show()
+
def on_treeWidget_itemDoubleClicked (self, item, column):
"""View property page."""
- pass # XXX todo
+ if item is not None:
+ self.view_item_properties(item)
def on_treeWidget_customContextMenuRequested (self, point):
"""Show item context menu."""
@@ -305,6 +312,13 @@ Version 2 or later.
self.contextmenu.enableFromItem(item)
self.contextmenu.popup(QtGui.QCursor.pos())
+ @QtCore.pyqtSignature("")
+ def on_actionViewProperties_triggered (self):
+ """View URL data properties in a separate window."""
+ item = self.treeWidget.currentItem()
+ if item is not None:
+ self.view_item_properties(item)
+
@QtCore.pyqtSignature("")
def on_actionViewOnline_triggered (self):
"""View item URL online."""
diff --git a/linkcheck/gui/contextmenu.py b/linkcheck/gui/contextmenu.py
index 2b489852..a85b6e7d 100644
--- a/linkcheck/gui/contextmenu.py
+++ b/linkcheck/gui/contextmenu.py
@@ -21,6 +21,7 @@ class ContextMenu (QtGui.QMenu):
def __init__ (self, parent=None):
super(ContextMenu, self).__init__(parent)
+ self.addAction(parent.actionViewProperties)
self.addAction(parent.actionViewOnline)
self.addAction(parent.actionCopyToClipboard)
self.addAction(parent.actionViewParentOnline)
diff --git a/linkcheck/gui/linkchecker_ui_properties.py b/linkcheck/gui/linkchecker_ui_properties.py
new file mode 100644
index 00000000..d5ef781b
--- /dev/null
+++ b/linkcheck/gui/linkchecker_ui_properties.py
@@ -0,0 +1,78 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'ui/properties.ui'
+#
+# Created: Fri Nov 5 13:01:36 2010
+# by: PyQt4 UI code generator 4.7.3
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+class Ui_PropertiesDialog(object):
+ def setupUi(self, PropertiesDialog):
+ PropertiesDialog.setObjectName("PropertiesDialog")
+ PropertiesDialog.setWindowModality(QtCore.Qt.ApplicationModal)
+ PropertiesDialog.resize(564, 547)
+ self.verticalLayout = QtGui.QVBoxLayout(PropertiesDialog)
+ self.verticalLayout.setObjectName("verticalLayout")
+ self.frame = QtGui.QFrame(PropertiesDialog)
+ self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
+ self.frame.setFrameShadow(QtGui.QFrame.Raised)
+ self.frame.setObjectName("frame")
+ self.label = QtGui.QLabel(self.frame)
+ self.label.setGeometry(QtCore.QRect(30, 40, 45, 16))
+ self.label.setObjectName("label")
+ self.label_2 = QtGui.QLabel(self.frame)
+ self.label_2.setGeometry(QtCore.QRect(30, 70, 45, 13))
+ self.label_2.setObjectName("label_2")
+ self.label_3 = QtGui.QLabel(self.frame)
+ self.label_3.setGeometry(QtCore.QRect(30, 100, 45, 13))
+ self.label_3.setObjectName("label_3")
+ self.label_4 = QtGui.QLabel(self.frame)
+ self.label_4.setGeometry(QtCore.QRect(30, 150, 71, 16))
+ self.label_4.setObjectName("label_4")
+ self.label_5 = QtGui.QLabel(self.frame)
+ self.label_5.setGeometry(QtCore.QRect(30, 180, 45, 13))
+ self.label_5.setObjectName("label_5")
+ self.label_6 = QtGui.QLabel(self.frame)
+ self.label_6.setGeometry(QtCore.QRect(30, 210, 45, 13))
+ self.label_6.setObjectName("label_6")
+ self.label_7 = QtGui.QLabel(self.frame)
+ self.label_7.setGeometry(QtCore.QRect(30, 240, 71, 16))
+ self.label_7.setObjectName("label_7")
+ self.label_8 = QtGui.QLabel(self.frame)
+ self.label_8.setGeometry(QtCore.QRect(30, 270, 45, 13))
+ self.label_8.setObjectName("label_8")
+ self.label_9 = QtGui.QLabel(self.frame)
+ self.label_9.setGeometry(QtCore.QRect(30, 300, 45, 13))
+ self.label_9.setObjectName("label_9")
+ self.label_10 = QtGui.QLabel(self.frame)
+ self.label_10.setGeometry(QtCore.QRect(30, 330, 45, 13))
+ self.label_10.setObjectName("label_10")
+ self.label_11 = QtGui.QLabel(self.frame)
+ self.label_11.setGeometry(QtCore.QRect(30, 360, 45, 13))
+ self.label_11.setObjectName("label_11")
+ self.label_12 = QtGui.QLabel(self.frame)
+ self.label_12.setGeometry(QtCore.QRect(30, 380, 45, 13))
+ self.label_12.setObjectName("label_12")
+ self.verticalLayout.addWidget(self.frame)
+
+ self.retranslateUi(PropertiesDialog)
+ QtCore.QMetaObject.connectSlotsByName(PropertiesDialog)
+
+ def retranslateUi(self, PropertiesDialog):
+ PropertiesDialog.setWindowTitle(_("LinkChecker URL properties"))
+ self.label.setText(_("ID"))
+ self.label_2.setText(_("URL"))
+ self.label_3.setText(_("Name"))
+ self.label_4.setText(_("Parent URL"))
+ self.label_5.setText(_("Base"))
+ self.label_6.setText(_("Real URL"))
+ self.label_7.setText(_("Check time"))
+ self.label_8.setText(_("D/L time"))
+ self.label_9.setText(_("Size"))
+ self.label_10.setText(_("Info"))
+ self.label_11.setText(_("Warning"))
+ self.label_12.setText(_("Result"))
+
diff --git a/linkcheck/gui/properties.py b/linkcheck/gui/properties.py
new file mode 100644
index 00000000..3c446d8f
--- /dev/null
+++ b/linkcheck/gui/properties.py
@@ -0,0 +1,28 @@
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2010 Bastian Kleineidam
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from PyQt4 import QtCore, QtGui
+from .linkchecker_ui_properties import Ui_PropertiesDialog
+
+
+class LinkCheckerProperties (QtGui.QDialog, Ui_PropertiesDialog):
+ """Show URL properties dialog."""
+
+ def __init__ (self, parent=None):
+ super(LinkCheckerProperties, self).__init__(parent)
+ self.setupUi(self)
+ # connect ok button to close event
diff --git a/linkcheck/gui/ui/properties.ui b/linkcheck/gui/ui/properties.ui
new file mode 100644
index 00000000..5305015d
--- /dev/null
+++ b/linkcheck/gui/ui/properties.ui
@@ -0,0 +1,361 @@
+
+
+ PropertiesDialog
+
+
+ Qt::ApplicationModal
+
+
+
+ 0
+ 0
+ 490
+ 317
+
+
+
+ LinkChecker URL properties
+
+
+ -
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
-
+
+
+ ID
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+ -
+
+
+ URL
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+ -
+
+
+ Name
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+ -
+
+
+ Parent URL
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+ -
+
+
+ Base
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+ -
+
+
+ Real URL
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+ -
+
+
+ Check time
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+ -
+
+
+ D/L time
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+ -
+
+
+ Size
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+ -
+
+
+ Info
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+ -
+
+
+ Warning
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+ -
+
+
+ Result
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Ok
+
+
+
+
+
+
+
+