Skip to content

Commit

Permalink
Made Copyright text take current year as default.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_8_0@6738 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Mar 1, 2007
1 parent b8637fa commit ed27b8f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/plugins/copyright_label/plugin.cpp
Expand Up @@ -34,6 +34,7 @@ email : tim@linfiniti.com
#include <Q3SimpleRichText>
#include <QPainter>
#include <QMenu>
#include <QDate>

//non qt includes
#include <iostream>
Expand Down Expand Up @@ -105,10 +106,15 @@ void QgsCopyrightLabelPlugin::projectRead()
std::cout << "+++++++++ Copyright plugin - project read slot called...." << std::endl;
#endif //default text to start with - try to fetch it from qgsproject

QDate now;
QString defString;

mQFont.setFamily(QgsProject::instance()->readEntry("CopyrightLabel","/FontName","Arial"));
mQFont.setPointSize(QgsProject::instance()->readNumEntry("CopyrightLabel","/FontSize",14));
mLabelQString = QgsProject::instance()->readEntry("CopyrightLabel","/Label","&copy; QGIS 2007");
now = QDate::currentDate();
defString = "&copy QGIS " + now.toString("yyyy");

mQFont.setFamily(QgsProject::instance()->readEntry("CopyrightLabel","/FontName","Sans Serif"));
mQFont.setPointSize(QgsProject::instance()->readNumEntry("CopyrightLabel","/FontSize",9));
mLabelQString = QgsProject::instance()->readEntry("CopyrightLabel","/Label", defString);
mPlacementIndex = QgsProject::instance()->readNumEntry("CopyrightLabel","/Placement",3);
mEnable = QgsProject::instance()->readBoolEntry("CopyrightLabel","/Enabled",true);
// todo - read & store state of font color
Expand Down

0 comments on commit ed27b8f

Please sign in to comment.