- Timestamp:
- Mar 6, 2009 10:27:03 AM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r17384 r17450 288 288 include/VBoxSettingsSelector.h \ 289 289 include/VBoxImportApplianceWgt.h \ 290 include/VBoxImportApplianceWzd.h 290 include/VBoxImportApplianceWzd.h \ 291 include/VBoxExportApplianceWzd.h 291 292 292 293 # Sources containing local definitions of classes that use the Q_OBJECT macro. … … 367 368 src/VBoxMedium.cpp \ 368 369 src/VBoxImportApplianceWgt.cpp \ 369 src/VBoxImportApplianceWzd.cpp 370 src/VBoxImportApplianceWzd.cpp \ 371 src/VBoxExportApplianceWzd.cpp 370 372 371 373 ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11 -
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r17049 r17450 57 57 ui/VBoxGLSettingsLanguage.ui \ 58 58 ui/VBoxImportApplianceWgt.ui \ 59 ui/VBoxImportApplianceWzd.ui 59 ui/VBoxImportApplianceWzd.ui \ 60 ui/VBoxExportApplianceWzd.ui 60 61 61 62 TRANSLATIONS = \ -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
r17049 r17450 88 88 class VBoxProblemReporter : public QObject 89 89 { 90 Q_OBJECT 90 Q_OBJECT; 91 91 92 92 public: … … 109 109 static VBoxProblemReporter &instance(); 110 110 111 bool isValid() ;111 bool isValid() const; 112 112 113 113 // helpers … … 119 119 const QString &aText1 = QString::null, 120 120 const QString &aText2 = QString::null, 121 const QString &aText3 = QString::null) ;121 const QString &aText3 = QString::null) const; 122 122 123 123 int message (QWidget *aParent, Type aType, const QString &aMessage, … … 126 126 const QString &aText1 = QString::null, 127 127 const QString &aText2 = QString::null, 128 const QString &aText3 = QString::null) 128 const QString &aText3 = QString::null) const 129 129 { 130 130 return message (aParent, aType, aMessage, QString::null, aAutoConfirmId, … … 136 136 const char *aAutoConfirmId = 0, 137 137 const QString &aYesText = QString::null, 138 const QString &aNoText = QString::null) 138 const QString &aNoText = QString::null) const 139 139 { 140 140 return (message (aParent, aType, aMessage, aDetails, aAutoConfirmId, … … 149 149 const char *aAutoConfirmId, 150 150 const QString &aYesText = QString::null, 151 const QString &aNoText = QString::null) 151 const QString &aNoText = QString::null) const 152 152 { 153 153 return messageYesNo (aParent, aType, aMessage, QString::null, … … 159 159 const char *aAutoConfirmId = 0, 160 160 const QString &aOkText = QString::null, 161 const QString &aCancelText = QString::null) 161 const QString &aCancelText = QString::null) const 162 162 { 163 163 return (message (aParent, aType, aMessage, aDetails, aAutoConfirmId, … … 172 172 const char *aAutoConfirmId, 173 173 const QString &aOkText = QString::null, 174 const QString &aCancelText = QString::null) 174 const QString &aCancelText = QString::null) const 175 175 { 176 176 return messageOkCancel (aParent, aType, aMessage, QString::null, … … 181 181 QWidget *aParent, int aMinDuration = 2000); 182 182 183 QWidget *mainWindowShown() ;183 QWidget *mainWindowShown() const; 184 184 185 185 // problem handlers … … 372 372 void cannotRunInSelectorMode(); 373 373 374 void cannotImportAppliance (CAppliance *aAppliance, QWidget *aParent = NULL); 375 void cannotImportAppliance (const CProgress &aProgress, CAppliance *aAppliance, QWidget *aParent = NULL); 374 void cannotImportAppliance (CAppliance *aAppliance, QWidget *aParent = NULL) const; 375 void cannotImportAppliance (const CProgress &aProgress, CAppliance *aAppliance, QWidget *aParent = NULL) const; 376 377 378 bool askForOverridingAppliance (const QString& path, QWidget *aParent = NULL) const; 379 void cannotExportAppliance (CAppliance *aAppliance, QWidget *aParent = NULL) const; 380 void cannotExportAppliance (const CProgress &aProgress, CAppliance *aAppliance, QWidget *aParent = NULL) const; 376 381 377 382 void showRuntimeError (const CConsole &console, bool fatal, 378 383 const QString &errorID, 379 const QString &errorMsg) ;384 const QString &errorMsg) const; 380 385 381 386 static QString toAccusative (VBoxDefs::MediaType aType); -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxSelectorWnd.h
r16617 r17450 69 69 void fileMediaMgr(); 70 70 void fileImportAppliance(); 71 void fileExportAppliance(); 71 72 void fileSettings(); 72 73 void fileExit(); … … 151 152 QAction *mFileMediaMgrAction; 152 153 QAction *mFileApplianceImportAction; 154 QAction *mFileApplianceExportAction; 153 155 QAction *mFileSettingsAction; 154 156 QAction *mFileExitAction; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxImportApplianceWzd.cpp
r17053 r17450 83 83 84 84 if (aWval == mWValFileSelector) 85 valid = mFileSelector->path(). endsWith (".ovf") &&85 valid = mFileSelector->path().toLower().endsWith (".ovf") && 86 86 QFileInfo (mFileSelector->path()).exists(); 87 87 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r17408 r17450 314 314 } 315 315 316 bool VBoxProblemReporter::isValid() 316 bool VBoxProblemReporter::isValid() const 317 317 { 318 318 return qApp != 0; … … 377 377 const QString &aText1 /* = QString::null */, 378 378 const QString &aText2 /* = QString::null */, 379 const QString &aText3 /* = QString::null */) 379 const QString &aText3 /* = QString::null */) const 380 380 { 381 381 if (aButton1 == 0 && aButton2 == 0 && aButton3 == 0) … … 520 520 * zero if none of them. The selector window takes precedence. 521 521 */ 522 QWidget *VBoxProblemReporter::mainWindowShown() 522 QWidget *VBoxProblemReporter::mainWindowShown() const 523 523 { 524 524 /* It may happen that this method is called during VBoxGlobal … … 2115 2115 } 2116 2116 2117 void VBoxProblemReporter::cannotImportAppliance (CAppliance *aAppliance, QWidget *aParent /* = NULL */) 2117 void VBoxProblemReporter::cannotImportAppliance (CAppliance *aAppliance, QWidget *aParent /* = NULL */) const 2118 2118 { 2119 2119 if (aAppliance->isNull()) … … 2134 2134 } 2135 2135 2136 void VBoxProblemReporter::cannotImportAppliance (const CProgress &aProgress, CAppliance* aAppliance, QWidget *aParent /* = NULL */) 2136 void VBoxProblemReporter::cannotImportAppliance (const CProgress &aProgress, CAppliance* aAppliance, QWidget *aParent /* = NULL */) const 2137 2137 { 2138 2138 AssertWrapperOk (aProgress); … … 2144 2144 } 2145 2145 2146 bool VBoxProblemReporter::askForOverridingAppliance (const QString& aPath, QWidget *aParent /* = NULL */) const 2147 { 2148 return messageYesNo (aParent, Question, tr ("The file <b>%1</b> exists already. Are you sure you want override it?").arg (aPath), NULL); 2149 } 2150 2151 void VBoxProblemReporter::cannotExportAppliance (CAppliance *aAppliance, QWidget *aParent /* = NULL */) const 2152 { 2153 if (aAppliance->isNull()) 2154 { 2155 message (aParent ? aParent : mainWindowShown(), 2156 Error, 2157 tr ("Failed to create an appliance.")); 2158 }else 2159 { 2160 /* Preserve the current error info before calling the object again */ 2161 COMResult res (*aAppliance); 2162 2163 message (aParent ? aParent : mainWindowShown(), 2164 Error, 2165 tr ("Failed to prepare the export of the appliance <b>%1</b>.").arg (aAppliance->GetPath()), 2166 formatErrorInfo (res)); 2167 } 2168 } 2169 2170 void VBoxProblemReporter::cannotExportAppliance (const CProgress &aProgress, CAppliance* aAppliance, QWidget *aParent /* = NULL */) const 2171 { 2172 AssertWrapperOk (aProgress); 2173 2174 message (aParent ? aParent : mainWindowShown(), 2175 Error, 2176 tr ("Failed to export appliance <b>%1</b>.").arg (aAppliance->GetPath()), 2177 formatErrorInfo (aProgress.GetErrorInfo())); 2178 } 2179 2146 2180 void VBoxProblemReporter::showRuntimeError (const CConsole &aConsole, bool fatal, 2147 2181 const QString &errorID, 2148 const QString &errorMsg) 2182 const QString &errorMsg) const 2149 2183 { 2150 2184 /// @todo (r=dmik) it's just a preliminary box. We need to: -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp
r17160 r17450 31 31 #include "VBoxMediaManagerDlg.h" 32 32 #include "VBoxImportApplianceWzd.h" 33 #include "VBoxExportApplianceWzd.h" 33 34 #include "VBoxSettingsDialogSpecific.h" 34 35 #include "VBoxVMLogViewer.h" … … 408 409 mFileApplianceImportAction = new QAction (this); 409 410 mFileApplianceImportAction->setIcon (VBoxGlobal::iconSet (":/import_16px.png")); 411 412 mFileApplianceExportAction = new QAction (this); 413 mFileApplianceExportAction->setIcon (VBoxGlobal::iconSet (":/import_16px.png")); 410 414 411 415 mFileSettingsAction = new QAction(this); … … 546 550 mFileMenu->addAction (mFileMediaMgrAction); 547 551 mFileMenu->addAction (mFileApplianceImportAction); 552 mFileMenu->addAction (mFileApplianceExportAction); 548 553 #ifndef Q_WS_MAC 549 554 mFileMenu->addSeparator(); … … 651 656 connect (mFileMediaMgrAction, SIGNAL (triggered()), this, SLOT (fileMediaMgr())); 652 657 connect (mFileApplianceImportAction, SIGNAL (triggered()), this, SLOT (fileImportAppliance())); 658 connect (mFileApplianceExportAction, SIGNAL (triggered()), this, SLOT (fileExportAppliance())); 653 659 connect (mFileSettingsAction, SIGNAL (triggered()), this, SLOT (fileSettings())); 654 660 connect (mFileExitAction, SIGNAL (triggered()), this, SLOT (fileExit())); … … 751 757 { 752 758 VBoxImportApplianceWzd wzd (this); 759 760 wzd.exec(); 761 } 762 763 void VBoxSelectorWnd::fileExportAppliance() 764 { 765 QString name; 766 767 VBoxVMItem *item = mVMListView->selectedItem(); 768 if (item) 769 name = item->name(); 770 771 VBoxExportApplianceWzd wzd (this, name); 753 772 754 773 wzd.exec(); … … 1273 1292 mFileApplianceImportAction->setStatusTip (tr ("Import an appliance into VirtualBox")); 1274 1293 1294 mFileApplianceExportAction->setText (tr ("&Export Appliance...")); 1295 mFileApplianceExportAction->setShortcut (QKeySequence ("Ctrl+J")); 1296 mFileApplianceExportAction->setStatusTip (tr ("Export an appliance out of VM's from VirtualBox")); 1297 1275 1298 #ifdef Q_WS_MAC 1276 1299 /* -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxImportApplianceWzd.ui
r17049 r17450 374 374 <resources> 375 375 <include location="../VirtualBox.qrc"/> 376 <include location="../ ../VirtualBox.qrc"/>376 <include location="../VirtualBox.qrc"/> 377 377 </resources> 378 378 <connections/>
Note:
See TracChangeset
for help on using the changeset viewer.