- Timestamp:
- May 22, 2007 12:57:33 PM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h
r2753 r2764 181 181 private: 182 182 183 void maybeRestrictMinimumSize(); 184 183 185 VBoxConsoleWnd *mainwnd; 184 186 … … 209 211 bool mAutoresizeGuest : 1; 210 212 211 bool mIsAdditionsActive ;213 bool mIsAdditionsActive : 1; 212 214 213 215 bool mfNumLock : 1; -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
r2736 r2764 273 273 QPoint normal_pos; 274 274 QSize normal_size; 275 QSize prev_min_size; 275 276 276 277 // variables for dealing with true fullscreen -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
r2736 r2764 144 144 bool confirmDiscardSavedState (const CMachine &machine); 145 145 146 bool confirmReleaseImage (QWidget *parent, const QString &usage); 147 146 148 void sayCannotOverwriteHardDiskImage (QWidget *parent, const QString &src); 147 149 int confirmHardDiskImageDeletion (QWidget *parent, const QString &src); … … 198 200 const QString &, const QString &); 199 201 200 bool confirmReleaseImage (QWidget*, QString); 201 202 void warnAboutOldAdditions (QWidget*, const QString &); 203 void warnAboutNewAdditions (QWidget*, const QString &); 202 void warnAboutTooOldAdditions (QWidget *, const QString &, const QString &); 203 void warnAboutOldAdditions (QWidget *, const QString &, const QString &); 204 void warnAboutNewAdditions (QWidget *, const QString &, const QString &); 204 205 205 206 bool remindAboutInputCapture(); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r2736 r2764 774 774 mAutoresizeGuest = on; 775 775 776 if (mode == VBoxDefs::SDLMode) 777 { 778 /* restrict minimum size because we cannot correctly draw 779 * in a scrolled window using SDL */ 780 if (!mAutoresizeGuest) 781 setMinimumSize (sizeHint()); 782 else 783 setMinimumSize (0, 0); 784 } 776 maybeRestrictMinimumSize(); 785 777 786 778 if (mIsAdditionsActive && mAutoresizeGuest) … … 795 787 void VBoxConsoleView::onFullscreenChange (bool /* on */) 796 788 { 797 /// @todo (r=dmik) not currently sure is this method necessary to 798 // fix fullscreen toggle problems (invalid areas) on Linux/SDL 799 // if (fb) 800 // { 801 // VBoxResizeEvent e (fb->pixelFormat(), fb->address(), fb->colorDepth(), 802 // fb->width(), fb->height()); 803 // fb->resizeEvent (&e); 804 // } 789 /* Nothing to do here so far */ 805 790 } 806 791 … … 843 828 setMaximumSize (sizeHint()); 844 829 845 if (mode == VBoxDefs::SDLMode) 846 { 847 /* restrict minimum size because we cannot correctly draw 848 * in a scrolled window using SDL */ 849 if (!mAutoresizeGuest) 850 setMinimumSize (sizeHint()); 851 else 852 setMinimumSize (0, 0); 853 } 830 maybeRestrictMinimumSize(); 854 831 855 832 /* resize the guest canvas */ … … 937 914 GuestAdditionsEvent *ge = (GuestAdditionsEvent *) e; 938 915 LogFlowFunc (("AdditionsStateChangeEventType\n")); 916 939 917 mIsAdditionsActive = ge->additionActive(); 918 919 maybeRestrictMinimumSize(); 920 940 921 emit additionsStateChanged (ge->additionVersion(), ge->additionActive()); 941 922 return true; … … 1700 1681 1701 1682 /** 1702 * Called on e very exit from fullscreen andmaximized mode.1683 * Called on exit from fullscreen or from maximized mode. 1703 1684 */ 1704 1685 void VBoxConsoleView::exitFullScreen() … … 1707 1688 { 1708 1689 doResizeHint(); 1690 /* Fire a normalize event with some delay to let the guest process the 1691 * resize hint and send resize properly, instead of normalizing to the 1692 * current guest size right now. */ 1709 1693 QTimer::singleShot (200, this, SLOT (normalizeGeo())); 1710 1694 } … … 1713 1697 normalizeGeo(); 1714 1698 } 1699 1715 1700 ignore_mainwnd_resize = false; 1716 1701 } … … 2888 2873 } 2889 2874 2875 /** 2876 * Sets the the minimum size restriction depending on the auto-resize feature 2877 * state and the current rendering mode. 2878 * 2879 * Currently, the restriction is set only in SDL mode and only when the 2880 * auto-resize feature is inactive. We need to do that because we cannot 2881 * correctly draw in a scrolled window in SDL mode. 2882 * 2883 * In all other modes, or when auto-resize is in force, this function does 2884 * nothing. 2885 */ 2886 void VBoxConsoleView::maybeRestrictMinimumSize() 2887 { 2888 if (mode == VBoxDefs::SDLMode) 2889 { 2890 if (!mIsAdditionsActive || !mAutoresizeGuest) 2891 setMinimumSize (sizeHint()); 2892 else 2893 setMinimumSize (0, 0); 2894 } 2895 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r2736 r2764 1710 1710 bool wasHidden = isHidden(); 1711 1711 1712 static QSize prevMinimumSize;1713 1712 if (on) 1714 1713 { 1715 /* Save previous scroll-view minimum size before entering fullscreen 1716 * state to make return to this minimum size before the exiting 1717 * fullscreen. Required for correct scroll-view update in SDL mode. */ 1718 prevMinimumSize = console->minimumSize(); 1714 /* Save the previous scroll-view minimum size before entering 1715 * fullscreen state to restore this minimum size before the exiting 1716 * fullscreen. Required for correct scroll-view and guest display 1717 * update in SDL mode. */ 1718 prev_min_size = console->minimumSize(); 1719 1719 console->setMinimumSize (0, 0); 1720 1720 … … 1766 1766 else 1767 1767 { 1768 /* Returns to previous scroll-view minimum size before the exiting 1769 * fullscreen. Required for correct scroll-view update in SDL mode. */ 1770 console->setMinimumSize (prevMinimumSize); 1768 /* Restore the previous scroll-view minimum size before the exiting 1769 * fullscreen. Required for correct scroll-view and guest display 1770 * update in SDL mode. */ 1771 console->setMinimumSize (prev_min_size); 1771 1772 1772 1773 /* hide early to avoid extra flicker */ … … 2515 2516 vmAutoresizeGuestAction->setEnabled (aActive); 2516 2517 2517 /* Check ing for the Guest Additions version to warnuser about possible2518 * compatibility issues in case ofinstalled version is outdated. */2518 /* Check the Guest Additions version and warn the user about possible 2519 * compatibility issues in case if the installed version is outdated. */ 2519 2520 uint version = aVersion.toUInt(); 2520 QString fullVersion= QString ("%1.%2")2521 QString verisonStr = QString ("%1.%2") 2521 2522 .arg (RT_HIWORD (version)).arg (RT_LOWORD (version)); 2522 2523 if (RT_HIWORD (version) < RT_HIWORD (VMMDEV_VERSION)) 2524 vboxProblem().warnAboutOldAdditions (this, fullVersion); 2525 else if (RT_HIWORD (version) == RT_HIWORD (VMMDEV_VERSION) && 2526 RT_LOWORD (version) < RT_LOWORD (VMMDEV_VERSION)) 2527 vboxProblem().warnAboutNewAdditions (this, fullVersion); 2523 QString expectedStr = QString ("%1.%2") 2524 .arg (VMMDEV_VERSION_MAJOR).arg (VMMDEV_VERSION_MINOR); 2525 2526 if (RT_HIWORD (version) < VMMDEV_VERSION_MAJOR) 2527 { 2528 vboxProblem().warnAboutTooOldAdditions (this, verisonStr, expectedStr); 2529 } 2530 else if (RT_HIWORD (version) == VMMDEV_VERSION_MAJOR && 2531 RT_LOWORD (version) < VMMDEV_VERSION_MINOR) 2532 { 2533 vboxProblem().warnAboutOldAdditions (this, verisonStr, expectedStr); 2534 } 2535 else if (version > VMMDEV_VERSION) 2536 { 2537 vboxProblem().warnAboutNewAdditions (this, verisonStr, expectedStr); 2538 } 2528 2539 } 2529 2540 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r2736 r2764 884 884 } 885 885 886 bool VBoxProblemReporter::confirmReleaseImage (QWidget* parent, QString usage) 886 bool VBoxProblemReporter::confirmReleaseImage (QWidget *parent, 887 const QString &usage) 887 888 { 888 889 return messageYesNo ( … … 1097 1098 } 1098 1099 1099 void VBoxProblemReporter::warnAboutOldAdditions (QWidget *aParent,1100 const QString &aVersion)1101 {1102 message (aParent, VBoxProblemReporter::Warning,1103 tr ("<p>Your Guest Additions are outdated (current version: %1).</p>"1104 "<p>You must update to the latest version by choosing Devices "1105 "- Install Guest Additions.</p>").arg (aVersion));1106 }1107 1108 void VBoxProblemReporter::warnAboutNewAdditions (QWidget *aParent,1109 const QString &aVersion)1110 {1111 message (aParent, VBoxProblemReporter::Warning,1112 tr ("<p>Your Guest Additions are outdated (current version: %1).</p>"1113 "<p>There is a newer Guest Additions version. You should update "1114 "to the latest version by choosing Devices "1115 "- Install Guest Additions.</p>").arg (aVersion));1116 }1117 1118 1100 #if defined Q_WS_WIN 1119 1101 … … 1254 1236 .arg (aConsole.GetMachine().GetName()), 1255 1237 formatErrorInfo (res)); 1238 } 1239 1240 void VBoxProblemReporter::warnAboutTooOldAdditions (QWidget *aParent, 1241 const QString &aInstalledVer, 1242 const QString &aExpectedVer) 1243 { 1244 message (aParent, VBoxProblemReporter::Error, 1245 tr ("<p>VirtualBox Guest Additions installed in the Guest OS are too " 1246 "old: the installed version is %1, the expected version is %2. " 1247 "Some features that require Guest Additions (mouse integration, " 1248 "guest dislpay auto-resize) will most likely stop " 1249 "working properly.</p>" 1250 "<p>Please update Guest Additions to a newer version by choosing " 1251 "<b>Devices</b> - <b>Install Guest Additions</b> from the " 1252 "main menu.</p>") 1253 .arg (aInstalledVer).arg (aExpectedVer), 1254 "warnAboutTooOldAdditions"); 1255 } 1256 1257 void VBoxProblemReporter::warnAboutOldAdditions (QWidget *aParent, 1258 const QString &aInstalledVer, 1259 const QString &aExpectedVer) 1260 { 1261 message (aParent, VBoxProblemReporter::Warning, 1262 tr ("<p>VirtualBox Guest Additions installed in the Guest OS are " 1263 "outdated: the installed version is %1, the expected version is %2. " 1264 "Some features that require Guest Additions (mouse integration, " 1265 "guest dislpay auto-resize) may not work as expected.</p>" 1266 "<p>It is recommended to update Guest Additions to a newer version by " 1267 "choosing <b>Devices</b> - <b>Install Guest Additions</b> from the " 1268 "main menu.</p>") 1269 .arg (aInstalledVer).arg (aExpectedVer), 1270 "warnAboutOldAdditions"); 1271 } 1272 1273 void VBoxProblemReporter::warnAboutNewAdditions (QWidget *aParent, 1274 const QString &aInstalledVer, 1275 const QString &aExpectedVer) 1276 { 1277 message (aParent, VBoxProblemReporter::Error, 1278 tr ("<p>VirtualBox Guest Additions installed in the Guest OS are " 1279 "too new: the installed version is %1, the expected version is %2.</p>" 1280 "<p>Using a newer version of Additions with an older version of " 1281 "VirtualBox is not supported. Please update Guest Additions to a suitable " 1282 "version by choosing <b>Devices</b> - <b>Install Guest Additions</b> " 1283 "from the main menu.</p>") 1284 .arg (aInstalledVer).arg (aExpectedVer), 1285 "warnAboutNewAdditions"); 1256 1286 } 1257 1287
Note:
See TracChangeset
for help on using the changeset viewer.