VirtualBox

Changeset 99910 in vbox for trunk


Ignore:
Timestamp:
May 22, 2023 5:15:24 PM (17 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10451. Removing endif guards and some more refactoring.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r99881 r99910  
    898898        src/guestctrl/UIFileManagerTable.h \
    899899        src/helpbrowser/UIHelpBrowserDialog.h \
     900        src/helpbrowser/UIHelpViewer.h \
     901        src/helpbrowser/UIHelpBrowserWidget.h \
    900902        src/logviewer/UIVMLogPage.h \
    901903        src/logviewer/UIVMLogViewerBookmarksPanel.h \
     
    10311033        src/wizards/newvd/UIWizardNewVDExpertPage.h
    10321034
    1033 ifdef VBOX_WITH_DOCS_QHELP
    1034  UICommon_QT_MOCHDRS += \
    1035         src/helpbrowser/UIHelpViewer.h \
    1036         src/helpbrowser/UIHelpBrowserWidget.h
    1037 endif
    1038 
    10391035ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    10401036 UICommon_QT_MOCHDRS += \
     
    11191115        src/guestctrl/UIFileManagerGuestTable.cpp \
    11201116        src/guestctrl/UIFileManagerHostTable.cpp \
     1117        src/helpbrowser/UIHelpViewer.cpp \
     1118        src/helpbrowser/UIHelpBrowserWidget.cpp \
    11211119        src/logviewer/UIVMLogViewerFilterPanel.cpp \
    11221120        src/logviewer/UIVMLogViewerTextEdit.cpp \
     
    11431141        src/widgets/UIStatusBarEditorWindow.cpp \
    11441142        src/widgets/UIToolBox.cpp
    1145 
    1146 ifdef VBOX_WITH_DOCS_QHELP
    1147  UICommon_QT_MOCSRCS += \
    1148         src/helpbrowser/UIHelpViewer.cpp \
    1149         src/helpbrowser/UIHelpBrowserWidget.cpp
    1150 endif
    11511143
    11521144ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     
    14861478        src/guestctrl/UIFileManagerTable.cpp \
    14871479        src/helpbrowser/UIHelpBrowserDialog.cpp \
     1480        src/helpbrowser/UIHelpViewer.cpp \
     1481        src/helpbrowser/UIHelpBrowserWidget.cpp \
    14881482        src/logviewer/UIVMLogPage.cpp \
    14891483        src/logviewer/UIVMLogViewerBookmarksPanel.cpp \
     
    16241618        src/wizards/newvd/UIWizardNewVDExpertPage.cpp
    16251619
    1626 ifdef VBOX_WITH_DOCS_QHELP
    1627  UICommon_SOURCES += \
    1628         src/helpbrowser/UIHelpViewer.cpp \
    1629         src/helpbrowser/UIHelpBrowserWidget.cpp
    1630 endif
    1631 
    16321620ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    16331621 UICommon_SOURCES += \
     
    17401728# (The include directory and lib/framework for each module will be added by the Qt unit.)
    17411729#
    1742 UICommon_QT_MODULES = Core Gui Widgets
     1730UICommon_QT_MODULES = Core Gui Widgets Help
    17431731ifdef VBOX_WITH_QT6
    17441732 UICommon_QT_MODULES += StateMachine
     
    17681756 UICommon_QT_MODULES.darwin  += MacExtras
    17691757 UICommon_QT_MODULES.win     += WinExtras
    1770 endif
    1771 
    1772 ifdef VBOX_WITH_DOCS_QHELP
    1773  UICommon_QT_MODULES   += Help
    17741758endif
    17751759
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r99905 r99910  
    20972097}
    20982098
     2099void UIMessageCenter::sltResetSuppressedMessages()
     2100{
     2101    /* Nullify suppressed message list: */
     2102    gEDataManager->setSuppressedMessages(QStringList());
     2103}
     2104
     2105void UIMessageCenter::sltShowUserManual(const QString &strHelpFilePath)
     2106{
     2107    if (!QFileInfo(strHelpFilePath).exists())
     2108    {
     2109        UINotificationMessage::cannotFindHelpFile(strHelpFilePath);
     2110        return;
     2111    }
     2112    if (!m_pHelpBrowserDialog)
     2113    {
     2114        m_pHelpBrowserDialog = new UIHelpBrowserDialog(0 /* parent */, 0 /* Center Widget */, strHelpFilePath);
     2115        AssertReturnVoid(m_pHelpBrowserDialog);
     2116        connect(m_pHelpBrowserDialog, &QMainWindow::destroyed, this, &UIMessageCenter::sltHelpBrowserClosed);
     2117    }
     2118
     2119    m_pHelpBrowserDialog->show();
     2120    m_pHelpBrowserDialog->setWindowState(m_pHelpBrowserDialog->windowState() & ~Qt::WindowMinimized);
     2121    m_pHelpBrowserDialog->activateWindow();
     2122}
     2123
     2124void UIMessageCenter::sltHelpBrowserClosed()
     2125{
     2126    m_pHelpBrowserDialog = 0;
     2127}
     2128
     2129void UIMessageCenter::sltHandleHelpRequest()
     2130{
     2131    sltHandleHelpRequestWithKeyword(uiCommon().helpKeyword(sender()));
     2132}
     2133
     2134void UIMessageCenter::sltHandleHelpRequestWithKeyword(const QString &strHelpKeyword)
     2135{
     2136    /* First open or show the help browser: */
     2137    sltShowUserManual(uiCommon().helpFile());
     2138    /* Show the help page for the @p strHelpKeyword: */
     2139    if (m_pHelpBrowserDialog)
     2140        m_pHelpBrowserDialog->showHelpForKeyword(strHelpKeyword);
     2141}
     2142
    20992143void UIMessageCenter::sltShowHelpHelpDialog()
    21002144{
    2101     /* Currently I am sure how this logic should be changed. I will just disable it for now: */
    2102     sltShowUserManual(uiCommon().helpFile());
    2103 #if 0
    21042145#ifndef VBOX_OSE
    21052146    /* For non-OSE version we just open it: */
     
    21322173# endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    21332174#endif /* #ifdef VBOX_OSE */
    2134 #endif
    2135 }
    2136 
    2137 void UIMessageCenter::sltResetSuppressedMessages()
    2138 {
    2139     /* Nullify suppressed message list: */
    2140     gEDataManager->setSuppressedMessages(QStringList());
    2141 }
    2142 
    2143 void UIMessageCenter::sltShowUserManual(const QString &strHelpFilePath)
    2144 {
    2145 #if defined(VBOX_WITH_DOCS_QHELP)
    2146     if (!QFileInfo(strHelpFilePath).exists())
    2147     {
    2148         UINotificationMessage::cannotFindHelpFile(strHelpFilePath);
    2149         return;
    2150     }
    2151     if (!m_pHelpBrowserDialog)
    2152     {
    2153         m_pHelpBrowserDialog = new UIHelpBrowserDialog(0 /* parent */, 0 /* Center Widget */, strHelpFilePath);
    2154         AssertReturnVoid(m_pHelpBrowserDialog);
    2155         connect(m_pHelpBrowserDialog, &QMainWindow::destroyed, this, &UIMessageCenter::sltHelpBrowserClosed);
    2156     }
    2157 
    2158     m_pHelpBrowserDialog->show();
    2159     m_pHelpBrowserDialog->setWindowState(m_pHelpBrowserDialog->windowState() & ~Qt::WindowMinimized);
    2160     m_pHelpBrowserDialog->activateWindow();
    2161 #else
    2162     Q_UNUSED(strHelpFilePath);
    2163 #endif
    2164 
    2165 }
    2166 
    2167 void UIMessageCenter::sltHelpBrowserClosed()
    2168 {
    2169     m_pHelpBrowserDialog = 0;
    2170 }
    2171 
    2172 void UIMessageCenter::sltHandleHelpRequest()
    2173 {
    2174 #if defined(VBOX_WITH_DOCS_QHELP)
    2175     sltHandleHelpRequestWithKeyword(uiCommon().helpKeyword(sender()));
    2176 #endif /* #if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))&& (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) */
    2177 }
    2178 
    2179 void UIMessageCenter::sltHandleHelpRequestWithKeyword(const QString &strHelpKeyword)
    2180 {
    2181 #if defined(VBOX_WITH_DOCS_QHELP)
    2182     /* First open or show the help browser: */
    2183     sltShowUserManual(uiCommon().helpFile());
    2184     /* Show the help page for the @p strHelpKeyword: */
    2185     if (m_pHelpBrowserDialog)
    2186         m_pHelpBrowserDialog->showHelpForKeyword(strHelpKeyword);
    2187 #else
    2188     Q_UNUSED(strHelpKeyword);
    2189 # endif /* #if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))&& (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) */
    21902175}
    21912176
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserDialog.cpp

    r99880 r99910  
    7272void UIHelpBrowserDialog::showHelpForKeyword(const QString &strKeyword)
    7373{
    74 #ifdef VBOX_WITH_DOCS_QHELP
    7574    if (m_pWidget)
    7675        m_pWidget->showHelpForKeyword(strKeyword);
    77 #else
    78     Q_UNUSED(strKeyword);
    79 #endif
    8076}
    8177
    8278void UIHelpBrowserDialog::retranslateUi()
    8379{
    84 #ifdef VBOX_WITH_DOCS_QHELP
    8580    setWindowTitle(UIHelpBrowserWidget::tr("Oracle VM VirtualBox User Manual"));
    86 #endif
    8781}
    8882
     
    119113void UIHelpBrowserDialog::prepareCentralWidget()
    120114{
    121 #ifdef VBOX_WITH_DOCS_QHELP
    122115    m_pWidget = new UIHelpBrowserWidget(EmbedTo_Dialog, m_strHelpFilePath);
    123116    AssertPtrReturnVoid(m_pWidget);
     
    136129    foreach (QMenu *pMenu, menuList)
    137130        menuBar()->addMenu(pMenu);
    138 #endif
    139131}
    140132
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp

    r99880 r99910  
    3030#include <QComboBox>
    3131#include <QtGlobal>
    32 #ifdef VBOX_WITH_DOCS_QHELP
    33 # include <QtHelp/QHelpEngine>
    34 # include <QtHelp/QHelpContentWidget>
    35 # include <QtHelp/QHelpIndexWidget>
    36 # include <QtHelp/QHelpSearchEngine>
    37 # include <QtHelp/QHelpSearchQueryWidget>
    38 # include <QtHelp/QHelpSearchResultWidget>
    39 # if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
    40 #  include <QtHelp/QHelpLink>
    41 # endif
     32#include <QtHelp/QHelpEngine>
     33#include <QtHelp/QHelpContentWidget>
     34#include <QtHelp/QHelpIndexWidget>
     35#include <QtHelp/QHelpSearchEngine>
     36#include <QtHelp/QHelpSearchQueryWidget>
     37#include <QtHelp/QHelpSearchResultWidget>
     38#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
     39# include <QtHelp/QHelpLink>
    4240#endif
     41
    4342#include <QLabel>
    4443#include <QListWidget>
     
    7069#include "CSystemProperties.h"
    7170
    72 #ifdef VBOX_WITH_DOCS_QHELP
    7371
    7472enum HelpBrowserTabs
     
    22742272
    22752273#include "UIHelpBrowserWidget.moc"
    2276 
    2277 #endif /*#ifdef VBOX_WITH_DOCS_QHELP*/
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h

    r99880 r99910  
    5858class UIZoomMenuAction;
    5959
    60 #ifdef VBOX_WITH_DOCS_QHELP
    6160class SHARED_LIBRARY_STUFF UIHelpBrowserWidget  : public QIWithRetranslateUI<QWidget>
    6261{
     
    220219};
    221220
    222 #endif /* #ifdef VBOX_WITH_DOCS_QHELP */
    223221#endif /* !FEQT_INCLUDED_SRC_helpbrowser_UIHelpBrowserWidget_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp

    r99880 r99910  
    2929#include <QClipboard>
    3030#include <QtGlobal>
    31 #ifdef VBOX_WITH_DOCS_QHELP
    32  #include <QtHelp/QHelpEngine>
    33  #include <QtHelp/QHelpContentWidget>
    34  #include <QtHelp/QHelpIndexWidget>
    35  #include <QtHelp/QHelpSearchEngine>
    36  #include <QtHelp/QHelpSearchQueryWidget>
    37  #include <QtHelp/QHelpSearchResultWidget>
    38 #endif
     31#include <QtHelp/QHelpEngine>
     32#include <QtHelp/QHelpContentWidget>
     33#include <QtHelp/QHelpIndexWidget>
     34#include <QtHelp/QHelpSearchEngine>
     35#include <QtHelp/QHelpSearchQueryWidget>
     36#include <QtHelp/QHelpSearchResultWidget>
    3937#include <QLabel>
    4038#include <QMenu>
     
    6361#include "COMEnums.h"
    6462#include "CSystemProperties.h"
    65 
    66 #ifdef VBOX_WITH_DOCS_QHELP
    6763
    6864
     
    10691065
    10701066#include "UIHelpViewer.moc"
    1071 
    1072 #endif /* #ifdef VBOX_WITH_DOCS_QHELP */
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h

    r99880 r99910  
    4343class QLabel;
    4444class UIFindInPageWidget;
    45 
    46 #ifdef VBOX_WITH_DOCS_QHELP
    4745
    4846/** A QTextBrowser extension used as poor man's html viewer. Since we were not happy with the quality of QTextBrowser's image
     
    172170};
    173171
    174 #endif /* #ifdef VBOX_WITH_DOCS_QHELP */
    175172#endif /* !FEQT_INCLUDED_SRC_helpbrowser_UIHelpViewer_h */
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