@@ -35,6 +35,7 @@ email : tim@linfiniti.com
35
35
#include < Q3SimpleRichText>
36
36
#include < QPainter>
37
37
#include < QMenu>
38
+ #include < QDate>
38
39
39
40
// non qt includes
40
41
#include < iostream>
@@ -103,10 +104,15 @@ void QgsCopyrightLabelPlugin::projectRead()
103
104
std::cout << " +++++++++ Copyright plugin - project read slot called...." << std::endl;
104
105
#endif // default text to start with - try to fetch it from qgsproject
105
106
107
+ QDate now;
108
+ QString defString;
106
109
107
- mQFont .setFamily (QgsProject::instance ()->readEntry (" CopyrightLabel" ," /FontName" ," Arial" ));
108
- mQFont .setPointSize (QgsProject::instance ()->readNumEntry (" CopyrightLabel" ," /FontSize" ,14 ));
109
- mLabelQString = QgsProject::instance ()->readEntry (" CopyrightLabel" ," /Label" ," © QGIS 2006" );
110
+ now = QDate::currentDate ();
111
+ defString = " © QGIS " + now.toString (" yyyy" );
112
+
113
+ mQFont .setFamily (QgsProject::instance ()->readEntry (" CopyrightLabel" ," /FontName" ," Sans Serif" ));
114
+ mQFont .setPointSize (QgsProject::instance ()->readNumEntry (" CopyrightLabel" ," /FontSize" ,9 ));
115
+ mLabelQString = QgsProject::instance ()->readEntry (" CopyrightLabel" ," /Label" , defString);
110
116
mPlacementIndex = QgsProject::instance ()->readNumEntry (" CopyrightLabel" ," /Placement" ,3 );
111
117
mEnable = QgsProject::instance ()->readBoolEntry (" CopyrightLabel" ," /Enabled" ,true );
112
118
// todo - read & store state of font color
0 commit comments