Changeset 24737 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Nov 17, 2009 8:19:09 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxSnapshotDetailsDlg.h
r24732 r24737 59 59 60 60 QPixmap mThumbnail; 61 QPixmap mScreenshot; 61 62 }; 62 63 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotDetailsDlg.cpp
r24735 r24737 69 69 /* Get thumbnail if present */ 70 70 ULONG width = 0, height = 0; 71 QVector <BYTE> data = machine.ReadSavedThumbnailToArray (true, width, height); 72 mThumbnail = data.size() != 0 ? QPixmap::fromImage (QImage (data.data(), width, height, QImage::Format_RGB32).copy()) : QPixmap(); 71 QVector <BYTE> thumbData = machine.ReadSavedThumbnailToArray (true, width, height); 72 mThumbnail = thumbData.size() != 0 ? QPixmap::fromImage (QImage (thumbData.data(), width, height, QImage::Format_RGB32).copy()) : QPixmap(); 73 QVector <BYTE> screenData = machine.ReadSavedScreenshotPNGToArray (width, height); 74 mScreenshot = screenData.size() != 0 ? QPixmap::fromImage (QImage::fromData (screenData.data(), screenData.size(), "PNG")) : QPixmap(); 75 73 76 QGridLayout *lt = qobject_cast <QGridLayout*> (layout()); 74 77 Assert (lt); … … 118 121 setWindowTitle (tr ("Details of %1 (%2)").arg (mSnapshot.GetName()).arg (machine.GetName())); 119 122 123 mLbThumbnail->setToolTip (mScreenshot.isNull() ? QString() : tr ("Click to enlarge the screenshot.")); 124 120 125 mTeDetails->setText (vboxGlobal().detailsReport (machine, false /* with links? */)); 121 126 } … … 124 129 { 125 130 Assert (aObject == mLbThumbnail); 126 if (aEvent->type() == QEvent::MouseButtonPress) 127 { 128 CMachine machine = mSnapshot.GetMachine(); 129 130 ULONG width = 0, height = 0; 131 QVector <BYTE> data = machine.ReadSavedScreenshotPNGToArray (width, height); 132 Assert (data.size()); 133 QPixmap pixmap = QPixmap::fromImage (QImage::fromData (data.data(), data.size(), "PNG")); 134 135 VBoxScreenshotViewer *viewer = new VBoxScreenshotViewer (this, pixmap, machine.GetName(), mSnapshot.GetName()); 131 if (aEvent->type() == QEvent::MouseButtonPress && !mScreenshot.isNull()) 132 { 133 VBoxScreenshotViewer *viewer = new VBoxScreenshotViewer (this, mScreenshot, mSnapshot.GetMachine().GetName(), mSnapshot.GetName()); 136 134 viewer->show(); 137 135 } … … 175 173 layout->addWidget (mArea); 176 174 175 double aspectRatio = (double) aScreenshot.height() / aScreenshot.width(); 177 176 QSize maxSize = aScreenshot.size() + QSize (mArea->frameWidth() * 2, mArea->frameWidth() * 2); 178 QSize initSize = QSize (640, 480).boundedTo (maxSize);177 QSize initSize = QSize (640, 640 * aspectRatio).boundedTo (maxSize); 179 178 180 179 setMaximumSize (maxSize); -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSnapshotDetailsDlg.ui
r24736 r24737 62 62 </sizepolicy> 63 63 </property> 64 <property name="toolTip">65 <string>Click to enlarge the screenshot.</string>66 </property>67 64 <property name="frameShape"> 68 65 <enum>QFrame::Panel</enum>
Note:
See TracChangeset
for help on using the changeset viewer.