Changeset 25116 in vbox
- Timestamp:
- Nov 30, 2009 7:58:24 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxTakeSnapshotDlg.h
r9729 r25116 6 6 7 7 /* 8 * Copyright (C) 2006-200 8Sun Microsystems, Inc.8 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 24 24 #define __VBoxTakeSnapshotDlg_h__ 25 25 26 /* Local includes */ 26 27 #include "VBoxTakeSnapshotDlg.gen.h" 27 28 #include "QIWithRetranslateUI.h" 29 #include "COMDefs.h" 28 30 29 class VBoxTakeSnapshotDlg : public QIWithRetranslateUI<QDialog>, 30 public Ui::VBoxTakeSnapshotDlg 31 class VBoxTakeSnapshotDlg : public QIWithRetranslateUI<QDialog>, public Ui::VBoxTakeSnapshotDlg 31 32 { 32 33 Q_OBJECT; … … 34 35 public: 35 36 36 VBoxTakeSnapshotDlg (QWidget *aParent);37 VBoxTakeSnapshotDlg(QWidget *pParent, const CMachine &machine); 37 38 38 39 protected: … … 42 43 private slots: 43 44 44 void nameChanged (const QString &aName);45 void nameChanged(const QString &strName); 45 46 }; 46 47 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r24766 r25116 2027 2027 CMachine machine = mSession.GetMachine(); 2028 2028 2029 VBoxTakeSnapshotDlg dlg (this );2029 VBoxTakeSnapshotDlg dlg (this, machine); 2030 2030 2031 2031 QString typeId = machine.GetOSTypeId(); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp
r24791 r25116 576 576 AssertReturn (item, (void) 0); 577 577 578 VBoxTakeSnapshotDlg dlg (this );578 VBoxTakeSnapshotDlg dlg (this, mMachine); 579 579 580 580 QString typeId = mMachine.GetOSTypeId(); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxTakeSnapshotDlg.cpp
r9089 r25116 6 6 7 7 /* 8 * Copyright (C) 2006-200 8Sun Microsystems, Inc.8 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 */ 22 22 23 /* Global includes */ 24 #include <QPushButton> 25 26 /* Local includes */ 23 27 #include "VBoxTakeSnapshotDlg.h" 24 28 #include "VBoxProblemReporter.h" 25 29 #include "VBoxUtils.h" 26 30 27 /* Qt includes */ 28 #include <QPushButton> 29 30 VBoxTakeSnapshotDlg::VBoxTakeSnapshotDlg (QWidget *aParent) 31 : QIWithRetranslateUI<QDialog> (aParent) 31 VBoxTakeSnapshotDlg::VBoxTakeSnapshotDlg(QWidget *pParent, const CMachine &machine) 32 : QIWithRetranslateUI<QDialog>(pParent) 32 33 { 33 34 /* Apply UI decorations */ 34 Ui::VBoxTakeSnapshotDlg::setupUi 35 Ui::VBoxTakeSnapshotDlg::setupUi(this); 35 36 36 QIAltKeyFilter *af = new QIAltKeyFilter (this); 37 af->watchOn (mLeName); 37 /* Alt key filter */ 38 QIAltKeyFilter *altKeyFilter = new QIAltKeyFilter(this); 39 altKeyFilter->watchOn(mLeName); 38 40 39 41 /* Setup connections */ 40 connect (mButtonBox, SIGNAL (helpRequested()), 41 &vboxProblem(), SLOT (showHelpHelpDialog())); 42 connect (mLeName, SIGNAL (textChanged (const QString &)), 43 this, SLOT (nameChanged (const QString &))); 42 connect (mButtonBox, SIGNAL(helpRequested()), &vboxProblem(), SLOT(showHelpHelpDialog())); 43 connect (mLeName, SIGNAL(textChanged(const QString &)), this, SLOT(nameChanged(const QString &))); 44 45 /* Check if machine have immutable attachments */ 46 int immutableMediums = 0; 47 48 if (machine.GetState() == KMachineState_Paused) 49 { 50 foreach (const CMediumAttachment &attachment, machine.GetMediumAttachments()) 51 { 52 CMedium medium = attachment.GetMedium(); 53 if (!medium.isNull() && !medium.GetParent().isNull() && medium.GetBase().GetType() == KMediumType_Immutable) 54 ++ immutableMediums; 55 } 56 } 57 58 if (immutableMediums) 59 { 60 mLbInfo->setText(tr("Warning: You are taking a snapshot of a running machine which has %n immutable image(s) " 61 "attached to it. The automatic resetting of the immutable image(s) will not occur while " 62 "the snapshot you are taking is the current snapshot to avoid data corruption.", "", 63 immutableMediums)); 64 mLbInfo->useSizeHintForWidth(400); 65 } 66 else 67 { 68 QGridLayout *lt = qobject_cast<QGridLayout*>(layout()); 69 lt->removeWidget (mLbInfo); 70 mLbInfo->setHidden (true); 71 72 lt->removeWidget (mButtonBox); 73 lt->addWidget (mButtonBox, 2, 0, 1, 2); 74 } 44 75 45 76 retranslateUi(); … … 49 80 { 50 81 /* Translate uic generated strings */ 51 Ui::VBoxTakeSnapshotDlg::retranslateUi 82 Ui::VBoxTakeSnapshotDlg::retranslateUi(this); 52 83 } 53 84 54 void VBoxTakeSnapshotDlg::nameChanged (const QString &aName)85 void VBoxTakeSnapshotDlg::nameChanged(const QString &strName) 55 86 { 56 mButtonBox->button (QDialogButtonBox::Ok)->setEnabled (!aName.trimmed().isEmpty());87 mButtonBox->button(QDialogButtonBox::Ok)->setEnabled(!strName.trimmed().isEmpty()); 57 88 } 58 89 -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxTakeSnapshotDlg.ui
r8743 r25116 3 3 VBox frontends: Qt4 GUI ("VirtualBox"): 4 4 5 Copyright (C) 2008 Sun Microsystems, Inc.5 Copyright (C) 2008-2009 Sun Microsystems, Inc. 6 6 7 7 This file is part of VirtualBox Open Source Edition (OSE), as … … 18 18 </comment> 19 19 <class>VBoxTakeSnapshotDlg</class> 20 <widget class="QDialog" name="VBoxTakeSnapshotDlg" 21 <property name="geometry" 20 <widget class="QDialog" name="VBoxTakeSnapshotDlg"> 21 <property name="geometry"> 22 22 <rect> 23 23 <x>0</x> 24 24 <y>0</y> 25 <width>3 14</width>26 <height>2 39</height>25 <width>300</width> 26 <height>240</height> 27 27 </rect> 28 28 </property> … … 30 30 <string>Take Snapshot of Virtual Machine</string> 31 31 </property> 32 <layout class="Q VBoxLayout">33 <item >34 <layout class="Q HBoxLayout">32 <layout class="QGridLayout"> 33 <item rowspan="2" row="0" column="0"> 34 <layout class="QVBoxLayout"> 35 35 <item> 36 <layout class="QVBoxLayout" > 37 <item> 38 <widget class="QLabel" name="mLbIcon" > 39 <property name="sizePolicy" > 40 <sizepolicy vsizetype="Preferred" hsizetype="Maximum" > 41 <horstretch>0</horstretch> 42 <verstretch>0</verstretch> 43 </sizepolicy> 44 </property> 45 <property name="text" > 46 <string/> 47 </property> 48 </widget> 49 </item> 50 <item> 51 <spacer> 52 <property name="orientation" > 53 <enum>Qt::Vertical</enum> 54 </property> 55 <property name="sizeHint" > 56 <size> 57 <width>20</width> 58 <height>40</height> 59 </size> 60 </property> 61 </spacer> 62 </item> 63 </layout> 36 <widget class="QLabel" name="mLbIcon"> 37 <property name="sizePolicy" > 38 <sizepolicy vsizetype="Preferred" hsizetype="Maximum"> 39 <horstretch>0</horstretch> 40 <verstretch>0</verstretch> 41 </sizepolicy> 42 </property> 43 </widget> 64 44 </item> 65 45 <item> 66 < layout class="QVBoxLayout">67 <property name=" spacing">68 < number>10</number>46 <spacer> 47 <property name="orientation"> 48 <enum>Qt::Vertical</enum> 69 49 </property> 70 <item> 71 <layout class="QVBoxLayout" > 72 <property name="spacing" > 73 <number>2</number> 74 </property> 75 <item> 76 <widget class="QLabel" name="mLbName" > 77 <property name="text" > 78 <string>Snapshot &Name</string> 79 </property> 80 <property name="buddy" > 81 <cstring>mLeName</cstring> 82 </property> 83 </widget> 84 </item> 85 <item> 86 <widget class="QLineEdit" name="mLeName" /> 87 </item> 88 </layout> 89 </item> 90 <item> 91 <layout class="QVBoxLayout" > 92 <property name="spacing" > 93 <number>2</number> 94 </property> 95 <item> 96 <widget class="QLabel" name="mLbDescription" > 97 <property name="text" > 98 <string>Snapshot &Description</string> 99 </property> 100 <property name="buddy" > 101 <cstring>mTeDescription</cstring> 102 </property> 103 </widget> 104 </item> 105 <item> 106 <widget class="QTextEdit" name="mTeDescription" /> 107 </item> 108 </layout> 109 </item> 110 </layout> 50 <property name="sizeHint"> 51 <size> 52 <width>0</width> 53 <height>0</height> 54 </size> 55 </property> 56 </spacer> 111 57 </item> 112 58 </layout> 113 59 </item> 114 <item> 115 <widget class="QIDialogButtonBox" name="mButtonBox" > 116 <property name="standardButtons" > 60 <item row="0" column="1"> 61 <layout class="QVBoxLayout"> 62 <property name="spacing"> 63 <number>2</number> 64 </property> 65 <item> 66 <widget class="QLabel" name="mLbName"> 67 <property name="text" > 68 <string>Snapshot &Name</string> 69 </property> 70 <property name="buddy" > 71 <cstring>mLeName</cstring> 72 </property> 73 </widget> 74 </item> 75 <item> 76 <widget class="QLineEdit" name="mLeName"/> 77 </item> 78 </layout> 79 </item> 80 <item row="1" column="1"> 81 <layout class="QVBoxLayout"> 82 <property name="spacing"> 83 <number>2</number> 84 </property> 85 <item> 86 <widget class="QLabel" name="mLbDescription"> 87 <property name="text"> 88 <string>Snapshot &Description</string> 89 </property> 90 <property name="buddy"> 91 <cstring>mTeDescription</cstring> 92 </property> 93 </widget> 94 </item> 95 <item> 96 <widget class="QTextEdit" name="mTeDescription"/> 97 </item> 98 </layout> 99 </item> 100 <item row="2" column="0" colspan="2"> 101 <widget class="QILabel" name="mLbInfo"> 102 <property name="sizePolicy" > 103 <sizepolicy vsizetype="Preferred" hsizetype="Preferred"> 104 <horstretch>0</horstretch> 105 <verstretch>0</verstretch> 106 </sizepolicy> 107 </property> 108 <property name="wordWrap"> 109 <bool>true</bool> 110 </property> 111 </widget> 112 </item> 113 <item row="3" column="0" colspan="2"> 114 <widget class="QIDialogButtonBox" name="mButtonBox"> 115 <property name="standardButtons"> 117 116 <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set> 118 117 </property> … … 122 121 </widget> 123 122 <customwidgets> 123 <customwidget> 124 <class>QILabel</class> 125 <extends>QLabel</extends> 126 <header>QILabel.h</header> 127 </customwidget> 124 128 <customwidget> 125 129 <class>QIDialogButtonBox</class> … … 136 140 <slot>accept()</slot> 137 141 <hints> 138 <hint type="sourcelabel" 142 <hint type="sourcelabel"> 139 143 <x>156</x> 140 144 <y>216</y> 141 145 </hint> 142 <hint type="destinationlabel" 146 <hint type="destinationlabel"> 143 147 <x>156</x> 144 148 <y>119</y> … … 152 156 <slot>reject()</slot> 153 157 <hints> 154 <hint type="sourcelabel" 158 <hint type="sourcelabel"> 155 159 <x>156</x> 156 160 <y>216</y> 157 161 </hint> 158 <hint type="destinationlabel" 162 <hint type="destinationlabel"> 159 163 <x>156</x> 160 164 <y>119</y>
Note:
See TracChangeset
for help on using the changeset viewer.