[update] make HELP work again
This commit is contained in:
parent
259538f0b0
commit
370e8a7074
@ -3025,10 +3025,10 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
def helpHelp(self):
|
def helpHelp(self):
|
||||||
if checkurl():
|
if checkurl():
|
||||||
form = HelpForm(
|
form = HelpForm(self,
|
||||||
'https://ariadne.geophysik.ruhr-uni-bochum.de/trac/PyLoT/wiki')
|
'https://ariadne.geophysik.ruhr-uni-bochum.de/trac/PyLoT/wiki')
|
||||||
else:
|
else:
|
||||||
form = HelpForm(':/help.html')
|
form = HelpForm(self, ':/help.html')
|
||||||
form.show()
|
form.show()
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
<qresource>
|
<qresource>
|
||||||
<file>icons/pylot.ico</file>
|
<file>icons/pylot.ico</file>
|
||||||
<file>icons/pylot.png</file>
|
<file>icons/pylot.png</file>
|
||||||
|
<file>icons/back.png</file>
|
||||||
|
<file>icons/home.png</file>
|
||||||
<file>icons/newfile.png</file>
|
<file>icons/newfile.png</file>
|
||||||
<file>icons/open.png</file>
|
<file>icons/open.png</file>
|
||||||
<file>icons/openproject.png</file>
|
<file>icons/openproject.png</file>
|
||||||
|
BIN
icons/back.png
Normal file
BIN
icons/back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
BIN
icons/home.png
Normal file
BIN
icons/home.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
2828
icons_rc_2.py
2828
icons_rc_2.py
File diff suppressed because it is too large
Load Diff
2828
icons_rc_3.py
2828
icons_rc_3.py
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,7 @@ except:
|
|||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
|
|
||||||
|
|
||||||
def checkurl(url='https://ariadne.geophysik.rub.de/trac/PyLoT'):
|
def checkurl(url='https://ariadne.geophysik.ruhr-uni-bochum.de/trac/PyLoT/'):
|
||||||
try:
|
try:
|
||||||
urlopen(url, timeout=1)
|
urlopen(url, timeout=1)
|
||||||
return True
|
return True
|
||||||
|
@ -54,9 +54,9 @@ from autoPyLoT import autoPyLoT
|
|||||||
from pylot.core.util.thread import Thread
|
from pylot.core.util.thread import Thread
|
||||||
|
|
||||||
if sys.version_info.major == 3:
|
if sys.version_info.major == 3:
|
||||||
pass
|
import icons_rc_3 as icons_rc
|
||||||
elif sys.version_info.major == 2:
|
elif sys.version_info.major == 2:
|
||||||
pass
|
import icons_rc_2 as icons_rc
|
||||||
else:
|
else:
|
||||||
raise ImportError('Could not determine python version.')
|
raise ImportError('Could not determine python version.')
|
||||||
|
|
||||||
@ -4302,15 +4302,23 @@ class LoadDataDlg(QDialog):
|
|||||||
|
|
||||||
|
|
||||||
class HelpForm(QDialog):
|
class HelpForm(QDialog):
|
||||||
def __init__(self, page=QUrl('https://ariadne.geophysik.rub.de/trac/PyLoT'),
|
def __init__(self, parent=None,
|
||||||
parent=None):
|
page=QUrl('https://ariadne.geophysik.ruhr-uni-bochum.de/trac/PyLoT/')):
|
||||||
super(HelpForm, self).__init__(parent)
|
super(HelpForm, self).__init__(parent, 1)
|
||||||
self.setAttribute(Qt.WA_DeleteOnClose)
|
self.setAttribute(Qt.WA_DeleteOnClose)
|
||||||
self.setAttribute(Qt.WA_GroupLeader)
|
self.setAttribute(Qt.WA_GroupLeader)
|
||||||
|
|
||||||
backAction = QAction(QIcon(":/back.png"), "&Back", self)
|
self.home_page = page
|
||||||
|
|
||||||
|
back_icon = QIcon()
|
||||||
|
back_icon.addPixmap(QPixmap(':/icons/back.png'))
|
||||||
|
|
||||||
|
home_icon = QIcon()
|
||||||
|
home_icon.addPixmap(QPixmap(':/icons/home.png'))
|
||||||
|
|
||||||
|
backAction = QAction(back_icon, "&Back", self)
|
||||||
backAction.setShortcut(QKeySequence.Back)
|
backAction.setShortcut(QKeySequence.Back)
|
||||||
homeAction = QAction(QIcon(":/home.png"), "&Home", self)
|
homeAction = QAction(home_icon, "&Home", self)
|
||||||
homeAction.setShortcut("Home")
|
homeAction.setShortcut("Home")
|
||||||
self.pageLabel = QLabel()
|
self.pageLabel = QLabel()
|
||||||
|
|
||||||
@ -4323,21 +4331,21 @@ class HelpForm(QDialog):
|
|||||||
|
|
||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
layout.addWidget(toolBar)
|
layout.addWidget(toolBar)
|
||||||
layout.addWidget(self.webBrowser, 1)
|
layout.addWidget(self.webBrowser)
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
|
|
||||||
self.connect(backAction, Signal("triggered()"),
|
backAction.triggered.connect(self.webBrowser.back)
|
||||||
self.webBrowser, Slot("backward()"))
|
homeAction.triggered.connect(self.home)
|
||||||
self.connect(homeAction, Signal("triggered()"),
|
self.webBrowser.urlChanged.connect(self.updatePageTitle)
|
||||||
self.webBrowser, Slot("home()"))
|
|
||||||
self.connect(self.webBrowser, Signal("sourceChanged(QUrl)"),
|
|
||||||
self.updatePageTitle)
|
|
||||||
|
|
||||||
self.resize(400, 600)
|
self.resize(1280, 720)
|
||||||
self.setWindowTitle("{0} Help".format(QApplication.applicationName()))
|
self.setWindowTitle("{0} Help".format(QApplication.applicationName()))
|
||||||
|
|
||||||
|
def home(self):
|
||||||
|
self.webBrowser.load(self.home_page)
|
||||||
|
|
||||||
def updatePageTitle(self):
|
def updatePageTitle(self):
|
||||||
self.pageLabel.setText(self.webBrowser.documentTitle())
|
self.pageLabel.setText(self.webBrowser.title())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user