~ubuntu-branches/ubuntu/quantal/qgis/quantal

« back to all changes in this revision

Viewing changes to plugins/scale_bar/plugingui.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
 
 *   Copyright (C) 2003 by Tim Sutton                                      *
3
 
 *   tim@linfiniti.com                                                     *
4
 
 *                                                                         *
5
 
 *   This is a plugin generated from the QGIS plugin template              *
6
 
 *                                                                         *
7
 
 *   This program is free software; you can redistribute it and/or modify  *
8
 
 *   it under the terms of the GNU General Public License as published by  *
9
 
 *   the Free Software Foundation; either version 2 of the License, or     *
10
 
 *   (at your option) any later version.                                   *
11
 
 ***************************************************************************/
12
 
#include "plugingui.h"
13
 
#include <qcombobox.h>
14
 
#include <qspinbox.h> 
15
 
#include <qcheckbox.h> 
16
 
 
17
 
QgsScaleBarPluginGui::QgsScaleBarPluginGui() : QgsScaleBarPluginGuiBase()
18
 
{
19
 
  
20
 
}
21
 
 
22
 
QgsScaleBarPluginGui::QgsScaleBarPluginGui( QWidget* parent , const char* name , bool modal , WFlags fl  )
23
 
: QgsScaleBarPluginGuiBase( parent, name, modal, fl )
24
 
{
25
 
   
26
 
}  
27
 
QgsScaleBarPluginGui::~QgsScaleBarPluginGui()
28
 
{
29
 
}
30
 
 
31
 
void QgsScaleBarPluginGui::pbnOK_clicked()
32
 
{
33
 
  hide();
34
 
  emit changePlacement(cboPlacement->currentText());
35
 
  emit changePreferredSize(spnSize->value());
36
 
  emit changeSnapping(chkSnapping->isChecked());
37
 
  emit changeEnabled(chkEnable->isChecked());
38
 
  emit changeStyle(cboStyle->currentText());
39
 
  emit changeColour(frameColour->paletteBackgroundColor());
40
 
  emit refreshCanvas();
41
 
  done(1);
42
 
43
 
void QgsScaleBarPluginGui::pbnCancel_clicked()
44
 
{
45
 
 close(1);
46
 
}
47
 
 
48
 
void QgsScaleBarPluginGui::setPlacement(QString thePlacementQString)
49
 
{
50
 
  cboPlacement->setCurrentText(tr(thePlacementQString));
51
 
}
52
 
 
53
 
void QgsScaleBarPluginGui::setPreferredSize(int thePreferredSize)
54
 
{
55
 
  spnSize->setValue(thePreferredSize);
56
 
}
57
 
 
58
 
void QgsScaleBarPluginGui::setSnapping(bool theSnapping)
59
 
{
60
 
  chkSnapping->setChecked(theSnapping);
61
 
}
62
 
void QgsScaleBarPluginGui::setEnabled(bool theBool)
63
 
{
64
 
  chkEnable->setChecked(theBool);
65
 
}
66
 
 
67
 
void QgsScaleBarPluginGui::setStyle(QString theStyleQString)
68
 
{
69
 
  if ((tr(theStyleQString))==tr("Tick Down"))
70
 
  {
71
 
    cboStyle->setCurrentItem(0);
72
 
  }
73
 
  else if ((tr(theStyleQString))==tr("Tick Up"))
74
 
  {
75
 
    cboStyle->setCurrentItem(1);
76
 
  }
77
 
  else if ((tr(theStyleQString))==tr("Box"))
78
 
  {
79
 
    cboStyle->setCurrentItem(2);
80
 
  }
81
 
  else if ((tr(theStyleQString))==tr("Bar"))
82
 
  {
83
 
    cboStyle->setCurrentItem(3);
84
 
  }
85
 
}
86
 
 
87
 
void QgsScaleBarPluginGui::setColour(QColor theQColor)
88
 
{
89
 
  frameColour->setPaletteBackgroundColor(theQColor);
90
 
}