Skip to content

Commit

Permalink
Fix for ticket #404 (print composer needs a help button).
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6164 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Dec 1, 2006
1 parent 4b3c462 commit eaa6b39
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 19 deletions.
1 change: 1 addition & 0 deletions resources/context_help/contextids.txt
Expand Up @@ -10,3 +10,4 @@
1033030847_en_US QgsDelimitedTextPluginGui
863656587_en_US QgsMapserverExport
94000531_en_US QgsVectorLayerProperties
1212121212_en_US QgsComposer
13 changes: 13 additions & 0 deletions src/composer/qgscomposer.cpp
Expand Up @@ -23,6 +23,7 @@
#include "qgsexception.h"
#include "qgsproject.h"
#include "qgsmessageviewer.h"
#include "qgscontexthelp.h"

#include <QDesktopWidget>
#include <QFileDialog>
Expand Down Expand Up @@ -86,6 +87,8 @@ QgsComposer::QgsComposer( QgisApp *qgis): QMainWindow()
restoreWindowState();

selectItem(); // Set selection tool

statusBar()->setHidden(true);
}

QgsComposer::~QgsComposer()
Expand Down Expand Up @@ -839,6 +842,16 @@ void QgsComposer::restoreWindowState()
mSplitter->setSizes ( list );
}

void QgsComposer::on_helpPButton_clicked()
{
QgsContextHelp::run(context_id);
}

void QgsComposer::on_closePButton_clicked()
{
close();
}

void QgsComposer::projectRead(void)
{
#ifdef QGISDEBUG
Expand Down
10 changes: 10 additions & 0 deletions src/composer/qgscomposer.h
Expand Up @@ -146,6 +146,12 @@ public slots:
//! Save window state
void saveWindowState();

//! Slot for when the help button is clicked
void on_helpPButton_clicked();

//! Slot for when the close button is clicked
void on_closePButton_clicked();

private:
//! Set teh pixmap / icons on the toolbar buttons
void setupTheme();
Expand Down Expand Up @@ -175,6 +181,10 @@ public slots:

//! Layout
QGridLayout *mItemOptionsLayout;

//! Help context id
static const int context_id = 1212121212; // CHANGE ME PLEASE GARY :)

};

#endif
50 changes: 31 additions & 19 deletions src/ui/qgscomposerbase.ui
@@ -1,15 +1,12 @@
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>QgsComposerBase</class>
<widget class="QMainWindow" name="QgsComposerBase" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
<height>609</height>
</rect>
</property>
<property name="windowTitle" >
Expand All @@ -23,7 +20,7 @@
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<item row="0" column="0" colspan="3" >
<widget class="QSplitter" name="mSplitter" >
<property name="sizePolicy" >
<sizepolicy>
Expand Down Expand Up @@ -195,18 +192,36 @@
</widget>
</widget>
</item>
<item row="1" column="2" >
<widget class="QPushButton" name="closePButton" >
<property name="text" >
<string>Close</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QPushButton" name="helpPButton" >
<property name="text" >
<string>Help</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar" >
<property name="geometry" >
<rect>
<x>0</x>
<y>578</y>
<width>800</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar" />
<widget class="QToolBar" name="toolBar" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
Expand All @@ -227,7 +242,6 @@
<addaction name="separator" />
<addaction name="mActionAddNewMap" />
<addaction name="mActionAddNewLabel" />
<addaction name="mActionAddImage" />
<addaction name="mActionAddNewVectLegend" />
<addaction name="mActionAddNewScalebar" />
<addaction name="mActionSelectMoveItem" />
Expand Down Expand Up @@ -353,14 +367,12 @@
</property>
</action>
</widget>
<pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>Q3Frame</class>
<extends></extends>
<extends>QFrame</extends>
<header>Qt3Support/Q3Frame</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<tabstops>
Expand Down

0 comments on commit eaa6b39

Please sign in to comment.