diff options
author | kh1 <karsten.heimrich@digia.com> | 2012-11-23 17:26:13 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-26 13:40:11 +0100 |
commit | b9d0c62882781e073e8c934b02516d87ae07ba25 (patch) | |
tree | bf9f80e9865fd536cfcafdde6f3c91569c7c3854 | |
parent | 72c62e2df12fce866d7aca00227166d0ca1a40de (diff) |
Fix inbuild help and message. Remove Trolltech references.
Change-Id: Ibe74e744d737c68854ca98dfe72af43287ff89c7
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
-rw-r--r-- | src/assistant/assistant/assistant.qch | bin | 364544 -> 548864 bytes | |||
-rw-r--r-- | src/assistant/assistant/helpviewer.cpp | 2 | ||||
-rw-r--r-- | src/assistant/assistant/helpviewer_qwv.cpp | 20 | ||||
-rw-r--r-- | src/assistant/assistant/mainwindow.cpp | 9 |
4 files changed, 25 insertions, 6 deletions
diff --git a/src/assistant/assistant/assistant.qch b/src/assistant/assistant/assistant.qch Binary files differindex e6d52997b..b023d53b0 100644 --- a/src/assistant/assistant/assistant.qch +++ b/src/assistant/assistant/assistant.qch diff --git a/src/assistant/assistant/helpviewer.cpp b/src/assistant/assistant/helpviewer.cpp index f1f4681db..314a765e8 100644 --- a/src/assistant/assistant/helpviewer.cpp +++ b/src/assistant/assistant/helpviewer.cpp @@ -62,7 +62,7 @@ const QString HelpViewer::AboutBlank = QCoreApplication::translate("HelpViewer", "<title>about:blank</title>"); const QString HelpViewer::LocalHelpFile = QLatin1String("qthelp://" - "com.trolltech.com.assistantinternal-1.0.0/assistant/assistant.html"); + "org.qt-project.assistantinternal-1.0.0/assistant/assistant-quick-guide.html"); const QString HelpViewer::PageNotFoundMessage = QCoreApplication::translate("HelpViewer", "<title>Error 404...</title><div " diff --git a/src/assistant/assistant/helpviewer_qwv.cpp b/src/assistant/assistant/helpviewer_qwv.cpp index 25acf57e1..81fb82838 100644 --- a/src/assistant/assistant/helpviewer_qwv.cpp +++ b/src/assistant/assistant/helpviewer_qwv.cpp @@ -62,6 +62,22 @@ QT_BEGIN_NAMESPACE +static const char g_htmlPage[] = "<html><head><meta http-equiv=\"content-type\" content=\"text/html; " + "charset=UTF-8\"><title>%1</title><style>body{padding: 3em 0em;background: #eeeeee;}" + "hr{color: lightgray;width: 100%;}img{float: left;opacity: .8;}#box{background: white;border: 1px solid " + "lightgray;width: 600px;padding: 60px;margin: auto;}h1{font-size: 130%;font-weight: bold;border-bottom: " + "1px solid lightgray;margin-left: 48px;}h2{font-size: 100%;font-weight: normal;border-bottom: 1px solid " + "lightgray;margin-left: 48px;}ul{font-size: 80%;padding-left: 48px;margin: 0;}#reloadButton{padding-left:" + "48px;}</style></head><body><div id=\"box\"><h1>%2</h1><h2>%3</h2><h2><b>%4</b></h2></div></body></html>"; + +// some of the values we will replace %1...4 inside the former html +const QString g_percent1 = QCoreApplication::translate("HelpViewer", "Error 404..."); +const QString g_percent2 = QCoreApplication::translate("HelpViewer", "The page could not be found!"); +// percent3 will be the url of the page we got the error from +const QString g_percent4 = QCoreApplication::translate("HelpViewer", "Please make sure that you have all " + "documentation sets installed."); + + // -- HelpNetworkReply class HelpNetworkReply : public QNetworkReply @@ -148,8 +164,8 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, url = HelpViewer::fixupVirtualFolderForUrl(&engine, request.url(), &fileFound); const QString &mimeType = HelpViewer::mimeFromUrl(url); - const QByteArray &data = fileFound ? engine.fileData(url) - : HelpViewer::PageNotFoundMessage.arg(url).toUtf8(); + const QByteArray &data = fileFound ? engine.fileData(url) : QString::fromLatin1(g_htmlPage) + .arg(g_percent1, g_percent2, HelpViewer::tr("Error loading: %1").arg(url), g_percent4).toUtf8(); return new HelpNetworkReply(request, data, mimeType.isEmpty() ? QLatin1String("application/octet-stream") : mimeType); diff --git a/src/assistant/assistant/mainwindow.cpp b/src/assistant/assistant/mainwindow.cpp index 4663a67b3..1c447aff3 100644 --- a/src/assistant/assistant/mainwindow.cpp +++ b/src/assistant/assistant/mainwindow.cpp @@ -223,6 +223,9 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) contentDock->raise(); const QRect screen = QApplication::desktop()->screenGeometry(); resize(4*screen.width()/5, 4*screen.height()/5); + + adjustSize(); // make sure we won't start outside of the screen + move(screen.center() - rect().center()); } if (!helpEngineWrapper.hasFontSettings()) { @@ -326,7 +329,7 @@ bool MainWindow::initHelpDB(bool registerInternalDoc) return true; } bool assistantInternalDocRegistered = false; - QString intern(QLatin1String("com.trolltech.com.assistantinternal-")); + QString intern(QLatin1String("org.qt-project.assistantinternal-")); foreach (const QString &ns, helpEngineWrapper.registeredDocumentations()) { if (ns.startsWith(intern)) { intern = ns; @@ -1016,7 +1019,7 @@ QString MainWindow::collectionFileDirectory(bool createDir, const QString &cache { TRACE_OBJ QString collectionPath = - QStandardPaths::writableLocation(QStandardPaths::DataLocation); + QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); if (collectionPath.isEmpty()) { if (cacheDir.isEmpty()) collectionPath = QDir::homePath() + QDir::separator() @@ -1025,7 +1028,7 @@ QString MainWindow::collectionFileDirectory(bool createDir, const QString &cache collectionPath = QDir::homePath() + QLatin1String("/.") + cacheDir; } else { if (cacheDir.isEmpty()) - collectionPath = collectionPath + QLatin1String("/Trolltech/Assistant"); + collectionPath = collectionPath + QLatin1String("/QtProject/Assistant"); else collectionPath = collectionPath + QDir::separator() + cacheDir; } |