Skip to content

Commit

Permalink
Added context help button to the gui
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@4696 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gsherman committed Jan 16, 2006
1 parent e88f90b commit 0209a89
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 146 deletions.
5 changes: 5 additions & 0 deletions src/plugins/copyright_label/plugingui.cpp
Expand Up @@ -10,6 +10,7 @@
* (at your option) any later version. *
***************************************************************************/
#include "plugingui.h"
#include "qgscontexthelp.h"
#include <q3textedit.h>
#include <q3simplerichtext.h>
#include <QComboBox>
Expand Down Expand Up @@ -58,6 +59,10 @@ void QgsCopyrightLabelPluginGui::on_pbnCancel_clicked()
close(1);
}

void QgsCopyrightLabelPluginGui::on_pbnHelp_clicked()
{
QgsContextHelp::run(context_id);
}
void QgsCopyrightLabelPluginGui::setEnabled(bool theBool)
{
cboxEnabled->setChecked(theBool);
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/copyright_label/plugingui.h
Expand Up @@ -33,9 +33,11 @@ Q_OBJECT;
public slots:
void on_pbnOK_clicked();
void on_pbnCancel_clicked();
void on_pbnHelp_clicked();
void setEnabled(bool);

private:
static const int context_id = 732921842;

signals:
//void drawRasterLayer(QString);
Expand Down
302 changes: 156 additions & 146 deletions src/plugins/copyright_label/pluginguibase.ui
Expand Up @@ -20,93 +20,12 @@
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>10</number>
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item rowspan="4" row="0" column="1" >
<widget class="Line" name="line1" >
<property name="maximumSize" >
<size>
<width>2</width>
<height>32767</height>
</size>
</property>
<property name="frameShape" >
<enum>QFrame::VLine</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item rowspan="4" row="0" column="0" >
<widget class="QLabel" name="pixmapLabel2" >
<property name="maximumSize" >
<size>
<width>150</width>
<height>32767</height>
</size>
</property>
<property name="pixmap" >
<pixmap resource="copyright_plugin.qrc" >:/copyright.png</pixmap>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="Q3TextEdit" name="textEdit2" >
<property name="lineWidth" >
<number>1</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; />&lt;/head>&lt;body style=&quot;font-size:10pt;font-family:helvetica&quot;>
&lt;p style=&quot;margin-top:18px&quot;>&lt;span style=&quot;font-size:19pt;font-weight:600&quot;>Description&lt;/span>&lt;/p>
&lt;p>Enter your copyright label below. This plugin supports basic html markup tags for formatting the label. For example:&lt;/p>
&lt;p>&lt;span style=&quot;font-family:Courier New&quot;>&amp;lt;B&amp;gt; &lt;/span>&lt;span style=&quot;font-family:Courier New;font-weight:600&quot;>Bold text&lt;/span>&lt;span style=&quot;font-family:Courier New&quot;> &amp;lt;/B&amp;gt;&lt;br />&amp;lt;I&amp;gt; &lt;/span>&lt;span style=&quot;font-family:Courier New;font-style:italic&quot;>Italics&lt;/span>&lt;span style=&quot;font-family:Courier New&quot;> &amp;lt;/I&amp;gt;&lt;/span>&lt;/p>
&lt;/body>&lt;/html>
</string>
</property>
<property name="wordWrap" >
<enum>Q3TextEdit::WidgetWidth</enum>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2" >
<widget class="Q3TextEdit" name="txtCopyrightText" >
<property name="frameShape" >
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth" >
<number>1</number>
</property>
<property name="textFormat" >
<enum>Qt::PlainText</enum>
</property>
<property name="text" >
<string>© QGIS 20056</string>
</property>
<property name="wordWrap" >
<enum>Q3TextEdit::WidgetWidth</enum>
</property>
</widget>
</item>
<item row="2" column="2" >
<item row="4" column="0" colspan="3" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
Expand All @@ -115,55 +34,49 @@
<number>6</number>
</property>
<item>
<widget class="QLabel" name="textLabel16" >
<widget class="QPushButton" name="pbnHelp" >
<property name="text" >
<string>Placement</string>
<string>Help</string>
</property>
<property name="shortcut" >
<string>Alt+O</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cboPlacement" >
<item>
<property name="text" >
<string>Bottom Left</string>
</property>
</item>
<item>
<property name="text" >
<string>Top Left</string>
</property>
</item>
<item>
<property name="text" >
<string>Bottom Right</string>
</property>
</item>
<item>
<property name="text" >
<string>Top Right</string>
</property>
</item>
</widget>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>281</width>
<height>26</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="textLabel15" >
<widget class="QPushButton" name="pbnOK" >
<property name="text" >
<string>Orientation</string>
<string>&amp;OK</string>
</property>
<property name="shortcut" >
<string>Alt+O</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cboOrientation" >
<item>
<property name="text" >
<string>Horizontal</string>
</property>
</item>
<item>
<property name="text" >
<string>Vertical</string>
</property>
</item>
<widget class="QPushButton" name="pbnCancel" >
<property name="text" >
<string>&amp;Cancel</string>
</property>
<property name="shortcut" >
<string>Alt+C</string>
</property>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -204,7 +117,7 @@
</item>
</layout>
</item>
<item row="4" column="0" colspan="3" >
<item row="2" column="2" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
Expand All @@ -213,43 +126,140 @@
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>400</width>
<height>21</height>
</size>
<widget class="QLabel" name="textLabel16" >
<property name="text" >
<string>Placement</string>
</property>
</spacer>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbnOK" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="shortcut" >
<string>Alt+O</string>
</property>
<widget class="QComboBox" name="cboPlacement" >
<item>
<property name="text" >
<string>Bottom Left</string>
</property>
</item>
<item>
<property name="text" >
<string>Top Left</string>
</property>
</item>
<item>
<property name="text" >
<string>Bottom Right</string>
</property>
</item>
<item>
<property name="text" >
<string>Top Right</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbnCancel" >
<widget class="QLabel" name="textLabel15" >
<property name="text" >
<string>&amp;Cancel</string>
</property>
<property name="shortcut" >
<string>Alt+C</string>
<string>Orientation</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cboOrientation" >
<item>
<property name="text" >
<string>Horizontal</string>
</property>
</item>
<item>
<property name="text" >
<string>Vertical</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="1" column="2" >
<widget class="Q3TextEdit" name="txtCopyrightText" >
<property name="frameShape" >
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth" >
<number>1</number>
</property>
<property name="textFormat" >
<enum>Qt::PlainText</enum>
</property>
<property name="text" >
<string>© QGIS 20056</string>
</property>
<property name="wordWrap" >
<enum>Q3TextEdit::WidgetWidth</enum>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="Q3TextEdit" name="textEdit2" >
<property name="lineWidth" >
<number>1</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style="font-size:10pt;font-family:helvetica">
&lt;p style="margin-top:18px">&lt;span style="font-size:19pt;font-weight:600">Description&lt;/span>&lt;/p>
&lt;p>Enter your copyright label below. This plugin supports basic html markup tags for formatting the label. For example:&lt;/p>
&lt;p>&lt;span style="font-family:Courier New">&amp;lt;B&amp;gt; &lt;/span>&lt;span style="font-family:Courier New;font-weight:600">Bold text&lt;/span>&lt;span style="font-family:Courier New"> &amp;lt;/B&amp;gt;&lt;br />&amp;lt;I&amp;gt; &lt;/span>&lt;span style="font-family:Courier New;font-style:italic">Italics&lt;/span>&lt;span style="font-family:Courier New"> &amp;lt;/I&amp;gt;&lt;/span>&lt;/p>
&lt;/body>&lt;/html>
</string>
</property>
<property name="wordWrap" >
<enum>Q3TextEdit::WidgetWidth</enum>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
<item rowspan="4" row="0" column="0" >
<widget class="QLabel" name="pixmapLabel2" >
<property name="maximumSize" >
<size>
<width>150</width>
<height>32767</height>
</size>
</property>
<property name="pixmap" >
<pixmap resource="copyright_plugin.qrc" >:/copyright.png</pixmap>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
</item>
<item rowspan="4" row="0" column="1" >
<widget class="Line" name="line1" >
<property name="maximumSize" >
<size>
<width>2</width>
<height>32767</height>
</size>
</property>
<property name="frameShape" >
<enum>QFrame::VLine</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
Expand Down

0 comments on commit 0209a89

Please sign in to comment.