- Timestamp:
- Jun 5, 2017 4:17:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.cpp
r67260 r67261 96 96 bool isCurrentStateItem() const { return m_fCurrentStateItem; } 97 97 98 /** Returns whether this is the current snapshot item. */ 99 bool isCurrentSnapshotItem() const { return m_fCurrentSnapshotItem; } 100 /** Defines whether this is the @a fCurrent snapshot item. */ 101 void setCurrentSnapshotItem(bool fCurrent); 102 98 103 /** Calculates and returns the current item level. */ 99 104 int level() const; 100 101 /** Returns whether the font is bold. */102 bool bold() const;103 /** Defines whether the font is @a fBold. */104 void setBold(bool fBold);105 106 /** Returns whether the font is italic. */107 bool italic() const;108 /** Defines whether the font is @a fItalic. */109 void setItalic(bool fItalic);110 105 111 106 /** Recaches the item's contents. */ … … 135 130 /** Holds whether this is a "current state" item. */ 136 131 bool m_fCurrentStateItem; 132 /** Holds whether this is a "current snapshot" item. */ 133 bool m_fCurrentSnapshotItem; 137 134 138 135 /** Holds the snapshot COM wrapper. */ … … 200 197 , m_pSnapshotWidget(pSnapshotWidget) 201 198 , m_fCurrentStateItem(false) 199 , m_fCurrentSnapshotItem(false) 202 200 , m_comSnapshot(comSnapshot) 203 201 { … … 208 206 , m_pSnapshotWidget(pSnapshotWidget) 209 207 , m_fCurrentStateItem(false) 208 , m_fCurrentSnapshotItem(false) 210 209 , m_comSnapshot(comSnapshot) 211 210 { … … 216 215 , m_pSnapshotWidget(pSnapshotWidget) 217 216 , m_fCurrentStateItem(true) 217 , m_fCurrentSnapshotItem(false) 218 218 , m_comMachine(comMachine) 219 219 { 220 /* Set the bold font state 221 * for current state item: */ 222 QFont myFont = font(0); 223 myFont.setBold(true); 224 setFont(0, myFont); 225 220 226 /* Fetch current machine state: */ 221 227 setMachineState(m_comMachine.GetState()); … … 226 232 , m_pSnapshotWidget(pSnapshotWidget) 227 233 , m_fCurrentStateItem(true) 234 , m_fCurrentSnapshotItem(false) 228 235 , m_comMachine(comMachine) 229 236 { 237 /* Set the bold font state 238 * for current state item: */ 239 QFont myFont = font(0); 240 myFont.setBold(true); 241 setFont(0, myFont); 242 230 243 /* Fetch current machine state: */ 231 244 setMachineState(m_comMachine.GetState()); … … 282 295 } 283 296 284 bool UISnapshotItem::bold() const 285 { 286 return font(0).bold(); 287 } 288 289 void UISnapshotItem::setBold(bool fBold) 290 { 291 /* Update font: */ 297 void UISnapshotItem::setCurrentSnapshotItem(bool fCurrent) 298 { 299 /* Remember the state: */ 300 m_fCurrentSnapshotItem = fCurrent; 301 302 /* Set/clear the bold font state 303 * for current snapshot item: */ 292 304 QFont myFont = font(0); 293 myFont.setBold(f Bold);305 myFont.setBold(fCurrent); 294 306 setFont(0, myFont); 295 307 296 /* Adjust text: */ 297 adjustText(); 298 } 299 300 bool UISnapshotItem::italic() const 301 { 302 return font(0).italic(); 303 } 304 305 void UISnapshotItem::setItalic(bool fItalic) 306 { 307 /* Update font: */ 308 QFont myFont = font(0); 309 myFont.setItalic(fItalic); 310 setFont(0, myFont); 311 312 /* Adjust text: */ 313 adjustText(); 308 /* Update tool-tip: */ 309 recacheToolTip(); 314 310 } 315 311 … … 462 458 else 463 459 { 464 /* The current snapshot is always bold: */ 465 if (bold()) 460 if (isCurrentSnapshotItem()) 466 461 strDetails = UISnapshotPane::tr(" (current, ", "Snapshot details"); 467 462 else … … 1131 1126 /* Add the "current state" item as a child to current snapshot item: */ 1132 1127 UISnapshotItem *pCsi = new UISnapshotItem(this, m_pCurrentSnapshotItem, m_comMachine); 1133 pCsi->setBold(true);1134 1128 pCsi->recache(); 1135 1129 … … 1154 1148 /* Add the "current state" item as a child of snapshot tree: */ 1155 1149 UISnapshotItem *pCsi = new UISnapshotItem(this, m_pSnapshotTree, m_comMachine); 1156 pCsi->setBold(true);1157 1150 pCsi->recache(); 1158 1151 … … 1177 1170 pSnapshotItem->recache(); 1178 1171 1179 /* Mark current snapshot item boldand remember it: */1172 /* Mark snapshot item as "current" and remember it: */ 1180 1173 CSnapshot comCurrentSnapshot = m_comMachine.GetCurrentSnapshot(); 1181 1174 if (!comCurrentSnapshot.isNull() && comCurrentSnapshot.GetId() == comSnapshot.GetId()) 1182 1175 { 1183 pSnapshotItem->set Bold(true);1176 pSnapshotItem->setCurrentSnapshotItem(true); 1184 1177 m_pCurrentSnapshotItem = pSnapshotItem; 1185 1178 }
Note:
See TracChangeset
for help on using the changeset viewer.