Changeset 92427 in vbox
- Timestamp:
- Nov 15, 2021 2:12:20 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
r92414 r92427 29 29 #include "QITabWidget.h" 30 30 #include "QIToolButton.h" 31 #include "UIActionPool.h" 31 32 #include "UICommon.h" 32 33 #include "UIDesktopWidgetWatchdog.h" … … 169 170 void UIMediumSelector::prepareActions() 170 171 { 171 QString strPrefix("hd"); 172 if (!m_pActionPool) 173 return; 174 172 175 switch (m_enmMediumType) 173 176 { 174 177 case UIMediumDeviceType_DVD: 175 strPrefix = "cd"; 178 m_pActionAdd = m_pActionPool->action(UIActionIndex_M_MediumSelector_AddCD); 179 m_pActionCreate = m_pActionPool->action(UIActionIndex_M_MediumSelector_CreateCD); 176 180 break; 177 181 case UIMediumDeviceType_Floppy: 178 strPrefix = "fd"; 182 m_pActionAdd = m_pActionPool->action(UIActionIndex_M_MediumSelector_AddFD); 183 m_pActionCreate = m_pActionPool->action(UIActionIndex_M_MediumSelector_CreateFD); 179 184 break; 180 185 case UIMediumDeviceType_HardDisk: … … 182 187 case UIMediumDeviceType_Invalid: 183 188 default: 184 strPrefix = "hd"; 185 break; 186 } 187 188 m_pActionAdd = new QAction(this); 189 if (m_pActionAdd) 190 { 191 /* Configure add-action: */ 192 m_pActionAdd->setShortcut(QKeySequence("")); 193 194 m_pActionAdd->setIcon(UIIconPool::iconSetFull(QString(":/%1_add_32px.png").arg(strPrefix), 195 QString(":/%1_add_16px.png").arg(strPrefix), 196 QString(":/%1_add_disabled_32px.png").arg(strPrefix), 197 QString(":/%1_add_disabled_16px.png").arg(strPrefix))); 198 } 199 200 m_pActionCreate = new QAction(this); 201 if (m_pActionCreate) 202 { 203 m_pActionCreate->setShortcut(QKeySequence("")); 204 m_pActionCreate->setIcon(UIIconPool::iconSetFull(QString(":/%1_create_32px.png").arg(strPrefix), 205 QString(":/%1_create_16px.png").arg(strPrefix), 206 QString(":/%1_create_disabled_32px.png").arg(strPrefix), 207 QString(":/%1_create_disabled_16px.png").arg(strPrefix))); 208 } 209 210 m_pActionRefresh = new QAction(this); 211 if (m_pActionRefresh) 212 { 213 m_pActionRefresh->setShortcut(QKeySequence()); 214 if (m_pActionRefresh && m_pActionRefresh->icon().isNull()) 215 m_pActionRefresh->setIcon(UIIconPool::iconSetFull(":/refresh_32px.png", ":/refresh_16px.png", 216 ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")); 217 } 189 m_pActionAdd = m_pActionPool->action(UIActionIndex_M_MediumSelector_AddHD); 190 m_pActionCreate = m_pActionPool->action(UIActionIndex_M_MediumSelector_CreateHD); 191 break; 192 } 193 194 m_pActionRefresh = m_pActionPool->action(UIActionIndex_M_MediumSelector_Refresh); 218 195 } 219 196
Note:
See TracChangeset
for help on using the changeset viewer.

