Changeset 65204 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 9, 2017 1:17:26 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r64659 r65204 1364 1364 } 1365 1365 1366 /* QString <= IndicatorType: */ 1367 template<> QString toString(const IndicatorType &indicatorType) 1368 { 1369 QString strResult; 1370 switch (indicatorType) 1371 { 1372 case IndicatorType_HardDisks: strResult = QApplication::translate("VBoxGlobal", "Hard Disks", "IndicatorType"); break; 1373 case IndicatorType_OpticalDisks: strResult = QApplication::translate("VBoxGlobal", "Optical Disks", "IndicatorType"); break; 1374 case IndicatorType_FloppyDisks: strResult = QApplication::translate("VBoxGlobal", "Floppy Disks", "IndicatorType"); break; 1375 case IndicatorType_Network: strResult = QApplication::translate("VBoxGlobal", "Network", "IndicatorType"); break; 1376 case IndicatorType_USB: strResult = QApplication::translate("VBoxGlobal", "USB", "IndicatorType"); break; 1377 case IndicatorType_SharedFolders: strResult = QApplication::translate("VBoxGlobal", "Shared Folders", "IndicatorType"); break; 1378 case IndicatorType_Display: strResult = QApplication::translate("VBoxGlobal", "Display", "IndicatorType"); break; 1379 case IndicatorType_VideoCapture: strResult = QApplication::translate("VBoxGlobal", "Video Capture", "IndicatorType"); break; 1380 case IndicatorType_Features: strResult = QApplication::translate("VBoxGlobal", "Features", "IndicatorType"); break; 1381 case IndicatorType_Mouse: strResult = QApplication::translate("VBoxGlobal", "Mouse", "IndicatorType"); break; 1382 case IndicatorType_Keyboard: strResult = QApplication::translate("VBoxGlobal", "Keyboard", "IndicatorType"); break; 1383 default: 1384 { 1385 AssertMsgFailed(("No text for indicator type=%d", indicatorType)); 1386 break; 1387 } 1388 } 1389 return strResult; 1390 } 1391 1366 1392 /* QIcon <= IndicatorType: */ 1367 1393 template<> QIcon toIcon(const IndicatorType &indicatorType) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.cpp
r65203 r65204 21 21 22 22 /* Qt includes: */ 23 # include <QAccessibleWidget> 23 24 # include <QStylePainter> 24 25 # include <QStyleOption> … … 113 114 }; 114 115 116 117 /** QAccessibleWidget extension used as an accessibility interface for UIStatusBarEditor buttons. */ 118 class UIAccessibilityInterfaceForUIStatusBarEditorButton : public QAccessibleWidget 119 { 120 public: 121 122 /** Returns an accessibility interface for passed @a strClassname and @a pObject. */ 123 static QAccessibleInterface *pFactory(const QString &strClassname, QObject *pObject); 124 125 /** Constructs an accessibility interface passing @a pWidget to the base-class. */ 126 UIAccessibilityInterfaceForUIStatusBarEditorButton(QWidget *pWidget); 127 128 /** Returns a text for the passed @a enmTextRole. */ 129 virtual QString text(QAccessible::Text enmTextRole) const /* override */; 130 131 /** Returns the state. */ 132 virtual QAccessible::State state() const /* override */; 133 134 private: 135 136 /** Returns corresponding toolbar button. */ 137 UIStatusBarEditorButton *button() const { return qobject_cast<UIStatusBarEditorButton*>(widget()); } 138 }; 139 140 141 /********************************************************************************************************************************* 142 * Class UIAccessibilityInterfaceForUIStatusBarEditorButton implementation. * 143 *********************************************************************************************************************************/ 144 145 /* static */ 146 QAccessibleInterface *UIAccessibilityInterfaceForUIStatusBarEditorButton::pFactory(const QString &strClassname, QObject *pObject) 147 { 148 /* Creating toolbar button accessibility interface: */ 149 if ( pObject 150 && strClassname == QLatin1String("UIStatusBarEditorButton")) 151 return new UIAccessibilityInterfaceForUIStatusBarEditorButton(qobject_cast<QWidget*>(pObject)); 152 153 /* Null by default: */ 154 return 0; 155 } 156 157 UIAccessibilityInterfaceForUIStatusBarEditorButton::UIAccessibilityInterfaceForUIStatusBarEditorButton(QWidget *pWidget) 158 : QAccessibleWidget(pWidget, QAccessible::CheckBox) 159 { 160 } 161 162 QString UIAccessibilityInterfaceForUIStatusBarEditorButton::text(QAccessible::Text /* enmTextRole */) const 163 { 164 /* Make sure view still alive: */ 165 AssertPtrReturn(button(), QString()); 166 167 /* Return view tool-tip: */ 168 return gpConverter->toString(button()->type()); 169 } 170 171 QAccessible::State UIAccessibilityInterfaceForUIStatusBarEditorButton::state() const /* override */ 172 { 173 /* Prepare the button state: */ 174 QAccessible::State state; 175 176 /* Make sure button still alive: */ 177 AssertPtrReturn(button(), state); 178 179 /* Compose the button state: */ 180 state.checkable = true; 181 state.checked = button()->isChecked(); 182 183 /* Return the button state: */ 184 return state; 185 } 186 187 188 189 /********************************************************************************************************************************* 190 * Class UIStatusBarEditorButton implementation. * 191 *********************************************************************************************************************************/ 115 192 116 193 /* static */ … … 402 479 if (m_strMachineID.isEmpty()) 403 480 return; 481 482 /* Install tool-bar button accessibility interface factory: */ 483 QAccessible::installFactory(UIAccessibilityInterfaceForUIStatusBarEditorButton::pFactory); 404 484 405 485 /* Track D&D events: */
Note:
See TracChangeset
for help on using the changeset viewer.