Changeset 71370 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 16, 2018 3:20:58 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 14 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc
r70055 r71370 1 1 <RCC> 2 <qresource prefix="/">2 <qresource suffix="/"> 3 3 <file alias="add_host_iface_16px.png">images/add_host_iface_16px.png</file> 4 4 <file alias="add_host_iface_22px.png">images/add_host_iface_22px.png</file> … … 230 230 <file alias="log_viewer_bookmark_24px.png">images/log_viewer_bookmark_24px.png</file> 231 231 <file alias="log_viewer_bookmark_disabled_24px.png">images/log_viewer_bookmark_disabled_24px.png</file> 232 <file alias="log_viewer_bookmark_off_16px.png">images/log_viewer_bookmark_off_16px.png</file> 233 <file alias="log_viewer_bookmark_on_16px.png">images/log_viewer_bookmark_on_16px.png</file> 234 <file alias="log_viewer_delete_all_bookmarks_16px.png">images/log_viewer_delete_all_bookmarks_16px.png</file> 235 <file alias="log_viewer_delete_current_bookmark_16px.png">images/log_viewer_delete_current_bookmark_16px.png</file> 232 236 <file alias="log_viewer_filter_24px.png">images/log_viewer_filter_24px.png</file> 237 <file alias="log_viewer_filter_add_16px.png">images/log_viewer_filter_add_16px.png</file> 233 238 <file alias="log_viewer_filter_disabled_24px.png">images/log_viewer_filter_disabled_24px.png</file> 234 239 <file alias="log_viewer_find_24px.png">images/log_viewer_find_24px.png</file> 235 240 <file alias="log_viewer_find_disabled_24px.png">images/log_viewer_find_disabled_24px.png</file> 241 <file alias="log_viewer_goto_next_bookmark_16px.png">images/log_viewer_goto_next_bookmark_16px.png</file> 242 <file alias="log_viewer_goto_previous_bookmark_16px.png">images/log_viewer_goto_previous_bookmark_16px.png</file> 243 <file alias="log_viewer_goto_selected_bookmark_16px.png">images/log_viewer_goto_selected_bookmark_16px.png</file> 236 244 <file alias="log_viewer_refresh_24px.png">images/log_viewer_refresh_24px.png</file> 237 245 <file alias="log_viewer_refresh_disabled_24px.png">images/log_viewer_refresh_disabled_24px.png</file> 238 246 <file alias="log_viewer_save_24px.png">images/log_viewer_save_24px.png</file> 239 247 <file alias="log_viewer_save_disabled_24px.png">images/log_viewer_save_disabled_24px.png</file> 248 <file alias="log_viewer_search_backward_16px.png">images/log_viewer_search_backward_16px.png</file> 249 <file alias="log_viewer_search_forward_16px.png">images/log_viewer_search_forward_16px.png</file> 250 <file alias="log_viewer_settings_16px.png">images/log_viewer_settings_16px.png</file> 251 <file alias="log_viewer_settings_22px.png">images/log_viewer_settings_22px.png</file> 252 <file alias="log_viewer_settings_disabled_16px.png">images/log_viewer_settings_disabled_16px.png</file> 253 <file alias="log_viewer_settings_disabled_22px.png">images/log_viewer_settings_disabled_22px.png</file> 240 254 <file alias="machine_16px.png">images/machine_16px.png</file> 241 255 <file alias="machine_24px.png">images/machine_24px.png</file> … … 306 320 <file alias="os_netbsd.png">images/os_netbsd.png</file> 307 321 <file alias="os_netware.png">images/os_netware.png</file> 308 <file alias="os_openbsd_64.png">images/os_openbsd_64.png</file>309 <file alias="os_openbsd.png">images/os_openbsd.png</file>310 <file alias="os_opensuse_64.png">images/os_opensuse_64.png</file>311 <file alias="os_opensuse.png">images/os_opensuse.png</file>312 <file alias="os_oracle_64.png">images/os_oracle_64.png</file>313 <file alias="os_oracle.png">images/os_oracle.png</file>314 <file alias="os_oraclesolaris_64.png">images/os_oraclesolaris_64.png</file>315 322 </qresource> 316 323 </RCC> -
trunk/src/VBox/Frontends/VirtualBox/VirtualBox2.qrc
r70055 r71370 1 1 <RCC> 2 <qresource prefix="/"> 2 <qresource suffix="/"> 3 <file alias="os_openbsd_64.png">images/os_openbsd_64.png</file> 4 <file alias="os_openbsd.png">images/os_openbsd.png</file> 5 <file alias="os_opensuse_64.png">images/os_opensuse_64.png</file> 6 <file alias="os_opensuse.png">images/os_opensuse.png</file> 7 <file alias="os_oracle_64.png">images/os_oracle_64.png</file> 8 <file alias="os_oracle.png">images/os_oracle.png</file> 9 <file alias="os_oraclesolaris_64.png">images/os_oraclesolaris_64.png</file> 3 10 <file alias="os_oraclesolaris.png">images/os_oraclesolaris.png</file> 4 11 <file alias="os_os2ecs.png">images/os_os2ecs.png</file> -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksPanel.cpp
r71355 r71370 116 116 { 117 117 mainLayout()->addWidget(m_pGotoSelectedBookmark, 0); 118 m_pGotoSelectedBookmark->setIcon(UIIconPool:: defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));118 m_pGotoSelectedBookmark->setIcon(UIIconPool::iconSet(":/log_viewer_goto_selected_bookmark_16px.png")); 119 119 } 120 120 … … 138 138 { 139 139 pContainerLayout->addWidget(m_pPreviousButton); 140 m_pPreviousButton->setIcon(UIIconPool:: defaultIcon(UIIconPool::UIDefaultIconType_ArrowBack, this));140 m_pPreviousButton->setIcon(UIIconPool::iconSet(":/log_viewer_goto_previous_bookmark_16px.png")); 141 141 } 142 142 … … 144 144 if (m_pNextButton){ 145 145 pContainerLayout->addWidget(m_pNextButton); 146 m_pNextButton->setIcon(UIIconPool:: defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));146 m_pNextButton->setIcon(UIIconPool::iconSet(":/log_viewer_goto_next_bookmark_16px.png")); 147 147 } 148 148 } … … 152 152 { 153 153 mainLayout()->addWidget(m_pDeleteCurrentButton, 0); 154 m_pDeleteCurrentButton->setIcon( m_pDeleteCurrentButton->style()->standardIcon(QStyle::SP_TitleBarCloseButton));154 m_pDeleteCurrentButton->setIcon(UIIconPool::iconSet(":/log_viewer_delete_current_bookmark_16px.png")); 155 155 } 156 156 … … 159 159 { 160 160 mainLayout()->addWidget(m_pDeleteAllButton, 2); 161 m_pDeleteAllButton->setIcon(UIIconPool::iconSet(":/log_viewer_delete_all_bookmarks_16px.png")); 161 162 } 162 163 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp
r70745 r71370 65 65 :QLineEdit(parent) 66 66 , m_pRemoveTermButton(0) 67 , m_iRemoveTermButtonSize(16) 68 , m_iTrailingSpaceCount(1) 67 69 { 68 70 setReadOnly(true); 69 71 home(false); 70 72 createButtons(); 73 /** Try to guess the width of the space between filter terms so that remove button 74 we display when a term is selected does not hide the next/previous word: */ 75 int spaceWidth = fontMetrics().width(' '); 76 if (spaceWidth != 0) 77 m_iTrailingSpaceCount = (m_iRemoveTermButtonSize / spaceWidth) + 1; 71 78 } 72 79 … … 78 85 { 79 86 QString newString(filterTermString); 80 insert(newString.prepend(' ')); 87 QString space(m_iTrailingSpaceCount, QChar(' ')); 88 insert(newString.prepend(space)); 81 89 } 82 90 } … … 112 120 m_pRemoveTermButton->show(); 113 121 int buttonY = 0.5 * (height() - 16); 114 int buttonSize = 16;122 int buttonSize = m_iRemoveTermButtonSize; 115 123 int charWidth = fontMetrics().width('x'); 116 124 int buttonLeft = cursorRect().right() - 0.5 * charWidth; … … 137 145 emit sigFilterTermRemoved(selectedText()); 138 146 /* Remove the string from text() including the trailing space: */ 139 setText(text().remove(selectionStart(), selectedText().length() +1));147 setText(text().remove(selectionStart(), selectedText().length() + m_iTrailingSpaceCount)); 140 148 } 141 149 … … 173 181 QToolButton *m_pRemoveTermButton; 174 182 QToolButton *m_pClearAllButton; 183 const int m_iRemoveTermButtonSize; 184 int m_iTrailingSpaceCount; 175 185 }; 176 186 … … 372 382 if (m_pAddFilterTermButton) 373 383 { 374 m_pAddFilterTermButton->setIcon(UIIconPool:: defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));384 m_pAddFilterTermButton->setIcon(UIIconPool::iconSet(":/log_viewer_filter_add_16px.png")); 375 385 mainLayout()->addWidget(m_pAddFilterTermButton,0); 376 386 } … … 484 494 UIVMLogViewerPanel::retranslateUi(); 485 495 m_pFilterComboBox->setToolTip(UIVMLogViewerWidget::tr("Enter filtering string here.")); 486 m_pAddFilterTermButton->setToolTip(UIVMLogViewerWidget::tr("Add filter term. (Enter "));496 m_pAddFilterTermButton->setToolTip(UIVMLogViewerWidget::tr("Add filter term. (Enter)")); 487 497 m_pResultLabel->setText(UIVMLogViewerWidget::tr("Showing %1/%2").arg(m_iFilteredLineCount).arg(m_iUnfilteredLineCount)); 488 498 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.")); -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.cpp
r70750 r71370 88 88 if (m_pCloseButton) 89 89 { 90 m_pCloseButton->setIcon(m_pCloseButton->style()->standardIcon(QStyle::SP_TitleBarCloseButton)); 90 //m_pCloseButton->setIcon(UIIconPool::iconSet(":/log_viewer_close_16px.png")); 91 m_pCloseButton->setIcon(UIIconPool::iconSet(":/close_16px.png")); 91 92 m_pMainLayout->addWidget(m_pCloseButton, 0, Qt::AlignLeft); 92 93 } -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp
r70745 r71370 255 255 { 256 256 pContainerLayout->addWidget(m_pPreviousButton); 257 m_pPreviousButton->setIcon(UIIconPool:: defaultIcon(UIIconPool::UIDefaultIconType_ArrowBack, this));257 m_pPreviousButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_backward_16px.png")); 258 258 } 259 259 … … 261 261 if (m_pNextButton){ 262 262 pContainerLayout->addWidget(m_pNextButton); 263 m_pNextButton->setIcon(UIIconPool:: defaultIcon(UIIconPool::UIDefaultIconType_ArrowForward, this));263 m_pNextButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_forward_16px.png")); 264 264 } 265 265 } … … 360 360 361 361 if (m_pNextButton) 362 m_pNextButton->setToolTip(UIVMLogViewerWidget::tr("Search for the previousoccurrence of the string (F3)"));362 m_pNextButton->setToolTip(UIVMLogViewerWidget::tr("Search for the next occurrence of the string (F3)")); 363 363 364 364 if (m_pPreviousButton) -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.cpp
r71050 r71370 32 32 33 33 /* GUI includes: */ 34 # include "UIIconPool.h" 34 35 # include "UIVMLogViewerTextEdit.h" 35 36 # include "UIVMLogViewerWidget.h" … … 90 91 { 91 92 QScrollBar::paintEvent(pEvent); 92 /* Put a red line to mark ing position: */93 /* Put a red line to mark the bookmark positions: */ 93 94 for (int i = 0; i < m_markingsVector.size(); ++i) 94 95 { … … 160 161 , m_bShowLineNumbers(true) 161 162 , m_bWrapLines(false) 163 , m_bHasContextMenu(false) 162 164 { 163 165 setMouseTracking(true); … … 245 247 painter.drawPath(path); 246 248 } 247 if ((blockNumber + 1) == m_mouseCursorLine && underMouse()) 249 /* Draw a unfilled red rectangled around the line number to indicate line the mouse cursor is currently 250 hovering on. Do this only if mouse is over the ext edit or the context menu is around: */ 251 if ((blockNumber + 1) == m_mouseCursorLine && (underMouse() || m_bHasContextMenu)) 248 252 { 249 253 painter.setPen(Qt::red); … … 317 321 return; 318 322 } 319 323 m_bHasContextMenu = true; 320 324 QMenu *menu = createStandardContextMenu(); 325 326 321 327 QAction *pAction = menu->addAction(UIVMLogViewerWidget::tr("Bookmark")); 322 m_iContextMenuBookmark = bookmarkForPos(pEvent->pos());323 328 if (pAction) 329 { 330 pAction->setCheckable(true); 331 QPair<int, QString> menuBookmark = bookmarkForPos(pEvent->pos()); 332 pAction->setChecked(m_bookmarkLineSet.contains(menuBookmark.first)); 333 if (pAction->isChecked()) 334 pAction->setIcon(UIIconPool::iconSet(":/log_viewer_bookmark_on_16px.png")); 335 else 336 pAction->setIcon(UIIconPool::iconSet(":/log_viewer_bookmark_off_16px.png")); 337 338 m_iContextMenuBookmark = menuBookmark; 324 339 connect(pAction, &QAction::triggered, this, &UIVMLogViewerTextEdit::sltBookmark); 325 340 341 } 326 342 menu->exec(pEvent->globalPos()); 327 343 … … 330 346 331 347 delete menu; 348 m_bHasContextMenu = false; 332 349 } 333 350 … … 376 393 void UIVMLogViewerTextEdit::sltBookmark() 377 394 { 378 emit sigAddBookmark(m_iContextMenuBookmark);395 toggleBookmark(m_iContextMenuBookmark); 379 396 } 380 397 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.h
r70792 r71370 109 109 QString m_strBackgroungText; 110 110 friend class UILineNumberArea; 111 bool m_bHasContextMenu; 111 112 }; 112 113 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp
r71355 r71370 525 525 m_pActionFind->setIcon(UIIconPool::iconSet(QString(":/%1_find_24px.png").arg(strPrefix), 526 526 QString(":/%1_find_disabled_24px.png").arg(strPrefix))); 527 528 527 if (m_pActionFilter) 529 528 m_pActionFilter->setIcon(UIIconPool::iconSet(QString(":/%1_filter_24px.png").arg(strPrefix), 530 529 QString(":/%1_filter_disabled_24px.png").arg(strPrefix))); 531 532 533 530 if (m_pActionRefresh) 534 531 m_pActionRefresh->setIcon(UIIconPool::iconSet(QString(":/%1_refresh_24px.png").arg(strPrefix), 535 532 QString(":/%1_refresh_disabled_24px.png").arg(strPrefix))); 536 537 538 533 if (m_pActionSave) 539 534 m_pActionSave->setIcon(UIIconPool::iconSet(QString(":/%1_save_24px.png").arg(strPrefix), 540 535 QString(":/%1_save_disabled_24px.png").arg(strPrefix))); 541 542 536 if (m_pActionBookmarks) 543 537 m_pActionBookmarks->setIcon(UIIconPool::iconSet(QString(":/%1_bookmark_24px.png").arg(strPrefix), 544 538 QString(":/%1_bookmark_disabled_24px.png").arg(strPrefix))); 545 546 539 if (m_pActionSettings) 547 m_pActionSettings->setIcon(UIIconPool::iconSet(QString(":/%1_ bookmark_24px.png").arg(strPrefix),548 QString(":/%1_ bookmark_disabled_24px.png").arg(strPrefix)));540 m_pActionSettings->setIcon(UIIconPool::iconSet(QString(":/%1_settings_22px.png").arg(strPrefix), 541 QString(":/%1_settings_disabled_22px.png").arg(strPrefix))); 549 542 } 550 543
Note:
See TracChangeset
for help on using the changeset viewer.