Mercurial > trustbridge
comparison ui/mainwindow.cpp @ 1008:2fb6071c6669
Merged
author | Emanuel Schuetze <emanuel@intevation.de> |
---|---|
date | Tue, 02 Sep 2014 11:55:15 +0200 |
parents | 6aa115b206df |
children | b4094dc55217 |
comparison
equal
deleted
inserted
replaced
1007:b75bd6686f43 | 1008:2fb6071c6669 |
---|---|
310 shExecInfo.lpParameters = reinterpret_cast<LPCWSTR> (parameters.utf16()); | 310 shExecInfo.lpParameters = reinterpret_cast<LPCWSTR> (parameters.utf16()); |
311 | 311 |
312 // shExecInfo.fMask = SEE_MASK_NOASYNC; | 312 // shExecInfo.fMask = SEE_MASK_NOASYNC; |
313 shExecInfo.nShow = SW_SHOWDEFAULT; | 313 shExecInfo.nShow = SW_SHOWDEFAULT; |
314 | 314 |
315 if (!is_system_install() || !is_admin()) { | 315 if (!is_system_install()) { |
316 shExecInfo.lpVerb = L"open"; | 316 shExecInfo.lpVerb = L"open"; |
317 } else { | 317 } else { |
318 shExecInfo.lpVerb = L"runas"; | 318 shExecInfo.lpVerb = L"runas"; |
319 } | 319 } |
320 | 320 |
621 mQuitButton->setFixedHeight(30); | 621 mQuitButton->setFixedHeight(30); |
622 | 622 |
623 mInstallButton = new QPushButton(" " + tr("Install certificates again")); | 623 mInstallButton = new QPushButton(" " + tr("Install certificates again")); |
624 mInstallButton->setFixedHeight(30); | 624 mInstallButton->setFixedHeight(30); |
625 #ifdef Q_OS_WIN | 625 #ifdef Q_OS_WIN |
626 if (is_admin() && is_system_install()) { | 626 if (is_system_install()) { |
627 QIcon uacShield = QApplication::style()->standardIcon(QStyle::SP_VistaShield); | 627 QIcon uacShield = QApplication::style()->standardIcon(QStyle::SP_VistaShield); |
628 mInstallButton->setIcon(uacShield); | 628 mInstallButton->setIcon(uacShield); |
629 } | 629 } |
630 #else | 630 #else |
631 mInstallButton->setIcon(QIcon(":/img/view-refresh_16px.png")); | 631 mInstallButton->setIcon(QIcon(":/img/view-refresh_16px.png")); |
1107 void MainWindow::installerError(const QString& errMsg) { | 1107 void MainWindow::installerError(const QString& errMsg) { |
1108 QMessageBox::warning(this, tr("Error executing update"), errMsg); | 1108 QMessageBox::warning(this, tr("Error executing update"), errMsg); |
1109 } | 1109 } |
1110 | 1110 |
1111 void MainWindow::installerSuccess() { | 1111 void MainWindow::installerSuccess() { |
1112 if (mCurState == NewListAvailable || mCurState == NewSoftwareAvailable) { | 1112 if (mCurState == NewListAvailable ) { |
1113 mCurState = NothingChanged; | 1113 mCurState = NothingChanged; |
1114 mCurMessage = QString(); | 1114 mCurMessage = QString(); |
1115 | 1115 } |
1116 QString listFileName = mSettings.value("List/available").toString(); | 1116 |
1117 QDateTime listFileDate = mSettings.value("List/availableDate").toDateTime(); | 1117 QString listFileName = mSettings.value("List/available").toString(); |
1118 | 1118 QDateTime listFileDate = mSettings.value("List/availableDate").toDateTime(); |
1119 if (!listFileName.isEmpty() && listFileDate.isValid()) { | |
1119 mSettings.remove("List/available"); | 1120 mSettings.remove("List/available"); |
1120 mSettings.remove("List/availableDate"); | 1121 mSettings.remove("List/availableDate"); |
1121 | 1122 |
1122 if (listFileName.isEmpty() || !listFileDate.isValid()) { | |
1123 qWarning() << "Error accessing settings"; | |
1124 return; /* Try again with next check */ | |
1125 } | |
1126 /* Rename the installed list to list-installed.txt so that external | 1123 /* Rename the installed list to list-installed.txt so that external |
1127 * programs (like the uninstaller can easily recognize it). */ | 1124 * programs (like the uninstaller can easily recognize it). */ |
1128 QString dataLoc = | 1125 QString dataLoc = |
1129 QStandardPaths::writableLocation(QStandardPaths::DataLocation); | 1126 QStandardPaths::writableLocation(QStandardPaths::DataLocation); |
1130 QDir dataDir(dataLoc); | 1127 QDir dataDir(dataLoc); |
1157 mInstalledList = CertificateList(); | 1154 mInstalledList = CertificateList(); |
1158 QFile::remove(oldList.filePath()); | 1155 QFile::remove(oldList.filePath()); |
1159 mSettings.remove("List/installed"); | 1156 mSettings.remove("List/installed"); |
1160 mSettings.remove("List/installedDate"); | 1157 mSettings.remove("List/installedDate"); |
1161 } | 1158 } |
1162 mListToInstall = CertificateList(); | 1159 } |
1163 | 1160 mListToInstall = CertificateList(); |
1164 } | |
1165 mUpdatesManual->clear(); | 1161 mUpdatesManual->clear(); |
1166 loadCertificateList(); | 1162 loadCertificateList(); |
1167 } | 1163 } |
1168 | 1164 |
1169 void MainWindow::installCerts() { | 1165 void MainWindow::installCerts() { |
1192 unselected << mUpdatesRemove->unselectedCertificates(); | 1188 unselected << mUpdatesRemove->unselectedCertificates(); |
1193 unselected << mInstallList->unselectedCertificates(); | 1189 unselected << mInstallList->unselectedCertificates(); |
1194 unselected << mRemoveList->unselectedCertificates(); | 1190 unselected << mRemoveList->unselectedCertificates(); |
1195 | 1191 |
1196 #ifdef Q_OS_WIN | 1192 #ifdef Q_OS_WIN |
1197 if (!is_admin() || !is_system_install()) { | 1193 if (!is_system_install()) { |
1198 QMessageBox::information(this, | 1194 QMessageBox::warning(this, |
1199 tr("Installation with standard user account"), | 1195 tr("Installation with standard user account"), |
1200 tr("Windows will now ask you to confirm qeach root certificate modification " | 1196 tr("Windows will now ask you to confirm each root certificate modification " |
1201 "because TrustBridge does not have the necessary privileges to install " | 1197 "because TrustBridge does not have the necessary privileges to install " |
1202 "root certificates into the Windows certificate store silently.")); | 1198 "root certificates into the Windows certificate store silently.")); |
1203 } | 1199 } |
1204 #endif | 1200 #endif |
1205 | 1201 |