mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@2227 c8812cc2-4d05-0410-92ff-de0c093fc19c
75 lines
2.3 KiB
C++
75 lines
2.3 KiB
C++
/***************************************************************************
|
|
qgsprojectproperties.cpp
|
|
Set various project properties (inherits qgsprojectpropertiesbase)
|
|
-------------------
|
|
begin : May 18, 2004
|
|
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$ */
|
|
|
|
#include "qgsprojectproperties.h"
|
|
|
|
|
|
#include <qbuttongroup.h>
|
|
#include <qlineedit.h>
|
|
|
|
#include "qgsproject.h"
|
|
|
|
|
|
QgsProjectProperties::QgsProjectProperties(QWidget *parent, const char *name)
|
|
: QgsProjectPropertiesBase(parent, name)
|
|
{
|
|
// out with the old
|
|
// QgsProject::instance()->mapUnits( QgsScaleCalculator::METERS );
|
|
// in with the new...
|
|
setMapUnits(QgsProject::instance()->mapUnits());
|
|
title(QgsProject::instance()->title());
|
|
}
|
|
|
|
QgsProjectProperties::~QgsProjectProperties()
|
|
{}
|
|
|
|
|
|
QgsScaleCalculator::units QgsProjectProperties::mapUnits() const
|
|
{
|
|
return QgsProject::instance()->mapUnits();
|
|
}
|
|
|
|
|
|
void QgsProjectProperties::mapUnitChange(int unit)
|
|
{
|
|
QgsProject::instance()->mapUnits(
|
|
static_cast<QgsScaleCalculator::units>(unit));
|
|
}
|
|
|
|
|
|
void QgsProjectProperties::setMapUnits(QgsScaleCalculator::units unit)
|
|
{
|
|
// select the button
|
|
btnGrpMapUnits->setButton(static_cast<int>(unit));
|
|
QgsProject::instance()->mapUnits(unit);
|
|
}
|
|
|
|
|
|
QString QgsProjectProperties::title() const
|
|
{
|
|
return titleEdit->text();
|
|
} // QgsProjectPropertires::title() const
|
|
|
|
|
|
void QgsProjectProperties::title( QString const & title )
|
|
{
|
|
titleEdit->setText( title );
|
|
QgsProject::instance()->title( title );
|
|
} // QgsProjectProperties::title( QString const & title )
|