~ubuntu-branches/ubuntu/hardy/qgis/hardy

« back to all changes in this revision

Viewing changes to src/qgslinestyledialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): William Grant
  • Date: 2007-05-06 13:42:32 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070506134232-pyli6t388w5asd8x
Tags: 0.8.0-3ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - debian/rules, debian/qgis.install, debian/qgis.dirs debian/qgis.desktop:
    Add and install .desktop.
* debian/qgis.desktop: Remove Applications category; it's not real.
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
                          qgslinestyledialog.cpp 
3
 
 Dialog for selecting vector line styles
4
 
                             -------------------
5
 
    begin                : 2004-02-12
6
 
    copyright            : (C) 2004 by Gary E.Sherman
7
 
    email                : sherman at mrcc.com
8
 
***************************************************************************/
9
 
 
10
 
/***************************************************************************
11
 
 *                                                                         *
12
 
 *   This program is free software; you can redistribute it and/or modify  *
13
 
 *   it under the terms of the GNU General Public License as published by  *
14
 
 *   the Free Software Foundation; either version 2 of the License, or     *
15
 
 *   (at your option) any later version.                                   *
16
 
 *                                                                         *
17
 
 ***************************************************************************/
18
 
 /* $Id: qgslinestyledialog.cpp,v 1.6 2004/03/06 12:11:04 mhugent Exp $ */
19
 
#include "qgslinestyledialog.h"
20
 
#include "qpushbutton.h"
21
 
#include <iostream>
22
 
#include "qgssymbologyutils.h"
23
 
 
24
 
QgsLineStyleDialog::QgsLineStyleDialog(QWidget * parent, const char *name, bool modal, WFlags fl):QgsLineStyleDialogBase(parent, name, modal,
25
 
                       fl)
26
 
{
27
 
  //load the icons stored in QgsSymbologyUtils.cpp (to avoid redundancy)
28
 
  solid->setPixmap(QgsSymbologyUtils::char2LinePixmap("SolidLine"));
29
 
  dash->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashLine"));
30
 
  dot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DotLine"));
31
 
  dashdot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashDotLine"));
32
 
  dashdotdot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashDotDotLine"));
33
 
  nopen->setPixmap(QgsSymbologyUtils::char2LinePixmap("NoPen"));
34
 
 
35
 
  QObject::connect(okbutton, SIGNAL(clicked()), this, SLOT(queryStyle()));
36
 
  QObject::connect(cancelbutton, SIGNAL(clicked()), this, SLOT(reject()));
37
 
  solid->toggle();              //solid style is the default
38
 
}
39
 
 
40
 
Qt::PenStyle QgsLineStyleDialog::style()
41
 
{
42
 
  return m_style;
43
 
}
44
 
 
45
 
void QgsLineStyleDialog::queryStyle()
46
 
{
47
 
  if (solid->isOn())
48
 
    {
49
 
      m_style = Qt::SolidLine;
50
 
    } 
51
 
  else if (dash->isOn())
52
 
    {
53
 
      m_style = Qt::DashLine;
54
 
    } 
55
 
  else if (dot->isOn())
56
 
    {
57
 
      m_style = Qt::DotLine;
58
 
    } 
59
 
  else if (dashdot->isOn())
60
 
    {
61
 
      m_style = Qt::DashDotLine;
62
 
    } 
63
 
  else if (dashdotdot->isOn())
64
 
    {
65
 
      m_style = Qt::DashDotDotLine;
66
 
    }
67
 
  else if (nopen->isOn())
68
 
    {
69
 
      m_style = Qt::NoPen;
70
 
    }
71
 
  accept();
72
 
}