Skip to content

Commit f3d2a25

Browse files
author
g_j_m
committed
Fix for ticket #404 (print composer needs a help button).
git-svn-id: http://svn.osgeo.org/qgis/trunk@6164 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9ca4093 commit f3d2a25

File tree

4 files changed

+55
-19
lines changed

4 files changed

+55
-19
lines changed

resources/context_help/contextids.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
1033030847_en_US QgsDelimitedTextPluginGui
1111
863656587_en_US QgsMapserverExport
1212
94000531_en_US QgsVectorLayerProperties
13+
1212121212_en_US QgsComposer

src/composer/qgscomposer.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "qgsexception.h"
2424
#include "qgsproject.h"
2525
#include "qgsmessageviewer.h"
26+
#include "qgscontexthelp.h"
2627

2728
#include <QDesktopWidget>
2829
#include <QFileDialog>
@@ -86,6 +87,8 @@ QgsComposer::QgsComposer( QgisApp *qgis): QMainWindow()
8687
restoreWindowState();
8788

8889
selectItem(); // Set selection tool
90+
91+
statusBar()->setHidden(true);
8992
}
9093

9194
QgsComposer::~QgsComposer()
@@ -839,6 +842,16 @@ void QgsComposer::restoreWindowState()
839842
mSplitter->setSizes ( list );
840843
}
841844

845+
void QgsComposer::on_helpPButton_clicked()
846+
{
847+
QgsContextHelp::run(context_id);
848+
}
849+
850+
void QgsComposer::on_closePButton_clicked()
851+
{
852+
close();
853+
}
854+
842855
void QgsComposer::projectRead(void)
843856
{
844857
#ifdef QGISDEBUG

src/composer/qgscomposer.h

+10
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ public slots:
146146
//! Save window state
147147
void saveWindowState();
148148

149+
//! Slot for when the help button is clicked
150+
void on_helpPButton_clicked();
151+
152+
//! Slot for when the close button is clicked
153+
void on_closePButton_clicked();
154+
149155
private:
150156
//! Set teh pixmap / icons on the toolbar buttons
151157
void setupTheme();
@@ -175,6 +181,10 @@ public slots:
175181

176182
//! Layout
177183
QGridLayout *mItemOptionsLayout;
184+
185+
//! Help context id
186+
static const int context_id = 1212121212; // CHANGE ME PLEASE GARY :)
187+
178188
};
179189

180190
#endif

src/ui/qgscomposerbase.ui

+31-19
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<ui version="4.0" >
2-
<author></author>
3-
<comment></comment>
4-
<exportmacro></exportmacro>
52
<class>QgsComposerBase</class>
63
<widget class="QMainWindow" name="QgsComposerBase" >
74
<property name="geometry" >
85
<rect>
96
<x>0</x>
107
<y>0</y>
118
<width>800</width>
12-
<height>600</height>
9+
<height>609</height>
1310
</rect>
1411
</property>
1512
<property name="windowTitle" >
@@ -23,7 +20,7 @@
2320
<property name="spacing" >
2421
<number>6</number>
2522
</property>
26-
<item row="0" column="0" >
23+
<item row="0" column="0" colspan="3" >
2724
<widget class="QSplitter" name="mSplitter" >
2825
<property name="sizePolicy" >
2926
<sizepolicy>
@@ -195,18 +192,36 @@
195192
</widget>
196193
</widget>
197194
</item>
195+
<item row="1" column="2" >
196+
<widget class="QPushButton" name="closePButton" >
197+
<property name="text" >
198+
<string>Close</string>
199+
</property>
200+
</widget>
201+
</item>
202+
<item row="1" column="0" >
203+
<widget class="QPushButton" name="helpPButton" >
204+
<property name="text" >
205+
<string>Help</string>
206+
</property>
207+
</widget>
208+
</item>
209+
<item row="1" column="1" >
210+
<spacer>
211+
<property name="orientation" >
212+
<enum>Qt::Horizontal</enum>
213+
</property>
214+
<property name="sizeHint" >
215+
<size>
216+
<width>40</width>
217+
<height>20</height>
218+
</size>
219+
</property>
220+
</spacer>
221+
</item>
198222
</layout>
199223
</widget>
200-
<widget class="QStatusBar" name="statusbar" >
201-
<property name="geometry" >
202-
<rect>
203-
<x>0</x>
204-
<y>578</y>
205-
<width>800</width>
206-
<height>22</height>
207-
</rect>
208-
</property>
209-
</widget>
224+
<widget class="QStatusBar" name="statusbar" />
210225
<widget class="QToolBar" name="toolBar" >
211226
<property name="orientation" >
212227
<enum>Qt::Horizontal</enum>
@@ -227,7 +242,6 @@
227242
<addaction name="separator" />
228243
<addaction name="mActionAddNewMap" />
229244
<addaction name="mActionAddNewLabel" />
230-
<addaction name="mActionAddImage" />
231245
<addaction name="mActionAddNewVectLegend" />
232246
<addaction name="mActionAddNewScalebar" />
233247
<addaction name="mActionSelectMoveItem" />
@@ -353,14 +367,12 @@
353367
</property>
354368
</action>
355369
</widget>
356-
<pixmapfunction></pixmapfunction>
357370
<customwidgets>
358371
<customwidget>
359372
<class>Q3Frame</class>
360-
<extends></extends>
373+
<extends>QFrame</extends>
361374
<header>Qt3Support/Q3Frame</header>
362375
<container>1</container>
363-
<pixmap></pixmap>
364376
</customwidget>
365377
</customwidgets>
366378
<tabstops>

0 commit comments

Comments
 (0)