Changeset 29015 in vbox
- Timestamp:
- May 4, 2010 1:30:16 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r28800 r29015 57 57 58 58 QString strToolTip = QApplication::translate("VBoxConsoleWnd", "<p style='white-space:pre'><nobr>Indicates the activity " 59 "of the virtual hard disks:</nobr>%1</p>", "HDD tooltip");59 "of the virtual hard disks:</nobr>%1</p>", "HDD tooltip"); 60 60 61 61 QString strFullData; 62 bool bAttachmentsPresent = false;62 bool fAttachmentsPresent = false; 63 63 64 64 const CStorageControllerVector &controllers = machine.GetStorageControllers(); … … 74 74 .arg(vboxGlobal().toString(StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()))) 75 75 .arg(VBoxMedium(attachment.GetMedium(), VBoxDefs::MediumType_HardDisk).location()); 76 bAttachmentsPresent = true;76 fAttachmentsPresent = true; 77 77 } 78 78 if (!strAttData.isNull()) … … 80 80 } 81 81 82 if (!bAttachmentsPresent) 83 strFullData += QApplication::translate("VBoxConsoleWnd", "<br><nobr><b>No hard disks attached</b></nobr>", "HDD tooltip"); 82 /* For now we will hide that LED at all if there are no attachments! */ 83 setHidden(!fAttachmentsPresent); 84 //if (!fAttachmentsPresent) 85 // strFullData += QApplication::translate("VBoxConsoleWnd", "<br><nobr><b>No hard disks attached</b></nobr>", "HDD tooltip"); 84 86 85 87 setToolTip(strToolTip.arg(strFullData)); 86 setState( bAttachmentsPresent ? KDeviceActivity_Idle : KDeviceActivity_Null);88 setState(fAttachmentsPresent ? KDeviceActivity_Idle : KDeviceActivity_Null); 87 89 } 88 90 … … 121 123 122 124 QString strToolTip = QApplication::translate("VBoxConsoleWnd", "<p style='white-space:pre'><nobr>Indicates the activity " 123 "of the CD/DVD devices:</nobr>%1</p>", "CD/DVD tooltip");125 "of the CD/DVD devices:</nobr>%1</p>", "CD/DVD tooltip"); 124 126 125 127 QString strFullData; 126 bool bAttachmentsPresent = false; 128 bool fAttachmentsPresent = false; 129 bool fAttachmentsMounted = false; 127 130 128 131 const CStorageControllerVector &controllers = machine.GetStorageControllers(); … … 139 142 .arg(vboxGlobal().toString(StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()))) 140 143 .arg(vboxMedium.isNull() || vboxMedium.isHostDrive() ? vboxMedium.name() : vboxMedium.location()); 144 fAttachmentsPresent = true; 141 145 if (!vboxMedium.isNull()) 142 bAttachmentsPresent= true;146 fAttachmentsMounted = true; 143 147 } 144 148 if (!strAttData.isNull()) … … 146 150 } 147 151 148 if (strFullData.isNull()) 149 strFullData = QApplication::translate("VBoxConsoleWnd", "<br><nobr><b>No CD/DVD devices attached</b></nobr>", "CD/DVD tooltip"); 152 /* For now we will hide that LED at all if there are no attachments! */ 153 setHidden(!fAttachmentsPresent); 154 //if (!fAttachmentsPresent) 155 // strFullData = QApplication::translate("VBoxConsoleWnd", "<br><nobr><b>No CD/DVD devices attached</b></nobr>", "CD/DVD tooltip"); 150 156 151 157 setToolTip(strToolTip.arg(strFullData)); 152 setState( bAttachmentsPresent? KDeviceActivity_Idle : KDeviceActivity_Null);158 setState(fAttachmentsMounted ? KDeviceActivity_Idle : KDeviceActivity_Null); 153 159 } 154 160 … … 186 192 const CMachine &machine = m_session.GetMachine(); 187 193 188 QString tip = QApplication::translate("VBoxConsoleWnd", "<p style='white-space:pre'><nobr>Indicates the activity " 189 "of the floppy devices:</nobr>%1</p>", "FD tooltip"); 190 QString data; 191 bool attachmentsPresent = false; 194 QString strToolTip = QApplication::translate("VBoxConsoleWnd", "<p style='white-space:pre'><nobr>Indicates the activity " 195 "of the floppy devices:</nobr>%1</p>", "FD tooltip"); 196 197 QString strFullData; 198 bool fAttachmentsPresent = false; 199 bool fAttachmentsMounted = false; 192 200 193 201 const CStorageControllerVector &controllers = machine.GetStorageControllers(); 194 202 foreach (const CStorageController &controller, controllers) 195 203 { 196 QString attData;197 const CMediumAttachmentVector &attachments = machine.GetMediumAttachmentsOfController 204 QString strAttData; 205 const CMediumAttachmentVector &attachments = machine.GetMediumAttachmentsOfController(controller.GetName()); 198 206 foreach (const CMediumAttachment &attachment, attachments) 199 207 { 200 208 if (attachment.GetType() != KDeviceType_Floppy) 201 209 continue; 202 VBoxMedium vboxMedium (attachment.GetMedium(), VBoxDefs::MediumType_Floppy); 203 attData += QString ("<br> <nobr>%1: %2</nobr>") 204 .arg (vboxGlobal().toString (StorageSlot (controller.GetBus(), attachment.GetPort(), attachment.GetDevice()))) 205 .arg (vboxMedium.isNull() || vboxMedium.isHostDrive() ? vboxMedium.name() : vboxMedium.location()); 210 VBoxMedium vboxMedium(attachment.GetMedium(), VBoxDefs::MediumType_Floppy); 211 strAttData += QString("<br> <nobr>%1: %2</nobr>") 212 .arg(vboxGlobal().toString(StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()))) 213 .arg(vboxMedium.isNull() || vboxMedium.isHostDrive() ? vboxMedium.name() : vboxMedium.location()); 214 fAttachmentsPresent = true; 206 215 if (!vboxMedium.isNull()) 207 attachmentsPresent= true;216 fAttachmentsMounted = true; 208 217 } 209 if (!attData.isNull()) 210 data += QString ("<br><nobr><b>%1</b></nobr>").arg (controller.GetName()) + attData; 211 } 212 213 if (data.isNull()) 214 data = QApplication::translate("VBoxConsoleWnd", "<br><nobr><b>No floppy devices attached</b></nobr>", "FD tooltip"); 215 216 setToolTip (tip.arg (data)); 217 setState (attachmentsPresent ? KDeviceActivity_Idle : KDeviceActivity_Null); 218 if (!strAttData.isNull()) 219 strFullData += QString("<br><nobr><b>%1</b></nobr>").arg(controller.GetName()) + strAttData; 220 } 221 222 /* For now we will hide that LED at all if there are no attachments! */ 223 setHidden(!fAttachmentsPresent); 224 //if (!fAttachmentsPresent) 225 // strFullData = QApplication::translate("VBoxConsoleWnd", "<br><nobr><b>No floppy devices attached</b></nobr>", "FD tooltip"); 226 227 setToolTip(strToolTip.arg(strFullData)); 228 setState(fAttachmentsMounted ? KDeviceActivity_Idle : KDeviceActivity_Null); 218 229 } 219 230 … … 666 677 m_IndicatorsPool[index] = new UIIndicatorOpticalDisks(m_session); 667 678 break; 679 case UIIndicatorIndex_FloppyDisks: 680 m_IndicatorsPool[index] = new UIIndicatorFloppyDisks(m_session); 681 break; 668 682 case UIIndicatorIndex_NetworkAdapters: 669 683 m_IndicatorsPool[index] = new UIIndicatorNetworkAdapters(m_session); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r28994 r29015 176 176 pStateIndicator->setState(state); 177 177 } 178 pStateIndicator = indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks); 179 if (pStateIndicator->state() != KDeviceActivity_Null) 180 { 181 int state = console.GetDeviceActivity(KDeviceType_Floppy); 182 if (pStateIndicator->state() != state) 183 pStateIndicator->setState(state); 184 } 178 185 pStateIndicator = indicatorsPool()->indicator(UIIndicatorIndex_USBDevices); 179 186 if (pStateIndicator->state() != KDeviceActivity_Null) … … 205 212 if (machineLogic()->actionsPool()->action(UIActionIndex_Menu_OpticalDevices)->isEnabled()) 206 213 machineLogic()->actionsPool()->action(UIActionIndex_Menu_OpticalDevices)->menu()->exec(pEvent->globalPos()); 214 } 215 else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks)) 216 { 217 if (machineLogic()->actionsPool()->action(UIActionIndex_Menu_FloppyDevices)->isEnabled()) 218 machineLogic()->actionsPool()->action(UIActionIndex_Menu_FloppyDevices)->menu()->exec(pEvent->globalPos()); 207 219 } 208 220 else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_USBDevices)) … … 256 268 if (iElement & UIVisualElement_CDStuff) 257 269 indicatorsPool()->indicator(UIIndicatorIndex_OpticalDisks)->updateAppearance(); 270 if (iElement & UIVisualElement_FDStuff) 271 indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks)->updateAppearance(); 258 272 if (iElement & UIVisualElement_USBStuff && 259 273 !indicatorsPool()->indicator(UIIndicatorIndex_USBDevices)->isHidden()) … … 379 393 this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*))); 380 394 395 /* Floppy Disks: */ 396 QIStateIndicator *pLedFloppyDisks = indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks); 397 pIndicatorBoxHLayout->addWidget(pLedFloppyDisks); 398 connect(pLedFloppyDisks, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)), 399 this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*))); 400 381 401 /* USB Devices: */ 382 402 QIStateIndicator *pLedUSBDevices = indicatorsPool()->indicator(UIIndicatorIndex_USBDevices);
Note:
See TracChangeset
for help on using the changeset viewer.