Skip to content
Permalink
Browse files

Add UI file for help

minor fix in settings dialog
  • Loading branch information
slarosa committed Oct 29, 2012
1 parent 1bac84c commit 812a0a8605a93d5bc7bd6ce8b0c16dcaf6fe8aeb
Showing with 122 additions and 52 deletions.
  1. +1 −1 python/console.py
  2. +9 −28 python/console_help.py
  3. +98 −0 python/console_help.ui
  4. +14 −23 python/console_settings.ui
@@ -348,7 +348,7 @@ def saveScriptFile(self):
sF.close()

def openHelp(self):
dlg = HelpDialog()
dlg = HelpDialog(self)
dlg.exec_()

def openSettings(self):
@@ -23,38 +23,22 @@
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

from PyQt4 import QtCore, QtGui, QtWebKit
from PyQt4.QtWebKit import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from ui_console_help import Ui_Help
from qgis.core import QgsApplication
import os

class HelpDialog(QtGui.QDialog):

def __init__(self):
QtGui.QDialog.__init__(self)
class HelpDialog(QDialog, Ui_Help):
def __init__(self, parent):
QDialog.__init__(self, parent)
self.setModal(True)
self.setupUi()
self.setupUi(self)

def setupUi(self):
self.setMaximumSize(500, 300)
self.webView = QtWebKit.QWebView()
self.setWindowTitle(QCoreApplication.translate("PythonConsole","Help Python Console"))
self.verticalLayout= QtGui.QVBoxLayout()
self.verticalLayout.setSpacing(2)
self.verticalLayout.setMargin(0)
self.verticalLayout.addWidget(self.webView)
self.closeButton = QtGui.QPushButton()
self.closeButton.setText("Close")
self.closeButton.setMaximumWidth(150)
self.horizontalLayout= QtGui.QHBoxLayout()
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.addStretch(1000)
self.horizontalLayout.addWidget(self.closeButton)
QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.closeWindow)
self.verticalLayout.addLayout(self.horizontalLayout)
self.setLayout(self.verticalLayout)
self.setMaximumSize(500, 300)

qgisDataDir = QgsApplication.pkgDataPath()
listFile = os.listdir(qgisDataDir + "/python/console_help/i18n")
localeFullName = QSettings().value( "locale/userLocale", QVariant( "" ) ).toString()
@@ -67,8 +51,5 @@ def setupUi(self):
lang=" + locale \
+ "&pkgDir=" + qgisDataDir

url = QtCore.QUrl(filename)
url = QUrl(filename)
self.webView.load(url)

def closeWindow(self):
self.close()
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Help</class>
<widget class="QDialog" name="Help">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>519</width>
<height>328</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QWebView" name="webView">
<property name="url">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header>QtWebKit/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Help</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Help</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
@@ -86,7 +86,7 @@
</property>
</spacer>
</item>
<item row="2" column="0">
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
@@ -107,17 +107,7 @@
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="preloadAPI">
<property name="text">
<string>Use preloaded API file</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidget">
@@ -219,7 +209,7 @@
</item>
</layout>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -229,19 +219,20 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="preloadAPI">
<property name="text">
<string>Use preloaded API file</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<zorder>buttonBox</zorder>
<zorder>layoutWidget</zorder>
<zorder>layoutWidget_2</zorder>
<zorder>layoutWidget_3</zorder>
<zorder>label</zorder>
<zorder>fontComboBox</zorder>
<zorder>label_3</zorder>
<zorder>fontComboBox</zorder>
<zorder>label</zorder>
<zorder>label_3</zorder>
<zorder>preloadAPI</zorder>
<zorder>verticalSpacer_2</zorder>
<zorder>preloadAPI</zorder>
</widget>
<resources/>
<connections>

0 comments on commit 812a0a8

Please sign in to comment.
You can’t perform that action at this time.