Changeset 76954 in vbox
- Timestamp:
- Jan 23, 2019 12:56:07 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/logviewer
- Files:
-
- 10 edited
-
UIVMLogViewerBookmarksPanel.cpp (modified) (1 diff)
-
UIVMLogViewerBookmarksPanel.h (modified) (2 diffs)
-
UIVMLogViewerFilterPanel.cpp (modified) (1 diff)
-
UIVMLogViewerFilterPanel.h (modified) (2 diffs)
-
UIVMLogViewerOptionsPanel.cpp (modified) (1 diff)
-
UIVMLogViewerOptionsPanel.h (modified) (1 diff)
-
UIVMLogViewerPanel.cpp (modified) (3 diffs)
-
UIVMLogViewerPanel.h (modified) (3 diffs)
-
UIVMLogViewerSearchPanel.cpp (modified) (2 diffs)
-
UIVMLogViewerSearchPanel.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.cpp
r76890 r76954 84 84 } 85 85 86 QString UIVMLogViewerBookmarksPanel::panelName() const 87 { 88 return "FilterPanel"; 89 } 90 86 91 void UIVMLogViewerBookmarksPanel::setBookmarkIndex(int index) 87 92 { -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.h
r76581 r76954 36 36 Q_OBJECT; 37 37 38 signals:39 40 void sigDeleteBookmark(int bookmarkIndex);41 void sigDeleteAllBookmarks();42 void sigBookmarkSelected(int index);43 44 38 public: 45 39 … … 55 49 /** Disable/enable all the widget except the close button */ 56 50 void disableEnableBookmarking(bool flag); 51 virtual QString panelName() const /* override */; 52 signals: 57 53 58 public slots: 54 void sigDeleteBookmark(int bookmarkIndex); 55 void sigDeleteAllBookmarks(); 56 void sigBookmarkSelected(int index); 59 57 60 58 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp
r76607 r76954 259 259 } 260 260 261 QString UIVMLogViewerFilterPanel::panelName() const 262 { 263 return "FilterPanel"; 264 } 265 261 266 void UIVMLogViewerFilterPanel::applyFilter(const int iCurrentIndex /* = 0 */) 262 267 { -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.h
r76581 r76954 57 57 * @param pViewer Specifies reference to the VM Log-Viewer this filter-panel belongs to. */ 58 58 UIVMLogViewerFilterPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer); 59 virtual QString panelName() const /* override */; 59 60 60 61 public slots: … … 113 114 114 115 #endif /* !FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerFilterPanel_h */ 115 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerOptionsPanel.cpp
r76606 r76954 70 70 return; 71 71 m_pFontSizeSpinBox->setValue(fontSizeInPoints); 72 } 73 74 QString UIVMLogViewerOptionsPanel::panelName() const 75 { 76 return "OptionsPanel"; 72 77 } 73 78 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerOptionsPanel.h
r76581 r76954 52 52 void setWrapLines(bool bWrapLines); 53 53 void setFontSizeInPoints(int fontSizeInPoints); 54 virtual QString panelName() const /* override */; 54 55 55 56 public slots: -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.cpp
r76606 r76954 36 36 37 37 UIVMLogViewerPanel::UIVMLogViewerPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer) 38 : QIWithRetranslateUI<QWidget>(pParent)38 : UIDialogPanel(pParent) 39 39 , m_pViewer(pViewer) 40 , m_pMainLayout(0)41 , m_pCloseButton(0)42 40 { 43 prepare();44 41 } 45 42 46 void UIVMLogViewerPanel:: setCloseButtonShortCut(QKeySequence shortCut)43 void UIVMLogViewerPanel::retranslateUi() 47 44 { 48 if (!m_pCloseButton)49 return;50 m_pCloseButton->setShortcut(shortCut);51 45 } 52 46 … … 59 53 { 60 54 return m_pViewer; 61 }62 63 QHBoxLayout* UIVMLogViewerPanel::mainLayout()64 {65 return m_pMainLayout;66 }67 68 void UIVMLogViewerPanel::prepare()69 {70 prepareWidgets();71 prepareConnections();72 retranslateUi();73 }74 75 void UIVMLogViewerPanel::prepareWidgets()76 {77 m_pMainLayout = new QHBoxLayout(this);78 if (m_pMainLayout)79 {80 #ifdef VBOX_WS_MAC81 m_pMainLayout->setContentsMargins(5 /* since there is always a button */, 0, 10 /* standard */, 0);82 m_pMainLayout->setSpacing(10);83 #else84 m_pMainLayout->setContentsMargins(qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2, 0,85 qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 2,86 qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin) / 2);87 m_pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing));88 #endif89 }90 m_pCloseButton = new QIToolButton;91 if (m_pCloseButton)92 {93 m_pCloseButton->setIcon(UIIconPool::iconSet(":/close_16px.png"));94 m_pMainLayout->addWidget(m_pCloseButton, 0, Qt::AlignLeft);95 }96 }97 98 void UIVMLogViewerPanel::prepareConnections()99 {100 if (m_pCloseButton)101 connect(m_pCloseButton, &QIToolButton::clicked, this, &UIVMLogViewerPanel::hide);102 }103 104 void UIVMLogViewerPanel::retranslateUi()105 {106 if (m_pCloseButton)107 m_pCloseButton->setToolTip(UIVMLogViewerWidget::tr("Close the pane"));108 }109 110 bool UIVMLogViewerPanel::eventFilter(QObject *pObject, QEvent *pEvent)111 {112 Q_UNUSED(pObject);113 Q_UNUSED(pEvent);114 /* Dont consume this event. Pass it back to Qt's event system: */115 return false;116 }117 118 void UIVMLogViewerPanel::showEvent(QShowEvent *pEvent)119 {120 QWidget::showEvent(pEvent);121 }122 123 void UIVMLogViewerPanel::hideEvent(QHideEvent *pEvent)124 {125 /* Get focused widget: */126 QWidget *pFocus = QApplication::focusWidget();127 /* If focus-widget is valid and child-widget of search-panel,128 * focus next child-widget in line: */129 if (pFocus && pFocus->parent() == this)130 focusNextPrevChild(true);131 if (m_pViewer)132 m_pViewer->hidePanel(this);133 134 QWidget::hideEvent(pEvent);135 55 } 136 56 … … 162 82 return &(page->logString()); 163 83 } 164 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.h
r76910 r76954 23 23 24 24 /* Qt includes: */ 25 #include <QWidget>26 25 #include <QKeySequence> 26 27 27 /* GUI includes: */ 28 #include " QIWithRetranslateUI.h"28 #include "UIDialogPanel.h" 29 29 30 30 /* Forward declarations: */ 31 class QHBoxLayout;32 31 class QPlainTextEdit; 33 32 class QTextDocument; 34 class QIToolButton;35 33 class UIVMLogViewerWidget; 36 34 37 35 38 /** QWidgetextension acting as the base class for UIVMLogViewerXXXPanel widgets. */39 class UIVMLogViewerPanel : public QIWithRetranslateUI<QWidget>36 /** UIDialonPanel extension acting as the base class for UIVMLogViewerXXXPanel widgets. */ 37 class UIVMLogViewerPanel : public UIDialogPanel 40 38 { 41 39 Q_OBJECT; … … 44 42 45 43 UIVMLogViewerPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer); 46 void setCloseButtonShortCut(QKeySequence shortCut);47 44 48 45 protected: 49 46 50 virtual void prepare(); 51 virtual void prepareWidgets(); 52 virtual void prepareConnections(); 47 virtual void retranslateUi() /* override */; 53 48 54 49 /* Access functions for children classes. */ 55 UIVMLogViewerWidget* viewer(); 56 const UIVMLogViewerWidget* viewer() const; 57 QHBoxLayout* mainLayout(); 58 59 /** Handles the translation event. */ 60 void retranslateUi() /* override */; 61 62 /** Handles Qt @a pEvent, used for keyboard processing. */ 63 bool eventFilter(QObject *pObject, QEvent *pEvent); 64 /** Handles the Qt show @a pEvent. */ 65 void showEvent(QShowEvent *pEvent); 66 /** Handles the Qt hide @a pEvent. */ 67 void hideEvent(QHideEvent *pEvent); 68 50 UIVMLogViewerWidget *viewer(); 51 const UIVMLogViewerWidget *viewer() const; 69 52 QTextDocument *textDocument(); 70 53 QPlainTextEdit *textEdit(); 71 54 /* Return the unmodified log. */ 72 const QString *logString() const;55 const QString *logString() const; 73 56 74 57 private: … … 76 59 /** Holds the reference to VM Log-Viewer this panel belongs to. */ 77 60 UIVMLogViewerWidget *m_pViewer; 78 QHBoxLayout *m_pMainLayout;79 QIToolButton *m_pCloseButton;80 61 }; 81 62 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp
r76606 r76954 108 108 { 109 109 return m_matchLocationVector; 110 } 111 112 QString UIVMLogViewerSearchPanel::panelName() const 113 { 114 return "SearchPanel"; 110 115 } 111 116 … … 612 617 613 618 #include "UIVMLogViewerSearchPanel.moc" 614 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.h
r76581 r76954 56 56 void reset(); 57 57 const QVector<float> &getMatchLocationVector() const; 58 virtual QString panelName() const /* override */; 58 59 59 60 protected: … … 131 132 132 133 #endif /* !FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerSearchPanel_h */ 133
Note:
See TracChangeset
for help on using the changeset viewer.

