HelpDialog.cpp   HelpDialog.cpp 
skipping to change at line 20 skipping to change at line 20
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "config.h"
#include <QString> #include <QString>
#include <QTextBrowser> #include <QTextBrowser>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QWidget> #include <QWidget>
#include <QFrame> #include <QFrame>
#include <QSettings>
#include <QResizeEvent> #include <QResizeEvent>
#include <QSize> #include <QSize>
#include <QMultiMap> #include <QMultiMap>
#include <QList> #include <QList>
#include <QSet> #include <QSet>
#include <QPair> #include <QPair>
#include <QtAlgorithms> #include <QtAlgorithms>
#include <QDebug> #include <QDebug>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QFileInfo>
#include <QFile>
#include <QDir>
#include <QProcess>
#include <QSysInfo>
#include "ui_helpDialogGui.h" #include "ui_helpDialogGui.h"
#include "HelpDialog.hpp" #include "HelpDialog.hpp"
#include "StelUtils.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelGui.hpp" #include "StelGui.hpp"
#include "StelGuiItems.hpp" #include "StelGuiItems.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelLogger.hpp" #include "StelLogger.hpp"
#include "StelShortcutGroup.hpp"
#include "StelShortcutMgr.hpp"
#include "StelStyle.hpp" #include "StelStyle.hpp"
#include "StelActionMgr.hpp"
#include "StelJsonParser.hpp"
HelpDialog::HelpDialog() : keyMgr(0) HelpDialog::HelpDialog(QObject* parent)
: StelDialog(parent)
, updateState(CompleteNoUpdates)
, downloadMgr(NULL)
{ {
ui = new Ui_helpDialogForm; ui = new Ui_helpDialogForm;
keyMgr = StelApp::getInstance().getStelShortcutManager();
Q_ASSERT(keyMgr); conf = StelApp::getInstance().getSettings();
setUpdatesEnabled(conf->value("main/check_updates_enabled", true).to
Bool()); // Enable check for updates by default
QString lang = conf->value("localization/app_locale", "en").toString
();
if (lang=="system" || lang=="C")
lang = "en";
updateUrl = QString("http://www.stellarium.org/%1/updates.php").arg(
lang);
currentVersion = StelUtils::getApplicationVersion();
conf->setValue("main/check_updates_enabled", getUpdatesEnabled());
} }
HelpDialog::~HelpDialog() HelpDialog::~HelpDialog()
{ {
delete ui; delete ui;
ui = NULL; ui = NULL;
} }
void HelpDialog::retranslate() void HelpDialog::retranslate()
{ {
skipping to change at line 78 skipping to change at line 97
} }
void HelpDialog::styleChanged() void HelpDialog::styleChanged()
{ {
if (dialog) if (dialog)
{ {
updateText(); updateText();
} }
} }
void HelpDialog::updateIconsColor()
{
QPixmap pixmap(50, 50);
QStringList icons;
icons << "help" << "info" << "logs";
bool redIcon = false;
if (StelApp::getInstance().getVisionModeNight())
redIcon = true;
foreach(const QString &iconName, icons)
{
pixmap.load(":/graphicGui/tabicon-" + iconName +".png");
if (redIcon)
pixmap = StelButton::makeRed(pixmap);
ui->stackListWidget->item(icons.indexOf(iconName))->setIcon(
QIcon(pixmap));
}
}
void HelpDialog::createDialogContent() void HelpDialog::createDialogContent()
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate())); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate()));
connect(&StelApp::getInstance(), SIGNAL(colorSchemeChanged(QString)) , this, SLOT(updateIconsColor()));
ui->stackedWidget->setCurrentIndex(0); ui->stackedWidget->setCurrentIndex(0);
updateIconsColor();
ui->stackListWidget->setCurrentRow(0); ui->stackListWidget->setCurrentRow(0);
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
setUpdatesMessage(false);
if (getUpdatesEnabled())
{
StelFileMgr::makeSureDirExistsAndIsWritable(StelFileMgr::get
UserDir()+"/data");
jsonDataPath = StelFileMgr::findFile("data", (StelFileMgr::F
lags)(StelFileMgr::Directory|StelFileMgr::Writable)) + "/updates.json";
// If the json file does not already exist, create it from t
he resource in the Qt resource
if(!QFileInfo(jsonDataPath).exists())
{
//qDebug() << "HelpDialog::createDialogContent() upd
ates.json does not exist - copying default file to " << QDir::toNativeSepar
ators(jsonDataPath);
restoreDefaultJsonFile();
}
//qDebug() << "HelpDialog::createDialogContent() using file:
" << QDir::toNativeSeparators(jsonDataPath);
// Set up download manager and the update schedule
downloadMgr = new QNetworkAccessManager(this);
connect(downloadMgr, SIGNAL(finished(QNetworkReply*)), this,
SLOT(updateDownloadComplete(QNetworkReply*)));
updateState = CompleteNoUpdates;
updateJSON();
}
// Help page // Help page
updateText(); updateText();
connect(ui->editShortcutsButton, SIGNAL(clicked()), connect(ui->editShortcutsButton, SIGNAL(clicked()),
this, SLOT(showShortcutsWindow())); this, SLOT(showShortcutsWindow()));
// Log page // Log page
ui->logPathLabel->setText(QString("%1/log.txt:").arg(StelFileMgr::ge tUserDir())); ui->logPathLabel->setText(QString("%1/log.txt:").arg(StelFileMgr::ge tUserDir()));
connect(ui->stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(u pdateLog(int))); connect(ui->stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(u pdateLog(int)));
connect(ui->refreshButton, SIGNAL(clicked()), this, SLOT(refreshLog( ))); connect(ui->refreshButton, SIGNAL(clicked()), this, SLOT(refreshLog( )));
connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetIt em *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWi dgetItem*))); connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetIt em *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWi dgetItem*)));
}
void HelpDialog::updateDownloadComplete(QNetworkReply *reply)
{
// check the download worked, and save the data to file if this is t
he case.
if (reply->error() != QNetworkReply::NoError)
{
qWarning() << "HelpDialog::updateDownloadComplete() FAILED t
o download" << reply->url() << " Error: " << reply->errorString();
}
else
{
// download completed successfully.
QString jsonFilePath = StelFileMgr::findFile("data", StelFil
eMgr::Flags(StelFileMgr::Writable|StelFileMgr::Directory)) + "/updates.json
";
if (jsonFilePath.isEmpty())
{
qWarning() << "HelpDialog::updateDownloadComplete():
cannot write JSON data to file data/updates.json";
return;
}
QFile jsonFile(jsonFilePath);
if (jsonFile.exists())
jsonFile.remove();
if(jsonFile.open(QIODevice::WriteOnly | QIODevice::Text))
{
jsonFile.write(reply->readAll());
jsonFile.close();
}
}
}
void HelpDialog::updateJSON(void)
{
if (updateState==HelpDialog::Updating)
{
qWarning() << "HelpDialog: already updating... will not sta
rt again current update is complete.";
return;
}
updateState = HelpDialog::Updating;
emit(updateStateChanged(updateState));
// Get info about operating system
QString OS = StelUtils::getOperatingSystemInfo();
if (OS.contains("Linux"))
OS = "Linux";
// Set user agent as "Stellarium/$version$ ($platform$)"
QString UserAgent = QString("Stellarium/%1 (%2)").arg(currentVersion
).arg(OS);
QNetworkRequest request;
request.setUrl(QUrl(updateUrl));
request.setRawHeader("User-Agent", UserAgent.toUtf8());
downloadMgr->get(request);
updateState = HelpDialog::CompleteUpdates;
emit(updateStateChanged(updateState));
readJsonFile();
}
QString HelpDialog::getLatestVersionFromJson()
{
QString jsonVersion("unknown");
QFile jsonDataFile(jsonDataPath);
if (!jsonDataFile.open(QIODevice::ReadOnly))
{
qWarning() << "HelpDialog::getLatestVersionFromJson() cannot
open " << QDir::toNativeSeparators(jsonDataPath);
return jsonVersion;
}
QVariantMap map;
try
{
map = StelJsonParser::parse(&jsonDataFile).toMap();
if (map.contains("latestVersion"))
{
jsonVersion = map.value("latestVersion").toString();
}
jsonDataFile.close();
}
catch(std::runtime_error& e)
{
qDebug() << "HelpDialog::getLatestVersionFromJson() error:"
<< e.what();
}
//qDebug() << "HelpDialog::getLatestVersionFromJson() latest version
from file:" << jsonVersion;
return jsonVersion;
}
/*
Replace the JSON file with the default from the compiled-in resource
*/
void HelpDialog::restoreDefaultJsonFile(void)
{
QFile src(StelFileMgr::findFile("data/updates.json"));
if (!src.copy(jsonDataPath))
{
qWarning() << "HelpDialog::restoreDefaultJsonFile() cannot c
opy json resource to " + QDir::toNativeSeparators(jsonDataPath);
}
else
{
//qDebug() << "HelpDialog::restoreDefaultJsonFile() copied d
efault updates.json to " << QDir::toNativeSeparators(jsonDataPath);
// The resource is read only, and the new file inherits this
... make sure the new file
// is writable by the Stellarium process so that updates can
be done.
QFile dest(jsonDataPath);
dest.setPermissions(dest.permissions() | QFile::WriteOwner);
}
}
void HelpDialog::readJsonFile()
{
QString version = getLatestVersionFromJson();
if (version!=currentVersion)
{
setUpdatesMessage(true, version);
}
}
void HelpDialog::setUpdatesMessage(bool hasUpdates, QString version)
{
if (version.contains("unknown"))
{
// TRANSLATORS: This message will be displayed for users if
Stellarium can't get info about version from stellarium.org
updatesMessage = q_("Oops... Stellarium can't check latest v
ersion.");
return;
}
int cVMajor = 0, cVMinor = 0, cVPatch = 0, rVMajor = 0, rVMinor = 0,
rVPatch = 0;
QRegExp vRx("(\\d+)\\.(\\d+)\\.(\\d+)");
if (vRx.exactMatch(currentVersion))
{
cVMajor = vRx.capturedTexts().at(1).toInt();
cVMinor = vRx.capturedTexts().at(2).toInt();
cVPatch = vRx.capturedTexts().at(3).toInt();
}
if (vRx.exactMatch(version))
{
rVMajor = vRx.capturedTexts().at(1).toInt();
rVMinor = vRx.capturedTexts().at(2).toInt();
rVPatch = vRx.capturedTexts().at(3).toInt();
}
if (hasUpdates)
{
if ((cVMajor>rVMajor) || (cVMinor>rVMinor) || (cVPatch>rVPat
ch))
{
// TRANSLATORS: This message will be displayed for u
sers if current version of Stellarium is bigger than version from stellariu
m.org
updatesMessage = q_("Looks like you are using the de
velopment version of Stellarium.");
}
else
{
// TRANSLATORS: This message will be displayed for u
sers if current version of Stellarium is smaller than version from stellari
um.org
updatesMessage = q_("This version of Stellarium is o
utdated! Latest version is %1.").arg(version);
}
}
else
{
// TRANSLATORS: This message will be displayed for users if
current version of Stellarium is equals with version from stellarium.org
updatesMessage = q_("This is latest stable version of Stella
rium.");
}
}
QString HelpDialog::getUpdatesMessage()
{
return updatesMessage;
} }
void HelpDialog::showShortcutsWindow() void HelpDialog::showShortcutsWindow()
{ {
QAction* action = StelAction* action = StelApp::getInstance().getStelActionManager()->
keyMgr->getGuiAction("actionShow_Shortcuts_Window_Global"); findAction("actionShow_Shortcuts_Window_Global");
if (action) if (action)
{
if (action->isChecked())
action->setChecked(false);
action->setChecked(true); action->setChecked(true);
}
} }
void HelpDialog::updateLog(int) void HelpDialog::updateLog(int)
{ {
if (ui->stackedWidget->currentWidget() == ui->pageLog) if (ui->stackedWidget->currentWidget() == ui->pageLog)
refreshLog(); refreshLog();
} }
void HelpDialog::refreshLog() void HelpDialog::refreshLog()
{ {
ui->logBrowser->setPlainText(StelLogger::getLog()); ui->logBrowser->setPlainText(StelLogger::getLog());
} }
QString HelpDialog::getHelpText(void) QString HelpDialog::getHelpText(void)
{ {
QString htmlText = "<html><head><title>"; QString htmlText = "<html><head><title>";
htmlText += Qt::escape(q_("Stellarium Help")); htmlText += q_("Stellarium Help").toHtmlEscaped();
htmlText += "</title></head><body>\n"; htmlText += "</title></head><body>\n";
// WARNING! Section titles are re-used below! // WARNING! Section titles are re-used below!
htmlText += "<p align=\"center\"><a href=\"#keys\">" + htmlText += "<p align=\"center\"><a href=\"#keys\">" +
Qt::escape(q_("Keys")) + q_("Keys").toHtmlEscaped() +
"</a> &bull; <a href=\"#links\">" + "</a> &bull; <a href=\"#links\">" +
Qt::escape(q_("Further Reading")) + q_("Further Reading").toHtmlEscaped() +
"</a></p>\n"; "</a></p>\n";
htmlText += "<h2 id='keys'>" + Qt::escape(q_("Keys")) + "</h2>\n"; htmlText += "<h2 id='keys'>" + q_("Keys").toHtmlEscaped() + "</h2>\n ";
htmlText += "<table cellpadding=\"10%\">\n"; htmlText += "<table cellpadding=\"10%\">\n";
// Describe keys for those keys which do not have actions. // Describe keys for those keys which do not have actions.
// navigate // navigate
htmlText += "<tr><td>" + Qt::escape(q_("Pan view around the sky")) + htmlText += "<tr><td>" + q_("Pan view around the sky").toHtmlEscaped
"</td>"; () + "</td>";
htmlText += "<td><b>" + Qt::escape(q_("Arrow keys & left mouse drag" htmlText += "<td><b>" + q_("Arrow keys & left mouse drag").toHtmlEsc
)) + "</b></td></tr>\n"; aped() + "</b></td></tr>\n";
// zoom in/out // zoom in/out
htmlText += "<tr><td rowspan='2'>" + Qt::escape(q_("Zoom in/out")) + htmlText += "<tr><td rowspan='2'>" + q_("Zoom in/out").toHtmlEscaped () +
"</td>"; "</td>";
htmlText += "<td><b>" + Qt::escape(q_("Page Up/Down")) + htmlText += "<td><b>" + q_("Page Up/Down").toHtmlEscaped() +
"</b></td></tr>\n"; "</b></td></tr>\n";
htmlText += "<tr><td><b>" + Qt::escape(q_("CTRL + Up/Down")) + htmlText += "<tr><td><b>" + q_("CTRL + Up/Down").toHtmlEscaped() +
"</b></td></tr>\n"; "</b></td></tr>\n";
// select object // select object
htmlText += "<tr><td>" + Qt::escape(q_("Select object")) + "</td>"; htmlText += "<tr><td>" + q_("Select object").toHtmlEscaped() + "</td
htmlText += "<td><b>" + Qt::escape(q_("Left click")) + "</b></td></t >";
r>\n"; htmlText += "<td><b>" + q_("Left click").toHtmlEscaped() + "</b></td
></tr>\n";
// clear selection // clear selection
htmlText += "<tr>"; htmlText += "<tr>";
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
htmlText += "<td rowspan='2'>"; htmlText += "<td rowspan='2'>";
#else #else
htmlText += "<td>"; htmlText += "<td>";
#endif #endif
htmlText += Qt::escape(q_("Clear selection")) + "</td>"; htmlText += q_("Clear selection").toHtmlEscaped() + "</td>";
htmlText += "<td><b>" + Qt::escape(q_("Right click")) + "</b></td></ htmlText += "<td><b>" + q_("Right click").toHtmlEscaped() + "</b></t
tr>\n"; d></tr>\n";
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
htmlText += "<tr><td><b>" + Qt::escape(q_("CTRL + Left click")) + "< htmlText += "<tr><td><b>" + q_("CTRL + Left click").toHtmlEscaped()
/b></td></tr>\n"; + "</b></td></tr>\n";
//htmlText += "<td>" + Qt::escape(q_("Clear selection")) + "</td>"; //htmlText += "<td>" + E("Clear selection") + "</td>";
#endif #endif
htmlText += "</table>\n<p>" + htmlText += "</table>\n<p>" +
Qt::escape(
q_("Below are listed only the actions with assigned keys. Further actions may be available via the \"%1\" button.") q_("Below are listed only the actions with assigned keys. Further actions may be available via the \"%1\" button.")
.arg(ui->editShortcutsButton->text()) .arg(ui->editShortcutsButton->text()).toHtmlEscaped(
) + ) +
"</p><table cellpadding=\"10%\">\n"; "</p><table cellpadding=\"10%\">\n";
QList<StelShortcutGroup*> groups = keyMgr->getGroupList(); // Append all StelAction shortcuts.
foreach (const StelShortcutGroup* group, groups) StelActionMgr* actionMgr = StelApp::getInstance().getStelActionManag
er();
typedef QPair<QString, QString> KeyDescription;
foreach (QString group, actionMgr->getGroupList())
{ {
QString groupName= group->getText(); QList<KeyDescription> descriptions;
if (groupName.isEmpty()) foreach (StelAction* action, actionMgr->getActionList(group)
groupName = group->getId(); )
QList< KeyDescription > descriptions;
QList<StelShortcut*> shortcuts = group->getActionList();
if (shortcuts.isEmpty())
continue;
foreach (const StelShortcut* shortcut, shortcuts)
{ {
QString text = q_(shortcut->getText()); if (action->getShortcut().isEmpty())
QKeySequence primary = shortcut->getPrimaryKey();
if (primary.isEmpty())
{
// TODO: Decide whether to display undefined
actions.
continue; continue;
} QString text = action->getText();
QString keyString = primary.toString(QKeySequence::N QString key = action->getShortcut().toString(QKeySe
ativeText); quence::NativeText);
descriptions.append(KeyDescription(text, keyString)) descriptions.append(KeyDescription(text, key));
;
} }
if (descriptions.isEmpty())
continue;
// Sort by translated description:
// - on one hand, pre-determined order is lost
// - on the other, easier for the users
qSort(descriptions); qSort(descriptions);
htmlText += "<tr></tr><tr><td><b><u>" + q_(group) +
htmlText += "<tr></tr><tr><td><b><u>" + Qt::escape(q_(groupN
ame)) +
":</u></b></td></tr>\n"; ":</u></b></td></tr>\n";
foreach (const KeyDescription& desc, descriptions) foreach (const KeyDescription& desc, descriptions)
{ {
htmlText += "<tr><td>" + Qt::escape(desc.first) + "< htmlText += "<tr><td>" + desc.first.toHtmlEscaped()
/td>"; + "</td>";
htmlText += "<td><b>" + Qt::escape(desc.second) + htmlText += "<td><b>" + desc.second.toHtmlEscaped()
+
"</b></td></tr>\n"; "</b></td></tr>\n";
} }
} }
// edit shortcuts // edit shortcuts
// htmlText += "<tr><td><b>" + Qt::escape(q_("F7")) + "</b></td>"; // htmlText += "<tr><td><b>" + Qt::escape(q_("F7")) + "</b></td>";
// htmlText += "<td>" + Qt::escape(q_("Show and edit all keyboard short cuts")) + "</td></tr>\n"; // htmlText += "<td>" + Qt::escape(q_("Show and edit all keyboard short cuts")) + "</td></tr>\n";
htmlText += "</table>"; htmlText += "</table>";
// Regexp to replace {text} with an HTML link. // Regexp to replace {text} with an HTML link.
QRegExp a_rx = QRegExp("[{]([^{]*)[}]"); QRegExp a_rx = QRegExp("[{]([^{]*)[}]");
// WARNING! Section titles are re-used above! // WARNING! Section titles are re-used above!
htmlText += "<h2 id=\"links\">" + Qt::escape(q_("Further Reading")) htmlText += "<h2 id=\"links\">" + q_("Further Reading").toHtmlEscape
+ "</h2>\n"; d() + "</h2>\n";
htmlText += Qt::escape(q_("The following links are external web link htmlText += q_("The following links are external web links, and will
s, and will launch your web browser:\n")); launch your web browser:\n").toHtmlEscaped();
htmlText += "<p><a href=\"http://stellarium.org/wiki/index.php/Categ htmlText += "<p><a href=\"http://stellarium.org/wiki/index.php/Categ
ory:User%27s_Guide\">" + Qt::escape(q_("The Stellarium User Guide")) + "</a ory:User%27s_Guide\">" + q_("The Stellarium User Guide").toHtmlEscaped() +
>"; "</a>";
htmlText += "<p>"; htmlText += "<p>";
// TRANSLATORS: The text between braces is the text of an HTML link. // TRANSLATORS: The text between braces is the text of an HTML link.
htmlText += Qt::escape(q_("{Frequently Asked Questions} about Stella rium. Answers too.")).replace(a_rx, "<a href=\"http://www.stellarium.org/w iki/index.php/FAQ\">\\1</a>"); htmlText += q_("{Frequently Asked Questions} about Stellarium. Answ ers too.").toHtmlEscaped().replace(a_rx, "<a href=\"http://www.stellarium.o rg/wiki/index.php/FAQ\">\\1</a>");
htmlText += "</p>\n"; htmlText += "</p>\n";
htmlText += "<p>"; htmlText += "<p>";
// TRANSLATORS: The text between braces is the text of an HTML link. // TRANSLATORS: The text between braces is the text of an HTML link.
htmlText += Qt::escape(q_("{The Stellarium Wiki} - General informati on. You can also find user-contributed landscapes and scripts here.")).rep lace(a_rx, "<a href=\"http://stellarium.org/wiki/\">\\1</a>"); htmlText += q_("{The Stellarium Wiki} - General information. You ca n also find user-contributed landscapes and scripts here.").toHtmlEscaped() .replace(a_rx, "<a href=\"http://stellarium.org/wiki/\">\\1</a>");
htmlText += "</p>\n"; htmlText += "</p>\n";
htmlText += "<p>"; htmlText += "<p>";
// TRANSLATORS: The text between braces is the text of an HTML link. // TRANSLATORS: The text between braces is the text of an HTML link.
htmlText += Qt::escape(q_("{Support ticket system} - if you need hel p using Stellarium, post a support request here and we'll try to help.")).r eplace(a_rx, "<a href=\"http://answers.launchpad.net/stellarium/+addquestio n\">\\1</a>"); htmlText += q_("{Support ticket system} - if you need help using Ste llarium, post a support request here and we'll try to help.").toHtmlEscaped ().replace(a_rx, "<a href=\"http://answers.launchpad.net/stellarium/+addque stion\">\\1</a>");
htmlText += "</p>\n"; htmlText += "</p>\n";
htmlText += "<p>"; htmlText += "<p>";
// TRANSLATORS: The text between braces is the text of an HTML link. // TRANSLATORS: The text between braces is the text of an HTML link.
htmlText += Qt::escape(q_("{Bug reporting and feature request system } - if something doesn't work properly or is missing and is not listed in t he tracker, you can open bug reports here.")).replace(a_rx, "<a href=\"http ://bugs.launchpad.net/stellarium/\">\\1</a>"); htmlText += q_("{Bug reporting and feature request system} - if some thing doesn't work properly or is missing and is not listed in the tracker, you can open bug reports here.").toHtmlEscaped().replace(a_rx, "<a href=\" http://bugs.launchpad.net/stellarium/\">\\1</a>");
htmlText += "</p>\n"; htmlText += "</p>\n";
htmlText += "<p>"; htmlText += "<p>";
// TRANSLATORS: The text between braces is the text of an HTML link. // TRANSLATORS: The text between braces is the text of an HTML link.
htmlText += Qt::escape(q_("{Forums} - discuss Stellarium with other users.")).replace(a_rx, "<a href=\"http://sourceforge.net/forum/forum.php?f orum_id=278769\">\\1</a>"); htmlText += q_("{Forums} - discuss Stellarium with other users.").to HtmlEscaped().replace(a_rx, "<a href=\"http://sourceforge.net/forum/forum.p hp?forum_id=278769\">\\1</a>");
htmlText += "</p>\n"; htmlText += "</p>\n";
htmlText += "</body></html>\n"; htmlText += "</body></html>\n";
return htmlText; return htmlText;
#undef E
} }
void HelpDialog::updateText(void) void HelpDialog::updateText(void)
{ {
QString newHtml = getHelpText(); QString newHtml = getHelpText();
ui->helpBrowser->clear(); ui->helpBrowser->clear();
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
Q_ASSERT(gui); Q_ASSERT(gui);
ui->helpBrowser->document()->setDefaultStyleSheet(QString(gui->getSt elStyle().htmlStyleSheet)); ui->helpBrowser->document()->setDefaultStyleSheet(QString(gui->getSt elStyle().htmlStyleSheet));
ui->helpBrowser->insertHtml(newHtml); ui->helpBrowser->insertHtml(newHtml);
ui->helpBrowser->scrollToAnchor("top"); ui->helpBrowser->scrollToAnchor("top");
// populate About tab // populate About tab
newHtml = "<h1>" + StelUtils::getApplicationName() + "</h1>"; newHtml = "<h1>" + StelUtils::getApplicationName() + "</h1>";
// Note: this legal notice is not suitable for traslation // Note: this legal notice is not suitable for traslation
newHtml += "<h3>Copyright &copy; 2000-2013 Stellarium Developers</h3 newHtml += "<h3>Copyright &copy; 2000-2014 Stellarium Developers</h3
>"; >";
if (getUpdatesEnabled())
newHtml += "<p><strong>" + getUpdatesMessage() + "</strong><
/p>";
newHtml += "<p>This program is free software; you can redistribute i t and/or "; newHtml += "<p>This program is free software; you can redistribute i t and/or ";
newHtml += "modify it under the terms of the GNU General Public Lice nse "; newHtml += "modify it under the terms of the GNU General Public Lice nse ";
newHtml += "as published by the Free Software Foundation; either ver sion 2 "; newHtml += "as published by the Free Software Foundation; either ver sion 2 ";
newHtml += "of the License, or (at your option) any later version.</ p>"; newHtml += "of the License, or (at your option) any later version.</ p>";
newHtml += "<p>This program is distributed in the hope that it will be useful, "; newHtml += "<p>This program is distributed in the hope that it will be useful, ";
newHtml += "but WITHOUT ANY WARRANTY; without even the implied "; newHtml += "but WITHOUT ANY WARRANTY; without even the implied ";
newHtml += "warranty of MERCHANTABILITY or FITNESS FOR A "; newHtml += "warranty of MERCHANTABILITY or FITNESS FOR A ";
newHtml += "PARTICULAR PURPOSE. See the GNU General Public "; newHtml += "PARTICULAR PURPOSE. See the GNU General Public ";
newHtml += "License for more details.</p>"; newHtml += "License for more details.</p>";
newHtml += "<p>You should have received a copy of the GNU General Pu blic "; newHtml += "<p>You should have received a copy of the GNU General Pu blic ";
newHtml += "License along with this program; if not, write to:</p>"; newHtml += "License along with this program; if not, write to:</p>";
newHtml += "<pre>Free Software Foundation, Inc.\n"; newHtml += "<pre>Free Software Foundation, Inc.\n";
newHtml += "51 Franklin Street, Suite 500\n"; newHtml += "51 Franklin Street, Suite 500\n";
newHtml += "Boston, MA 02110-1335, USA.\n</pre>"; newHtml += "Boston, MA 02110-1335, USA.\n</pre>";
newHtml += "<p><a href=\"http://www.fsf.org\">www.fsf.org</a></p>"; newHtml += "<p><a href=\"http://www.fsf.org\">www.fsf.org</a></p>";
newHtml += "<h3>" + Qt::escape(q_("Developers")) + "</h3><ul>"; newHtml += "<h3>" + q_("Developers").toHtmlEscaped() + "</h3><ul>";
newHtml += "<li>" + Qt::escape(q_("Project coordinator & lead develo newHtml += "<li>" + q_("Project coordinator & lead developer: %1").a
per: %1").arg(QString("Fabien Ch%1reau").arg(QChar(0x00E9)))) + "</li>"; rg(QString("Fabien Ch%1reau").arg(QChar(0x00E9))).toHtmlEscaped() + "</li>"
newHtml += "<li>" + Qt::escape(q_("Doc author/developer: %1").arg(QS ;
tring("Matthew Gates"))) + "</li>"; newHtml += "<li>" + q_("Doc author/developer: %1").arg(QString("Matt
newHtml += "<li>" + Qt::escape(q_("Developer: %1").arg(QString("Bogd hew Gates")).toHtmlEscaped() + "</li>";
an Marinov"))) + "</li>"; newHtml += "<li>" + q_("Developer: %1").arg(QString("Bogdan Marinov"
newHtml += "<li>" + Qt::escape(q_("Developer: %1").arg(QString("Timo )).toHtmlEscaped() + "</li>";
thy Reaves"))) + "</li>"; newHtml += "<li>" + q_("Developer: %1").arg(QString("Timothy Reaves"
newHtml += "<li>" + Qt::escape(q_("Developer: %1").arg(QString("Guil )).toHtmlEscaped() + "</li>";
laume Ch%1reau").arg(QChar(0x00E9)))) + "</li>"; newHtml += "<li>" + q_("Developer: %1").arg(QString("Guillaume Ch%1r
newHtml += "<li>" + Qt::escape(q_("Developer: %1").arg(QString("Geor eau").arg(QChar(0x00E9))).toHtmlEscaped() + "</li>";
g Zotti"))) + "</li>"; newHtml += "<li>" + q_("Developer: %1").arg(QString("Georg Zotti")).
newHtml += "<li>" + Qt::escape(q_("Developer: %1").arg(QString("Alex toHtmlEscaped() + "</li>";
ander Wolf"))) + "</li>"; newHtml += "<li>" + q_("Developer: %1").arg(QString("Alexander Wolf"
newHtml += "<li>" + Qt::escape(q_("Continuous Integration: %1").arg( )).toHtmlEscaped() + "</li>";
QString("Hans Lambermont"))) + "</li>"; newHtml += "<li>" + q_("Developer: %1").arg(QString("Marcos Cardinot
newHtml += "<li>" + Qt::escape(q_("Tester: %1").arg(QString("Barry G ")).toHtmlEscaped() + "</li>";
erdes"))) + "</li>"; newHtml += "<li>" + q_("Developer: %1").arg(QString("Ferdinand Majer
newHtml += "<li>" + Qt::escape(q_("Tester: %1").arg(QString("Khalid ech")).toHtmlEscaped() + "</li>";
AlAjaji"))) + "</li></ul>"; newHtml += "<li>" + q_("Developer: %1").arg(QString("Jörg Müller")).
newHtml += "<h3>" + Qt::escape(q_("Past Developers")) + "</h3>"; toHtmlEscaped() + "</li>";
newHtml += "<p>" + Qt::escape(q_("Several people have made signific newHtml += "<li>" + q_("Continuous Integration: %1").arg(QString("Ha
ant contributions, but are no longer active. Their work has made a big diff ns Lambermont")).toHtmlEscaped() + "</li>";
erence to the project:")) + "</p><ul>"; newHtml += "<li>" + q_("Tester: %1").arg(QString("Barry Gerdes")).to
newHtml += "<li>" + Qt::escape(q_("Graphic/other designer: %1").arg( HtmlEscaped() + "</li>";
QString("Johan Meuris"))) + "</li>"; newHtml += "<li>" + q_("Tester: %1").arg(QString("Khalid AlAjaji")).
newHtml += "<li>" + Qt::escape(q_("Developer: %1").arg(QString("Joha toHtmlEscaped() + "</li></ul>";
nnes Gajdosik"))) + "</li>"; newHtml += "<h3>" + q_("Past Developers").toHtmlEscaped() + "</h3>";
newHtml += "<li>" + Qt::escape(q_("Developer: %1").arg(QString("Rob newHtml += "<p>" + q_("Several people have made significant contrib
Spearman"))) + "</li>"; utions, but are no longer active. Their work has made a big difference to t
newHtml += "<li>" + Qt::escape(q_("Developer: %1").arg(QString("Andr he project:").toHtmlEscaped() + "</p><ul>";
%1s Mohari").arg(QChar(0x00E1)))) + "</li>"; newHtml += "<li>" + q_("Graphic/other designer: %1").arg(QString("Jo
newHtml += "<li>" + Qt::escape(q_("Developer: %1").arg(QString("Mike han Meuris")).toHtmlEscaped() + "</li>";
Storm"))) + "</li>"; newHtml += "<li>" + q_("Developer: %1").arg(QString("Johannes Gajdos
newHtml += "<li>" + Qt::escape(q_("OSX Developer: %1").arg(QString(" ik")).toHtmlEscaped() + "</li>";
Nigel Kerr"))) + "</li>"; newHtml += "<li>" + q_("Developer: %1").arg(QString("Rob Spearman"))
newHtml += "<li>" + Qt::escape(q_("OSX Developer: %1").arg(QString(" .toHtmlEscaped() + "</li>";
Diego Marcos"))) + "</li></ul>"; newHtml += "<li>" + q_("Developer: %1").arg(QString("Andr%1s Mohari"
).arg(QChar(0x00E1))).toHtmlEscaped() + "</li>";
newHtml += "<li>" + q_("Developer: %1").arg(QString("Mike Storm")).t
oHtmlEscaped() + "</li>";
newHtml += "<li>" + q_("OSX Developer: %1").arg(QString("Nigel Kerr"
)).toHtmlEscaped() + "</li>";
newHtml += "<li>" + q_("OSX Developer: %1").arg(QString("Diego Marco
s")).toHtmlEscaped() + "</li></ul>";
newHtml += "<p>"; newHtml += "<p>";
ui->aboutBrowser->clear(); ui->aboutBrowser->clear();
ui->aboutBrowser->document()->setDefaultStyleSheet(QString(gui->getS telStyle().htmlStyleSheet)); ui->aboutBrowser->document()->setDefaultStyleSheet(QString(gui->getS telStyle().htmlStyleSheet));
ui->aboutBrowser->insertHtml(newHtml); ui->aboutBrowser->insertHtml(newHtml);
ui->aboutBrowser->scrollToAnchor("top"); ui->aboutBrowser->scrollToAnchor("top");
} }
void HelpDialog::changePage(QListWidgetItem *current, QListWidgetItem *prev ious) void HelpDialog::changePage(QListWidgetItem *current, QListWidgetItem *prev ious)
{ {
if (!current) if (!current)
 End of changes. 46 change blocks. 
144 lines changed or deleted 352 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/