From ee5d6ac313dcc7657e6c8d060565dba782a313da Mon Sep 17 00:00:00 2001 From: mhugent Date: Fri, 30 Jan 2004 10:35:34 +0000 Subject: [PATCH] added line style icons. todo: use line style and pattern icons also in the renderer dialogs git-svn-id: http://svn.osgeo.org/qgis/trunk@646 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/qgisapp.cpp | 2 +- src/qgshelpviewer.cpp | 74 +++++++++++++++++++++++------------ src/qgshelpviewer.h | 43 ++++++++++---------- src/qgslinestyledialogbase.ui | 46 ++++++++++++++++++---- 4 files changed, 111 insertions(+), 54 deletions(-) diff --git a/src/qgisapp.cpp b/src/qgisapp.cpp index ab41b6e2f0b..2ab25daf488 100644 --- a/src/qgisapp.cpp +++ b/src/qgisapp.cpp @@ -1374,7 +1374,7 @@ void QgisApp::helpContents(){ // find the installed location of the help files // open index.html using browser helpViewer = new QgsHelpViewer(this,"helpviewer",false); - helpViewer->showContent(appDir +"/share/doc","index.html"); + //helpViewer->showContent(appDir +"/share/doc","index.html"); helpViewer->show(); } /** Get a pointer to the currently selected map layer */ diff --git a/src/qgshelpviewer.cpp b/src/qgshelpviewer.cpp index 84118060eba..761d5ffc793 100644 --- a/src/qgshelpviewer.cpp +++ b/src/qgshelpviewer.cpp @@ -1,22 +1,11 @@ - -/*************************************************************************** - qgshelpviewer.cpp - Simple help browser - ------------------- - begin : 2004-01-28 - copyright : (C) 2004 by Gary E.Sherman - email : sherman at mrcc.com -***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - /* $Id$ */ +/**************************************************************************** +** Form implementation generated from reading ui file 'qgshelpviewer.ui' +** +** Created: Fre Jan 30 07:58:59 2004 +** by: The User Interface Compiler ($Id$) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ #include "qgshelpviewer.h" @@ -27,10 +16,40 @@ #include #include +/* + * Constructs a QgsHelpViewer as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + * + * The dialog will by default be modeless, unless you set 'modal' to + * TRUE to construct a modal dialog. + */ QgsHelpViewer::QgsHelpViewer( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QgsHelpViewerBase( parent, name, modal, fl ) + : QDialog( parent, name, modal, fl ) { - + if ( !name ) + setName( "QgsHelpViewer" ); + setSizeGripEnabled( TRUE ); + QgsHelpViewerLayout = new QGridLayout( this, 1, 1, 2, 0, "QgsHelpViewerLayout"); + + Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); + Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout1->addItem( Horizontal_Spacing2 ); + + buttonCancel = new QPushButton( this, "buttonCancel" ); + buttonCancel->setAutoDefault( TRUE ); + Layout1->addWidget( buttonCancel ); + + QgsHelpViewerLayout->addLayout( Layout1, 1, 0 ); + + textBrowser = new QTextBrowser( this, "textBrowser" ); + + QgsHelpViewerLayout->addWidget( textBrowser, 0, 0 ); + languageChange(); + resize( QSize(511, 574).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); } /* @@ -40,8 +59,15 @@ QgsHelpViewer::~QgsHelpViewer() { // no need to delete child widgets, Qt does it all for us } -void QgsHelpViewer::showContent(QString path, QString doc){ - textBrowser->mimeSourceFactory()->addFilePath(path); - textBrowser->setSource(doc); + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void QgsHelpViewer::languageChange() +{ + setCaption( tr( "QGIS Help" ) ); + buttonCancel->setText( tr( "&Close" ) ); + buttonCancel->setAccel( QKeySequence( tr( "Alt+C" ) ) ); } diff --git a/src/qgshelpviewer.h b/src/qgshelpviewer.h index 71e9d15929e..25edc76f20f 100644 --- a/src/qgshelpviewer.h +++ b/src/qgshelpviewer.h @@ -1,21 +1,11 @@ -/*************************************************************************** - qgshelpviewer.h - Simple help browser - ------------------- - begin : 2004-01-28 - copyright : (C) 2004 by Gary E.Sherman - email : sherman at mrcc.com -***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - /* $Id$ */ +/**************************************************************************** +** Form interface generated from reading ui file 'qgshelpviewer.ui' +** +** Created: Fre Jan 30 07:57:36 2004 +** by: The User Interface Compiler ($Id$) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ #ifndef QGSHELPVIEWER_H #define QGSHELPVIEWER_H @@ -26,19 +16,28 @@ class QVBoxLayout; class QHBoxLayout; class QGridLayout; +class QSpacerItem; class QPushButton; class QTextBrowser; -class QString; -#include "qgshelpviewerbase.h" -class QgsHelpViewer : public QgsHelpViewerBase + +class QgsHelpViewer : public QDialog { Q_OBJECT public: QgsHelpViewer( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~QgsHelpViewer(); - void showContent(QString path, QString doc); + QPushButton* buttonCancel; + QTextBrowser* textBrowser; + +protected: + QGridLayout* QgsHelpViewerLayout; + QHBoxLayout* Layout1; + QSpacerItem* Horizontal_Spacing2; + +protected slots: + virtual void languageChange(); }; diff --git a/src/qgslinestyledialogbase.ui b/src/qgslinestyledialogbase.ui index 3aa38dd7c67..5e3b6b5aab0 100644 --- a/src/qgslinestyledialogbase.ui +++ b/src/qgslinestyledialogbase.ui @@ -8,8 +8,8 @@ 0 0 - 354 - 219 + 327 + 242 @@ -38,7 +38,10 @@ solid - solid + + + + image0 true @@ -49,7 +52,10 @@ dash - dash + + + + image1 true @@ -60,7 +66,10 @@ dot - dot + + + + image2 true @@ -71,7 +80,10 @@ dashdot - dashdot + + + + image3 true @@ -82,7 +94,10 @@ dashdotdot - dashdotdot + + + + image4 true @@ -142,5 +157,22 @@ + + + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232335030325330513054d2e1524a544856f0cbcf4b05b19591d87a48ec24205bd90008924dc152cae443b0957ae4c351fb47ed4fa2000c07fd031dfea3f68fda3f60f6d75a7301002beea187 + + + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232335030325330513054d2e1524a544856f0cbcf4b05b19591d87a48ec24205bd90008924dc152cae443b0957ae4c351fb47eda7d4fe242400361559006c0b6e15e8fac1a6220b806dc1ad6230d83fd0e13f6affa8fd64db5f6bcd0500ea7197ed + + + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232335030325330513054d2e1524a544856f0cbcf4b05b19591d87a48ec24205bd90008924dc152cae443b0957ae4c351fb47eda7d4fe24200099450e0dd30f328b1c7a30d83fd0e13f6affa8fd64db5f6bcd0500a41b8f27 + + + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232335030325330513054d2e1524a544856f0cbcf4b05b19591d87a48ec24205bd90008924dc152cae443b0957ae4c351fb47eda7d4fe24240032139926248eae1f6426324d487c30d83fd0e13f6affa8fd64db5f6bcd0500f2ce9707 + + + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232335030325330553054d2e1524a544856f0cbcf4b05b19591d87a486ca0190aca0640906c0ae22681b869600056a94c3e04bb408f7c386affa8fd49140070ea46022033b1d1b8e4d1f583fc848dc6253f18ec1feaf13f6aff08b6bfd69a0b00d61fa689 + +