Skip to content

Commit

Permalink
Changes to get about box to work with qt4
Browse files Browse the repository at this point in the history
Replaced all qt3 widgets with qt4 ones
Added tr() to some displayed text
Tweak the display of author's photos so that a photo is visible
when the author tab is first selected


git-svn-id: http://svn.osgeo.org/qgis/trunk@4491 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jan 7, 2006
1 parent 4f3cf2f commit ed654c4
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 256 deletions.
30 changes: 17 additions & 13 deletions src/qgsabout.cpp
Expand Up @@ -14,15 +14,15 @@
* (at your option) any later version. *
* *
***************************************************************************/
/* $Id:$ */
/* $Id$ */

#include "qgsabout.h"
#include "qgsapplication.h"
#ifdef Q_OS_MACX
#include <ApplicationServices/ApplicationServices.h>
#else
#include <QInputDialog>
#include <Q3Process>
#include <QProcess>
#include <QSettings>
#endif
#include <QFile>
Expand Down Expand Up @@ -70,6 +70,7 @@ void QgsAbout::init()
QStringList myTokens = QStringList::split("\t",line);
//printf ("Added contributor name to listbox: %s ",myTokens[0]);
lines += myTokens[0];

// add the image to the map
/* Uncomment this block to preload the images (takes time at initial startup)
QString authorName = myTokens[0].replace(" ","_");
Expand All @@ -82,7 +83,11 @@ void QgsAbout::init()
}
file.close();
listBox1->clear();
listBox1->insertStringList(lines,0);
listBox1->insertItems(0, lines);

// Load in the image for the first author
if (listBox1->count() > 0)
listBox1->setCurrentRow(0);
}

}
Expand Down Expand Up @@ -112,13 +117,13 @@ void QgsAbout::on_buttonCancel_clicked()
reject();
}

void QgsAbout::on_listBox1_currentChanged(Q3ListBoxItem *theItem)
void QgsAbout::on_listBox1_currentItemChanged(QListWidgetItem *theItem)
{
//replace spaces in author name
#ifdef QGISDEBUG
printf ("Loading mug: ");
#endif
QString myString = listBox1->currentText();
QString myString = listBox1->currentItem()->text();
myString = myString.replace(" ","_");
#ifdef QGISDEBUG
printf ("Loading mug: %s", (const char *)myString.toLocal8Bit().data());
Expand Down Expand Up @@ -166,10 +171,11 @@ void QgsAbout::openUrl(QString url)
{
// ask user for browser and use it
bool ok;
QString text = QInputDialog::getText("QGIS Browser Selection",
"Enter the name of a web browser to use (eg. konqueror).\n"
"Enter the full path if the browser is not in your PATH.\n"
"You can change this option later by selection Options from the Tools menu.",
QString text = QInputDialog::getText(tr("QGIS Browser Selection"),
tr("Enter the name of a web browser to use (eg. konqueror).\n"
"Enter the full path if the browser is not in your PATH.\n"
"You can change this option later by selection Options from"
" the Tools menu."),
QLineEdit::Normal,
QString::null, &ok, this);
if (ok && !text.isEmpty())
Expand All @@ -188,10 +194,8 @@ void QgsAbout::openUrl(QString url)
// find the installed location of the help files
// open index.html using browser
//XXX for debug on win32 QMessageBox::information(this, "Help opening...", browser + " - " + url);
Q3Process *helpProcess = new Q3Process(this);
helpProcess->addArgument(browser);
helpProcess->addArgument(url);
helpProcess->start();
QProcess *helpProcess = new QProcess(this);
helpProcess->start(browser, QStringList() << url);
}
#endif
/* mHelpViewer = new QgsHelpViewer(this,"helpviewer",false);
Expand Down
3 changes: 1 addition & 2 deletions src/qgsabout.h
Expand Up @@ -19,7 +19,6 @@
#define QGSABOUT_H

#include "ui_qgsabout.h"
#include <QDialog>

class QgsAbout : public QDialog, private Ui::QgsAbout
{
Expand All @@ -38,7 +37,7 @@ class QgsAbout : public QDialog, private Ui::QgsAbout

private slots:
void on_buttonCancel_clicked();
void on_listBox1_currentChanged(Q3ListBoxItem *theItem);
void on_listBox1_currentItemChanged(QListWidgetItem *theItem);
void on_btnQgisUser_clicked();
void on_btnQgisHome_clicked();
};
Expand Down

0 comments on commit ed654c4

Please sign in to comment.