Changeset 72775 in vbox
- Timestamp:
- Jun 29, 2018 2:50:07 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/logviewer
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.cpp
r72719 r72775 22 22 /* Qt includes: */ 23 23 # include <QComboBox> 24 # include <QFrame>25 24 # include <QHBoxLayout> 26 25 # include <QLabel> … … 48 47 , m_pNextButton(0) 49 48 , m_pPreviousButton(0) 50 , m_pNextPreviousButtonContainer(0)51 49 { 52 50 prepare(); … … 90 88 m_pNextButton->setEnabled(flag); 91 89 m_pPreviousButton->setEnabled(flag); 92 m_pNextPreviousButtonContainer->setEnabled(flag);93 90 } 94 91 … … 103 100 return; 104 101 } 105 /* index+1 since we always have a 0th item in our combo 102 /* index+1 since we always have a 0th item in our combo-box. */ 106 103 m_pBookmarksComboBox->setCurrentIndex(index+1); 107 104 } … … 112 109 return; 113 110 114 m_pBookmarksComboBox = new QComboBox;115 Q FontMetrics fontMetrics = m_pBookmarksComboBox->fontMetrics();116 if ( m_pBookmarksComboBox)111 /* Create bookmark combo/button layout: */ 112 QHBoxLayout *pComboButtonLayout = new QHBoxLayout; 113 if (pComboButtonLayout) 117 114 { 118 m_pBookmarksComboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); 119 m_pBookmarksComboBox->setMaximumWidth(fontMetrics.width('a') * (m_iMaxBookmarkTextLength + 2)); 120 /* Make sure we have 0th item in our combo box. */ 121 m_pBookmarksComboBox->insertItem(0, ""); 122 mainLayout()->addWidget(m_pBookmarksComboBox, 2); 115 pComboButtonLayout->setContentsMargins(0, 0, 0, 0); 116 #ifdef VBOX_WS_MAC 117 pComboButtonLayout->setSpacing(5); 118 #else 119 pComboButtonLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2); 120 #endif 121 122 /* Create bookmark combo-box: */ 123 m_pBookmarksComboBox = new QComboBox; 124 if (m_pBookmarksComboBox) 125 { 126 m_pBookmarksComboBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); 127 /* Make sure we have 0th item in our combo-box. */ 128 m_pBookmarksComboBox->insertItem(0, ""); 129 pComboButtonLayout->addWidget(m_pBookmarksComboBox); 130 } 131 132 /* Create bookmark button layout 1: */ 133 QHBoxLayout *pButtonLayout1 = new QHBoxLayout; 134 if (pButtonLayout1) 135 { 136 pButtonLayout1->setContentsMargins(0, 0, 0, 0); 137 pButtonLayout1->setSpacing(0); 138 139 /* Create goto selected bookmark button: */ 140 m_pGotoSelectedBookmark = new QIToolButton; 141 if (m_pGotoSelectedBookmark) 142 { 143 m_pGotoSelectedBookmark->setIcon(UIIconPool::iconSet(":/log_viewer_goto_selected_bookmark_16px.png")); 144 pButtonLayout1->addWidget(m_pGotoSelectedBookmark); 145 } 146 147 /* Create goto previous bookmark button: */ 148 m_pPreviousButton = new QIToolButton; 149 if (m_pPreviousButton) 150 { 151 m_pPreviousButton->setIcon(UIIconPool::iconSet(":/log_viewer_goto_previous_bookmark_16px.png")); 152 pButtonLayout1->addWidget(m_pPreviousButton); 153 } 154 155 /* Create goto next bookmark button: */ 156 m_pNextButton = new QIToolButton; 157 if (m_pNextButton) 158 { 159 m_pNextButton->setIcon(UIIconPool::iconSet(":/log_viewer_goto_next_bookmark_16px.png")); 160 pButtonLayout1->addWidget(m_pNextButton); 161 } 162 163 pComboButtonLayout->addLayout(pButtonLayout1); 164 } 165 166 /* Create bookmark button layout 2: */ 167 QHBoxLayout *pButtonLayout2 = new QHBoxLayout; 168 if (pButtonLayout2) 169 { 170 pButtonLayout2->setContentsMargins(0, 0, 0, 0); 171 pButtonLayout2->setSpacing(0); 172 173 /* Create delete current bookmark button: */ 174 m_pDeleteCurrentButton = new QIToolButton; 175 if (m_pDeleteCurrentButton) 176 { 177 m_pDeleteCurrentButton->setIcon(UIIconPool::iconSet(":/log_viewer_delete_current_bookmark_16px.png")); 178 pButtonLayout2->addWidget(m_pDeleteCurrentButton); 179 } 180 181 /* Create delete all bookmarks button: */ 182 m_pDeleteAllButton = new QIToolButton; 183 if (m_pDeleteAllButton) 184 { 185 m_pDeleteAllButton->setIcon(UIIconPool::iconSet(":/log_viewer_delete_all_bookmarks_16px.png")); 186 pButtonLayout2->addWidget(m_pDeleteAllButton); 187 } 188 189 pComboButtonLayout->addLayout(pButtonLayout2); 190 } 191 192 mainLayout()->addLayout(pComboButtonLayout); 123 193 } 124 125 m_pGotoSelectedBookmark = new QIToolButton;126 if (m_pGotoSelectedBookmark)127 {128 mainLayout()->addWidget(m_pGotoSelectedBookmark, 0);129 m_pGotoSelectedBookmark->setIcon(UIIconPool::iconSet(":/log_viewer_goto_selected_bookmark_16px.png"));130 }131 132 m_pNextPreviousButtonContainer = new QFrame;133 if (m_pNextPreviousButtonContainer)134 {135 mainLayout()->addWidget(m_pNextPreviousButtonContainer);136 QHBoxLayout *pContainerLayout = new QHBoxLayout(m_pNextPreviousButtonContainer);137 /* Configure layout: */138 #ifdef VBOX_WS_MAC139 pContainerLayout->setContentsMargins(5, 0, 5, 0);140 pContainerLayout->setSpacing(5);141 #else142 pContainerLayout->setContentsMargins(qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2, 0,143 qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 2, 0);144 pContainerLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2);145 #endif146 147 m_pPreviousButton = new QIToolButton;148 if (m_pPreviousButton)149 {150 pContainerLayout->addWidget(m_pPreviousButton);151 m_pPreviousButton->setIcon(UIIconPool::iconSet(":/log_viewer_goto_previous_bookmark_16px.png"));152 }153 154 m_pNextButton = new QIToolButton;155 if (m_pNextButton){156 pContainerLayout->addWidget(m_pNextButton);157 m_pNextButton->setIcon(UIIconPool::iconSet(":/log_viewer_goto_next_bookmark_16px.png"));158 }159 }160 161 m_pDeleteCurrentButton = new QIToolButton;162 if (m_pDeleteCurrentButton)163 {164 mainLayout()->addWidget(m_pDeleteCurrentButton, 0);165 m_pDeleteCurrentButton->setIcon(UIIconPool::iconSet(":/log_viewer_delete_current_bookmark_16px.png"));166 }167 168 m_pDeleteAllButton = new QIToolButton;169 if (m_pDeleteAllButton)170 {171 mainLayout()->addWidget(m_pDeleteAllButton, 2);172 m_pDeleteAllButton->setIcon(UIIconPool::iconSet(":/log_viewer_delete_all_bookmarks_16px.png"));173 }174 175 mainLayout()->addStretch(3);176 194 } 177 195 … … 192 210 void UIVMLogViewerBookmarksPanel::retranslateUi() 193 211 { 194 if (m_pDeleteCurrentButton)195 m_pDeleteCurrentButton->setToolTip(UIVMLogViewerWidget::tr("Delete the current bookmark."));196 197 if (m_pDeleteAllButton)198 {199 m_pDeleteAllButton->setToolTip(UIVMLogViewerWidget::tr("Delete all bookmarks."));200 m_pDeleteAllButton->setText(UIVMLogViewerWidget::tr("Delete all"));201 }202 203 if (m_pNextButton)204 m_pNextButton->setToolTip(UIVMLogViewerWidget::tr("Goto the next bookmark"));205 206 if (m_pPreviousButton)207 m_pPreviousButton->setToolTip(UIVMLogViewerWidget::tr("Goto the previous bookmark"));208 209 if (m_pGotoSelectedBookmark)210 m_pGotoSelectedBookmark->setToolTip(UIVMLogViewerWidget::tr("Goto selected bookmark."));211 212 212 UIVMLogViewerPanel::retranslateUi(); 213 214 m_pDeleteCurrentButton->setToolTip(UIVMLogViewerWidget::tr("Delete the current bookmark")); 215 m_pDeleteAllButton->setToolTip(UIVMLogViewerWidget::tr("Delete all bookmarks")); 216 m_pNextButton->setToolTip(UIVMLogViewerWidget::tr("Goto the next bookmark")); 217 m_pPreviousButton->setToolTip(UIVMLogViewerWidget::tr("Goto the previous bookmark")); 218 m_pGotoSelectedBookmark->setToolTip(UIVMLogViewerWidget::tr("Goto selected bookmark")); 213 219 } 214 220 … … 225 231 void UIVMLogViewerBookmarksPanel::sltBookmarkSelected(int index) 226 232 { 227 /* Do nothing if the index is 0, that is combo 233 /* Do nothing if the index is 0, that is combo-box title item: */ 228 234 if (index <= 0) 229 235 return; -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.h
r72030 r72775 24 24 /* Forward declarations: */ 25 25 class QComboBox; 26 class Q Frame;26 class QWidget; 27 27 class QIToolButton; 28 28 … … 83 83 QIToolButton *m_pNextButton; 84 84 QIToolButton *m_pPreviousButton; 85 QFrame *m_pNextPreviousButtonContainer;86 85 }; 87 86 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp
r72759 r72775 146 146 void UIVMFilterLineEdit::paintEvent(QPaintEvent *event) 147 147 { 148 /* Call to base-class: */ 148 149 QLineEdit::paintEvent(event); 149 150 150 151 151 if (!m_pClearAllButton || !m_pRemoveTermButton) … … 154 154 155 155 int deltaHeight = 0.5 * (height() - m_pClearAllButton->height()); 156 #ifdef VBOX_WS_MAC 157 m_pClearAllButton->setGeometry(width() - clearButtonSize - 1, deltaHeight, clearButtonSize, clearButtonSize); 158 #else 156 159 m_pClearAllButton->setGeometry(width() - clearButtonSize, deltaHeight, clearButtonSize, clearButtonSize); 157 158 160 #endif 159 161 160 162 /* If we have a selected term move the m_pRemoveTermButton to the end of the … … 166 168 int buttonSize = m_iRemoveTermButtonSize; 167 169 int charWidth = fontMetrics().width('x'); 170 #ifdef VBOX_WS_MAC 171 int buttonLeft = cursorRect().left() + 1; 172 #else 168 173 int buttonLeft = cursorRect().right() - 0.5 * charWidth; 174 #endif 169 175 /* If buttonLeft is in far right of the line edit, move the 170 176 button to left side of the selected word: */ … … 416 422 prepareRadioButtonGroup(); 417 423 418 m_pFilterComboBox = new QComboBox; 419 if (m_pFilterComboBox) 420 { 421 m_pFilterComboBox->setEditable(true); 422 QStringList strFilterPresets; 423 strFilterPresets << "" << "GUI" << "NAT" << "AHCI" << "VD" << "Audio" << "VUSB" << "SUP" << "PGM" << "HDA" 424 << "HM" << "VMM" << "GIM" << "CPUM"; 425 strFilterPresets.sort(); 426 m_pFilterComboBox->addItems(strFilterPresets); 427 mainLayout()->addWidget(m_pFilterComboBox,1); 428 } 429 430 m_pAddFilterTermButton = new QIToolButton; 431 if (m_pAddFilterTermButton) 432 { 433 m_pAddFilterTermButton->setIcon(UIIconPool::iconSet(":/log_viewer_filter_add_16px.png")); 434 mainLayout()->addWidget(m_pAddFilterTermButton,0); 435 } 436 424 /* Create combo/button layout: */ 425 QHBoxLayout *pComboButtonLayout = new QHBoxLayout; 426 if (pComboButtonLayout) 427 { 428 pComboButtonLayout->setContentsMargins(0, 0, 0, 0); 429 #ifdef VBOX_WS_MAC 430 pComboButtonLayout->setSpacing(5); 431 #else 432 pComboButtonLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2); 433 #endif 434 435 /* Create filter combo-box: */ 436 m_pFilterComboBox = new QComboBox; 437 if (m_pFilterComboBox) 438 { 439 m_pFilterComboBox->setEditable(true); 440 QStringList strFilterPresets; 441 strFilterPresets << "" << "GUI" << "NAT" << "AHCI" << "VD" 442 << "Audio" << "VUSB" << "SUP" << "PGM" << "HDA" 443 << "HM" << "VMM" << "GIM" << "CPUM"; 444 strFilterPresets.sort(); 445 m_pFilterComboBox->addItems(strFilterPresets); 446 pComboButtonLayout->addWidget(m_pFilterComboBox); 447 } 448 449 /* Create add filter-term button: */ 450 m_pAddFilterTermButton = new QIToolButton; 451 if (m_pAddFilterTermButton) 452 { 453 m_pAddFilterTermButton->setIcon(UIIconPool::iconSet(":/log_viewer_filter_add_16px.png")); 454 pComboButtonLayout->addWidget(m_pAddFilterTermButton); 455 } 456 457 mainLayout()->addLayout(pComboButtonLayout, 1); 458 } 459 460 /* Create filter-term line-edit: */ 437 461 m_pFilterTermsLineEdit = new UIVMFilterLineEdit; 438 462 if (m_pFilterTermsLineEdit) 439 463 { 440 mainLayout()->addWidget(m_pFilterTermsLineEdit, 4); 441 m_pFilterTermsLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum /*vertical */); 442 } 443 464 m_pFilterTermsLineEdit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 465 mainLayout()->addWidget(m_pFilterTermsLineEdit, 3); 466 } 467 468 /* Create result label: */ 444 469 m_pResultLabel = new QLabel; 445 470 if (m_pResultLabel) 446 471 { 447 mainLayout()->addWidget(m_pResultLabel,0); 472 m_pResultLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); 473 mainLayout()->addWidget(m_pResultLabel, 0); 448 474 } 449 475 } … … 456 482 { 457 483 /* Configure container: */ 484 m_pRadioButtonContainer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); 458 485 m_pRadioButtonContainer->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); 459 486 … … 464 491 /* Configure layout: */ 465 492 #ifdef VBOX_WS_MAC 466 pContainerLayout->setContentsMargins(5, 0, 0, 5);493 pContainerLayout->setContentsMargins(5, 0, 0, 7); 467 494 pContainerLayout->setSpacing(5); 468 495 #else … … 528 555 { 529 556 UIVMLogViewerPanel::retranslateUi(); 530 m_pFilterComboBox->setToolTip(UIVMLogViewerWidget::tr("Select or enter a term which will be used in filtering the log text.")); 531 m_pAddFilterTermButton->setToolTip(UIVMLogViewerWidget::tr("Add the filter term to the set of filter terms.")); 557 558 m_pFilterComboBox->setToolTip(UIVMLogViewerWidget::tr("Select or enter a term which will be used in filtering the log text")); 559 m_pAddFilterTermButton->setToolTip(UIVMLogViewerWidget::tr("Add the filter term to the set of filter terms")); 532 560 m_pResultLabel->setText(UIVMLogViewerWidget::tr("Showing %1/%2").arg(m_iFilteredLineCount).arg(m_iUnfilteredLineCount)); 533 m_pFilterTermsLineEdit->setToolTip(UIVMLogViewerWidget::tr("The filter terms list. Select one to remove or click the button on the right side to remove them all.")); 534 m_pRadioButtonContainer->setToolTip(UIVMLogViewerWidget::tr("The type of boolean operator for filter operation.")); 561 m_pFilterTermsLineEdit->setToolTip(UIVMLogViewerWidget::tr("The filter terms list, select one to remove or click " 562 "the button on the right side to remove them all")); 563 m_pRadioButtonContainer->setToolTip(UIVMLogViewerWidget::tr("The type of boolean operator for filter operation")); 535 564 } 536 565 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.cpp
r72720 r72775 84 84 { 85 85 #ifdef VBOX_WS_MAC 86 m_pMainLayout->setContentsMargins(5 , 0, 5, 0);86 m_pMainLayout->setContentsMargins(5 /* since there is always a button */, 0, 10 /* standard */, 0); 87 87 m_pMainLayout->setSpacing(10); 88 88 #else 89 89 m_pMainLayout->setContentsMargins(qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2, 0, 90 qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 2, 0); 91 m_pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2); 90 qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 2, 91 qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin) / 2); 92 m_pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing)); 92 93 #endif 93 94 } … … 109 110 { 110 111 if (m_pCloseButton) 111 m_pCloseButton->setToolTip(UIVMLogViewerWidget::tr("Close the search panel."));112 m_pCloseButton->setToolTip(UIVMLogViewerWidget::tr("Close the pane")); 112 113 } 113 114 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp
r72720 r72775 80 80 UIVMLogViewerSearchPanel::UIVMLogViewerSearchPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer) 81 81 : UIVMLogViewerPanel(pParent, pViewer) 82 , m_pSearchLabel(0)83 82 , m_pSearchEditor(0) 84 83 , m_pNextButton(0) 85 84 , m_pPreviousButton(0) 86 , m_pNextPreviousButtonContainer(0)87 85 , m_pCaseSensitiveCheckBox(0) 88 86 , m_pMatchWholeWordCheckBox(0) … … 185 183 { 186 184 /* we need this check not to remove the 'not found' label 187 when the user toggles with this check box: */185 when the user toggles with this check-box: */ 188 186 if (m_iMatchCount != 0) 189 187 clearHighlighting(-1); … … 210 208 return; 211 209 212 /* Create search-editor: */ 213 m_pSearchEditor = new UIVMLogViewerSearchField(0 /* parent */); 214 if (m_pSearchEditor) 215 { 216 /* Configure search-editor: */ 217 m_pSearchEditor->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); 218 /* Add search-editor to main-layout: */ 219 mainLayout()->addWidget(m_pSearchEditor); 220 } 221 222 /* Create search-label: */ 223 m_pSearchLabel = new QLabel; 224 if (m_pSearchLabel) 225 { 226 /* Configure search-label: */ 227 m_pSearchLabel->setBuddy(m_pSearchEditor); 228 /* Prepare font: */ 229 #ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS 230 QFont font = m_pSearchLabel->font(); 231 font.setPointSize(::darwinSmallFontSize()); 232 m_pSearchLabel->setFont(font); 233 #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */ 234 /* Add search-label to main-layout: */ 235 mainLayout()->addWidget(m_pSearchLabel); 236 } 237 238 /* Create Next/Previous buttons: */ 239 m_pNextPreviousButtonContainer = new QFrame; 240 if (m_pNextPreviousButtonContainer) 241 { 242 mainLayout()->addWidget(m_pNextPreviousButtonContainer); 243 QHBoxLayout *pContainerLayout = new QHBoxLayout(m_pNextPreviousButtonContainer); 244 /* Configure layout: */ 210 /* Create search field layout: */ 211 QHBoxLayout *pSearchFieldLayout = new QHBoxLayout; 212 if (pSearchFieldLayout) 213 { 214 pSearchFieldLayout->setContentsMargins(0, 0, 0, 0); 245 215 #ifdef VBOX_WS_MAC 246 pContainerLayout->setContentsMargins(5, 0, 5, 0); 247 pContainerLayout->setSpacing(5); 216 pSearchFieldLayout->setSpacing(5); 248 217 #else 249 pContainerLayout->setContentsMargins(qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2, 0, 250 qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 2, 0); 251 pContainerLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2); 218 pSearchFieldLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2); 252 219 #endif 253 m_pPreviousButton = new QIToolButton; 254 if (m_pPreviousButton) 255 { 256 pContainerLayout->addWidget(m_pPreviousButton); 257 m_pPreviousButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_backward_16px.png")); 258 } 259 260 m_pNextButton = new QIToolButton; 261 if (m_pNextButton){ 262 pContainerLayout->addWidget(m_pNextButton); 263 m_pNextButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_forward_16px.png")); 264 } 265 } 266 267 /* Create case-sensitive checkbox: */ 220 221 /* Create search-editor: */ 222 m_pSearchEditor = new UIVMLogViewerSearchField(0 /* parent */); 223 if (m_pSearchEditor) 224 { 225 m_pSearchEditor->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 226 pSearchFieldLayout->addWidget(m_pSearchEditor); 227 } 228 229 /* Create search button layout: */ 230 QHBoxLayout *pSearchButtonsLayout = new QHBoxLayout; 231 if (pSearchButtonsLayout) 232 { 233 pSearchButtonsLayout->setContentsMargins(0, 0, 0, 0); 234 pSearchButtonsLayout->setSpacing(0); 235 236 /* Create Previous button: */ 237 m_pPreviousButton = new QIToolButton; 238 if (m_pPreviousButton) 239 { 240 m_pPreviousButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_backward_16px.png")); 241 pSearchButtonsLayout->addWidget(m_pPreviousButton); 242 } 243 244 /* Create Next button: */ 245 m_pNextButton = new QIToolButton; 246 if (m_pNextButton) 247 { 248 m_pNextButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_forward_16px.png")); 249 pSearchButtonsLayout->addWidget(m_pNextButton); 250 } 251 252 pSearchFieldLayout->addLayout(pSearchButtonsLayout); 253 } 254 255 mainLayout()->addLayout(pSearchFieldLayout); 256 } 257 258 /* Create case-sensitive check-box: */ 268 259 m_pCaseSensitiveCheckBox = new QCheckBox; 269 260 if (m_pCaseSensitiveCheckBox) 270 261 { 271 /* Configure font: */272 #ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS273 QFont font = m_pCaseSensitiveCheckBox->font();274 font.setPointSize(::darwinSmallFontSize());275 m_pCaseSensitiveCheckBox->setFont(font);276 #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */277 /* Add case-sensitive checkbox to main-layout: */278 262 mainLayout()->addWidget(m_pCaseSensitiveCheckBox); 279 263 } 280 264 265 /* Create whole-word check-box: */ 281 266 m_pMatchWholeWordCheckBox = new QCheckBox; 282 267 if (m_pMatchWholeWordCheckBox) 283 268 { 284 /* Configure focus for case-sensitive checkbox: */285 269 setFocusProxy(m_pMatchWholeWordCheckBox); 286 /* Configure font: */287 #ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS288 QFont font = m_pMatchWholeWordCheckBox->font();289 font.setPointSize(::darwinSmallFontSize());290 m_pMatchWholeWordCheckBox->setFont(font);291 #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */292 270 mainLayout()->addWidget(m_pMatchWholeWordCheckBox); 293 271 } 294 272 273 /* Create highlight-all check-box: */ 295 274 m_pHighlightAllCheckBox = new QCheckBox; 296 275 if (m_pHighlightAllCheckBox) 297 276 { 298 /* Configure font: */299 #ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS300 QFont font = m_pHighlightAllCheckBox->font();301 font.setPointSize(::darwinSmallFontSize());302 m_pHighlightAllCheckBox->setFont(font);303 #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */304 /* Add case-sensitive checkbox to main-layout: */305 277 mainLayout()->addWidget(m_pHighlightAllCheckBox); 306 278 } 307 279 308 /* Create warning-icon: */ 309 m_pWarningIcon = new QLabel; 310 if (m_pWarningIcon) 311 { 312 /* Confifure warning-icon: */ 313 m_pWarningIcon->hide(); 314 QIcon icon = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxWarning, this); 315 if (!icon.isNull()) 316 m_pWarningIcon->setPixmap(icon.pixmap(16, 16)); 317 /* Add warning-icon to main-layout: */ 318 mainLayout()->addWidget(m_pWarningIcon); 319 } 320 321 /* Create warning-label: */ 322 m_pInfoLabel = new QLabel; 323 if (m_pInfoLabel) 324 { 325 /* Configure warning-label: */ 326 m_pInfoLabel->hide(); 327 /* Prepare font: */ 328 #ifdef VBOX_DARWIN_USE_NATIVE_CONTROLS 329 QFont font = m_pInfoLabel->font(); 330 font.setPointSize(::darwinSmallFontSize()); 331 m_pInfoLabel->setFont(font); 332 #endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */ 333 /* Add warning-label to main-layout: */ 334 mainLayout()->addWidget(m_pInfoLabel); 335 } 336 mainLayout()->addStretch(2); 280 /* Create search field layout: */ 281 QHBoxLayout *pSearchErrorLayout = new QHBoxLayout; 282 if (pSearchErrorLayout) 283 { 284 pSearchErrorLayout->setContentsMargins(0, 0, 0, 0); 285 #ifdef VBOX_WS_MAC 286 pSearchErrorLayout->setSpacing(5); 287 #else 288 pSearchErrorLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2); 289 #endif 290 291 /* Create warning-icon: */ 292 m_pWarningIcon = new QLabel; 293 if (m_pWarningIcon) 294 { 295 m_pWarningIcon->hide(); 296 QIcon icon = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxWarning, this); 297 if (!icon.isNull()) 298 m_pWarningIcon->setPixmap(icon.pixmap(16, 16)); 299 pSearchErrorLayout->addWidget(m_pWarningIcon); 300 } 301 302 /* Create warning-label: */ 303 m_pInfoLabel = new QLabel; 304 if (m_pInfoLabel) 305 { 306 m_pInfoLabel->hide(); 307 pSearchErrorLayout->addWidget(m_pInfoLabel); 308 } 309 310 mainLayout()->addLayout(pSearchErrorLayout); 311 } 337 312 } 338 313 … … 353 328 void UIVMLogViewerSearchPanel::retranslateUi() 354 329 { 355 if (m_pSearchLabel) 356 m_pSearchLabel->setText(QString("%1 ").arg(UIVMLogViewerWidget::tr("&Find"))); 357 358 if (m_pSearchEditor) 359 m_pSearchEditor->setToolTip(UIVMLogViewerWidget::tr("Enter a search string here")); 360 361 if (m_pNextButton) 362 m_pNextButton->setToolTip(UIVMLogViewerWidget::tr("Search for the next occurrence of the string (F3)")); 363 364 if (m_pPreviousButton) 365 m_pPreviousButton->setToolTip(UIVMLogViewerWidget::tr("Search for the previous occurrence of the string (Shift+F3)")); 366 367 368 if (m_pCaseSensitiveCheckBox) 369 { 370 m_pCaseSensitiveCheckBox->setText(UIVMLogViewerWidget::tr("C&ase Sensitive")); 371 m_pCaseSensitiveCheckBox->setToolTip(UIVMLogViewerWidget::tr("Perform case sensitive search (when checked)")); 372 } 373 374 if (m_pMatchWholeWordCheckBox) 375 { 376 m_pMatchWholeWordCheckBox->setText(UIVMLogViewerWidget::tr("Ma&tch Whole Word")); 377 m_pMatchWholeWordCheckBox->setToolTip(UIVMLogViewerWidget::tr("Search matches only complete words when checked")); 378 } 379 380 if (m_pHighlightAllCheckBox) 381 { 382 m_pHighlightAllCheckBox->setText(UIVMLogViewerWidget::tr("&Highlight All")); 383 m_pHighlightAllCheckBox->setToolTip(UIVMLogViewerWidget::tr("All occurence of the search text are highlighted")); 384 } 330 UIVMLogViewerPanel::retranslateUi(); 331 332 m_pSearchEditor->setToolTip(UIVMLogViewerWidget::tr("Enter a search string here")); 333 m_pNextButton->setToolTip(UIVMLogViewerWidget::tr("Search for the next occurrence of the string (F3)")); 334 m_pPreviousButton->setToolTip(UIVMLogViewerWidget::tr("Search for the previous occurrence of the string (Shift+F3)")); 335 336 m_pCaseSensitiveCheckBox->setText(UIVMLogViewerWidget::tr("C&ase Sensitive")); 337 m_pCaseSensitiveCheckBox->setToolTip(UIVMLogViewerWidget::tr("When checked, perform case sensitive search")); 338 339 m_pMatchWholeWordCheckBox->setText(UIVMLogViewerWidget::tr("Ma&tch Whole Word")); 340 m_pMatchWholeWordCheckBox->setToolTip(UIVMLogViewerWidget::tr("When checked, search matches only complete words")); 341 342 m_pHighlightAllCheckBox->setText(UIVMLogViewerWidget::tr("&Highlight All")); 343 m_pHighlightAllCheckBox->setToolTip(UIVMLogViewerWidget::tr("When checked, all occurence of the search text are highlighted")); 385 344 386 345 if (m_iMatchCount == 0) -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.h
r71638 r72775 27 27 /* Forward declarations: */ 28 28 class QCheckBox; 29 class QFrame;30 29 class QHBoxLayout; 31 30 class QLabel; 31 class QWidget; 32 32 class QIToolButton; 33 33 class UIVMLogViewerSearchField; … … 99 99 QTextDocument::FindFlags constructFindFlags(SearchDirection eDirection); 100 100 101 /** Holds the instance of search-label we create. */102 QLabel *m_pSearchLabel;103 101 /** Holds the instance of search-editor we create. */ 104 102 UIVMLogViewerSearchField *m_pSearchEditor; … … 106 104 QIToolButton *m_pNextButton; 107 105 QIToolButton *m_pPreviousButton; 108 QFrame *m_pNextPreviousButtonContainer;109 106 /** Holds the instance of case-sensitive checkbox we create. */ 110 107 QCheckBox *m_pCaseSensitiveCheckBox; -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSettingsPanel.cpp
r72724 r72775 83 83 return; 84 84 85 /* Create line-number check-box: */ 85 86 m_pLineNumberCheckBox = new QCheckBox; 86 87 if (m_pLineNumberCheckBox) … … 90 91 } 91 92 93 /* Create wrap-lines check-box: */ 92 94 m_pWrapLinesCheckBox = new QCheckBox; 93 95 if (m_pWrapLinesCheckBox) … … 97 99 } 98 100 101 /* Create font-size spin-box: */ 99 102 m_pFontSizeSpinBox = new QSpinBox; 100 103 if (m_pFontSizeSpinBox) … … 106 109 } 107 110 111 /* Create font-size label: */ 108 112 m_pFontSizeLabel = new QLabel; 109 113 if (m_pFontSizeLabel) … … 112 116 } 113 117 114 m_pOpenFontDialogButton = new QIToolButton; 115 if (m_pOpenFontDialogButton) 118 /* Create combo/button layout: */ 119 QHBoxLayout *pButtonLayout = new QHBoxLayout; 120 if (pButtonLayout) 116 121 { 117 mainLayout()->addWidget(m_pOpenFontDialogButton, 0); 118 m_pOpenFontDialogButton->setIcon(UIIconPool::iconSet(":/log_viewer_choose_font_16px.png")); 122 pButtonLayout->setContentsMargins(0, 0, 0, 0); 123 pButtonLayout->setSpacing(0); 124 125 /* Create open font dialog button: */ 126 m_pOpenFontDialogButton = new QIToolButton; 127 if (m_pOpenFontDialogButton) 128 { 129 pButtonLayout->addWidget(m_pOpenFontDialogButton, 0); 130 m_pOpenFontDialogButton->setIcon(UIIconPool::iconSet(":/log_viewer_choose_font_16px.png")); 131 } 132 133 /* Create reset font to default button: */ 134 m_pResetToDefaultsButton = new QIToolButton; 135 if (m_pResetToDefaultsButton) 136 { 137 pButtonLayout->addWidget(m_pResetToDefaultsButton, 0); 138 m_pResetToDefaultsButton->setIcon(UIIconPool::iconSet(":/log_viewer_reset_font_16px.png")); 139 } 140 141 mainLayout()->addLayout(pButtonLayout); 119 142 } 120 143 121 m_pResetToDefaultsButton = new QIToolButton;122 if (m_pResetToDefaultsButton)123 {124 mainLayout()->addWidget(m_pResetToDefaultsButton, 0);125 m_pResetToDefaultsButton->setIcon(UIIconPool::iconSet(":/log_viewer_reset_font_16px.png"));126 }127 144 mainLayout()->addStretch(2); 128 145 } … … 146 163 { 147 164 UIVMLogViewerPanel::retranslateUi(); 148 if (m_pLineNumberCheckBox)149 {150 m_pLineNumberCheckBox->setText(UIVMLogViewerWidget::tr("Show Line Numbers"));151 m_pLineNumberCheckBox->setToolTip(UIVMLogViewerWidget::tr("Show Line Numbers"));152 }153 165 154 if (m_pWrapLinesCheckBox) 155 { 156 m_pWrapLinesCheckBox->setText(UIVMLogViewerWidget::tr("Wrap Lines")); 157 m_pWrapLinesCheckBox->setToolTip(UIVMLogViewerWidget::tr("Wrap Lines")); 158 } 166 m_pLineNumberCheckBox->setText(UIVMLogViewerWidget::tr("Show Line Numbers")); 167 m_pLineNumberCheckBox->setToolTip(UIVMLogViewerWidget::tr("When checked, show line numbers")); 159 168 160 if (m_pFontSizeLabel) 161 { 162 m_pFontSizeLabel->setText(UIVMLogViewerWidget::tr("Font Size")); 163 m_pFontSizeSpinBox->setToolTip(UIVMLogViewerWidget::tr("Log Viewer Font Size")); 164 } 169 m_pWrapLinesCheckBox->setText(UIVMLogViewerWidget::tr("Wrap Lines")); 170 m_pWrapLinesCheckBox->setToolTip(UIVMLogViewerWidget::tr("When checked, wrap lines")); 165 171 166 if (m_pOpenFontDialogButton)167 m_pOpenFontDialogButton->setToolTip(UIVMLogViewerWidget::tr("Open a font dialog to select font face for the logviewer"));172 m_pFontSizeLabel->setText(UIVMLogViewerWidget::tr("Font Size")); 173 m_pFontSizeSpinBox->setToolTip(UIVMLogViewerWidget::tr("Log viewer font size")); 168 174 169 if (m_pResetToDefaultsButton)170 175 m_pOpenFontDialogButton->setToolTip(UIVMLogViewerWidget::tr("Open a font dialog to select font face for the logviewer")); 176 m_pResetToDefaultsButton->setToolTip(UIVMLogViewerWidget::tr("Reset settings to application defaults")); 171 177 } 172 178
Note:
See TracChangeset
for help on using the changeset viewer.