Changeset 96658 in vbox
- Timestamp:
- Sep 8, 2022 1:10:38 PM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/snapshots
- Files:
-
- 3 edited
-
UISnapshotDetailsWidget.cpp (modified) (4 diffs)
-
UISnapshotDetailsWidget.h (modified) (3 diffs)
-
UISnapshotPane.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotDetailsWidget.cpp
r96407 r96658 780 780 void UISnapshotDetailsWidget::sltHandleNameChange() 781 781 { 782 m_newData. m_strName = m_pEditorName->text();782 m_newData.setName(m_pEditorName->text()); 783 783 revalidate(m_pErrorPaneName); 784 784 updateButtonStates(); … … 787 787 void UISnapshotDetailsWidget::sltHandleDescriptionChange() 788 788 { 789 m_newData. m_strDescription = m_pBrowserDescription->toPlainText();789 m_newData.setDescription(m_pBrowserDescription->toPlainText()); 790 790 revalidate(m_pErrorPaneDescription); 791 791 updateButtonStates(); … … 1150 1150 { 1151 1151 /* Read general snapshot properties: */ 1152 m_pEditorName->setText(m_newData. m_strName);1153 m_pBrowserDescription->setText(m_newData. m_strDescription);1152 m_pEditorName->setText(m_newData.name()); 1153 m_pBrowserDescription->setText(m_newData.description()); 1154 1154 revalidate(); 1155 1155 … … 1197 1197 if (!pWidget || pWidget == m_pErrorPaneName) 1198 1198 { 1199 const bool fError = m_newData. m_strName.isEmpty();1199 const bool fError = m_newData.name().isEmpty(); 1200 1200 m_pErrorPaneName->setVisible(fError && m_comMachine.isNull()); 1201 1201 } -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotDetailsWidget.h
r96407 r96658 59 59 60 60 61 /** Snapshot pane: Snapshot data structure. */62 structUIDataSnapshot61 /** Snapshot pane: Snapshot data. */ 62 class UIDataSnapshot 63 63 { 64 public: 65 64 66 /** Constructs data. */ 65 67 UIDataSnapshot() … … 67 69 , m_strDescription(QString()) 68 70 {} 71 72 /** Returns name. */ 73 QString name() const { return m_strName; } 74 /** Defines @a strName. */ 75 void setName(const QString &strName) { m_strName = strName; } 76 77 /** Returns description. */ 78 QString description() const { return m_strDescription; } 79 /** Defines @a strDescription. */ 80 void setDescription(const QString &strDescription) { m_strDescription = strDescription; } 69 81 70 82 /** Returns whether the @a other passed data is equal to this one. */ … … 82 94 bool operator!=(const UIDataSnapshot &other) const { return !equal(other); } 83 95 84 /** Holds the snapshot name. */ 85 QString m_strName; 86 /** Holds the snapshot description. */ 87 QString m_strDescription; 96 protected: 97 98 /** Holds the name. */ 99 QString m_strName; 100 /** Holds the description. */ 101 QString m_strDescription; 88 102 }; 89 103 -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp
r96635 r96658 87 87 88 88 /** Constructs normal snapshot item (child of tree-widget). */ 89 UISnapshotItem(UISnapshotPane *pSnapshotWidget, QITreeWidget *pTreeWidget, const CSnapshot &comSnapshot); 89 UISnapshotItem(UISnapshotPane *pSnapshotWidget, 90 QITreeWidget *pTreeWidget, 91 const CSnapshot &comSnapshot); 90 92 /** Constructs normal snapshot item (child of tree-widget-item). */ 91 UISnapshotItem(UISnapshotPane *pSnapshotWidget, QITreeWidgetItem *pRootItem, const CSnapshot &comSnapshot); 93 UISnapshotItem(UISnapshotPane *pSnapshotWidget, 94 QITreeWidgetItem *pRootItem, 95 const CSnapshot &comSnapshot); 92 96 93 97 /** Constructs "current state" item (child of tree-widget). */ 94 UISnapshotItem(UISnapshotPane *pSnapshotWidget, QITreeWidget *pTreeWidget, const CMachine &comMachine); 98 UISnapshotItem(UISnapshotPane *pSnapshotWidget, 99 QITreeWidget *pTreeWidget, 100 const CMachine &comMachine); 95 101 /** Constructs "current state" item (child of tree-widget-item). */ 96 UISnapshotItem(UISnapshotPane *pSnapshotWidget, QITreeWidgetItem *pRootItem, const CMachine &comMachine); 102 UISnapshotItem(UISnapshotPane *pSnapshotWidget, 103 QITreeWidgetItem *pRootItem, 104 const CMachine &comMachine); 97 105 98 106 /** Returns item machine. */ … … 200 208 } 201 209 202 UISnapshotItem::UISnapshotItem(UISnapshotPane *pSnapshotWidget, QITreeWidget *pTreeWidget, const CSnapshot &comSnapshot) 210 UISnapshotItem::UISnapshotItem(UISnapshotPane *pSnapshotWidget, 211 QITreeWidget *pTreeWidget, 212 const CSnapshot &comSnapshot) 203 213 : QITreeWidgetItem(pTreeWidget) 204 214 , m_pSnapshotWidget(pSnapshotWidget) … … 212 222 } 213 223 214 UISnapshotItem::UISnapshotItem(UISnapshotPane *pSnapshotWidget, QITreeWidgetItem *pRootItem, const CSnapshot &comSnapshot) 224 UISnapshotItem::UISnapshotItem(UISnapshotPane *pSnapshotWidget, 225 QITreeWidgetItem *pRootItem, 226 const CSnapshot &comSnapshot) 215 227 : QITreeWidgetItem(pRootItem) 216 228 , m_pSnapshotWidget(pSnapshotWidget) … … 224 236 } 225 237 226 UISnapshotItem::UISnapshotItem(UISnapshotPane *pSnapshotWidget, QITreeWidget *pTreeWidget, const CMachine &comMachine) 238 UISnapshotItem::UISnapshotItem(UISnapshotPane *pSnapshotWidget, 239 QITreeWidget *pTreeWidget, 240 const CMachine &comMachine) 227 241 : QITreeWidgetItem(pTreeWidget) 228 242 , m_pSnapshotWidget(pSnapshotWidget) … … 244 258 } 245 259 246 UISnapshotItem::UISnapshotItem(UISnapshotPane *pSnapshotWidget, QITreeWidgetItem *pRootItem, const CMachine &comMachine) 260 UISnapshotItem::UISnapshotItem(UISnapshotPane *pSnapshotWidget, 261 QITreeWidgetItem *pRootItem, 262 const CMachine &comMachine) 247 263 : QITreeWidgetItem(pRootItem) 248 264 , m_pSnapshotWidget(pSnapshotWidget) … … 452 468 /* Prepare tool-tip: */ 453 469 QString strToolTip = QString("<nobr><b>%1</b>%2</nobr><br><nobr>%3</nobr>") 454 .arg( text(Column_Name)).arg(strDetails).arg(strDateTime);470 .arg(name()).arg(strDetails).arg(strDateTime); 455 471 456 472 /* Append description if any: */ … … 968 984 /* Take snapshot: */ 969 985 UINotificationProgressSnapshotTake *pNotification = new UINotificationProgressSnapshotTake(m_comMachine, 970 newData. m_strName,971 newData. m_strDescription);986 newData.name(), 987 newData.description()); 972 988 gpNotificationCenter->append(pNotification); 973 989 } … … 1003 1019 { 1004 1020 /* Save snapshot name: */ 1005 if (newData. m_strName != oldData.m_strName)1021 if (newData.name() != oldData.name()) 1006 1022 { 1007 comSnapshot.SetName(newData. m_strName);1023 comSnapshot.SetName(newData.name()); 1008 1024 if (!comSnapshot.isOk()) 1009 1025 { 1010 UINotificationMessage::cannotChangeSnapshot(comSnapshot, oldData. m_strName, comMachine.GetName());1026 UINotificationMessage::cannotChangeSnapshot(comSnapshot, oldData.name(), comMachine.GetName()); 1011 1027 break; 1012 1028 } … … 1014 1030 1015 1031 /* Save snapshot description: */ 1016 if (newData. m_strDescription != oldData.m_strDescription)1032 if (newData.description() != oldData.description()) 1017 1033 { 1018 comSnapshot.SetDescription(newData. m_strDescription);1034 comSnapshot.SetDescription(newData.description()); 1019 1035 if (!comSnapshot.isOk()) 1020 1036 { 1021 UINotificationMessage::cannotChangeSnapshot(comSnapshot, oldData. m_strName, comMachine.GetName());1037 UINotificationMessage::cannotChangeSnapshot(comSnapshot, oldData.name(), comMachine.GetName()); 1022 1038 break; 1023 1039 } … … 1126 1142 { 1127 1143 /* Rename corresponding snapshot if necessary: */ 1128 if (comSnapshot.GetName() != pSnapshotItem-> text(Column_Name))1144 if (comSnapshot.GetName() != pSnapshotItem->name()) 1129 1145 { 1130 1146 /* We need to open a session when we manipulate the snapshot data of a machine: */ … … 1135 1151 1136 1152 /* Save snapshot name: */ 1137 comSnapshot.SetName(pSnapshotItem-> text(Column_Name));1153 comSnapshot.SetName(pSnapshotItem->name()); 1138 1154 1139 1155 /* Close the session again: */ … … 1547 1563 while (*iterator) 1548 1564 { 1549 const QString strName = static_cast<UISnapshotItem*>(*iterator)-> text(Column_Name);1565 const QString strName = static_cast<UISnapshotItem*>(*iterator)->name(); 1550 1566 const int iPosition = reName.indexIn(strName); 1551 1567 if (iPosition != -1)
Note:
See TracChangeset
for help on using the changeset viewer.

