Changeset 3144 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 18, 2007 3:05:33 PM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h
r2981 r3144 433 433 static bool activateWindow (WId aWId, bool aSwitchDesktop = true); 434 434 435 static QString removeAccelMark (const QString &aText); 436 435 437 signals: 436 438 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r3136 r3144 2952 2952 } 2953 2953 2954 /** 2955 * Removes the acceletartor mark (the ampersand symbol) from the given string 2956 * and returns the result. The string is supposed to be a menu item's text 2957 * that may (or may not) contain the accelerator mark. 2958 * 2959 * In order to support accelerators used in non-alphabet languages 2960 * (e.g. Japanese) that has a form of "(&<L>)" (where <L> is a latin letter), 2961 * this method first searches for this pattern and, if found, removes it as a 2962 * whole. If such a pattern is not found, then the '&' character is simply 2963 * removed from the string. 2964 * 2965 * @note This function removes only the first occurense of the accelerator 2966 * mark. 2967 * 2968 * @param aText Menu item's text to remove the acceletaror mark from. 2969 * 2970 * @return The resulting string. 2971 */ 2972 /* static */ 2973 QString VBoxGlobal::removeAccelMark (const QString &aText) 2974 { 2975 QString result = aText; 2976 2977 QRegExp accel ("\\(&[a-zA-Z]\\)"); 2978 int pos = accel.search (result); 2979 if (pos >= 0) 2980 result.remove (pos, accel.cap().length()); 2981 else 2982 { 2983 pos = result.find ('&'); 2984 if (pos >= 0) 2985 result.remove (pos, 1); 2986 } 2987 2988 return result; 2989 } 2990 2954 2991 // Protected members 2955 2992 //////////////////////////////////////////////////////////////////////////////// -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewHDWzd.ui.h
r3143 r3144 391 391 QString type = rbDynamicType->isOn() ? rbDynamicType->text() 392 392 : rbFixedType->text(); 393 type.remove (QRegExp( "\\(&\\w\\)" )); 394 type.remove ('&'); 393 type = VBoxGlobal::removeAccelMark (type); 395 394 396 395 Q_UINT64 sizeB = imageSize() * _1M;
Note:
See TracChangeset
for help on using the changeset viewer.