Skip to content

Commit 99d1f4d

Browse files
author
gsherman
committedOct 28, 2006
Show sponsors in a tab in the about box
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6024 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent e1a2dd1 commit 99d1f4d

File tree

4 files changed

+65
-7
lines changed

4 files changed

+65
-7
lines changed
 

‎src/core/qgsapplication.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ const QString QgsApplication::authorsFilePath()
6969
{
7070
return mPkgDataPath + QString("/doc/AUTHORS");
7171
}
72-
72+
/*!
73+
Returns the path to the sponsors file.
74+
*/
75+
const QString QgsApplication::sponsorsFilePath()
76+
{
77+
return mPkgDataPath + QString("/doc/SPONSORS");
78+
}
7379
/*!
7480
Returns the path to the developer image directory.
7581
*/

‎src/core/qgsapplication.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class QgsApplication: public QApplication
3030
//! Returns the path to the authors file.
3131
static const QString authorsFilePath();
3232

33+
//! Returns the path to the sponsors file.
34+
static const QString sponsorsFilePath();
35+
3336
//! Returns the path to the developer image directory.
3437
static const QString developerPath();
3538

‎src/gui/qgsabout.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,28 @@ void QgsAbout::init()
9393
listBox1->setCurrentRow(0);
9494
}
9595

96+
// read the SPONSORS file and populate the text widget
97+
QFile sponsorFile(QgsApplication::sponsorsFilePath());
98+
#ifdef QGISDEBUG
99+
printf (("Reading sponsors file " + sponsorFile.name() +
100+
".............................................\n").toLocal8Bit().data());
101+
#endif
102+
if ( sponsorFile.open( QIODevice::ReadOnly ) ) {
103+
QString sponsorHTML = "<center>"
104+
+ tr("The following have sponsored QGIS by contributing money to fund development and other project costs")
105+
+ "</center>";
106+
QTextStream sponsorStream( &sponsorFile );
107+
QString sline;
108+
int i = 1;
109+
while ( !sponsorStream.atEnd() )
110+
{
111+
sline = sponsorStream.readLine(); // line of text excluding '\n'
112+
//ignore the line if it starts with a hash....
113+
if (sline.left(1)=="#") continue;
114+
sponsorHTML += sline + "<br>";
115+
}
116+
txtSponsors->setText(txtSponsors->text() + sponsorHTML);
117+
}
96118
}
97119

98120
void QgsAbout::setVersion(QString v)

‎src/ui/qgsabout.ui

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<ui version="4.0" >
2-
<author></author>
3-
<comment></comment>
4-
<exportmacro></exportmacro>
52
<class>QgsAbout</class>
63
<widget class="QDialog" name="QgsAbout" >
74
<property name="geometry" >
@@ -28,7 +25,7 @@
2825
<item row="0" column="0" >
2926
<widget class="QTabWidget" name="tabWidget" >
3027
<property name="currentIndex" >
31-
<number>0</number>
28+
<number>4</number>
3229
</property>
3330
<widget class="QWidget" name="Widget2" >
3431
<attribute name="title" >
@@ -100,7 +97,11 @@
10097
<item row="3" column="0" >
10198
<widget class="QTextEdit" name="lblUrls" >
10299
<property name="html" >
103-
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Arial; font-size:12pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p align='center' style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Sans Serif; font-size:9pt;">Quantum GIS is licensed under the GNU General Public License&lt;/p>&lt;p align='center' style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Sans Serif; font-size:9pt;">http://www.gnu.org/licenses&lt;/p>&lt;/body>&lt;/html></string>
100+
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
101+
p, li { white-space: pre-wrap; }
102+
&lt;/style>&lt;/head>&lt;body style=" font-family:'Arial'; font-size:12pt; font-weight:400; font-style:normal; text-decoration:none;">
103+
&lt;p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">Quantum GIS is licensed under the GNU General Public License&lt;/p>
104+
&lt;p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">http://www.gnu.org/licenses&lt;/p>&lt;/body>&lt;/html></string>
104105
</property>
105106
</widget>
106107
</item>
@@ -247,6 +248,33 @@
247248
</item>
248249
</layout>
249250
</widget>
251+
<widget class="QWidget" name="tab_2" >
252+
<attribute name="title" >
253+
<string>Sponsors</string>
254+
</attribute>
255+
<layout class="QGridLayout" >
256+
<property name="margin" >
257+
<number>9</number>
258+
</property>
259+
<property name="spacing" >
260+
<number>6</number>
261+
</property>
262+
<item row="0" column="0" >
263+
<widget class="QTextEdit" name="txtSponsors" >
264+
<property name="readOnly" >
265+
<bool>true</bool>
266+
</property>
267+
<property name="html" >
268+
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
269+
p, li { white-space: pre-wrap; }
270+
&lt;/style>&lt;/head>&lt;body style=" font-family:'Arial'; font-size:12pt; font-weight:400; font-style:normal; text-decoration:none;">
271+
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:16pt; font-weight:600;">Sponsors of Quantum GIS&lt;/span>&lt;/p>
272+
&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16pt; font-weight:600;">&lt;/p>&lt;/body>&lt;/html></string>
273+
</property>
274+
</widget>
275+
</item>
276+
</layout>
277+
</widget>
250278
</widget>
251279
</item>
252280
<item row="1" column="0" >
@@ -291,7 +319,6 @@
291319
</layout>
292320
</widget>
293321
<layoutdefault spacing="6" margin="11" />
294-
<pixmapfunction></pixmapfunction>
295322
<tabstops>
296323
<tabstop>tabWidget</tabstop>
297324
<tabstop>btnQgisUser</tabstop>

0 commit comments

Comments
 (0)