Changeset 25045 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 27, 2009 10:50:46 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 55378
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
r23899 r25045 90 90 { 91 91 public: 92 VBoxRepaintEvent (int x, int y, int w, int h) :92 VBoxRepaintEvent (int iX, int iY, int iW, int iH) : 93 93 QEvent ((QEvent::Type) VBoxDefs::RepaintEventType), 94 ex ( x), ey (y), ew (w), eh (h)94 ex (iX), ey (iY), ew (iW), eh (iH) 95 95 {} 96 96 int x() { return ex; } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxMedium.cpp
r24752 r25045 135 135 136 136 /* Adjust the parent if its possible */ 137 CMedium parent = mMedium.GetParent();138 Assert (!parent .isNull() || mParent == NULL);139 140 if (!parent .isNull() && (mParent == NULL || mParent->mMedium != parent))137 CMedium parentMedium = mMedium.GetParent(); 138 Assert (!parentMedium.isNull() || mParent == NULL); 139 140 if (!parentMedium.isNull() && (mParent == NULL || mParent->mMedium != parentMedium)) 141 141 { 142 142 /* Search for the parent (might be there) */ … … 147 147 break; 148 148 149 if ((*it).mMedium == parent )149 if ((*it).mMedium == parentMedium) 150 150 { 151 151 mParent = unconst (&*it); … … 184 184 if (machineIds.size() > 0) 185 185 { 186 QString usage;186 QString sUsage; 187 187 188 188 CVirtualBox vbox = vboxGlobal().virtualBox(); … … 192 192 CMachine machine = vbox.GetMachine (*it); 193 193 194 QString name = machine.GetName();195 QString s napshots;194 QString sName = machine.GetName(); 195 QString sSnapshots; 196 196 197 197 QVector <QString> snapIds = mMedium.GetSnapshotIds (*it); … … 210 210 if (!snapshot.isNull()) // can be NULL while takeSnaphot is in progress 211 211 { 212 if (!s napshots.isNull())213 s napshots += ", ";214 s napshots += snapshot.GetName();212 if (!sSnapshots.isNull()) 213 sSnapshots += ", "; 214 sSnapshots += snapshot.GetName(); 215 215 } 216 216 } 217 217 218 if (! usage.isNull())219 usage += ", ";220 221 usage += name;222 223 if (!s napshots.isNull())218 if (!sUsage.isNull()) 219 sUsage += ", "; 220 221 sUsage += sName; 222 223 if (!sSnapshots.isNull()) 224 224 { 225 usage += QString (" (%2)").arg (snapshots);225 sUsage += QString (" (%2)").arg (sSnapshots); 226 226 mIsUsedInSnapshots = true; 227 227 } … … 230 230 } 231 231 232 Assert (! usage.isEmpty());233 mUsage = usage;232 Assert (!sUsage.isEmpty()); 233 mUsage = sUsage; 234 234 } 235 235 } … … 286 286 VBoxMedium &VBoxMedium::root() const 287 287 { 288 VBoxMedium * root = unconst (this);289 while ( root->mParent != NULL)290 root = root->mParent;291 292 return * root;288 VBoxMedium *pRoot = unconst (this); 289 while (pRoot->mParent != NULL) 290 pRoot = pRoot->mParent; 291 292 return *pRoot; 293 293 } 294 294 … … 307 307 QString VBoxMedium::toolTip (bool aNoDiffs /* = false */, bool aCheckRO /* = false */, bool aNullAllowed /* = false */) const 308 308 { 309 QString tip;309 QString sTip; 310 310 311 311 if (mMedium.isNull()) 312 312 { 313 tip = aNullAllowed ? mRow.arg (VBoxGlobal::tr ("<b>No medium selected</b>", "medium")) +314 mRow.arg (VBoxGlobal::tr ("You can also change this while the machine is running.")) :315 mRow.arg (VBoxGlobal::tr ("<b>No media available</b>", "medium")) +316 mRow.arg (VBoxGlobal::tr ("You can create media images using the virtual media manager."));313 sTip = aNullAllowed ? mRow.arg (VBoxGlobal::tr ("<b>No medium selected</b>", "medium")) + 314 mRow.arg (VBoxGlobal::tr ("You can also change this while the machine is running.")) : 315 mRow.arg (VBoxGlobal::tr ("<b>No media available</b>", "medium")) + 316 mRow.arg (VBoxGlobal::tr ("You can create media images using the virtual media manager.")); 317 317 } 318 318 else … … 320 320 unconst (this)->checkNoDiffs (aNoDiffs); 321 321 322 tip = aNoDiffs ? mNoDiffs.toolTip : mToolTip;322 sTip = aNoDiffs ? mNoDiffs.toolTip : mToolTip; 323 323 324 324 if (aCheckRO && mIsReadOnly) 325 tip += mRow.arg ("<hr>") +326 mRow.arg (VBoxGlobal::tr ("Attaching this hard disk will be performed indirectly using "327 "a newly created differencing hard disk.", "medium"));328 } 329 330 return mTable.arg ( tip);325 sTip += mRow.arg ("<hr>") + 326 mRow.arg (VBoxGlobal::tr ("Attaching this hard disk will be performed indirectly using " 327 "a newly created differencing hard disk.", "medium")); 328 } 329 330 return mTable.arg (sTip); 331 331 } 332 332 … … 347 347 QPixmap VBoxMedium::icon (bool aNoDiffs /* = false */, bool aCheckRO /* = false */) const 348 348 { 349 QPixmap icon;349 QPixmap pixmap; 350 350 351 351 if (state (aNoDiffs) == KMediumState_Inaccessible) 352 icon= result (aNoDiffs).isOk() ? vboxGlobal().warningIcon() : vboxGlobal().errorIcon();352 pixmap = result (aNoDiffs).isOk() ? vboxGlobal().warningIcon() : vboxGlobal().errorIcon(); 353 353 354 354 if (aCheckRO && mIsReadOnly) 355 icon = VBoxGlobal::joinPixmaps (icon, QPixmap (":/new_16px.png"));356 357 return icon;355 pixmap = VBoxGlobal::joinPixmaps (pixmap, QPixmap (":/new_16px.png")); 356 357 return pixmap; 358 358 } 359 359 … … 407 407 return QString::null; 408 408 409 QString details, str;410 411 VBoxMedium * root = unconst (this);412 KMediumState state = mState;409 QString sDetails, sStr; 410 411 VBoxMedium *pRoot = unconst (this); 412 KMediumState eState = mState; 413 413 414 414 if (mType == VBoxDefs::MediumType_HardDisk) … … 416 416 if (aNoDiffs) 417 417 { 418 root = &this->root();418 pRoot = &this->root(); 419 419 420 420 bool isDiff = (!aPredictDiff && mParent != NULL) || (aPredictDiff && mIsReadOnly); 421 421 422 details = isDiff && aUseHTML ?423 QString ("<i>%1</i>, ").arg ( root->mHardDiskType) :424 QString ("%1, ").arg ( root->mHardDiskType);425 426 state = this->state (true /* aNoDiffs */);427 428 if ( root->mState == KMediumState_NotCreated)429 state = KMediumState_NotCreated;422 sDetails = isDiff && aUseHTML ? 423 QString ("<i>%1</i>, ").arg (pRoot->mHardDiskType) : 424 QString ("%1, ").arg (pRoot->mHardDiskType); 425 426 eState = this->state (true /* aNoDiffs */); 427 428 if (pRoot->mState == KMediumState_NotCreated) 429 eState = KMediumState_NotCreated; 430 430 } 431 431 else 432 432 { 433 details = QString ("%1, ").arg (root->mHardDiskType);433 sDetails = QString ("%1, ").arg (pRoot->mHardDiskType); 434 434 } 435 435 } … … 437 437 // @todo prepend the details with the warning/error icon when not accessible 438 438 439 switch ( state)439 switch (eState) 440 440 { 441 441 case KMediumState_NotCreated: 442 s tr = VBoxGlobal::tr ("Checking...", "medium");443 details += aUseHTML ? QString ("<i>%1</i>").arg (str) : str;442 sStr = VBoxGlobal::tr ("Checking...", "medium"); 443 sDetails += aUseHTML ? QString ("<i>%1</i>").arg (sStr) : sStr; 444 444 break; 445 445 case KMediumState_Inaccessible: 446 s tr = VBoxGlobal::tr ("Inaccessible", "medium");447 details += aUseHTML ? QString ("<b>%1</b>").arg (str) : str;446 sStr = VBoxGlobal::tr ("Inaccessible", "medium"); 447 sDetails += aUseHTML ? QString ("<b>%1</b>").arg (sStr) : sStr; 448 448 break; 449 449 default: 450 details += mType == VBoxDefs::MediumType_HardDisk ? root->mLogicalSize : root->mSize;450 sDetails += mType == VBoxDefs::MediumType_HardDisk ? pRoot->mLogicalSize : pRoot->mSize; 451 451 break; 452 452 } 453 453 454 details = aUseHTML ?455 QString ("%1 (<nobr>%2</nobr>)").arg (VBoxGlobal::locationForHTML ( root->mName), details) :456 QString ("%1 (%2)").arg (VBoxGlobal::locationForHTML ( root->mName), details);457 458 return details;454 sDetails = aUseHTML ? 455 QString ("%1 (<nobr>%2</nobr>)").arg (VBoxGlobal::locationForHTML (pRoot->mName), sDetails) : 456 QString ("%1 (%2)").arg (VBoxGlobal::locationForHTML (pRoot->mName), sDetails); 457 458 return sDetails; 459 459 } 460 460 -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r25041 r25045 298 298 #endif 299 299 300 int i; 301 for (i=0; i<argc; i++) 300 for (int i=0; i<argc; i++) 302 301 if ( !strcmp(argv[i], "-h") 303 302 || !strcmp(argv[i], "-?")
Note:
See TracChangeset
for help on using the changeset viewer.