VirtualBox

Changeset 12553 in vbox for trunk/src


Ignore:
Timestamp:
Sep 18, 2008 10:04:01 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: Use translated manual of the current selected language if it exists.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h

    r12424 r12553  
    566566    static QString languageId();
    567567    static void loadLanguage (const QString &aLangId = QString::null);
     568    QString helpFile() const;
    568569
    569570    static QIcon iconSet (const char *aNormal,
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r12424 r12553  
    29162916}
    29172917
     2918QString VBoxGlobal::helpFile() const
     2919{
     2920#if defined (Q_WS_WIN32) || defined (Q_WS_X11)
     2921    const QString name = "VirtualBox";
     2922    const QString suffix = "chm";
     2923#elif defined (Q_WS_MAC)
     2924    const QString name = "UserManual";
     2925    const QString suffix = "pdf";
     2926#endif
     2927    /* Where are the docs located? */
     2928    char szDocsPath[RTPATH_MAX];
     2929    int rc = RTPathAppDocs (szDocsPath, sizeof (szDocsPath));
     2930    Assert (RT_SUCCESS (rc));
     2931
     2932    /* Construct the path and the filename */
     2933    QString manual = QString ("%1/%2_%3.%4").arg (szDocsPath)
     2934                                            .arg (name)
     2935                                            .arg (vboxGlobal().languageId())
     2936                                            .arg (suffix);
     2937    /* Check if a help file with that name exists */
     2938    QFileInfo fi (manual);
     2939    if (fi.exists())
     2940        return manual;
     2941
     2942    /* Fall back to the standard */
     2943    manual = QString ("%1/%2.%4").arg (szDocsPath)
     2944                                 .arg (name)
     2945                                 .arg (suffix);
     2946    return manual;
     2947}
     2948
    29182949/* static */
    29192950QIcon VBoxGlobal::iconSet (const char *aNormal,
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxProblemReporter.cpp

    r12098 r12553  
    22572257{
    22582258#ifndef VBOX_OSE
     2259    QString manual = vboxGlobal().helpFile();
    22592260#if defined (Q_WS_WIN32)
    2260     QString fullHelpFilePath = qApp->applicationDirPath() + "/VirtualBox.chm";
    2261 
    2262     HtmlHelp (GetDesktopWindow(), fullHelpFilePath.utf16(),
     2261    HtmlHelp (GetDesktopWindow(), manual.utf16(),
    22632262              HH_DISPLAY_TOPIC, NULL);
    22642263#elif defined (Q_WS_X11)
    2265     char szDocsPath[RTPATH_MAX];
    22662264    char szViewerPath[RTPATH_MAX];
    22672265    int rc;
    22682266
    2269     rc = RTPathAppDocs (szDocsPath, sizeof (szDocsPath));
    2270     Assert(RT_SUCCESS(rc));
    22712267    rc = RTPathAppPrivateArch (szViewerPath, sizeof (szViewerPath));
    22722268    Assert(RT_SUCCESS(rc));
    22732269
    22742270    QProcess::startDetached (QString(szViewerPath) + "/kchmviewer",
    2275                              QStringList (QString(szDocsPath) + "/VirtualBox.chm"));
     2271                             QStringList (manual));
    22762272#elif defined (Q_WS_MAC)
    22772273    QProcess::startDetached ("/usr/bin/open",
    2278                              QStringList (qApp->applicationDirPath() + "/UserManual.pdf"));
     2274                             QStringList (manual));
    22792275#endif
    22802276#endif /* VBOX_OSE */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette