- Timestamp:
- Apr 2, 2013 4:39:35 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/UIMediumTypeChangeDialog.cpp
r44529 r45292 92 92 { 93 93 /* Show error message: */ 94 msgCenter().cannotChangeMediumType( this, m_medium, m_oldMediumType, m_newMediumType);94 msgCenter().cannotChangeMediumType(m_medium, m_oldMediumType, m_newMediumType, this); 95 95 return; 96 96 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r45289 r45292 927 927 } 928 928 929 void UIMessageCenter::cannotChangeMediumType(QWidget *pParent, 930 const CMedium &medium, 931 KMediumType oldMediumType, 932 KMediumType newMediumType) 929 void UIMessageCenter::cannotChangeMediumType(const CMedium &medium, KMediumType oldMediumType, KMediumType newMediumType, 930 QWidget *pParent /*= 0*/) 933 931 { 934 932 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 935 933 tr("<p>Error changing medium type from <b>%1</b> to <b>%2</b>.</p>") 936 934 .arg(gpConverter->toString(oldMediumType)).arg(gpConverter->toString(newMediumType)), 937 935 formatErrorInfo(medium)); 938 936 } 939 937 940 bool UIMessageCenter::confirmReleaseMedium(QWidget *pParent, 941 const UIMedium &aMedium, 942 const QString &strUsage) 943 { 944 /** @todo (translation-related): the gender of "the" in translations 945 * will depend on the gender of aMedium.type(). */ 946 return messageOkCancel(pParent, MessageType_Question, 947 tr("<p>Are you sure you want to release the %1 " 948 "<nobr><b>%2</b></nobr>?</p>" 949 "<p>This will detach it from the " 950 "following virtual machine(s): <b>%3</b>.</p>") 951 .arg(mediumToAccusative(aMedium.type())) 952 .arg(aMedium.location()) 953 .arg(strUsage), 954 0 /* auto-confirm id */, 955 tr("Release", "detach medium")); 956 } 957 958 bool UIMessageCenter::confirmRemoveMedium(QWidget *pParent, 959 const UIMedium &aMedium) 960 { 961 /** @todo (translation-related): the gender of "the" in translations 962 * will depend on the gender of aMedium.type(). */ 963 QString msg = 964 tr("<p>Are you sure you want to remove the %1 " 965 "<nobr><b>%2</b></nobr> from the list of known media?</p>") 966 .arg(mediumToAccusative(aMedium.type())) 967 .arg(aMedium.location()); 968 969 qulonglong caps = 0; 970 QVector<KMediumFormatCapabilities> capabilities; 971 capabilities = aMedium.medium().GetMediumFormat().GetCapabilities(); 972 for (int i = 0; i < capabilities.size(); i++) 973 caps |= capabilities[i]; 974 975 if (aMedium.type() == UIMediumType_HardDisk && 976 caps & MediumFormatCapabilities_File) 977 { 978 if (aMedium.state() == KMediumState_Inaccessible) 979 msg += 980 tr("Note that as this hard disk is inaccessible its " 981 "storage unit cannot be deleted right now."); 982 else 983 msg += 984 tr("The next dialog will let you choose whether you also " 985 "want to delete the storage unit of this hard disk or " 986 "keep it for later usage."); 987 } 988 else 989 msg += 990 tr("<p>Note that the storage unit of this medium will not be " 991 "deleted and that it will be possible to use it later again.</p>"); 992 993 return messageOkCancel(pParent, MessageType_Question, msg, 994 "confirmRemoveMedium" /* auto-confirm id */, 995 tr("Remove", "medium")); 996 } 997 998 int UIMessageCenter::confirmDeleteHardDiskStorage(QWidget *pParent, const QString &strLocation) 999 { 1000 return message(pParent, MessageType_Question, 1001 tr("<p>Do you want to delete the storage unit of the hard disk " 1002 "<nobr><b>%1</b></nobr>?</p>" 1003 "<p>If you select <b>Delete</b> then the specified storage unit " 1004 "will be permanently deleted. This operation <b>cannot be " 1005 "undone</b>.</p>" 1006 "<p>If you select <b>Keep</b> then the hard disk will be only " 1007 "removed from the list of known hard disks, but the storage unit " 1008 "will be left untouched which makes it possible to add this hard " 1009 "disk to the list later again.</p>") 1010 .arg(strLocation), 1011 0 /* auto-confirm id */, 1012 QIMessageBox::Yes, 1013 QIMessageBox::No | QIMessageBox::Default, 1014 QIMessageBox::Cancel | QIMessageBox::Escape, 1015 tr("Delete", "hard disk storage"), 1016 tr("Keep", "hard disk storage")); 1017 } 1018 1019 void UIMessageCenter::cannotDeleteHardDiskStorage(QWidget *pParent, 1020 const CMedium &medium, 1021 const CProgress &progress) 1022 { 1023 /* below, we use CMedium (medium) to preserve current error info 1024 * for formatErrorInfo() */ 1025 1026 message(pParent, MessageType_Error, 1027 tr("Failed to delete the storage unit of the hard disk <b>%1</b>.") 1028 .arg(CMedium(medium).GetLocation()), 1029 !medium.isOk() ? formatErrorInfo(medium) : 1030 !progress.isOk() ? formatErrorInfo(progress) : 1031 formatErrorInfo(progress.GetErrorInfo())); 1032 } 1033 1034 void UIMessageCenter::cannotDetachDevice(QWidget *pParent, 1035 const CMachine &machine, 1036 UIMediumType type, 1037 const QString &strLocation, 1038 const StorageSlot &storageSlot) 1039 { 938 bool UIMessageCenter::confirmMediumRelease(const UIMedium &medium, const QString &strUsage, QWidget *pParent /*= 0*/) 939 { 940 /* Prepare the message: */ 941 QString strMessage; 942 switch (medium.type()) 943 { 944 case UIMediumType_HardDisk: 945 { 946 strMessage = tr("<p>Are you sure you want to release the virtual hard disk <nobr><b>%1</b></nobr>?</p>" 947 "<p>This will detach it from the following virtual machine(s): <b>%2</b>.</p>"); 948 break; 949 } 950 case UIMediumType_DVD: 951 { 952 strMessage = tr("<p>Are you sure you want to release the virtual optical disk <nobr><b>%1</b></nobr>?</p>" 953 "<p>This will detach it from the following virtual machine(s): <b>%2</b>.</p>"); 954 break; 955 } 956 case UIMediumType_Floppy: 957 { 958 strMessage = tr("<p>Are you sure you want to release the virtual floppy disk <nobr><b>%1</b></nobr>?</p>" 959 "<p>This will detach it from the following virtual machine(s): <b>%2</b>.</p>"); 960 break; 961 } 962 default: 963 break; 964 } 965 /* Show the message: */ 966 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question, 967 strMessage.arg(medium.location(), strUsage), 968 0 /* auto-confirm id */, tr("Release", "detach medium")); 969 } 970 971 bool UIMessageCenter::confirmMediumRemoval(const UIMedium &medium, QWidget *pParent /*= 0*/) 972 { 973 /* Prepare the message: */ 974 QString strMessage; 975 switch (medium.type()) 976 { 977 case UIMediumType_HardDisk: 978 { 979 strMessage = tr("<p>Are you sure you want to remove the virtual hard disk " 980 "<nobr><b>%1</b></nobr> from the list of known media?</p>"); 981 /* Compose capabilities flag: */ 982 qulonglong caps = 0; 983 QVector<KMediumFormatCapabilities> capabilities; 984 capabilities = medium.medium().GetMediumFormat().GetCapabilities(); 985 for (int i = 0; i < capabilities.size(); ++i) 986 caps |= capabilities[i]; 987 /* Check capabilities for additional options: */ 988 if (caps & MediumFormatCapabilities_File) 989 { 990 if (medium.state() == KMediumState_Inaccessible) 991 strMessage += tr("<p>Note that as this hard disk is inaccessible its " 992 "storage unit cannot be deleted right now.</p>"); 993 } 994 break; 995 } 996 case UIMediumType_DVD: 997 { 998 strMessage = tr("<p>Are you sure you want to remove the virtual optical disk " 999 "<nobr><b>%1</b></nobr> from the list of known media?</p>"); 1000 strMessage += tr("<p>Note that the storage unit of this medium will not be " 1001 "deleted and that it will be possible to use it later again.</p>"); 1002 break; 1003 } 1004 case UIMediumType_Floppy: 1005 { 1006 strMessage = tr("<p>Are you sure you want to remove the virtual floppy disk " 1007 "<nobr><b>%1</b></nobr> from the list of known media?</p>"); 1008 strMessage += tr("<p>Note that the storage unit of this medium will not be " 1009 "deleted and that it will be possible to use it later again.</p>"); 1010 break; 1011 } 1012 default: 1013 break; 1014 } 1015 /* Show the message: */ 1016 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question, 1017 strMessage.arg(medium.location()), 1018 "confirmMediumRemoval" /* auto-confirm id */, tr("Remove", "medium")); 1019 } 1020 1021 int UIMessageCenter::confirmDeleteHardDiskStorage(const QString &strLocation, QWidget *pParent /*= 0*/) 1022 { 1023 return message(pParent ? pParent : mainWindowShown(), MessageType_Question, 1024 tr("<p>Do you want to delete the storage unit of the hard disk " 1025 "<nobr><b>%1</b></nobr>?</p>" 1026 "<p>If you select <b>Delete</b> then the specified storage unit " 1027 "will be permanently deleted. This operation <b>cannot be " 1028 "undone</b>.</p>" 1029 "<p>If you select <b>Keep</b> then the hard disk will be only " 1030 "removed from the list of known hard disks, but the storage unit " 1031 "will be left untouched which makes it possible to add this hard " 1032 "disk to the list later again.</p>") 1033 .arg(strLocation), 1034 0 /* auto-confirm id */, 1035 QIMessageBox::Yes, 1036 QIMessageBox::No | QIMessageBox::Default, 1037 QIMessageBox::Cancel | QIMessageBox::Escape, 1038 tr("Delete", "hard disk storage"), 1039 tr("Keep", "hard disk storage")); 1040 } 1041 1042 void UIMessageCenter::cannotDeleteHardDiskStorage(const CMedium &medium, const CProgress &progress, QWidget *pParent /*= 0*/) 1043 { 1044 /* Preserve error-info: */ 1045 QString strErrorInfo = !medium.isOk() ? formatErrorInfo(medium) : 1046 !progress.isOk() ? formatErrorInfo(progress) : 1047 formatErrorInfo(progress.GetErrorInfo()); 1048 /* Show the message: */ 1049 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 1050 tr("Failed to delete the storage unit of the hard disk <b>%1</b>.") 1051 .arg(medium.GetLocation()), 1052 strErrorInfo); 1053 } 1054 1055 void UIMessageCenter::cannotDetachDevice(const CMachine &machine, UIMediumType type, const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent /*= 0*/) 1056 { 1057 /* Preserve error-info: */ 1058 QString strErrorInfo = formatErrorInfo(machine); 1059 /* Prepare the message: */ 1040 1060 QString strMessage; 1041 1061 switch (type) … … 1044 1064 { 1045 1065 strMessage = tr("Failed to detach the hard disk (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.") 1046 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(CMachine(machine).GetName());1066 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(machine.GetName()); 1047 1067 break; 1048 1068 } … … 1050 1070 { 1051 1071 strMessage = tr("Failed to detach the CD/DVD device (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.") 1052 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(CMachine(machine).GetName());1072 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(machine.GetName()); 1053 1073 break; 1054 1074 } … … 1056 1076 { 1057 1077 strMessage = tr("Failed to detach the floppy device (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.") 1058 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(CMachine(machine).GetName());1078 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(machine.GetName()); 1059 1079 break; 1060 1080 } … … 1062 1082 break; 1063 1083 } 1064 message(pParent ? pParent : mainWindowShown(), MessageType_Error, strMessage, formatErrorInfo(machine)); 1065 } 1066 1067 int UIMessageCenter::cannotRemountMedium(QWidget *pParent, 1068 const CMachine &machine, 1069 const UIMedium &aMedium, 1070 bool fMount, 1071 bool fRetry) 1072 { 1073 /** @todo (translation-related): the gender of "the" in translations 1074 * will depend on the gender of aMedium.type(). */ 1075 QString text; 1076 if (fMount) 1077 { 1078 text = tr("Unable to mount the %1 <nobr><b>%2</b></nobr> on the machine <b>%3</b>."); 1079 if (fRetry) text += tr(" Would you like to force mounting of this medium?"); 1080 } 1081 else 1082 { 1083 text = tr("Unable to unmount the %1 <nobr><b>%2</b></nobr> from the machine <b>%3</b>."); 1084 if (fRetry) text += tr(" Would you like to force unmounting of this medium?"); 1085 } 1084 /* Show the message: */ 1085 message(pParent ? pParent : mainWindowShown(), MessageType_Error, strMessage, strErrorInfo); 1086 } 1087 1088 int UIMessageCenter::cannotRemountMedium(const CMachine &machine, const UIMedium &medium, bool fMount, bool fRetry, QWidget *pParent /*= 0*/) 1089 { 1090 /* Preserve error-info: */ 1091 QString strErrorInfo = formatErrorInfo(machine); 1092 /* Compose the message: */ 1093 QString strMessage; 1094 switch (medium.type()) 1095 { 1096 case UIMediumType_DVD: 1097 { 1098 if (fMount) 1099 { 1100 strMessage = tr("<p>Unable to mount the virtual optical disk <nobr><b>%1</b></nobr> on the machine <b>%2</b>.</p>"); 1101 if (fRetry) 1102 strMessage += tr("<p>Would you like to try force mounting of this medium?</p>"); 1103 } 1104 else 1105 { 1106 strMessage = tr("<p>Unable to unmount the virtual optical disk <nobr><b>%1</b></nobr> from the machine <b>%2</b>.</p>"); 1107 if (fRetry) 1108 strMessage += tr("<p>Would you like to try force unmounting of this medium?</p>"); 1109 } 1110 break; 1111 } 1112 case UIMediumType_Floppy: 1113 { 1114 if (fMount) 1115 { 1116 strMessage = tr("<p>Unable to mount the virtual floppy disk <nobr><b>%1</b></nobr> on the machine <b>%2</b>.</p>"); 1117 if (fRetry) 1118 strMessage += tr("<p>Would you like to try force mounting of this medium?</p>"); 1119 } 1120 else 1121 { 1122 strMessage = tr("<p>Unable to unmount the virtual floppy disk <nobr><b>%1</b></nobr> from the machine <b>%2</b>.</p>"); 1123 if (fRetry) 1124 strMessage += tr("<p>Would you like to try force unmounting of this medium?</p>"); 1125 } 1126 break; 1127 } 1128 default: 1129 break; 1130 } 1131 /* Show the messsage: */ 1086 1132 if (fRetry) 1087 { 1088 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question, text 1089 .arg(mediumToAccusative(aMedium.type(), aMedium.isHostDrive())) 1090 .arg(aMedium.isHostDrive() ? aMedium.name() : aMedium.location()) 1091 .arg(CMachine(machine).GetName()), 1092 formatErrorInfo(machine), 1093 0 /* Auto Confirm ID */, 1094 tr("Force Unmount")); 1095 } 1096 else 1097 { 1098 return message(pParent ? pParent : mainWindowShown(), MessageType_Error, text 1099 .arg(mediumToAccusative(aMedium.type(), aMedium.isHostDrive())) 1100 .arg(aMedium.isHostDrive() ? aMedium.name() : aMedium.location()) 1101 .arg(CMachine(machine).GetName()), 1102 formatErrorInfo(machine)); 1103 } 1104 } 1105 1106 void UIMessageCenter::cannotOpenMedium(QWidget *pParent, 1107 const CVirtualBox &vbox, 1108 UIMediumType type, 1109 const QString &strLocation) 1110 { 1111 /** @todo (translation-related): the gender of "the" in translations 1112 * will depend on the gender of aMedium.type(). */ 1133 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question, 1134 strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()), 1135 strErrorInfo, 1136 0 /* Auto Confirm ID */, 1137 tr("Force Unmount")); 1138 return message(pParent ? pParent : mainWindowShown(), MessageType_Error, 1139 strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()), 1140 strErrorInfo); 1141 } 1142 1143 void UIMessageCenter::cannotOpenMedium(const CVirtualBox &vbox, UIMediumType type, const QString &strLocation, QWidget *pParent /*= 0*/) 1144 { 1145 /* Prepare the message: */ 1146 QString strMessage; 1147 switch (type) 1148 { 1149 case UIMediumType_HardDisk: 1150 { 1151 strMessage = tr("Failed to open the hard disk file <nobr><b>%1</b></nobr>."); 1152 break; 1153 } 1154 case UIMediumType_DVD: 1155 { 1156 strMessage = tr("Failed to open the optical disk file <nobr><b>%1</b></nobr>."); 1157 break; 1158 } 1159 case UIMediumType_Floppy: 1160 { 1161 strMessage = tr("Failed to open the floppy disk file <nobr><b>%1</b></nobr>."); 1162 break; 1163 } 1164 default: 1165 break; 1166 } 1167 /* Show the message: */ 1113 1168 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 1114 tr("Failed to open the %1 <nobr><b>%2</b></nobr>.") 1115 .arg(mediumToAccusative(type)) 1116 .arg(strLocation), 1117 formatErrorInfo(vbox)); 1118 } 1119 1120 void UIMessageCenter::cannotCloseMedium(QWidget *pParent, 1121 const UIMedium &aMedium, 1122 const COMResult &rc) 1123 { 1124 /** @todo (translation-related): the gender of "the" in translations 1125 * will depend on the gender of aMedium.type(). */ 1126 message(pParent, MessageType_Error, 1127 tr("Failed to close the %1 <nobr><b>%2</b></nobr>.") 1128 .arg(mediumToAccusative(aMedium.type())) 1129 .arg(aMedium.location()), 1130 formatErrorInfo(rc)); 1169 strMessage.arg(strLocation), formatErrorInfo(vbox)); 1170 } 1171 1172 void UIMessageCenter::cannotCloseMedium(const UIMedium &medium, const COMResult &rc, QWidget *pParent /*= 0*/) 1173 { 1174 /* Prepare the message: */ 1175 QString strMessage; 1176 switch (medium.type()) 1177 { 1178 case UIMediumType_HardDisk: 1179 { 1180 strMessage = tr("Failed to close the hard disk file <nobr><b>%2</b></nobr>."); 1181 break; 1182 } 1183 case UIMediumType_DVD: 1184 { 1185 strMessage = tr("Failed to close the optical disk file <nobr><b>%2</b></nobr>."); 1186 break; 1187 } 1188 case UIMediumType_Floppy: 1189 { 1190 strMessage = tr("Failed to close the floppy disk file <nobr><b>%2</b></nobr>."); 1191 break; 1192 } 1193 default: 1194 break; 1195 } 1196 /* Show the message: */ 1197 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 1198 strMessage.arg(medium.location()), formatErrorInfo(rc)); 1131 1199 } 1132 1200 … … 2397 2465 2398 2466 /* static */ 2399 QString UIMessageCenter::mediumToAccusative(UIMediumType type, bool fIsHostDrive /* = false */)2400 {2401 QString strType =2402 type == UIMediumType_HardDisk ?2403 tr("hard disk", "failed to mount ...") :2404 type == UIMediumType_DVD && fIsHostDrive ?2405 tr("CD/DVD", "failed to mount ... host-drive") :2406 type == UIMediumType_DVD && !fIsHostDrive ?2407 tr("CD/DVD image", "failed to mount ...") :2408 type == UIMediumType_Floppy && fIsHostDrive ?2409 tr("floppy", "failed to mount ... host-drive") :2410 type == UIMediumType_Floppy && !fIsHostDrive ?2411 tr("floppy image", "failed to mount ...") :2412 QString();2413 2414 Assert(!strType.isNull());2415 return strType;2416 }2417 2418 /* static */2419 2467 QString UIMessageCenter::formatRC(HRESULT rc) 2420 2468 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r45289 r45292 255 255 256 256 /* API: Virtual Medium Manager warnings: */ 257 void cannotChangeMediumType(QWidget *pParent, const CMedium &medium, KMediumType oldMediumType, KMediumType newMediumType); 258 bool confirmReleaseMedium(QWidget *pParent, const UIMedium &aMedium, 259 const QString &strUsage); 260 bool confirmRemoveMedium(QWidget *pParent, const UIMedium &aMedium); 261 int confirmDeleteHardDiskStorage(QWidget *pParent, 262 const QString &strLocation); 263 void cannotDeleteHardDiskStorage(QWidget *pParent, const CMedium &medium, 264 const CProgress &progress); 265 void cannotDetachDevice(QWidget *pParent, const CMachine &machine, 266 UIMediumType type, const QString &strLocation, const StorageSlot &storageSlot); 267 int cannotRemountMedium(QWidget *pParent, const CMachine &machine, const UIMedium &aMedium, bool fMount, bool fRetry); 268 void cannotOpenMedium(QWidget *pParent, const CVirtualBox &vbox, 269 UIMediumType type, const QString &strLocation); 270 void cannotCloseMedium(QWidget *pParent, const UIMedium &aMedium, 271 const COMResult &rc); 257 void cannotChangeMediumType(const CMedium &medium, KMediumType oldMediumType, KMediumType newMediumType, QWidget *pParent = 0); 258 bool confirmMediumRelease(const UIMedium &medium, const QString &strUsage, QWidget *pParent = 0); 259 bool confirmMediumRemoval(const UIMedium &medium, QWidget *pParent = 0); 260 int confirmDeleteHardDiskStorage(const QString &strLocation, QWidget *pParent = 0); 261 void cannotDeleteHardDiskStorage(const CMedium &medium, const CProgress &progress, QWidget *pParent = 0); 262 void cannotDetachDevice(const CMachine &machine, UIMediumType type, const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent = 0); 263 int cannotRemountMedium(const CMachine &machine, const UIMedium &medium, bool fMount, bool fRetry, QWidget *pParent = 0); 264 void cannotOpenMedium(const CVirtualBox &vbox, UIMediumType type, const QString &strLocation, QWidget *pParent = 0); 265 void cannotCloseMedium(const UIMedium &medium, const COMResult &rc, QWidget *pParent = 0); 272 266 273 267 /* API: Wizards warnings: */ … … 374 368 bool askForOverridingFilesIfExists(const QVector<QString> &strPaths, QWidget *pParent = 0); 375 369 376 /* Helpers: */377 static QString mediumToAccusative(UIMediumType type, bool fIsHostDrive = false);378 379 370 static QString formatRC(HRESULT rc); 380 371 static QString formatErrorInfo(const COMErrorInfo &info, HRESULT wrapperRC = S_OK); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r45275 r45292 2286 2286 } 2287 2287 else 2288 msgCenter().cannotOpenMedium( pParent, vbox, mediumType, strMediumLocation);2288 msgCenter().cannotOpenMedium(vbox, mediumType, strMediumLocation, pParent); 2289 2289 2290 2290 return QString(); -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r45290 r45292 1132 1132 UIMediumType type = item->type(); 1133 1133 1134 if (!msgCenter().confirmRemoveMedium (this, item->medium())) 1134 /* Confirm medium removal: */ 1135 if (!msgCenter().confirmMediumRemoval(item->medium(), this)) 1135 1136 return; 1136 1137 … … 1143 1144 bool deleteStorage = false; 1144 1145 1145 /* We don't want to try to delete inaccessible storage as it will 1146 * most likely fail. Note that 1147 * UIMessageCenter::confirmRemoveMedium() is aware of that and 1148 * will give a corresponding hint. Therefore, once the code is 1149 * changed below, the hint should be re-checked for validity. */ 1146 /* We don't want to try to delete inaccessible storage as it will most likely fail. 1147 * Note that UIMessageCenter::confirmMediumRemoval() is aware of that and 1148 * will give a corresponding hint. Therefore, once the code is changed below, 1149 * the hint should be re-checked for validity. */ 1150 1150 1151 1151 qulonglong caps = 0; … … 1158 1158 caps & MediumFormatCapabilities_File) 1159 1159 { 1160 int rc = msgCenter(). 1161 confirmDeleteHardDiskStorage (this, item->location()); 1160 int rc = msgCenter().confirmDeleteHardDiskStorage(item->location(), this); 1162 1161 if (rc == QIMessageBox::Cancel) 1163 1162 return; … … 1175 1174 if (!(progress.isOk() && progress.GetResultCode() == S_OK)) 1176 1175 { 1177 msgCenter().cannotDeleteHardDiskStorage( this, hardDisk, progress);1176 msgCenter().cannotDeleteHardDiskStorage(hardDisk, progress, this); 1178 1177 return; 1179 1178 } … … 1204 1203 1205 1204 if (result.isOk()) 1206 vboxGlobal().removeMedium 1205 vboxGlobal().removeMedium(type, id); 1207 1206 else 1208 msgCenter().cannotCloseMedium (this, item->medium(), result);1207 msgCenter().cannotCloseMedium(item->medium(), result, this); 1209 1208 } 1210 1209 … … 1247 1246 AssertReturnVoid (machines.size() > 0); 1248 1247 1249 if (!msgCenter().confirm ReleaseMedium (this, item->medium(), usage))1248 if (!msgCenter().confirmMediumRelease(item->medium(), usage, this)) 1250 1249 return; 1251 1250 … … 1300 1299 { 1301 1300 CStorageController controller = machine.GetStorageControllerByName (attachment.GetController()); 1302 msgCenter().cannotDetachDevice (this,machine, UIMediumType_HardDisk, aMedium.location(),1303 StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()));1301 msgCenter().cannotDetachDevice(machine, UIMediumType_HardDisk, aMedium.location(), 1302 StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()), this); 1304 1303 success = false; 1305 1304 break; … … 1322 1321 if (!machine.isOk()) 1323 1322 { 1324 msgCenter().cannotRemountMedium (this, machine, aMedium, false /* mount? */, false /* retry? */);1323 msgCenter().cannotRemountMedium(machine, aMedium, false /* mount? */, false /* retry? */, this); 1325 1324 success = false; 1326 1325 break; … … 1343 1342 if (!machine.isOk()) 1344 1343 { 1345 msgCenter().cannotRemountMedium (this, machine, aMedium, false /* mount? */, false /* retry? */);1344 msgCenter().cannotRemountMedium(machine, aMedium, false /* mount? */, false /* retry? */, this); 1346 1345 success = false; 1347 1346 break; … … 1645 1644 1646 1645 if (!mVBox.isOk()) 1647 msgCenter().cannotOpenMedium( this, mVBox, aType, aLocation);1646 msgCenter().cannotOpenMedium(mVBox, aType, aLocation, this); 1648 1647 else 1649 1648 vboxGlobal().addMedium(medium); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r45274 r45292 1492 1492 { 1493 1493 /* Ask for force remounting: */ 1494 if (msgCenter().cannotRemountMedium(0, machine, vboxGlobal().findMedium (fMount ? newId : currentId), fMount, true /* retry? */) == QIMessageBox::Ok) 1494 if (msgCenter().cannotRemountMedium(machine, vboxGlobal().findMedium(fMount ? newId : currentId), 1495 fMount, true /* retry? */, activeMachineWindow()) == QIMessageBox::Ok) 1495 1496 { 1496 1497 /* Force remount medium to the predefined port/device: */ … … 1499 1500 fWasMounted = true; 1500 1501 else 1501 msgCenter().cannotRemountMedium(0, machine, vboxGlobal().findMedium (fMount ? newId : currentId), fMount, false /* retry? */); 1502 msgCenter().cannotRemountMedium(machine, vboxGlobal().findMedium(fMount ? newId : currentId), 1503 fMount, false /* retry? */, activeMachineWindow()); 1502 1504 } 1503 1505 } … … 1551 1553 { 1552 1554 /* Ask for force remounting: */ 1553 if (msgCenter().cannotRemountMedium(0, machine, vboxGlobal().findMedium(fMount ? strNewId : strCurrentId), fMount, true /* retry? */) == QIMessageBox::Ok) 1555 if (msgCenter().cannotRemountMedium(machine, vboxGlobal().findMedium(fMount ? strNewId : strCurrentId), 1556 fMount, true /* retry? */, activeMachineWindow()) == QIMessageBox::Ok) 1554 1557 { 1555 1558 /* Force remount medium to the predefined port/device: */ … … 1558 1561 fWasMounted = true; 1559 1562 else 1560 msgCenter().cannotRemountMedium(0, machine, vboxGlobal().findMedium(fMount ? strNewId : strCurrentId), fMount, false /* retry? */); 1563 msgCenter().cannotRemountMedium(machine, vboxGlobal().findMedium(fMount ? strNewId : strCurrentId), 1564 fMount, false /* retry? */, activeMachineWindow()); 1561 1565 } 1562 1566 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r45224 r45292 547 547 if (!vbox.isOk()) 548 548 { 549 msgCenter().cannotOpenMedium( 0, vbox, UIMediumType_DVD, strSource);549 msgCenter().cannotOpenMedium(vbox, UIMediumType_DVD, strSource, mainMachineWindow()); 550 550 return; 551 551 } … … 591 591 { 592 592 /* Ask for force mounting: */ 593 if (msgCenter().cannotRemountMedium(0, machine, vboxMedium, true /* mount? */, true /* retry? */) == QIMessageBox::Ok) 593 if (msgCenter().cannotRemountMedium(machine, vboxMedium, true /* mount? */, 594 true /* retry? */, mainMachineWindow()) == QIMessageBox::Ok) 594 595 { 595 596 /* Force mount medium to the predefined port/device: */ 596 597 machine.MountMedium(strCntName, iCntPort, iCntDevice, vboxMedium.medium(), true /* force */); 597 598 if (!machine.isOk()) 598 msgCenter().cannotRemountMedium(0, machine, vboxMedium, true /* mount? */, false /* retry? */); 599 msgCenter().cannotRemountMedium(machine, vboxMedium, true /* mount? */, 600 false /* retry? */, mainMachineWindow()); 599 601 } 600 602 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIWizardFirstRun.cpp
r42551 r45292 82 82 else 83 83 { 84 msgCenter().cannotRemountMedium( this, m_machine, vmedium, true /* mount? */, false /* retry? */);84 msgCenter().cannotRemountMedium(m_machine, vmedium, true /* mount? */, false /* retry? */, this); 85 85 return false; 86 86 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp
r45193 r45292 121 121 vboxGlobal().removeMedium(UIMediumType_HardDisk, strId); 122 122 else 123 msgCenter().cannotDeleteHardDiskStorage( thisImp(), m_virtualDisk, progress);123 msgCenter().cannotDeleteHardDiskStorage(m_virtualDisk, progress, thisImp()); 124 124 125 125 /* Detach virtual-disk finally: */
Note:
See TracChangeset
for help on using the changeset viewer.