Changeset 45342 in vbox
- Timestamp:
- Apr 4, 2013 5:21:13 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r45334 r45342 1885 1885 } 1886 1886 1887 bool UIMessageCenter::askAboutCancelAllNetworkRequest(QWidget *pParent) 1888 { 1889 return messageOkCancel(pParent, MessageType_Question, tr("Do you wish to cancel all current network operations?")); 1887 bool UIMessageCenter::confirmCancelingAllNetworkRequests() 1888 { 1889 return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question, 1890 tr("Do you wish to cancel all current network operations?")); 1890 1891 } 1891 1892 … … 1893 1894 { 1894 1895 message(networkManagerOrMainWindowShown(), MessageType_Info, 1895 tr("<p>A new version of VirtualBox has been released! Version <b>%1</b> is available at <a href=\"http://www.virtualbox.org/\">virtualbox.org</a>.</p>" 1896 tr("<p>A new version of VirtualBox has been released! Version <b>%1</b> is available " 1897 "at <a href=\"http://www.virtualbox.org/\">virtualbox.org</a>.</p>" 1896 1898 "<p>You can download this version using the link:</p>" 1897 1899 "<p><a href=%2>%3</a></p>") 1898 .arg(strVersion, strLink, strLink));1900 .arg(strVersion, strLink, strLink)); 1899 1901 } 1900 1902 … … 1905 1907 } 1906 1908 1907 bool UIMessageCenter::cannotFindGuestAdditions() 1908 { 1909 return messageYesNo(mainMachineWindowShown(), MessageType_Question, 1910 tr("<p>Could not find the VirtualBox Guest Additions " 1911 "CD image file.</nobr></p><p>Do you wish to " 1912 "download this CD image from the Internet?</p>")); 1913 } 1914 1915 bool UIMessageCenter::confirmDownloadAdditions(const QString &strUrl, qulonglong uSize) 1916 { 1917 QLocale loc(VBoxGlobal::languageId()); 1918 return messageOkCancel(networkManagerOrMainMachineWindowShown(), MessageType_Question, 1919 tr("<p>Are you sure you want to download the VirtualBox " 1920 "Guest Additions CD image from " 1921 "<nobr><a href=\"%1\">%2</a></nobr> " 1922 "(size %3 bytes)?</p>").arg(strUrl).arg(strUrl).arg(loc.toString(uSize)), 1923 0 /* auto-confirm id */, 1924 tr("Download", "additions")); 1925 } 1926 1927 bool UIMessageCenter::confirmMountAdditions(const QString &strUrl, const QString &strSrc) 1928 { 1929 return messageOkCancel(networkManagerOrMainMachineWindowShown(), MessageType_Question, 1930 tr("<p>The VirtualBox Guest Additions CD image has been " 1931 "successfully downloaded from " 1932 "<nobr><a href=\"%1\">%2</a></nobr> " 1933 "and saved locally as <nobr><b>%3</b>.</nobr></p>" 1934 "<p>Do you wish to register this CD image and mount it " 1935 "on the virtual CD/DVD drive?</p>") 1936 .arg(strUrl).arg(strUrl).arg(strSrc), 1937 0 /* auto-confirm id */, 1938 tr("Mount", "additions")); 1939 } 1940 1941 void UIMessageCenter::cannotMountGuestAdditions(const QString &strMachineName) 1942 { 1943 message(mainMachineWindowShown(), MessageType_Error, 1944 tr("<p>Could not insert the VirtualBox Guest Additions " 1945 "installer CD image into the virtual machine <b>%1</b>, as the machine " 1946 "has no CD/DVD-ROM drives. Please add a drive using the " 1947 "storage page of the virtual machine settings dialog.</p>") 1948 .arg(strMachineName)); 1949 } 1950 1951 void UIMessageCenter::warnAboutAdditionsCantBeSaved(const QString &strTarget) 1952 { 1953 message(networkManagerOrMainMachineWindowShown(), MessageType_Error, 1954 tr("<p>Failed to save the downloaded file as <nobr><b>%1</b>.</nobr></p>") 1955 .arg(QDir::toNativeSeparators(strTarget))); 1956 } 1957 1958 bool UIMessageCenter::askAboutUserManualDownload(const QString &strMissedLocation) 1959 { 1960 return messageOkCancel(mainWindowShown(), MessageType_Question, 1961 tr("<p>Could not find the VirtualBox User Manual " 1962 "<nobr><b>%1</b>.</nobr></p><p>Do you wish to " 1963 "download this file from the Internet?</p>") 1964 .arg(strMissedLocation), 1965 0 /* auto-confirm id */, 1966 tr("Download", "additions")); 1967 } 1968 1969 bool UIMessageCenter::confirmUserManualDownload(const QString &strURL, qulonglong uSize) 1970 { 1971 QLocale loc(VBoxGlobal::languageId()); 1972 return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question, 1973 tr("<p>Are you sure you want to download the VirtualBox " 1974 "User Manual from " 1975 "<nobr><a href=\"%1\">%2</a></nobr> " 1976 "(size %3 bytes)?</p>").arg(strURL).arg(strURL).arg(loc.toString(uSize)), 1977 0 /* auto-confirm id */, 1978 tr("Download", "additions")); 1979 } 1980 1981 void UIMessageCenter::warnAboutUserManualDownloaded(const QString &strURL, const QString &strTarget) 1982 { 1983 message(networkManagerOrMainWindowShown(), MessageType_Warning, 1984 tr("<p>The VirtualBox User Manual has been " 1985 "successfully downloaded from " 1986 "<nobr><a href=\"%1\">%2</a></nobr> " 1987 "and saved locally as <nobr><b>%3</b>.</nobr></p>") 1988 .arg(strURL).arg(strURL).arg(strTarget)); 1989 } 1990 1991 void UIMessageCenter::warnAboutUserManualCantBeSaved(const QString &strURL, const QString &strTarget) 1992 { 1993 message(networkManagerOrMainWindowShown(), MessageType_Error, 1994 tr("<p>The VirtualBox User Manual has been " 1995 "successfully downloaded from " 1996 "<nobr><a href=\"%1\">%2</a></nobr> " 1997 "but can't be saved locally as <nobr><b>%3</b>.</nobr></p>" 1998 "<p>Please choose another location for that file.</p>") 1999 .arg(strURL).arg(strURL).arg(strTarget)); 2000 } 2001 2002 bool UIMessageCenter::proposeDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion) 2003 { 2004 return messageOkCancel(mainWindowShown(), 2005 MessageType_Question, 2006 tr("<p>You have an old version (%1) of the <b><nobr>%2</nobr></b> installed.</p>" 2007 "<p>Do you wish to download latest one from the Internet?</p>") 2008 .arg(strExtPackVersion).arg(strExtPackName), 2009 0 /* auto-confirm id */, 2010 tr("Download", "extension pack")); 2011 } 2012 2013 bool UIMessageCenter::requestUserDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion) 1909 bool UIMessageCenter::askUserToDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion) 2014 1910 { 2015 1911 return message(mainWindowShown(), MessageType_Info, … … 2024 1920 } 2025 1921 2026 bool UIMessageCenter::confirmDownloadExtensionPack(const QString &strExtPackName, const QString &strURL, qulonglong uSize) 1922 bool UIMessageCenter::cannotFindGuestAdditions() const 1923 { 1924 return messageYesNo(mainMachineWindowShown(), MessageType_Question, 1925 tr("<p>Could not find the <b>VirtualBox Guest Additions</b> CD image.</p>" 1926 "<p>Do you wish to download this CD image from the Internet?</p>"), 1927 0 /* auto-confirm id */, 1928 tr("Download")); 1929 } 1930 1931 bool UIMessageCenter::confirmDownloadGuestAdditions(const QString &strUrl, qulonglong uSize) const 1932 { 1933 QLocale loc(VBoxGlobal::languageId()); 1934 return messageOkCancel(networkManagerOrMainMachineWindowShown(), MessageType_Question, 1935 tr("<p>Are you sure you want to download the <b>VirtualBox Guest Additions</b> CD image " 1936 "from <nobr><a href=\"%1\">%1</a></nobr> (size %2 bytes)?</p>") 1937 .arg(strUrl, loc.toString(uSize)), 1938 0 /* auto-confirm id */, 1939 tr("Download")); 1940 } 1941 1942 void UIMessageCenter::cannotSaveGuestAdditions(const QString &strURL, const QString &strTarget) const 1943 { 1944 message(networkManagerOrMainMachineWindowShown(), MessageType_Error, 1945 tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded " 1946 "from <nobr><a href=\"%1\">%1</a></nobr> " 1947 "but can't be saved locally as <nobr><b>%2</b>.</nobr></p>" 1948 "<p>Please choose another location for that file.</p>") 1949 .arg(strURL, strTarget)); 1950 } 1951 1952 bool UIMessageCenter::proposeMountGuestAdditions(const QString &strUrl, const QString &strSrc) const 1953 { 1954 return messageOkCancel(networkManagerOrMainMachineWindowShown(), MessageType_Question, 1955 tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded " 1956 "from <nobr><a href=\"%1\">%1</a></nobr> " 1957 "and saved locally as <nobr><b>%2</b>.</nobr></p>" 1958 "<p>Do you wish to register this CD image and mount it on the virtual CD/DVD drive?</p>") 1959 .arg(strUrl, strSrc), 1960 0 /* auto-confirm id */, 1961 tr("Mount", "additions")); 1962 } 1963 1964 void UIMessageCenter::cannotMountGuestAdditions(const QString &strMachineName) const 1965 { 1966 message(mainMachineWindowShown(), MessageType_Error, 1967 tr("<p>Could not insert the <b>VirtualBox Guest Additions</b> CD image into the virtual machine <b>%1</b>, " 1968 "as the machine has no CD/DVD-ROM drives. Please add a drive using the storage page of the " 1969 "virtual machine settings dialog.</p>") 1970 .arg(strMachineName)); 1971 } 1972 1973 void UIMessageCenter::cannotUpdateGuestAdditions(const CProgress &progress) const 1974 { 1975 message(mainMachineWindowShown(), MessageType_Error, 1976 tr("Failed to update Guest Additions. " 1977 "The Guest Additions installation image will be mounted to provide a manual installation."), 1978 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 1979 } 1980 1981 bool UIMessageCenter::cannotFindUserManual(const QString &strMissedLocation) const 1982 { 1983 return messageYesNo(mainWindowShown(), MessageType_Question, 1984 tr("<p>Could not find the <b>VirtualBox User Manual</b> <nobr><b>%1</b>.</nobr></p>" 1985 "<p>Do you wish to download this file from the Internet?</p>") 1986 .arg(strMissedLocation), 1987 0 /* auto-confirm id */, 1988 tr("Download")); 1989 } 1990 1991 bool UIMessageCenter::confirmDownloadUserManual(const QString &strURL, qulonglong uSize) const 1992 { 1993 QLocale loc(VBoxGlobal::languageId()); 1994 return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question, 1995 tr("<p>Are you sure you want to download the <b>VirtualBox User Manual</b> " 1996 "from <nobr><a href=\"%1\">%1</a></nobr> (size %2 bytes)?</p>") 1997 .arg(strURL, loc.toString(uSize)), 1998 0 /* auto-confirm id */, 1999 tr("Download")); 2000 } 2001 2002 void UIMessageCenter::cannotSaveUserManual(const QString &strURL, const QString &strTarget) const 2003 { 2004 message(networkManagerOrMainWindowShown(), MessageType_Error, 2005 tr("<p>The VirtualBox User Manual has been successfully downloaded " 2006 "from <nobr><a href=\"%1\">%1</a></nobr> " 2007 "but can't be saved locally as <nobr><b>%2</b>.</nobr></p>" 2008 "<p>Please choose another location for that file.</p>") 2009 .arg(strURL, strTarget)); 2010 } 2011 2012 void UIMessageCenter::warnAboutUserManualDownloaded(const QString &strURL, const QString &strTarget) const 2013 { 2014 message(networkManagerOrMainWindowShown(), MessageType_Warning, 2015 tr("<p>The VirtualBox User Manual has been successfully downloaded " 2016 "from <nobr><a href=\"%1\">%1</a></nobr> " 2017 "and saved locally as <nobr><b>%2</b>.</nobr></p>") 2018 .arg(strURL, strTarget)); 2019 } 2020 2021 bool UIMessageCenter::warAboutOutdatedExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion) const 2022 { 2023 return messageYesNo(mainWindowShown(), 2024 MessageType_Question, 2025 tr("<p>You have an old version (%1) of the <b><nobr>%2</nobr></b> installed.</p>" 2026 "<p>Do you wish to download latest one from the Internet?</p>") 2027 .arg(strExtPackVersion).arg(strExtPackName), 2028 0 /* auto-confirm id */, 2029 tr("Download")); 2030 } 2031 2032 bool UIMessageCenter::confirmDownloadExtensionPack(const QString &strExtPackName, const QString &strURL, qulonglong uSize) const 2027 2033 { 2028 2034 QLocale loc(VBoxGlobal::languageId()); … … 2032 2038 .arg(strExtPackName, strURL, loc.toString(uSize)), 2033 2039 0 /* auto-confirm id */, 2034 tr("Download", "extension pack")); 2035 } 2036 2037 bool UIMessageCenter::proposeInstallExtentionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo) 2040 tr("Download")); 2041 } 2042 2043 void UIMessageCenter::cannotSaveExtensionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo) const 2044 { 2045 message(networkManagerOrMainWindowShown(), MessageType_Error, 2046 tr("<p>The <b><nobr>%1</nobr></b> has been successfully downloaded " 2047 "from <nobr><a href=\"%2\">%2</a></nobr> " 2048 "but can't be saved locally as <nobr><b>%3</b>.</nobr></p>" 2049 "<p>Please choose another location for that file.</p>") 2050 .arg(strExtPackName, strFrom, strTo)); 2051 } 2052 2053 bool UIMessageCenter::proposeInstallExtentionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo) const 2038 2054 { 2039 2055 return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question, 2040 tr("<p>The <b><nobr>%1</nobr></b> has been "2041 " successfully downloadedfrom <nobr><a href=\"%2\">%2</a></nobr> "2056 tr("<p>The <b><nobr>%1</nobr></b> has been successfully downloaded " 2057 "from <nobr><a href=\"%2\">%2</a></nobr> " 2042 2058 "and saved locally as <nobr><b>%3</b>.</nobr></p>" 2043 2059 "<p>Do you wish to install this extension pack?</p>") 2044 2060 .arg(strExtPackName, strFrom, strTo), 2045 2061 0 /* auto-confirm id */, 2046 tr ("Install", "extension pack")); 2047 } 2048 2049 void UIMessageCenter::warnAboutExtentionPackCantBeSaved(const QString &strExtPackName, const QString &strFrom, const QString &strTo) 2050 { 2051 message(networkManagerOrMainWindowShown(), MessageType_Error, 2052 tr("<p>The <b><nobr>%1</nobr></b> has been " 2053 "successfully downloaded from <nobr><a href=\"%2\">%2</a></nobr> " 2054 "but can't be saved locally as <nobr><b>%3</b>.</nobr></p>" 2055 "<p>Please choose another location for that file.</p>") 2056 .arg(strExtPackName, strFrom, strTo)); 2057 } 2058 2059 void UIMessageCenter::cannotUpdateGuestAdditions(const CProgress &progress, 2060 QWidget *pParent /* = NULL */) const 2061 { 2062 AssertWrapperOk(progress); 2063 2064 message(pParent ? pParent : mainWindowShown(), 2065 MessageType_Error, 2066 tr("Failed to update Guest Additions. The Guest Additions installation image will be mounted to provide a manual installation."), 2067 formatErrorInfo(progress.GetErrorInfo())); 2068 } 2069 2070 void UIMessageCenter::cannotOpenExtPack(const QString &strFilename, 2071 const CExtPackManager &extPackManager, 2072 QWidget *pParent) 2073 { 2074 message(pParent ? pParent : mainWindowShown(), 2075 MessageType_Error, 2076 tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename), 2077 formatErrorInfo(extPackManager)); 2078 } 2079 2080 void UIMessageCenter::badExtPackFile(const QString &strFilename, 2081 const CExtPackFile &extPackFile, 2082 QWidget *pParent) 2083 { 2084 message(pParent ? pParent : mainWindowShown(), 2085 MessageType_Error, 2086 tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename), 2087 "<!--EOM-->" + extPackFile.GetWhyUnusable()); 2088 } 2089 2090 void UIMessageCenter::cannotInstallExtPack(const QString &strFilename, 2091 const CExtPackFile &extPackFile, 2092 const CProgress &progress, 2093 QWidget *pParent) 2094 { 2095 if (!pParent) 2096 pParent = mainWindowShown(); 2097 QString strErrInfo = !extPackFile.isOk() || progress.isNull() 2098 ? formatErrorInfo(extPackFile) : formatErrorInfo(progress.GetErrorInfo()); 2099 message(pParent, 2100 MessageType_Error, 2101 tr("Failed to install the Extension Pack <b>%1</b>.").arg(strFilename), 2102 strErrInfo); 2103 } 2104 2105 void UIMessageCenter::cannotUninstallExtPack(const QString &strPackName, const CExtPackManager &extPackManager, 2106 const CProgress &progress, QWidget *pParent) 2107 { 2108 if (!pParent) 2109 pParent = mainWindowShown(); 2110 QString strErrInfo = !extPackManager.isOk() || progress.isNull() 2111 ? formatErrorInfo(extPackManager) : formatErrorInfo(progress.GetErrorInfo()); 2112 message(pParent, 2113 MessageType_Error, 2114 tr("Failed to uninstall the Extension Pack <b>%1</b>.").arg(strPackName), 2115 strErrInfo); 2116 } 2117 2118 bool UIMessageCenter::confirmInstallingPackage(const QString &strPackName, const QString &strPackVersion, 2119 const QString &strPackDescription, QWidget *pParent) 2062 tr("Install", "extension pack")); 2063 } 2064 2065 bool UIMessageCenter::confirmInstallExtensionPack(const QString &strPackName, const QString &strPackVersion, 2066 const QString &strPackDescription, QWidget *pParent /*= 0*/) const 2120 2067 { 2121 2068 return messageOkCancel(pParent ? pParent : mainWindowShown(), … … 2130 2077 "<tr><td><b>Description: </b></td><td>%3</td></tr>" 2131 2078 "</table></p>") 2132 .arg(strPackName).arg(strPackVersion).arg(strPackDescription),2079 .arg(strPackName).arg(strPackVersion).arg(strPackDescription), 2133 2080 0, 2134 tr("&Install")); 2135 } 2136 2137 bool UIMessageCenter::confirmReplacePackage(const QString &strPackName, const QString &strPackVersionNew, 2138 const QString &strPackVersionOld, const QString &strPackDescription, 2139 QWidget *pParent) 2140 { 2141 if (!pParent) 2142 pParent = pParent ? pParent : mainWindowShown(); /* this is boring stuff that messageOkCancel should do! */ 2143 2081 tr("Install", "extension pack")); 2082 } 2083 2084 bool UIMessageCenter::confirmReplaceExtensionPack(const QString &strPackName, const QString &strPackVersionNew, 2085 const QString &strPackVersionOld, const QString &strPackDescription, 2086 QWidget *pParent /*= 0*/) const 2087 { 2088 /* Prepare initial message: */ 2144 2089 QString strBelehrung = tr("Extension packs complement the functionality of VirtualBox and can contain " 2145 2090 "system level software that could be potentially harmful to your system. " … … 2147 2092 "the extension pack from a trusted source."); 2148 2093 2094 /* Compare versions: */ 2149 2095 QByteArray ba1 = strPackVersionNew.toUtf8(); 2150 2096 QByteArray ba2 = strPackVersionOld.toUtf8(); 2151 2097 int iVerCmp = RTStrVersionCompare(ba1.constData(), ba2.constData()); 2152 2098 2099 /* Show the message: */ 2153 2100 bool fRc; 2154 2101 if (iVerCmp > 0) 2155 fRc = messageOkCancel(pParent ,2102 fRc = messageOkCancel(pParent ? pParent : mainWindowShown(), 2156 2103 MessageType_Question, 2157 2104 tr("<p>An older version of the extension pack is already installed, would you like to upgrade? " … … 2163 2110 "<tr><td><b>Description: </b></td><td>%5</td></tr>" 2164 2111 "</table></p>") 2165 .arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription),2112 .arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription), 2166 2113 0, 2167 2114 tr("&Upgrade")); 2168 2115 else if (iVerCmp < 0) 2169 fRc = messageOkCancel(pParent ,2116 fRc = messageOkCancel(pParent ? pParent : mainWindowShown(), 2170 2117 MessageType_Question, 2171 2118 tr("<p>An newer version of the extension pack is already installed, would you like to downgrade? " … … 2177 2124 "<tr><td><b>Description: </b></td><td>%5</td></tr>" 2178 2125 "</table></p>") 2179 .arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription),2126 .arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription), 2180 2127 0, 2181 2128 tr("&Downgrade")); 2182 2129 else 2183 fRc = messageOkCancel(pParent ,2130 fRc = messageOkCancel(pParent ? pParent : mainWindowShown(), 2184 2131 MessageType_Question, 2185 2132 tr("<p>The extension pack is already installed with the same version, would you like reinstall it? " … … 2190 2137 "<tr><td><b>Description: </b></td><td>%4</td></tr>" 2191 2138 "</table></p>") 2192 .arg(strBelehrung).arg(strPackName).arg(strPackVersionOld).arg(strPackDescription),2139 .arg(strBelehrung).arg(strPackName).arg(strPackVersionOld).arg(strPackDescription), 2193 2140 0, 2194 2141 tr("&Reinstall")); … … 2196 2143 } 2197 2144 2198 bool UIMessageCenter::confirmRemov ingPackage(const QString &strPackName, QWidget *pParent)2145 bool UIMessageCenter::confirmRemoveExtensionPack(const QString &strPackName, QWidget *pParent /*= 0*/) const 2199 2146 { 2200 2147 return messageOkCancel(pParent ? pParent : mainWindowShown(), 2201 MessageType_Question, 2202 tr("<p>You are about to remove the VirtualBox extension pack <b>%1</b>.</p>" 2203 "<p>Are you sure you want to proceed?</p>").arg(strPackName), 2204 0, 2205 tr("&Remove")); 2206 } 2207 2208 void UIMessageCenter::notifyAboutExtPackInstalled(const QString &strPackName, QWidget *pParent) 2148 MessageType_Question, 2149 tr("<p>You are about to remove the VirtualBox extension pack <b>%1</b>.</p>" 2150 "<p>Are you sure you want to proceed?</p>") 2151 .arg(strPackName), 2152 0, 2153 tr("&Remove")); 2154 } 2155 2156 void UIMessageCenter::cannotOpenExtPack(const QString &strFilename, const CExtPackManager &extPackManager, QWidget *pParent /*= 0*/) const 2157 { 2158 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 2159 tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename), 2160 formatErrorInfo(extPackManager)); 2161 } 2162 2163 void UIMessageCenter::warnAboutBadExtPackFile(const QString &strFilename, const CExtPackFile &extPackFile, QWidget *pParent /*= 0*/) const 2164 { 2165 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 2166 tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename), 2167 "<!--EOM-->" + extPackFile.GetWhyUnusable()); 2168 } 2169 2170 void UIMessageCenter::cannotInstallExtPack(const CExtPackFile &extPackFile, const QString &strFilename, QWidget *pParent /*= 0*/) const 2171 { 2172 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 2173 tr("Failed to install the Extension Pack <b>%1</b>.") 2174 .arg(strFilename), 2175 formatErrorInfo(extPackFile)); 2176 } 2177 2178 void UIMessageCenter::cannotInstallExtPack(const CProgress &progress, const QString &strFilename, QWidget *pParent /*= 0*/) const 2179 { 2180 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 2181 tr("Failed to install the Extension Pack <b>%1</b>.") 2182 .arg(strFilename), 2183 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 2184 } 2185 2186 void UIMessageCenter::cannotUninstallExtPack(const CExtPackManager &extPackManager, const QString &strPackName, QWidget *pParent /*= 0*/) const 2187 { 2188 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 2189 tr("Failed to uninstall the Extension Pack <b>%1</b>.") 2190 .arg(strPackName), 2191 formatErrorInfo(extPackManager)); 2192 } 2193 2194 void UIMessageCenter::cannotUninstallExtPack(const CProgress &progress, const QString &strPackName, QWidget *pParent /*= 0*/) const 2195 { 2196 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 2197 tr("Failed to uninstall the Extension Pack <b>%1</b>.") 2198 .arg(strPackName), 2199 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 2200 } 2201 2202 void UIMessageCenter::warnAboutExtPackInstalled(const QString &strPackName, QWidget *pParent /*= 0*/) const 2209 2203 { 2210 2204 message(pParent ? pParent : mainWindowShown(), 2211 MessageType_Info, 2212 tr("The extension pack <br><nobr><b>%1</b><nobr><br> was installed successfully.").arg(strPackName)); 2205 MessageType_Info, 2206 tr("The extension pack <br><nobr><b>%1</b><nobr><br> was installed successfully.") 2207 .arg(strPackName)); 2213 2208 } 2214 2209 … … 2531 2526 } 2532 2527 /* Else propose to download user manual: */ 2533 else if ( askAboutUserManualDownload(strUserManualFileName1))2528 else if (cannotFindUserManual(strUserManualFileName1)) 2534 2529 { 2535 2530 /* Create User Manual downloader: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r45334 r45342 325 325 326 326 /* API: Network management warnings: */ 327 bool askAboutCancelAllNetworkRequest(QWidget *pParent);327 bool confirmCancelingAllNetworkRequests(); 328 328 void showUpdateSuccess(const QString &strVersion, const QString &strLink); 329 329 void showUpdateNotFound(); 330 bool askUserToDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion); 330 331 331 332 /* API: Downloading warnings: */ 332 bool cannotFindGuestAdditions(); 333 bool confirmDownloadAdditions(const QString &strUrl, qulonglong uSize); 334 bool confirmMountAdditions(const QString &strUrl, const QString &strSrc); 335 void cannotMountGuestAdditions(const QString &strMachineName); 336 void warnAboutAdditionsCantBeSaved(const QString &strTarget); 337 bool askAboutUserManualDownload(const QString &strMissedLocation); 338 bool confirmUserManualDownload(const QString &strURL, qulonglong uSize); 339 void warnAboutUserManualDownloaded(const QString &strURL, const QString &strTarget); 340 void warnAboutUserManualCantBeSaved(const QString &strURL, const QString &strTarget); 341 bool proposeDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion); 342 bool requestUserDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion); 343 bool confirmDownloadExtensionPack(const QString &strExtPackName, const QString &strURL, qulonglong uSize); 344 bool proposeInstallExtentionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo); 345 void warnAboutExtentionPackCantBeSaved(const QString &strExtPackName, const QString &strFrom, const QString &strTo); 346 void cannotUpdateGuestAdditions(const CProgress &progress, QWidget *pParent /* = NULL */) const; 347 void cannotOpenExtPack(const QString &strFilename, const CExtPackManager &extPackManager, QWidget *pParent); 348 void badExtPackFile(const QString &strFilename, const CExtPackFile &extPackFile, QWidget *pParent); 349 void cannotInstallExtPack(const QString &strFilename, const CExtPackFile &extPackFile, const CProgress &progress, QWidget *pParent); 350 void cannotUninstallExtPack(const QString &strPackName, const CExtPackManager &extPackManager, const CProgress &progress, QWidget *pParent); 351 bool confirmInstallingPackage(const QString &strPackName, const QString &strPackVersion, const QString &strPackDescription, QWidget *pParent); 352 bool confirmReplacePackage(const QString &strPackName, const QString &strPackVersionNew, const QString &strPackVersionOld, 353 const QString &strPackDescription, QWidget *pParent); 354 bool confirmRemovingPackage(const QString &strPackName, QWidget *pParent); 355 void notifyAboutExtPackInstalled(const QString &strPackName, QWidget *pParent); 333 bool cannotFindGuestAdditions() const; 334 bool confirmDownloadGuestAdditions(const QString &strUrl, qulonglong uSize) const; 335 void cannotSaveGuestAdditions(const QString &strURL, const QString &strTarget) const; 336 bool proposeMountGuestAdditions(const QString &strUrl, const QString &strSrc) const; 337 void cannotMountGuestAdditions(const QString &strMachineName) const; 338 void cannotUpdateGuestAdditions(const CProgress &progress) const; 339 bool cannotFindUserManual(const QString &strMissedLocation) const; 340 bool confirmDownloadUserManual(const QString &strURL, qulonglong uSize) const; 341 void cannotSaveUserManual(const QString &strURL, const QString &strTarget) const; 342 void warnAboutUserManualDownloaded(const QString &strURL, const QString &strTarget) const; 343 bool warAboutOutdatedExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion) const; 344 bool confirmDownloadExtensionPack(const QString &strExtPackName, const QString &strURL, qulonglong uSize) const; 345 void cannotSaveExtensionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo) const; 346 bool proposeInstallExtentionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo) const; 347 bool confirmInstallExtensionPack(const QString &strPackName, const QString &strPackVersion, const QString &strPackDescription, QWidget *pParent = 0) const; 348 bool confirmReplaceExtensionPack(const QString &strPackName, const QString &strPackVersionNew, const QString &strPackVersionOld, 349 const QString &strPackDescription, QWidget *pParent = 0) const; 350 bool confirmRemoveExtensionPack(const QString &strPackName, QWidget *pParent = 0) const; 351 void cannotOpenExtPack(const QString &strFilename, const CExtPackManager &extPackManager, QWidget *pParent = 0) const; 352 void warnAboutBadExtPackFile(const QString &strFilename, const CExtPackFile &extPackFile, QWidget *pParent = 0) const; 353 void cannotInstallExtPack(const CExtPackFile &extPackFile, const QString &strFilename, QWidget *pParent = 0) const; 354 void cannotInstallExtPack(const CProgress &progress, const QString &strFilename, QWidget *pParent = 0) const; 355 void cannotUninstallExtPack(const CExtPackManager &extPackManager, const QString &strPackName, QWidget *pParent = 0) const; 356 void cannotUninstallExtPack(const CProgress &progress, const QString &strPackName, QWidget *pParent = 0) const; 357 void warnAboutExtPackInstalled(const QString &strPackName, QWidget *pParent = 0) const; 356 358 357 359 /* API: License-viewer warnings: */ -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp
r43707 r45342 74 74 bool UIDownloaderAdditions::askForDownloadingConfirmation(UINetworkReply *pReply) 75 75 { 76 return msgCenter().confirmDownload Additions(source().toString(), pReply->header(QNetworkRequest::ContentLengthHeader).toInt());76 return msgCenter().confirmDownloadGuestAdditions(source().toString(), pReply->header(QNetworkRequest::ContentLengthHeader).toInt()); 77 77 } 78 78 … … 93 93 94 94 /* Warn the user about additions-image loaded and saved, propose to mount it: */ 95 if (msgCenter(). confirmMountAdditions(source().toString(), QDir::toNativeSeparators(target())))95 if (msgCenter().proposeMountGuestAdditions(source().toString(), QDir::toNativeSeparators(target()))) 96 96 emit sigDownloadFinished(target()); 97 97 break; … … 99 99 100 100 /* Warn the user about additions-image was downloaded but was NOT saved: */ 101 msgCenter(). warnAboutAdditionsCantBeSaved(target());101 msgCenter().cannotSaveGuestAdditions(source().toString(), QDir::toNativeSeparators(target())); 102 102 103 103 /* Ask the user for another location for the additions-image file: */ -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp
r43707 r45342 116 116 117 117 /* Warn the user about extension-pack was downloaded but was NOT saved: */ 118 msgCenter(). warnAboutExtentionPackCantBeSaved(GUI_ExtPackName, source().toString(), QDir::toNativeSeparators(target()));118 msgCenter().cannotSaveExtensionPack(GUI_ExtPackName, source().toString(), QDir::toNativeSeparators(target())); 119 119 120 120 /* Ask the user for another location for the extension-pack file: */ -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderUserManual.cpp
r43707 r45342 77 77 bool UIDownloaderUserManual::askForDownloadingConfirmation(UINetworkReply *pReply) 78 78 { 79 return msgCenter().confirm UserManualDownload(source().toString(), pReply->header(QNetworkRequest::ContentLengthHeader).toInt());79 return msgCenter().confirmDownloadUserManual(source().toString(), pReply->header(QNetworkRequest::ContentLengthHeader).toInt()); 80 80 } 81 81 … … 103 103 104 104 /* Warn user about user-manual was downloaded but was NOT saved: */ 105 msgCenter(). warnAboutUserManualCantBeSaved(source().toString(), QDir::toNativeSeparators(target()));105 msgCenter().cannotSaveUserManual(source().toString(), QDir::toNativeSeparators(target())); 106 106 107 107 /* Ask the user for another location for the user-manual file: */ -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.cpp
r42526 r45342 145 145 { 146 146 /* Ask if user wants to cancel all current network-requests: */ 147 if (msgCenter(). askAboutCancelAllNetworkRequest(this))147 if (msgCenter().confirmCancelingAllNetworkRequests()) 148 148 emit sigCancelNetworkRequests(); 149 149 } -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp
r43711 r45342 414 414 { 415 415 /* Inform the user that he should update the extension pack: */ 416 msgCenter(). requestUserDownloadExtensionPack(GUI_ExtPackName, strExtPackVersion, strVBoxVersion);416 msgCenter().askUserToDownloadExtensionPack(GUI_ExtPackName, strExtPackVersion, strVBoxVersion); 417 417 /* Never try to download for ENTERPRISE version: */ 418 418 emit sigStepComplete(); … … 421 421 422 422 /* Ask the user about extension pack downloading: */ 423 if (!msgCenter(). proposeDownloadExtensionPack(GUI_ExtPackName, strExtPackVersion))423 if (!msgCenter().warAboutOutdatedExtensionPack(GUI_ExtPackName, strExtPackVersion)) 424 424 { 425 425 emit sigStepComplete(); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.cpp
r45219 r45342 148 148 if (!extPackFile.GetUsable()) 149 149 { 150 msgCenter(). badExtPackFile(strFilePath, extPackFile, pParent);150 msgCenter().warnAboutBadExtPackFile(strFilePath, extPackFile, pParent); 151 151 return; 152 152 } … … 166 166 { 167 167 QString strPackVersionCur = QString("%1r%2%3").arg(extPackCur.GetVersion()).arg(extPackCur.GetRevision()).arg(extPackCur.GetEdition()); 168 if (!msgCenter().confirmReplace Package(strPackName, strPackVersion, strPackVersionCur, strPackDescription, pParent))168 if (!msgCenter().confirmReplaceExtensionPack(strPackName, strPackVersion, strPackVersionCur, strPackDescription, pParent)) 169 169 return; 170 170 } … … 174 174 else 175 175 { 176 if (!msgCenter().confirmInstall ingPackage(strPackName, strPackVersion, strPackDescription, pParent))176 if (!msgCenter().confirmInstallExtensionPack(strPackName, strPackVersion, strPackDescription, pParent)) 177 177 return; 178 178 } … … 196 196 */ 197 197 QString displayInfo; 198 #ifdef RT_OS_WINDOWS198 #ifdef Q_WS_WIN 199 199 if (pParent) 200 200 displayInfo.sprintf("hwnd=%#llx", (uint64_t)(uintptr_t)pParent->winId()); 201 #endif 201 #endif /* Q_WS_WIN */ 202 /* Prepare installation progress: */ 202 203 CProgress progress = extPackFile.Install(fReplaceIt, displayInfo); 203 204 if (extPackFile.isOk()) 204 205 { 205 if (progress.isNull())206 msgCenter().notifyAboutExtPackInstalled(strPackName, pParent);207 else206 /* Show installation progress: */ 207 msgCenter().showModalProgressDialog(progress, tr("Extensions"), "", pParent); 208 if (!progress.GetCanceled()) 208 209 { 209 msgCenter().showModalProgressDialog(progress, tr("Extensions"), "", pParent); 210 if (!progress.GetCanceled()) 211 { 212 if (progress.isOk() && progress.GetResultCode() == 0) 213 msgCenter().notifyAboutExtPackInstalled(strPackName, pParent); 214 else 215 msgCenter().cannotInstallExtPack(strFilePath, extPackFile, progress, pParent); 216 } 210 if (progress.isOk() && progress.GetResultCode() == 0) 211 msgCenter().warnAboutExtPackInstalled(strPackName, pParent); 212 else 213 msgCenter().cannotInstallExtPack(progress, strFilePath, pParent); 217 214 } 218 215 } 219 216 else 220 msgCenter().cannotInstallExtPack( strFilePath, extPackFile, progress, pParent);217 msgCenter().cannotInstallExtPack(extPackFile, strFilePath, pParent); 221 218 222 219 if (pstrExtPackName) … … 409 406 QString strSelectedPackageName = pItem->name(); 410 407 /* Ask the user about package removing: */ 411 if (msgCenter().confirmRemov ingPackage(strSelectedPackageName, this))408 if (msgCenter().confirmRemoveExtensionPack(strSelectedPackageName, this)) 412 409 { 413 410 /* … … 417 414 /** @todo Refuse this if any VMs are running. */ 418 415 QString displayInfo; 419 #ifdef RT_OS_WINDOWS416 #ifdef Q_WS_WIN 420 417 displayInfo.sprintf("hwnd=%#llx", (uint64_t)(uintptr_t)this->winId()); 421 #endif 418 #endif /* Q_WS_WIN */ 419 /* Prepare uninstallation progress: */ 422 420 CProgress progress = manager.Uninstall(strSelectedPackageName, false /* forced removal? */, displayInfo); 423 421 if (manager.isOk()) 424 422 { 425 bool fOk = true; 426 if (!progress.isNull()) 427 { 428 msgCenter().showModalProgressDialog(progress, tr("Extensions"), "", window()); 429 fOk = progress.isOk() && progress.GetResultCode() == 0; 430 } 431 if (fOk) 423 /* Show uninstallation progress: */ 424 msgCenter().showModalProgressDialog(progress, tr("Extensions"), "", this); 425 if (progress.isOk() && progress.GetResultCode() == 0) 432 426 { 433 427 /* Remove selected package from cache: */ … … 440 434 } 441 435 } 442 443 436 /* Remove selected package from tree: */ 444 437 delete pItem; 445 438 } 446 439 else 447 msgCenter().cannotUninstallExtPack( strSelectedPackageName, manager, progress, this);440 msgCenter().cannotUninstallExtPack(progress, strSelectedPackageName, this); 448 441 } 449 442 else 450 msgCenter().cannotUninstallExtPack( strSelectedPackageName, manager, progress, this);443 msgCenter().cannotUninstallExtPack(manager, strSelectedPackageName, this); 451 444 } 452 445 }
Note:
See TracChangeset
for help on using the changeset viewer.