HelpDialog.cpp   HelpDialog.cpp 
skipping to change at line 41 skipping to change at line 41
#include <QPair> #include <QPair>
#include <QtAlgorithms> #include <QtAlgorithms>
#include <QDebug> #include <QDebug>
#include "ui_helpDialogGui.h" #include "ui_helpDialogGui.h"
#include "HelpDialog.hpp" #include "HelpDialog.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelMainGraphicsView.hpp"
#include "StelStyle.hpp" #include "StelStyle.hpp"
#include "StelLogger.hpp"
HelpDialog::HelpDialog() HelpDialog::HelpDialog()
{ {
ui = new Ui_helpDialogForm; ui = new Ui_helpDialogForm;
// Make some key and mouse bindings translatable. Keys starting with // Make some key and mouse bindings translatable. Keys starting with
// "!NUMBER-" are made up; the number is there to keep the entries // "!NUMBER-" are made up; the number is there to keep the entries
// sorted (at least relative to each other). // sorted (at least relative to each other).
specialKeys["Space"] = N_("Space"); specialKeys["Space"] = N_("Space");
specialKeys["!01-arrows-and-left-drag"] = N_("Arrow keys & left mous e drag"); specialKeys["!01-arrows-and-left-drag"] = N_("Arrow keys & left mous e drag");
skipping to change at line 66 skipping to change at line 66
specialKeys["!05-right-click"] = N_("Right click"); specialKeys["!05-right-click"] = N_("Right click");
specialKeys["!06-ctrl+left-click"] = N_("CTRL + Left click"); specialKeys["!06-ctrl+left-click"] = N_("CTRL + Left click");
// Add keys for those keys which do not have actions. // Add keys for those keys which do not have actions.
QString group = N_("Movement and Selection"); QString group = N_("Movement and Selection");
setKey(group, "", "!01-arrows-and-left-drag", N_("Pan view around th e sky")); setKey(group, "", "!01-arrows-and-left-drag", N_("Pan view around th e sky"));
setKey(group, "", "!02-page-up/down", N_("Zoom in/out")); setKey(group, "", "!02-page-up/down", N_("Zoom in/out"));
setKey(group, "", "!03-ctrl+up/down", N_("Zoom in/out")); setKey(group, "", "!03-ctrl+up/down", N_("Zoom in/out"));
setKey(group, "", "!04-left-click", N_("Select object")); setKey(group, "", "!04-left-click", N_("Select object"));
setKey(group, "", "!05-right-click", N_("Clear selection")); setKey(group, "", "!05-right-click", N_("Clear selection"));
#ifdef MACOSX #ifdef Q_OS_MAC
setKey(group, "", "!06-ctrl+left-click", N_("Clear selection")); setKey(group, "", "!06-ctrl+left-click", N_("Clear selection"));
#endif #endif
group = N_("When a Script is Running");
setKey(group, "", "J", N_("Slow down the script execution rate"));
setKey(group, "", "L", N_("Speed up the script execution rate"));
setKey(group, "", "K", N_("Set the normal script execution rate"));
} }
HelpDialog::~HelpDialog() HelpDialog::~HelpDialog()
{ {
delete ui; delete ui;
ui = NULL; ui = NULL;
} }
void HelpDialog::languageChanged() void HelpDialog::languageChanged()
{ {
skipping to change at line 97 skipping to change at line 102
{ {
if (dialog) if (dialog)
{ {
updateText(); updateText();
} }
} }
void HelpDialog::createDialogContent() void HelpDialog::createDialogContent()
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
ui->helpTabWidget->setCurrentIndex(0); ui->stackedWidget->setCurrentIndex(0);
ui->stackListWidget->setCurrentRow(0);
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
updateText(); updateText();
ui->logPathLabel->setText(QString("%1/log.txt:").arg(StelApp::getIns ui->logPathLabel->setText(QString("%1/log.txt:").arg(StelFileMgr::ge
tance().getFileMgr().getUserDir())); tUserDir()));
connect(ui->helpTabWidget, SIGNAL(currentChanged(int)), this, SLOT(u connect(ui->stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(u
pdateLog(int))); 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*)));
} }
void HelpDialog::updateLog(int) void HelpDialog::updateLog(int)
{ {
if(ui->helpTabWidget->currentWidget() == ui->logTab) if(ui->stackedWidget->currentWidget() == ui->page_3)
refreshLog(); refreshLog();
} }
void HelpDialog::refreshLog() void HelpDialog::refreshLog()
{ {
ui->logBrowser->setPlainText(StelApp::getInstance().getLog()); ui->logBrowser->setPlainText(StelLogger::getLog());
} }
void HelpDialog::setKey(QString group, QString oldKey, QString newKey, QStr ing description) void HelpDialog::setKey(QString group, QString oldKey, QString newKey, QStr ing description)
{ {
// For adding keys like this, the choice of a QMultiMap seems like // For adding keys like this, the choice of a QMultiMap seems like
// madness. However, when we update the text it does the grouping // madness. However, when we update the text it does the grouping
// for us... we have to live with ugliness in one of these functions // for us... we have to live with ugliness in one of these functions
// and it seems easier here. // and it seems easier here.
// For new key bindings we just insert and return // For new key bindings we just insert and return
skipping to change at line 178 skipping to change at line 186
footer += Qt::escape(q_("{Frequently Asked Questions} about Stellari um. Answers too.")).replace(a_rx, "<a href=\"http://www.stellarium.org/wik i/index.php/FAQ\">\\1</a>"); footer += Qt::escape(q_("{Frequently Asked Questions} about Stellari um. Answers too.")).replace(a_rx, "<a href=\"http://www.stellarium.org/wik i/index.php/FAQ\">\\1</a>");
footer += "</p>\n"; footer += "</p>\n";
footer += "<p>"; footer += "<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.
footer += Qt::escape(q_("{The Stellarium Wiki} - General information . You can also find user-contributed landscapes and scripts here.")).repla ce(a_rx, "<a href=\"http://stellarium.org/wiki/\">\\1</a>"); footer += Qt::escape(q_("{The Stellarium Wiki} - General information . You can also find user-contributed landscapes and scripts here.")).repla ce(a_rx, "<a href=\"http://stellarium.org/wiki/\">\\1</a>");
footer += "</p>\n"; footer += "</p>\n";
footer += "<p>"; footer += "<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.
footer += Qt::escape(q_("{Support ticket system} - if you need help using Stellarium, post a support request here and we'll try to help.")).rep lace(a_rx, "<a href=\"http://sourceforge.net/tracker/?group_id=48857&atid=4 54374\">\\1</a>"); footer += Qt::escape(q_("{Support ticket system} - if you need help using Stellarium, post a support request here and we'll try to help.")).rep lace(a_rx, "<a href=\"http://answers.launchpad.net/stellarium/+addquestion\ ">\\1</a>");
footer += "</p>\n"; footer += "</p>\n";
footer += "<p>"; footer += "<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.
footer += Qt::escape(q_("{Bug reporting system} - if something doesn footer += Qt::escape(q_("{Bug reporting and feature request system}
't work properly and is not listed in the FAQ list, you can open bug report - if something doesn't work properly or is missing and is not listed in the
s here.")).replace(a_rx, "<a href=\"http://sourceforge.net/tracker/?group_i tracker, you can open bug reports here.")).replace(a_rx, "<a href=\"http:/
d=48857&atid=454373\">\\1</a>"); /bugs.launchpad.net/stellarium/\">\\1</a>");
footer += "</p>\n";
footer += "<p>";
// TRANSLATORS: The text between braces is the text of an HTML link.
footer += Qt::escape(q_("{Feature request system} - if you have an i
dea for a new feature, send it to us. We can't promise to implement every i
dea, but we appreciate the feedback and review the list when we are plannin
g future features.")).replace(a_rx, "<a href=\"http://sourceforge.net/track
er/?group_id=48857&atid=454376\">\\1</a>");
footer += "</p>\n"; footer += "</p>\n";
footer += "<p>"; footer += "<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.
footer += Qt::escape(q_("{Forums} - discuss Stellarium with other us ers.")).replace(a_rx, "<a href=\"http://sourceforge.net/forum/forum.php?for um_id=278769\">\\1</a>"); footer += Qt::escape(q_("{Forums} - discuss Stellarium with other us ers.")).replace(a_rx, "<a href=\"http://sourceforge.net/forum/forum.php?for um_id=278769\">\\1</a>");
footer += "</p>\n"; footer += "</p>\n";
footer += "</body></html>\n"; footer += "</body></html>\n";
return footer; return footer;
skipping to change at line 269 skipping to change at line 272
} }
newHtml += "</table>"; newHtml += "</table>";
newHtml += getFooterText(); newHtml += getFooterText();
ui->helpBrowser->clear(); ui->helpBrowser->clear();
ui->helpBrowser->document()->setDefaultStyleSheet(QString(StelApp::g etInstance().getCurrentStelStyle()->htmlStyleSheet)); ui->helpBrowser->document()->setDefaultStyleSheet(QString(StelApp::g etInstance().getCurrentStelStyle()->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>" + StelApp::getInstance().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-2009 Stellarium Developers</h3 >"; newHtml += "<h3>Copyright &copy; 2000-2010 Stellarium Developers</h3 >";
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 ";
skipping to change at line 330 skipping to change at line 333
s1c = "ZZZ" + s1c; s1c = "ZZZ" + s1c;
if (s2c=="" || s2c==QString(N_("Miscellaneous")).toUpper()) if (s2c=="" || s2c==QString(N_("Miscellaneous")).toUpper())
s2c = "ZZZ" + s2c; s2c = "ZZZ" + s2c;
if (s1c=="DEBUG") if (s1c=="DEBUG")
s1c = "ZZZZ" + s1c; s1c = "ZZZZ" + s1c;
if (s2c=="DEBUG") if (s2c=="DEBUG")
s2c = "ZZZZ" + s2c; s2c = "ZZZZ" + s2c;
return s1c < s2c; return s1c < s2c;
} }
void HelpDialog::changePage(QListWidgetItem *current, QListWidgetItem *prev
ious)
{
if (!current)
current = previous;
ui->stackedWidget->setCurrentIndex(ui->stackListWidget->row(current)
);
}
 End of changes. 14 change blocks. 
25 lines changed or deleted 26 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/