Changeset 88903 in vbox
- Timestamp:
- May 6, 2021 1:47:30 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/logviewer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.cpp
r88901 r88903 66 66 , m_comMachine(comMachine) 67 67 { 68 } 69 70 UIVMLogViewerDialog::~UIVMLogViewerDialog() 71 { 72 UIVMLogViewerWidget *pWidget = qobject_cast<UIVMLogViewerWidget*>(widget()); 73 if (pWidget) 74 pWidget->setDialogBeingClosed(true); 68 75 } 69 76 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.h
r88901 r88903 78 78 * @param comMachine Brings the machine reference. */ 79 79 UIVMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine); 80 ~UIVMLogViewerDialog(); 80 81 81 82 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp
r88877 r88903 164 164 , m_pCornerButton(0) 165 165 , m_pMachineSelectionMenu(0) 166 , m_fDialogBeingClosed(false) 166 167 { 167 168 /* Prepare VM Log-Viewer: */ … … 289 290 } 290 291 292 void UIVMLogViewerWidget::setDialogBeingClosed(bool fFlag) 293 { 294 m_fDialogBeingClosed = fFlag; 295 } 296 291 297 bool UIVMLogViewerWidget::shouldBeMaximized() const 292 298 { … … 294 300 } 295 301 296 void UIVMLogViewerWidget::sltSaveOptions() 297 { 302 void UIVMLogViewerWidget::saveOptions() 303 { 304 gEDataManager->setLogViweverOptions(m_font, m_bWrapLines, m_bShowLineNumbers); 305 } 306 307 void UIVMLogViewerWidget::savePanelVisibility() 308 { 309 if (m_fDialogBeingClosed) 310 return; 298 311 /* Save a list of currently visible panels: */ 299 312 QStringList strNameList; … … 301 314 strNameList.append(pPanel->panelName()); 302 315 gEDataManager->setLogViewerVisiblePanels(strNameList); 303 gEDataManager->setLogViweverOptions(m_font, m_bWrapLines, m_bShowLineNumbers);304 316 } 305 317 … … 508 520 pLogPage->setShowLineNumbers(m_bShowLineNumbers); 509 521 } 522 saveOptions(); 510 523 } 511 524 … … 523 536 pLogPage->setWrapLines(m_bWrapLines); 524 537 } 538 saveOptions(); 525 539 } 526 540 … … 536 550 pLogPage->setCurrentFont(m_font); 537 551 } 552 saveOptions(); 538 553 } 539 554 … … 549 564 pLogPage->setCurrentFont(m_font); 550 565 } 566 saveOptions(); 551 567 } 552 568 … … 563 579 m_pOptionsPanel->setFontSizeInPoints(m_font.pointSize()); 564 580 } 581 saveOptions(); 565 582 } 566 583 … … 766 783 if (loadedFont != QFont()) 767 784 m_font = loadedFont; 768 connect(&uiCommon(), &UICommon::sigAskToCommitData,769 this, &UIVMLogViewerWidget::sltSaveOptions);770 785 } 771 786 … … 1054 1069 m_visiblePanelsList.removeOne(panel); 1055 1070 manageEscapeShortCut(); 1071 savePanelVisibility(); 1056 1072 } 1057 1073 … … 1069 1085 m_visiblePanelsList.push_back(panel); 1070 1086 manageEscapeShortCut(); 1087 savePanelVisibility(); 1071 1088 } 1072 1089 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h
r88834 r88903 89 89 QFont currentFont() const; 90 90 91 /** Sets m_fDialogBeingClosed. */ 92 void setDialogBeingClosed(bool fFlag); 93 91 94 protected: 92 95 … … 95 98 96 99 private slots: 97 98 /** Saves options. */99 void sltSaveOptions();100 100 101 101 /** Rereads the log file shown in the current tab. */ … … 152 152 /** Prepares toolbar. */ 153 153 void prepareToolBar(); 154 void saveOptions(); 154 155 /** Loads options. */ 155 156 void loadOptions(); 157 void savePanelVisibility(); 156 158 /** Shows the panels that have been visible the last time logviewer is closed. */ 157 159 void restorePanelVisibility(); … … 246 248 QIToolButton *m_pCornerButton; 247 249 UIMachineListMenu *m_pMachineSelectionMenu; 250 /** This is set to true by the parent dialog. This is necessary not to save 251 * visible panel list during destruction since they are hidden automatically during that. */ 252 bool m_fDialogBeingClosed; 248 253 friend class UIVMLogViewerFilterPanel; 249 254 friend class UIVMLogViewerPanel;
Note:
See TracChangeset
for help on using the changeset viewer.