mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-01 05:30:26 +00:00
Added property dialog.
This commit is contained in:
parent
06dcf13629
commit
f3037b2fa3
6 changed files with 485 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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.</p>
|
|||
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.</p>
|
|||
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."""
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
78
linkcheck/gui/linkchecker_ui_properties.py
Normal file
78
linkcheck/gui/linkchecker_ui_properties.py
Normal file
|
|
@ -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"))
|
||||
|
||||
28
linkcheck/gui/properties.py
Normal file
28
linkcheck/gui/properties.py
Normal file
|
|
@ -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
|
||||
361
linkcheck/gui/ui/properties.ui
Normal file
361
linkcheck/gui/ui/properties.ui
Normal file
|
|
@ -0,0 +1,361 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PropertiesDialog</class>
|
||||
<widget class="QDialog" name="PropertiesDialog">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::ApplicationModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>490</width>
|
||||
<height>317</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>LinkChecker URL properties</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>ID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="prop_id">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>URL</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="prop_url">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="prop_name">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Parent URL</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="prop_parenturl">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Base</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="prop_base">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Real URL</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="prop_realurl">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Check time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="prop_checktime">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>D/L time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="prop_dltijme">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLabel" name="prop_size">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Info</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLabel" name="prop_info">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Warning</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QLabel" name="prop_warning">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Result</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QLabel" name="prop_result">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ok</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Loading…
Reference in a new issue