@@ -100,20 +100,58 @@ void QgsAbout::init()
100
100
" .............................................\n " ).toLocal8Bit ().data ());
101
101
#endif
102
102
if ( sponsorFile.open ( QIODevice::ReadOnly ) ) {
103
- QString sponsorHTML = " <center>"
103
+ QString sponsorHTML = " <html><body><h2>"
104
+ + tr (" QGIS Sponsors" ) + " </h2><center>"
105
+
104
106
+ tr (" The following have sponsored QGIS by contributing money to fund development and other project costs" )
105
- + " </center>" ;
107
+ + " </center><hr>"
108
+ + " <table border='1' cellpadding='1' width='100%'>"
109
+ + " <tr><th>" + tr (" Name" ) + " </th><th>" + tr (" Website" ) + " </th>"
110
+ + " <th></th>"
111
+ + " </th><th>" + tr (" Name" ) + " </th><th>" + tr (" Website" ) + " </th></tr>" ;
112
+ QString website;
106
113
QTextStream sponsorStream ( &sponsorFile );
107
114
QString sline;
108
- int i = 1 ;
115
+ int count = 0 ;
109
116
while ( !sponsorStream.atEnd () )
110
117
{
111
118
sline = sponsorStream.readLine (); // line of text excluding '\n'
112
119
// ignore the line if it starts with a hash....
113
120
if (sline.left (1 )==" #" ) continue ;
114
- sponsorHTML += sline + " <br>" ;
121
+ count++;
122
+ QStringList myTokens = QStringList::split (" |" ,sline);
123
+ if (myTokens.size () > 1 )
124
+ {
125
+ website = myTokens[1 ];
126
+ }
127
+ else
128
+ {
129
+ website = " " ;
130
+ }
131
+ if (count == 1 ){
132
+ sponsorHTML += " <tr>" ;
133
+ }
134
+ if (count == 2 )
135
+ {
136
+ // a spacer between donator columns
137
+ sponsorHTML += " <td></td>" ;
138
+ }
139
+ sponsorHTML += " <td>" + myTokens[0 ] + " </td><td>" + website + " </td>" ;
140
+ if (count == 2 ){
141
+ // close the row
142
+ sponsorHTML += " </tr>" ;
143
+ count = 0 ;
144
+ }
145
+
115
146
}
116
- txtSponsors->setText (txtSponsors->text () + sponsorHTML);
147
+ sponsorHTML += " </table></body></html>" ;
148
+
149
+ txtSponsors->setAcceptRichText (true );
150
+ txtSponsors->setHtml (sponsorHTML);
151
+ #ifdef QGISDEBUG
152
+ std::cout << " sponsorHTML:" << sponsorHTML.ascii () << std::endl;
153
+ std::cout << " txtSponsors:" << txtSponsors->toHtml ().ascii () << std::endl;
154
+ #endif
117
155
}
118
156
}
119
157
0 commit comments