Changeset 23368 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 28, 2009 12:39:04 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h
r23223 r23368 297 297 void setMainWindow (QWidget *aMainWindow) { mMainWindow = aMainWindow; } 298 298 QWidget *mainWindow() const { return mMainWindow; } 299 300 /* branding */ 301 bool brandingIsActive (bool aForce = false); 302 QString VBoxGlobal::brandingGetKey (QString aKey); 299 303 300 304 bool isVMConsoleProcess() const { return !vmUuid.isNull(); } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxAboutDlg.cpp
r22391 r23368 22 22 23 23 #include "VBoxAboutDlg.h" 24 #include "VBoxGlobal.h" 24 25 25 26 /* Qt includes */ 27 #include <QDir> 28 #include <QEvent> 26 29 #include <QPainter> 27 #include <QEvent>28 30 29 31 VBoxAboutDlg::VBoxAboutDlg (QWidget* aParent, const QString &aVersion) 30 32 : QIWithRetranslateUI2 <QIDialog> (aParent, Qt::CustomizeWindowHint | 31 33 Qt::WindowTitleHint | Qt::WindowSystemMenuHint), 32 mVersion (aVersion), 33 mBgImage (":/about.png") 34 mVersion (aVersion) 34 35 { 35 36 retranslateUi(); 37 38 /* Branding: Use a custom about splash picture if set */ 39 QString sSplash = vboxGlobal().brandingGetKey("UI/AboutSplash"); 40 QDir pathImage(sSplash); 41 if (vboxGlobal().brandingIsActive() && !sSplash.isEmpty()) 42 mBgImage.load(pathImage.absolutePath()); 43 else /* ... or load the built-in picture */ 44 mBgImage.load(":/about.png"); 36 45 } 37 46 … … 66 75 painter.drawPixmap (0, 0, mBgImage); 67 76 painter.setFont (font()); 68 painter.setPen (Qt::white); 77 78 /* Branding: Set a different text color (because splash also could be white), 79 otherwise use white as default color */ 80 QColor colorText(vboxGlobal().brandingGetKey("UI/AboutTextColor")); 81 if (!colorText.name().isEmpty()) 82 painter.setPen (colorText.name()); 83 else 84 painter.setPen (Qt::white); 69 85 #if VBOX_OSE 70 86 painter.drawText (QRect (0, 400, 600, 32), -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r23358 r23368 54 54 #include <QThread> 55 55 #include <QPainter> 56 #include <QSettings> 56 57 #include <QTimer> 57 58 #include <QDir> … … 754 755 755 756 return *mConsoleWnd; 757 } 758 759 bool VBoxGlobal::brandingIsActive (bool aForce /* = false*/) 760 { 761 if (aForce) 762 return true; 763 return !VBoxGlobal::brandingGetKey("VerSuffix").isEmpty(); 764 } 765 766 /** 767 * Gets a value from the global (platform-specific) application settings 768 * (e.g. on Windows using the registry) for branding stuff 769 */ 770 QString VBoxGlobal::brandingGetKey (QString aKey) 771 { 772 QSettings settings("Sun", "VirtualBox"); 773 return settings.value(QString("Branding/%1").arg(aKey)).toString(); 756 774 } 757 775 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r23223 r23368 2346 2346 { 2347 2347 CVirtualBox vbox = vboxGlobal().virtualBox(); 2348 QString fullVersion (QString ("%1 r%2").arg (vbox.GetVersion()) 2349 .arg (vbox.GetRevision())); 2348 QString fullVersion ; 2349 if (vboxGlobal().brandingIsActive()) 2350 { 2351 fullVersion = (QString ("%1 r%2 - %3").arg (vbox.GetVersion()) 2352 .arg (vbox.GetRevision()) 2353 .arg (vboxGlobal().brandingGetKey("Name"))); 2354 } 2355 else 2356 { 2357 fullVersion = (QString ("%1 r%2").arg (vbox.GetVersion()) 2358 .arg (vbox.GetRevision())); 2359 } 2350 2360 AssertWrapperOk (vbox); 2351 2361 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxUpdateDlg.cpp
r21770 r23368 353 353 /* Compose query */ 354 354 QUrl url (mUrl); 355 url.addQueryItem ("platform", vboxGlobal().virtualBox().GetPackageType()); 356 url.addQueryItem ("version", QString ("%1_%2").arg (vboxGlobal().virtualBox().GetVersion()) 357 .arg (vboxGlobal().virtualBox().GetRevision())); 355 url.addQueryItem ("platform", vboxGlobal().virtualBox().GetPackageType()); 356 /* Branding: Check whether we have a local branding file which tells us our version suffix "FOO" 357 (e.g. 3.06.54321_FOO) to identify this installation */ 358 if (vboxGlobal().brandingIsActive()) 359 { 360 url.addQueryItem ("version", QString ("%1_%2_%3").arg (vboxGlobal().virtualBox().GetVersion()) 361 .arg (vboxGlobal().virtualBox().GetRevision()) 362 .arg (vboxGlobal().brandingGetKey("VerSuffix"))); 363 } 364 else 365 { 366 /* Use hard coded version set by VBOX_VERSION_STRING */ 367 url.addQueryItem ("version", QString ("%1_%2").arg (vboxGlobal().virtualBox().GetVersion()) 368 .arg (vboxGlobal().virtualBox().GetRevision())); 369 } 358 370 url.addQueryItem ("count", QString::number (count)); 359 371 url.addQueryItem ("branch", VBoxUpdateData (vboxGlobal().virtualBox().
Note:
See TracChangeset
for help on using the changeset viewer.