VirtualBox

Ignore:
Timestamp:
Jul 18, 2018 11:24:33 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123802
Message:

FE/Qt: Few style fixes for r123794, r123795 and r123796.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r72920 r73198  
    383383
    384384    return fRc;
     385}
     386
     387void UIMessageCenter::warnAboutUnknownOptionType(const QString &strOption)
     388{
     389    alert(0, MessageType_Error,
     390          tr("Unknown option <b>%1</b>.")
     391             .arg(strOption));
     392}
     393
     394void UIMessageCenter::warnAboutUnrelatedOptionType(const QString &strOption)
     395{
     396    alert(0, MessageType_Error,
     397          tr("<b>%1</b> is an option for the VirtualBox VM runner (VirtualBoxVM) application, not the VirtualBox Manager.")
     398             .arg(strOption));
    385399}
    386400
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r72920 r73198  
    231231
    232232    /* API: Main (startup) warnings: */
     233    void warnAboutUnknownOptionType(const QString &strOption);
     234    void warnAboutUnrelatedOptionType(const QString &strOption);
    233235#ifdef RT_OS_LINUX
    234236    void warnAboutWrongUSBMounted() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r73196 r73198  
    40524052#ifdef RT_OS_WINDOWS /** @todo add more here, please... */
    40534053        else
    4054             msgCenter().error(0, MessageType_Error, tr("Unknown option <b>%1</b>.").arg(arguments.at(i)), "");
     4054            msgCenter().warnAboutUnknownOptionType(arguments.at(i));
    40554055#endif
    40564056#ifdef VBOX_GUI_WITH_SHARED_LIBRARY
    40574057        if (enmOptType == OptType_VMRunner && m_enmType != UIType_RuntimeUI)
    4058             msgCenter().error(0, MessageType_Error,
    4059                               tr("<b>%1</b> is an option for the VirtualBox VM runner (VirtualBoxVM) application, not the selector")
    4060                               .arg(arg), "");
     4058            msgCenter().warnAboutUnrelatedOptionType(arg);
    40614059#endif
    40624060
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r73192 r73198  
    338338
    339339#ifdef RT_OS_WINDOWS
    340     /*
    341      * Show message box.  We modify the option list a little to better
    342      * make it fit in the dialog.
    343      */
    344     char        szTitleWithVersion[sizeof(s_szTitle) + 128];
    345     char        szMsg[sizeof(s_szUsage) + 128];
    346     char       *pszDst = szMsg;
    347     size_t      offSrc = 0;
     340    /* Show message box. Modify the option list a little
     341     * to better make it fit in the upcoming dialog. */
     342    char szTitleWithVersion[sizeof(s_szTitle) + 128];
     343    char szMsg[sizeof(s_szUsage) + 128];
     344    char *pszDst = szMsg;
     345    size_t offSrc = 0;
    348346    while (offSrc < sizeof(s_szUsage) - 1U)
    349347    {
     
    352350            && s_szUsage[offSrc + 1] == ' '
    353351            && (   (ch = s_szUsage[offSrc + 2]) == '-' /* option line */
    354                 || ch == 'V' /* env.var. line*/ ) )
     352                || ch == 'V' /* env.var. line */))
    355353        {
    356354            /* Split option lines: */
     
    361359                while (   s_szUsage[offSrc + cchOption] != ' '
    362360                       || s_szUsage[offSrc + cchOption + 1] != ' ')
    363                     cchOption++;
     361                    ++cchOption;
    364362
    365363                memcpy(pszDst, &s_szUsage[offSrc], cchOption);
    366                 offSrc   += cchOption + 2;
    367                 pszDst   += cchOption;
     364                offSrc += cchOption + 2;
     365                pszDst += cchOption;
    368366            }
    369367            /* Change environment variable indentation: */
     
    373371                size_t cchLine = 0;
    374372                while ((ch = s_szUsage[offSrc + cchLine]) != '\n' && ch != '\0')
    375                     cchLine++;
     373                    ++cchLine;
    376374
    377375                memcpy(pszDst, &s_szUsage[offSrc], cchLine);
     
    383381
    384382            while (s_szUsage[offSrc] == ' ')
    385                 offSrc++;
     383                ++offSrc;
    386384        }
    387385
    388         /* Copy up to and including end of line. */
     386        /* Copy up to and including end of line: */
    389387        while ((ch = s_szUsage[offSrc++]) != '\n' && ch != '\0')
    390388            *pszDst++ = ch;
     
    616614# endif /* VBOX_WS_X11 */
    617615
    618     /*
    619      * Initialize VBox Runtime.
    620      */
     616    /* Initialize VBox Runtime: */
    621617# if !defined(VBOX_GUI_WITH_SHARED_LIBRARY) || defined(VBOX_RUNTIME_UI)
    622618    /* Initialize the SUPLib as well only if we are really about to start a VM.
     
    698694    }
    699695
    700     /*
    701      * Call actual main function:
    702      */
     696    /* Call to actual main function: */
    703697    return TrustedMain(argc, argv, envp);
    704698}
Note: See TracChangeset for help on using the changeset viewer.

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