Changeset 100879 in vbox for trunk/src/VBox
- Timestamp:
- Aug 15, 2023 11:14:27 AM (19 months ago)
- svn:sync-xref-src-repo-rev:
- 158799
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r100297 r100879 848 848 src/guestctrl/UIFileManagerOperationsPanel.h \ 849 849 src/guestctrl/UIFileManagerOptionsPanel.h \ 850 src/guestctrl/UIFileManagerPanel.h \ 850 851 src/guestctrl/UIFileManagerTable.h \ 851 852 src/helpbrowser/UIHelpBrowserDialog.h \ … … 1063 1064 src/guestctrl/UIFileManagerLogPanel.cpp \ 1064 1065 src/guestctrl/UIFileManagerOperationsPanel.cpp \ 1066 src/guestctrl/UIFileManagerPanel.cpp \ 1065 1067 src/guestctrl/UIFileManagerTable.cpp \ 1066 1068 src/guestctrl/UIFileManagerGuestTable.cpp \ … … 1426 1428 src/guestctrl/UIFileManagerHostTable.cpp \ 1427 1429 src/guestctrl/UIFileManagerLogPanel.cpp \ 1430 src/guestctrl/UIFileManagerPanel.cpp \ 1428 1431 src/guestctrl/UIFileManagerOperationsPanel.cpp \ 1429 1432 src/guestctrl/UIFileManagerOptionsPanel.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp
r98103 r100879 42 42 #include "UIIconPool.h" 43 43 #include "UIFileManager.h" 44 #include "UIFileManagerPanel.h" 44 45 #include "UIFileManagerOptionsPanel.h" 45 46 #include "UIFileManagerLogPanel.h" … … 138 139 , m_pLogPanel(0) 139 140 , m_pOperationsPanel(0) 141 , m_pPanel(0) 140 142 , m_fCommitDataSignalReceived(false) 141 143 { … … 258 260 m_pVerticalSplitter->setStretchFactor(2, 1); 259 261 } 262 263 m_pPanel = new UIFileManagerPanel; 264 AssertReturnVoid(m_pPanel); 265 m_pVerticalSplitter->addWidget(m_pPanel); 260 266 } 261 267 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h
r98103 r100879 54 54 class UIDialogPanel; 55 55 class UIFileManagerLogPanel; 56 class UIFileManagerPanel; 56 57 class UIFileManagerOperationsPanel; 57 58 class UIFileManagerOptionsPanel; … … 184 185 QMap<UIDialogPanel*, QAction*> m_panelActionMap; 185 186 QList<UIDialogPanel*> m_visiblePanelsList; 186 UIFileManagerOptionsPanel 187 UIFileManagerLogPanel 188 UIFileManagerOperationsPanel 189 187 UIFileManagerOptionsPanel *m_pOptionsPanel; 188 UIFileManagerLogPanel *m_pLogPanel; 189 UIFileManagerOperationsPanel *m_pOperationsPanel; 190 UIFileManagerPanel *m_pPanel; 190 191 bool m_fCommitDataSignalReceived; 191 192 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerPanel.cpp
r100868 r100879 27 27 28 28 /* Qt includes: */ 29 #include <QCheckBox> 29 30 #include <QHBoxLayout> 30 31 #include <QMenu> 31 32 #include <QSpinBox> 32 #include <QTextEdit> 33 #include <QTime> 33 #include <QTabWidget> 34 34 35 35 /* GUI includes: */ 36 #include "QIToolButton.h" 37 #include "UIIconPool.h" 38 #include "UIFileManager.h" 39 #include "UIFileManagerLogPanel.h" 36 #include "UIFileManagerPanel.h" 40 37 41 38 42 /********************************************************************************************************************************* 43 * UIFileManagerLogViewer definition. * 44 *********************************************************************************************************************************/ 45 46 class UIFileManagerLogViewer : public QTextEdit 39 UIFileManagerPanel::UIFileManagerPanel(QWidget *pParent /* = 0 */) 40 : QIWithRetranslateUI<QWidget>(pParent) 41 , m_pTabWidget(0) 42 , m_pListDirectoriesOnTopCheckBox(0) 43 , m_pDeleteConfirmationCheckBox(0) 44 , m_pHumanReabableSizesCheckBox(0) 45 , m_pShowHiddenObjectsCheckBox(0) 47 46 { 48 49 Q_OBJECT; 50 51 public: 52 53 UIFileManagerLogViewer(QWidget *pParent = 0); 54 55 protected: 56 57 virtual void contextMenuEvent(QContextMenuEvent * event) RT_OVERRIDE; 58 59 private slots: 60 61 void sltClear(); 62 }; 63 64 /********************************************************************************************************************************* 65 * UIFileManagerLogViewer implementation. * 66 *********************************************************************************************************************************/ 67 68 UIFileManagerLogViewer::UIFileManagerLogViewer(QWidget *pParent /* = 0 */) 69 :QTextEdit(pParent) 70 { 71 setUndoRedoEnabled(false); 72 setReadOnly(true); 73 } 74 75 void UIFileManagerLogViewer::contextMenuEvent(QContextMenuEvent *event) 76 { 77 QMenu *menu = createStandardContextMenu(); 78 79 QAction *pClearAction = menu->addAction(UIFileManager::tr("Clear")); 80 connect(pClearAction, &QAction::triggered, this, &UIFileManagerLogViewer::sltClear); 81 menu->exec(event->globalPos()); 82 delete menu; 83 } 84 85 void UIFileManagerLogViewer::sltClear() 86 { 87 clear(); 47 prepare(); 48 retranslateUi(); 88 49 } 89 50 90 51 91 /********************************************************************************************************************************* 92 * UIFileManagerLogPanel implementation. * 93 *********************************************************************************************************************************/ 52 void UIFileManagerPanel::prepare() 53 { 54 QHBoxLayout *pMainLayout = new QHBoxLayout(this); 55 AssertReturnVoid(pMainLayout); 94 56 95 UIFileManagerLogPanel::UIFileManagerLogPanel(QWidget *pParent /* = 0 */) 96 : UIDialogPanel(pParent) 97 , m_pLogTextEdit(0) 98 { 99 prepare(); 57 m_pTabWidget = new QTabWidget; 58 AssertReturnVoid(m_pTabWidget); 59 pMainLayout->addWidget(m_pTabWidget); 60 preparePreferencesTab(); 100 61 } 101 62 102 void UIFileManager LogPanel::appendLog(const QString &strLog, const QString &strMachineName, FileManagerLogType eLogType)63 void UIFileManagerPanel::preparePreferencesTab() 103 64 { 104 if (!m_pLogTextEdit) 105 return; 106 QString strStartTag("<font color=\"Black\">"); 107 QString strEndTag("</font>"); 108 if (eLogType == FileManagerLogType_Error) 109 { 110 strStartTag = "<b><font color=\"Red\">"; 111 strEndTag = "</font></b>"; 112 } 113 QString strColoredLog = QString("%1 %2: %3 %4 %5").arg(strStartTag).arg(QTime::currentTime().toString("hh:mm:ss:z")).arg(strMachineName).arg(strLog).arg(strEndTag); 114 m_pLogTextEdit->append(strColoredLog); 115 m_pLogTextEdit->moveCursor(QTextCursor::End); 116 m_pLogTextEdit->ensureCursorVisible(); 117 emit sigShowPanel(this); 65 m_pPreferencesTab = new QWidget; 66 m_pListDirectoriesOnTopCheckBox = new QCheckBox; 67 m_pDeleteConfirmationCheckBox = new QCheckBox; 68 m_pHumanReabableSizesCheckBox = new QCheckBox; 69 m_pShowHiddenObjectsCheckBox = new QCheckBox; 70 71 AssertReturnVoid(m_pPreferencesTab); 72 AssertReturnVoid(m_pListDirectoriesOnTopCheckBox); 73 AssertReturnVoid(m_pDeleteConfirmationCheckBox); 74 AssertReturnVoid(m_pHumanReabableSizesCheckBox); 75 AssertReturnVoid(m_pShowHiddenObjectsCheckBox); 76 77 connect(m_pListDirectoriesOnTopCheckBox, &QCheckBox::toggled, this, &UIFileManagerPanel::sigListDirectoryCheckBoxToogled); 78 connect(m_pDeleteConfirmationCheckBox, &QCheckBox::toggled, this, &UIFileManagerPanel::sigDeleteConfirmationCheckBoxToogled); 79 connect(m_pHumanReabableSizesCheckBox, &QCheckBox::toggled, this, &UIFileManagerPanel::sigHumanReabableSizesCheckBoxToogled); 80 connect(m_pShowHiddenObjectsCheckBox, &QCheckBox::toggled, this, &UIFileManagerPanel::sigShowHiddenObjectsCheckBoxToggled); 81 82 QGridLayout *pPreferencesLayout = new QGridLayout(m_pPreferencesTab); 83 AssertReturnVoid(pPreferencesLayout); 84 pPreferencesLayout->addWidget(m_pListDirectoriesOnTopCheckBox, 0, 0, 1, 1); 85 pPreferencesLayout->addWidget(m_pDeleteConfirmationCheckBox, 1, 0, 1, 1); 86 pPreferencesLayout->addWidget(m_pHumanReabableSizesCheckBox, 0, 1, 1, 1); 87 pPreferencesLayout->addWidget(m_pShowHiddenObjectsCheckBox, 1, 1, 1, 1); 88 89 m_pTabWidget->addTab(m_pPreferencesTab, QApplication::translate("UIFileManager", "Preferences")); 118 90 } 119 91 120 QString UIFileManagerLogPanel::panelName() const 92 93 94 void UIFileManagerPanel::retranslateUi() 121 95 { 122 return "LogPanel"; 123 } 96 if (m_pListDirectoriesOnTopCheckBox) 97 { 98 m_pListDirectoriesOnTopCheckBox->setText(QApplication::translate("UIFileManager", "List directories on top")); 99 m_pListDirectoriesOnTopCheckBox->setToolTip(QApplication::translate("UIFileManager", "List directories before files")); 100 } 124 101 125 void UIFileManagerLogPanel::prepareWidgets() 126 { 127 if (!mainLayout()) 128 return; 129 m_pLogTextEdit = new UIFileManagerLogViewer; 130 if (m_pLogTextEdit) 102 if (m_pDeleteConfirmationCheckBox) 131 103 { 132 mainLayout()->addWidget(m_pLogTextEdit); 104 m_pDeleteConfirmationCheckBox->setText(QApplication::translate("UIFileManager", "Ask before delete")); 105 m_pDeleteConfirmationCheckBox->setToolTip(QApplication::translate("UIFileManager", "Show a confirmation dialog " 106 "before deleting files and directories")); 107 } 108 109 if (m_pHumanReabableSizesCheckBox) 110 { 111 m_pHumanReabableSizesCheckBox->setText(QApplication::translate("UIFileManager", "Human readable sizes")); 112 m_pHumanReabableSizesCheckBox->setToolTip(QApplication::translate("UIFileManager", "Show file/directory sizes in human " 113 "readable format rather than in bytes")); 114 } 115 116 if (m_pShowHiddenObjectsCheckBox) 117 { 118 m_pShowHiddenObjectsCheckBox->setText(QApplication::translate("UIFileManager", "Show hidden objects")); 119 m_pShowHiddenObjectsCheckBox->setToolTip(QApplication::translate("UIFileManager", "Show hidden files/directories")); 133 120 } 134 121 } 135 122 136 void UIFileManagerLogPanel::prepareConnections()137 {138 }139 140 void UIFileManagerLogPanel::retranslateUi()141 {142 UIDialogPanel::retranslateUi();143 144 }145 123 146 124 147 #include "UIFileManager LogPanel.moc"125 #include "UIFileManagerPanel.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerPanel.h
r100868 r100879 26 26 */ 27 27 28 #ifndef FEQT_INCLUDED_SRC_guestctrl_UIFileManager LogPanel_h29 #define FEQT_INCLUDED_SRC_guestctrl_UIFileManager LogPanel_h28 #ifndef FEQT_INCLUDED_SRC_guestctrl_UIFileManagerPanel_h 29 #define FEQT_INCLUDED_SRC_guestctrl_UIFileManagerPanel_h 30 30 #ifndef RT_WITHOUT_PRAGMA_ONCE 31 31 # pragma once … … 34 34 /* GUI includes: */ 35 35 #include "UIGuestControlDefs.h" 36 #include "UIDialogPanel.h" 36 #include "QIWithRetranslateUI.h" 37 /* Forward declarations: */ 38 class QTabWidget; 39 class QCheckBox; 37 40 38 /* Forward declarations: */ 39 class QTextEdit; 40 class UIFileManager; 41 42 /** UIDialogPanel extension to display file manager logs. */ 43 class UIFileManagerLogPanel : public UIDialogPanel 41 class UIFileManagerPanel : public QIWithRetranslateUI<QWidget> 44 42 { 45 43 Q_OBJECT; 46 44 45 signals: 46 47 void sigListDirectoryCheckBoxToogled(bool bChecked); 48 void sigDeleteConfirmationCheckBoxToogled(bool bChecked); 49 void sigHumanReabableSizesCheckBoxToogled(bool bChecked); 50 void sigShowHiddenObjectsCheckBoxToggled(bool bChecked); 51 47 52 public: 48 53 49 UIFileManagerLogPanel(QWidget *pParent = 0); 50 void appendLog(const QString &str, const QString &strMachineName, FileManagerLogType eLogType); 51 virtual QString panelName() const RT_OVERRIDE; 54 UIFileManagerPanel(QWidget *pParent = 0); 52 55 53 56 protected: 54 57 55 virtual void prepareWidgets() RT_OVERRIDE; 56 virtual void prepareConnections() RT_OVERRIDE; 57 58 /** Handles the translation event. */ 59 void retranslateUi(); 58 virtual void retranslateUi() final override; 60 59 61 60 private slots: … … 64 63 private: 65 64 66 QTextEdit *m_pLogTextEdit; 65 void prepare(); 66 void preparePreferencesTab(); 67 QTabWidget *m_pTabWidget; 68 69 /** @name Preferences tab 70 * @{ */ 71 QWidget *m_pPreferencesTab; 72 QCheckBox *m_pListDirectoriesOnTopCheckBox; 73 QCheckBox *m_pDeleteConfirmationCheckBox; 74 QCheckBox *m_pHumanReabableSizesCheckBox; 75 QCheckBox *m_pShowHiddenObjectsCheckBox; 76 /** @} */ 77 78 67 79 }; 68 80 69 #endif /* !FEQT_INCLUDED_SRC_guestctrl_UIFileManager LogPanel_h */81 #endif /* !FEQT_INCLUDED_SRC_guestctrl_UIFileManagerPanel_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp
r100876 r100879 93 93 QILineEdit *m_pCustomOptionsLineEdit; 94 94 QCheckBox *m_pShowHiddenObjectsCheckBox; 95 QILabel *m_pShowHiddenObjectsLabel;96 95 QGridLayout *m_pVisoOptionsGridLayout; 97 96 }; … … 110 109 , m_pCustomOptionsLineEdit(0) 111 110 , m_pShowHiddenObjectsCheckBox(0) 112 , m_pShowHiddenObjectsLabel(0)113 111 , m_pVisoOptionsGridLayout(0) 114 112 { … … 172 170 QHBoxLayout *pShowHiddenObjectsLayout = new QHBoxLayout; 173 171 m_pShowHiddenObjectsCheckBox = new QCheckBox; 174 m_pShowHiddenObjectsLabel = new QILabel(QApplication::translate("UIVisoCreatorWidget", "Show Hidden Objects:"));175 m_pShowHiddenObjectsLabel->setBuddy(m_pShowHiddenObjectsCheckBox);176 pShowHiddenObjectsLayout->addWidget(m_pShowHiddenObjectsLabel);177 172 pShowHiddenObjectsLayout->addWidget(m_pShowHiddenObjectsCheckBox); 178 173 pShowHiddenObjectsLayout->addStretch(1); … … 202 197 if (m_pCustomOptionsLineEdit) 203 198 m_pCustomOptionsLineEdit->setToolTip(QApplication::translate("UIVisoCreatorWidget", "The list of suctom options delimited with ';'.")); 204 if (m_pShowHiddenObjectsLabel)205 m_pShowHiddenObjectsLabel->setText(QApplication::translate("UIVisoCreatorWidget", "Show Hidden Objects:"));206 199 if (m_pShowHiddenObjectsCheckBox) 200 { 207 201 m_pShowHiddenObjectsCheckBox->setToolTip(QApplication::translate("UIVisoCreatorWidget", "When checked, " 208 202 "multiple hidden objects are shown in the file browser")); 203 m_pShowHiddenObjectsCheckBox->setText(QApplication::translate("UIVisoCreatorWidget", "Show Hidden Objects")); 204 } 209 205 210 206 //m_pVisoOptionsGridLayout->setColumnMinimumWidth(0, iLabelWidth);
Note:
See TracChangeset
for help on using the changeset viewer.