From 132b9639e2a48cf5314c302c5920e068e70863ca Mon Sep 17 00:00:00 2001 From: cricri-pingouin <64480118+cricri-pingouin@users.noreply.github.com> Date: Tue, 22 Dec 2020 17:49:58 +0000 Subject: [PATCH 1/9] Update SbieView.cpp Fixed few typos --- SandboxiePlus/SandMan/Views/SbieView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SandboxiePlus/SandMan/Views/SbieView.cpp b/SandboxiePlus/SandMan/Views/SbieView.cpp index 1b8a3d89..116dc59b 100644 --- a/SandboxiePlus/SandMan/Views/SbieView.cpp +++ b/SandboxiePlus/SandMan/Views/SbieView.cpp @@ -343,7 +343,7 @@ void CSbieView::OnGroupAction() } else if (Action == m_pDelGroupe) { - if (QMessageBox("Sandboxie-Plus", tr("Do you really want remove the selected group(s)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes) + if (QMessageBox("Sandboxie-Plus", tr("Do you really want to remove the selected group(s)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes) return; foreach(const QModelIndex& Index, m_pSbieTree->selectedRows()) @@ -451,7 +451,7 @@ void CSbieView::OnSandBoxAction() } else if (Action == m_pMenuRemove) { - if (QMessageBox("Sandboxie-Plus", tr("Do you really want remove the selected sandbox(es)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes) + if (QMessageBox("Sandboxie-Plus", tr("Do you really want to remove the selected sandbox(es)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes) return; foreach(const CSandBoxPtr& pBox, SandBoxes) @@ -463,7 +463,7 @@ void CSbieView::OnSandBoxAction() } else if (Action == m_pMenuCleanUp) { - if (QMessageBox("Sandboxie-Plus", tr("Do you really want delete the content of the selected sandbox(es)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes) + if (QMessageBox("Sandboxie-Plus", tr("Do you really want to delete the content of the selected sandbox(es)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes) return; foreach(const CSandBoxPtr& pBox, SandBoxes) @@ -701,4 +701,4 @@ void CSbieView::UpdateRunMenu(const CSandBoxPtr& pBox) pAction->setData(NameCmd.second); } -} \ No newline at end of file +} From c2d762e0c9f77267f10b91cee8284953fd748e20 Mon Sep 17 00:00:00 2001 From: cricri-pingouin <64480118+cricri-pingouin@users.noreply.github.com> Date: Tue, 22 Dec 2020 17:51:47 +0000 Subject: [PATCH 2/9] Update NewBoxWindow.cpp Fixed "behaviour" typo --- SandboxiePlus/SandMan/Windows/NewBoxWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SandboxiePlus/SandMan/Windows/NewBoxWindow.cpp b/SandboxiePlus/SandMan/Windows/NewBoxWindow.cpp index 1fc5791f..8a38a01a 100644 --- a/SandboxiePlus/SandMan/Windows/NewBoxWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/NewBoxWindow.cpp @@ -17,7 +17,7 @@ CNewBoxWindow::CNewBoxWindow(QWidget *parent) ui.cmbTemplates->addItem(tr("Hardened")); ui.cmbTemplates->addItem(tr("Default")); ui.cmbTemplates->setCurrentIndex(eDefault); - ui.cmbTemplates->addItem(tr("Legacy (old sbie behavioure)")); + ui.cmbTemplates->addItem(tr("Legacy (old sbie behaviour)")); ui.cmbBoxes->addItems(theAPI->GetAllBoxes().keys()); @@ -84,4 +84,4 @@ void CNewBoxWindow::CreateBox() CSandMan::CheckResults(QList() << Status); else accept(); -} \ No newline at end of file +} From cf751992beb4a87a8f7b60a043370fb40f62cdbc Mon Sep 17 00:00:00 2001 From: cricri-pingouin <64480118+cricri-pingouin@users.noreply.github.com> Date: Tue, 22 Dec 2020 17:58:45 +0000 Subject: [PATCH 3/9] Update SnapshotsWindow.cpp Fixed "delete" typo. --- SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp b/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp index 423157c6..40c671cf 100644 --- a/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp @@ -156,7 +156,7 @@ void CSnapshotsWindow::OnRemoveSnapshot() //QVariant ID = m_pSnapshotModel->GetItemID(ModelIndex); QVariant ID = m_pSnapshotModel->GetItemID(Index); - if (QMessageBox("Sandboxie-Plus", tr("Do you really want delete the sellected snapshot?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes) + if (QMessageBox("Sandboxie-Plus", tr("Do you really want delete the selected snapshot?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes) return; HandleResult(m_pBox->RemoveSnapshot(ID.toString())); @@ -172,4 +172,4 @@ void CSnapshotsWindow::HandleResult(SB_PROGRESS Status) else if (Status.IsError()) CSandMan::CheckResults(QList() << Status); UpdateSnapshots(); -} \ No newline at end of file +} From 1e142d12559c4a2e52455e39e42fcd55b027fa7a Mon Sep 17 00:00:00 2001 From: cricri-pingouin <64480118+cricri-pingouin@users.noreply.github.com> Date: Tue, 22 Dec 2020 18:02:01 +0000 Subject: [PATCH 4/9] Update SandMan.cpp Fixed "applied" typo. --- SandboxiePlus/SandMan/SandMan.cpp | 54 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index f9133870..29e95cc0 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -1082,7 +1082,7 @@ void CSandMan::OnEditIni() if (theConf->GetBool("Options/NoEditInfo", true)) { bool State = false; - CCheckableMessageBox::question(this, "Sandboxie-Plus", tr("The changes will be applyed automatically as soon as the editor is closed.") + CCheckableMessageBox::question(this, "Sandboxie-Plus", tr("The changes will be applied automatically as soon as the editor is closed.") , tr("Don't show this message again."), &State, QDialogButtonBox::Ok, QDialogButtonBox::Ok, QMessageBox::Information); if (State) @@ -1381,13 +1381,13 @@ void CSandMan::OnUpdateCheck() QString MsgHash = QCryptographicHash::hash(Data["userMsg"].toByteArray(), QCryptographicHash::Md5).toHex().left(8); if (!IgnoredUpdates.contains(MsgHash)) { - CCheckableMessageBox mb(this); - mb.setWindowTitle("Sandboxie-Plus"); + CCheckableMessageBox mb(this); + mb.setWindowTitle("Sandboxie-Plus"); QIcon ico(QLatin1String(":/SandMan.png")); - mb.setIconPixmap(ico.pixmap(64, 64)); - mb.setText(UserMsg); - mb.setCheckBoxText(tr("Don't show this announcement in future.")); - mb.setStandardButtons(QDialogButtonBox::Close); + mb.setIconPixmap(ico.pixmap(64, 64)); + mb.setText(UserMsg); + mb.setCheckBoxText(tr("Don't show this announcement in future.")); + mb.setStandardButtons(QDialogButtonBox::Close); mb.exec(); if (mb.isChecked()) @@ -1418,27 +1418,27 @@ void CSandMan::OnUpdateCheck() else if (!UpdateUrl.isEmpty()) FullMessage += tr("

Do you want to go to the download page?

").arg(UpdateUrl); - CCheckableMessageBox mb(this); - mb.setWindowTitle("Sandboxie-Plus"); + CCheckableMessageBox mb(this); + mb.setWindowTitle("Sandboxie-Plus"); QIcon ico(QLatin1String(":/SandMan.png")); - mb.setIconPixmap(ico.pixmap(64, 64)); - //mb.setTextFormat(Qt::RichText); - mb.setText(FullMessage); - mb.setCheckBoxText(tr("Ignore this update, notify me anout the next one.")); - mb.setCheckBoxVisible(!bManual); - - if (!UpdateUrl.isEmpty() || !DownloadUrl.isEmpty()) { - mb.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); - mb.setDefaultButton(QDialogButtonBox::Yes); - } - else - mb.setStandardButtons(QDialogButtonBox::Ok); - - mb.exec(); - + mb.setIconPixmap(ico.pixmap(64, 64)); + //mb.setTextFormat(Qt::RichText); + mb.setText(FullMessage); + mb.setCheckBoxText(tr("Ignore this update, notify me anout the next one.")); + mb.setCheckBoxVisible(!bManual); + + if (!UpdateUrl.isEmpty() || !DownloadUrl.isEmpty()) { + mb.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); + mb.setDefaultButton(QDialogButtonBox::Yes); + } + else + mb.setStandardButtons(QDialogButtonBox::Ok); + + mb.exec(); + if (mb.isChecked()) - theConf->SetValue("Options/IgnoredUpdates", IgnoredUpdates << Version); - + theConf->SetValue("Options/IgnoredUpdates", IgnoredUpdates << Version); + if (mb.clickedStandardButton() == QDialogButtonBox::Yes) { if (!DownloadUrl.isEmpty()) @@ -1704,4 +1704,4 @@ QString ShowRunDialog(const QString& BoxName) ShowRunFileDialog(MainWndHandle, NULL, NULL, boxName.c_str(), L"Enter the path of a program that will be created in a sandbox.", 0); // RFF_OPTRUNAS); return g_RunDialogCommand; } -*/ \ No newline at end of file +*/ From 12c9a497406954fd5e9d0f5864aff77863a4b1fb Mon Sep 17 00:00:00 2001 From: cricri-pingouin <64480118+cricri-pingouin@users.noreply.github.com> Date: Tue, 22 Dec 2020 18:03:57 +0000 Subject: [PATCH 5/9] Update SandMan.cpp Fixed "about" typo. --- SandboxiePlus/SandMan/SandMan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 29e95cc0..62abb59a 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -1424,7 +1424,7 @@ void CSandMan::OnUpdateCheck() mb.setIconPixmap(ico.pixmap(64, 64)); //mb.setTextFormat(Qt::RichText); mb.setText(FullMessage); - mb.setCheckBoxText(tr("Ignore this update, notify me anout the next one.")); + mb.setCheckBoxText(tr("Ignore this update, notify me about the next one.")); mb.setCheckBoxVisible(!bManual); if (!UpdateUrl.isEmpty() || !DownloadUrl.isEmpty()) { From 57df74c9201d985ea1843351dd61221a2ab30ea0 Mon Sep 17 00:00:00 2001 From: cricri-pingouin <64480118+cricri-pingouin@users.noreply.github.com> Date: Tue, 22 Dec 2020 19:38:51 +0000 Subject: [PATCH 6/9] Update OptionsWindow.cpp More typos. --- SandboxiePlus/SandMan/Windows/OptionsWindow.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp b/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp index 0ab6ddd0..c5af38d8 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp @@ -842,7 +842,7 @@ void COptionsWindow::OnAddProg() if (!pItem) { - QMessageBox::warning(this, "SandboxiePlus", tr("Please sellect group first.")); + QMessageBox::warning(this, "SandboxiePlus", tr("Please select group first.")); return; } @@ -1054,14 +1054,14 @@ void COptionsWindow::OnDelStopProg() void COptionsWindow::OnRestrictStart() { - // only sellected + // only selected bool Enable = ui.radStartSelected->isChecked(); if (Enable) SetAccessEntry(eIPC, "!", eClosed, "*"); else DelAccessEntry(eIPC, "!", eClosed, "*"); - // all except sellected + // all except selected Enable = ui.radStartExcept->isChecked(); if (Enable) SetAccessEntry(eIPC, "", eClosed, "*"); @@ -1291,7 +1291,7 @@ void COptionsWindow::ParseAndAddAccessEntry(EAccessEntry EntryType, const QStrin // Mind this special cases // OpenIpcPath=$:program.exe <- full access into the address space of a target process running outside the sandbox. // OpenWinClass=$:program.exe <- permits to use the PostThreadMessage API to send a message directly to a thread running outside the sandbox. - // This forms of the setting does not support wildcards. + // This form of the setting does not support wildcards. // QStringList Values = Value.split(","); @@ -1904,7 +1904,7 @@ void COptionsWindow::OnTemplateClicked(QTreeWidgetItem* pItem, int Column) { QString Name = pItem->data(1, Qt::UserRole).toString().mid(9); if (m_GlobalTemplates.contains(Name)) { - QMessageBox::warning(this, "SandboxiePlus", tr("This template is enabled globally to configure it use the global options.")); + QMessageBox::warning(this, "SandboxiePlus", tr("This template is enabled globally. To configure it, use the global options.")); pItem->setCheckState(1, Qt::PartiallyChecked); return; } @@ -2026,8 +2026,8 @@ void COptionsWindow::SaveIniSection() { m_ConfigDirty = true; - // Note: an incremental update would be more elegat but it would change the entry order in the ini, - // hence its better for the user to fully rebuild the section each time. + // Note: an incremental update would be more elegant but it would change the entry order in the ini, + // hence it's better for the user to fully rebuild the section each time. // for (QList>::const_iterator I = m_Settings.begin(); I != m_Settings.end(); ++I) m_pBox->DelValue(I->first, I->second); @@ -2055,4 +2055,4 @@ void COptionsWindow::SaveIniSection() // m_pBox->InsertText(I->first, I->second); LoadIniSection(); -} \ No newline at end of file +} From 440c733122f77b9482f9f8e6dc6f4d6fc601d150 Mon Sep 17 00:00:00 2001 From: cricri-pingouin <64480118+cricri-pingouin@users.noreply.github.com> Date: Tue, 22 Dec 2020 19:41:57 +0000 Subject: [PATCH 7/9] Update PopUpWindow.cpp More typos. --- SandboxiePlus/SandMan/Windows/PopUpWindow.cpp | 210 +++++++++--------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp b/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp index e4e60407..8fcb01af 100644 --- a/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp @@ -135,11 +135,11 @@ void CPopUpWindow::AddLogMessage(const QString& Message, quint32 MsgCode, const AddEntry(pEntry); } - // 2219 // elvation is disabled + // 2219 // elevation is disabled - // 1307 // internet denided + // 1307 // internet denied - // 1308 // start/run denided + // 1308 // start/run denied } void CPopUpWindow::ReloadHiddenMessages() @@ -271,13 +271,13 @@ void CPopUpWindow::SendPromptResult(CPopUpPrompt* pEntry, int retval) void CPopUpWindow::AddFileToRecover(const QString& FilePath, const QString& BoxName, quint32 ProcessId) { - CSandBoxPtr pBox = theAPI->GetBoxByName(BoxName); - if (!pBox.isNull() && pBox.objectCast()->IsRecoverySuspended()) - return; + CSandBoxPtr pBox = theAPI->GetBoxByName(BoxName); + if (!pBox.isNull() && pBox.objectCast()->IsRecoverySuspended()) + return; CBoxedProcessPtr pProcess = theAPI->GetProcessById(ProcessId); - QString Message = tr("The file %1 is eligible for quick recovery from %2.\r\nFull path: %3\r\nWriten by: %4") + QString Message = tr("The file %1 is eligible for quick recovery from %2.\r\nFull path: %3\r\nWritten by: %4") .arg(FilePath.mid(FilePath.lastIndexOf("\\") + 1)).arg(QString(BoxName).replace("_", " ")).arg(FilePath) .arg(pProcess.isNull() ? tr("an UNKNOWN process.") : tr("%1 (%2)").arg(pProcess->GetProcessName()).arg(pProcess->GetProcessId())); @@ -288,84 +288,84 @@ void CPopUpWindow::AddFileToRecover(const QString& FilePath, const QString& BoxN AddEntry(pEntry); } -void CPopUpWindow::OnDismiss(int iFlag) -{ - CPopUpRecovery* pEntry = qobject_cast(sender()); - - if (iFlag == 0) - RemoveEntry(pEntry); - - if ((iFlag & 0x02) != 0) // disable for this box - { - CSandBoxPtr pBox = theAPI->GetBoxByName(pEntry->m_BoxName); - if (!pBox.isNull()) - pBox.objectCast()->SetSuspendRecovery(); - } - - if ((iFlag & 0x01) != 0) // dismiss all fromt his box +void CPopUpWindow::OnDismiss(int iFlag) +{ + CPopUpRecovery* pEntry = qobject_cast(sender()); + + if (iFlag == 0) + RemoveEntry(pEntry); + + if ((iFlag & 0x02) != 0) // disable for this box + { + CSandBoxPtr pBox = theAPI->GetBoxByName(pEntry->m_BoxName); + if (!pBox.isNull()) + pBox.objectCast()->SetSuspendRecovery(); + } + + if ((iFlag & 0x01) != 0) // dismiss all from this box { for (int i = 0; i < ui.table->rowCount(); i++) { CPopUpRecovery* pCurEntry = qobject_cast(ui.table->cellWidget(i, 0)); if (pCurEntry && pCurEntry->m_BoxName == pEntry->m_BoxName) ui.table->removeRow(i--); - } - + } + if (ui.table->rowCount() == 0) - this->hide(); - } -} - -void CPopUpWindow::OnRecoverFile(bool bBrowse) -{ - CPopUpRecovery* pEntry = qobject_cast(sender()); - - QString RecoveryFolder; - if (bBrowse) - RecoveryFolder = QFileDialog::getExistingDirectory(this, tr("Select Directory")).replace("/", "\\"); - else - RecoveryFolder = pEntry->m_FilePath.left(pEntry->m_FilePath.lastIndexOf("\\")); - + this->hide(); + } +} + +void CPopUpWindow::OnRecoverFile(bool bBrowse) +{ + CPopUpRecovery* pEntry = qobject_cast(sender()); + + QString RecoveryFolder; + if (bBrowse) + RecoveryFolder = QFileDialog::getExistingDirectory(this, tr("Select Directory")).replace("/", "\\"); + else + RecoveryFolder = pEntry->m_FilePath.left(pEntry->m_FilePath.lastIndexOf("\\")); + if (RecoveryFolder.isEmpty()) - return; - - QString FileName = pEntry->m_FilePath.mid(pEntry->m_FilePath.lastIndexOf("\\") + 1); - QString BoxedFilePath = theAPI->GetBoxedPath(pEntry->m_BoxName, pEntry->m_FilePath); - - QList> FileList; - FileList.append(qMakePair(BoxedFilePath, RecoveryFolder + "\\" + FileName)); - + return; + + QString FileName = pEntry->m_FilePath.mid(pEntry->m_FilePath.lastIndexOf("\\") + 1); + QString BoxedFilePath = theAPI->GetBoxedPath(pEntry->m_BoxName, pEntry->m_FilePath); + + QList> FileList; + FileList.append(qMakePair(BoxedFilePath, RecoveryFolder + "\\" + FileName)); + SB_PROGRESS Status = theGUI->RecoverFiles(FileList); if (Status.GetStatus() == OP_ASYNC) - theGUI->AddAsyncOp(Status.GetValue()); - - RemoveEntry(pEntry); -} - -void CPopUpWindow::OnOpenRecovery() -{ - CPopUpRecovery* pEntry = qobject_cast(sender()); - - emit RecoveryRequested(pEntry->m_BoxName); - - // since we opened the recvery dialog we can dismiss all the notification for this box - OnDismiss(0x01); -} - -void CPopUpWindow::ShowProgress(quint32 MsgCode, const QStringList& MsgData, quint32 ProcessId) -{ - QString BoxName = MsgData.size() >= 2 ? MsgData[1] : tr("UNKNOWN"); - QString FilePath = MsgData.size() >= 3 ? theAPI->Nt2DosPath(MsgData[2]) : tr("UNKNOWN"); - quint64 SizeLeft = MsgData.size() >= 4 ? MsgData[3].toULongLong() : 0; - - if (m_HiddenMessages.contains(0, FilePath)) - return; - - QString Message = tr("Migrating a large file %1 into the sandbox %2, %3 left.\r\nFull path: %4") - .arg(FilePath.mid(FilePath.lastIndexOf("\\") + 1)).arg(BoxName).arg(FormatSize(SizeLeft)) - .arg(FilePath); - - CPopUpProgress* pEntry = NULL; + theGUI->AddAsyncOp(Status.GetValue()); + + RemoveEntry(pEntry); +} + +void CPopUpWindow::OnOpenRecovery() +{ + CPopUpRecovery* pEntry = qobject_cast(sender()); + + emit RecoveryRequested(pEntry->m_BoxName); + + // since we opened the recovery dialog, we can dismiss all the notifications for this box + OnDismiss(0x01); +} + +void CPopUpWindow::ShowProgress(quint32 MsgCode, const QStringList& MsgData, quint32 ProcessId) +{ + QString BoxName = MsgData.size() >= 2 ? MsgData[1] : tr("UNKNOWN"); + QString FilePath = MsgData.size() >= 3 ? theAPI->Nt2DosPath(MsgData[2]) : tr("UNKNOWN"); + quint64 SizeLeft = MsgData.size() >= 4 ? MsgData[3].toULongLong() : 0; + + if (m_HiddenMessages.contains(0, FilePath)) + return; + + QString Message = tr("Migrating a large file %1 into the sandbox %2, %3 left.\r\nFull path: %4") + .arg(FilePath.mid(FilePath.lastIndexOf("\\") + 1)).arg(BoxName).arg(FormatSize(SizeLeft)) + .arg(FilePath); + + CPopUpProgress* pEntry = NULL; for (int i = 0; i < ui.table->rowCount(); i++) { CPopUpProgress* pCurEntry = qobject_cast(ui.table->cellWidget(i, 0)); @@ -373,35 +373,35 @@ void CPopUpWindow::ShowProgress(quint32 MsgCode, const QStringList& MsgData, qui pEntry = pCurEntry; break; } - } - - if (!pEntry) - { + } + + if (!pEntry) + { pEntry = new CPopUpProgress(Message, FilePath, SizeLeft, this); QObject::connect(pEntry, SIGNAL(Dismiss(bool)), this, SLOT(OnDismissProgress(bool))); - AddEntry(pEntry); - } - else - pEntry->UpdateProgress(Message, SizeLeft); -} - -void CPopUpWindow::OnDismissProgress(bool bHide) -{ - CPopUpProgress* pEntry = qobject_cast(sender()); - - if (bHide) - m_HiddenMessages.insert(0, pEntry->m_ID); - - RemoveEntry(pEntry); -} - -void CPopUpWindow::OnCopy() -{ - QStringList Messages; - foreach(const QModelIndex& Index, ui.table->selectionModel()->selectedIndexes()) - { - CPopUpEntry* pCurEntry = qobject_cast(ui.table->cellWidget(Index.row(), 0)); - Messages.append(pCurEntry->GetMessageText()); - } - QApplication::clipboard()->setText(Messages.join("\n")); -} \ No newline at end of file + AddEntry(pEntry); + } + else + pEntry->UpdateProgress(Message, SizeLeft); +} + +void CPopUpWindow::OnDismissProgress(bool bHide) +{ + CPopUpProgress* pEntry = qobject_cast(sender()); + + if (bHide) + m_HiddenMessages.insert(0, pEntry->m_ID); + + RemoveEntry(pEntry); +} + +void CPopUpWindow::OnCopy() +{ + QStringList Messages; + foreach(const QModelIndex& Index, ui.table->selectionModel()->selectedIndexes()) + { + CPopUpEntry* pCurEntry = qobject_cast(ui.table->cellWidget(Index.row(), 0)); + Messages.append(pCurEntry->GetMessageText()); + } + QApplication::clipboard()->setText(Messages.join("\n")); +} From a5d6b5a2ffd8e5de1e9d0d3031d7853fb5ef1388 Mon Sep 17 00:00:00 2001 From: cricri-pingouin <64480118+cricri-pingouin@users.noreply.github.com> Date: Tue, 22 Dec 2020 19:46:39 +0000 Subject: [PATCH 8/9] Update SnapshotsWindow.cpp Fixed a typo --- SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp b/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp index 40c671cf..6f0f3001 100644 --- a/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp @@ -156,7 +156,7 @@ void CSnapshotsWindow::OnRemoveSnapshot() //QVariant ID = m_pSnapshotModel->GetItemID(ModelIndex); QVariant ID = m_pSnapshotModel->GetItemID(Index); - if (QMessageBox("Sandboxie-Plus", tr("Do you really want delete the selected snapshot?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes) + if (QMessageBox("Sandboxie-Plus", tr("Do you really want to delete the selected snapshot?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes) return; HandleResult(m_pBox->RemoveSnapshot(ID.toString())); From e2098d70e386bbe6986d38e5423816ae0950f749 Mon Sep 17 00:00:00 2001 From: cricri-pingouin <64480118+cricri-pingouin@users.noreply.github.com> Date: Tue, 22 Dec 2020 19:48:16 +0000 Subject: [PATCH 9/9] Update PopUpWindow.h Fixed couple of typos --- SandboxiePlus/SandMan/Windows/PopUpWindow.h | 298 ++++++++++---------- 1 file changed, 149 insertions(+), 149 deletions(-) diff --git a/SandboxiePlus/SandMan/Windows/PopUpWindow.h b/SandboxiePlus/SandMan/Windows/PopUpWindow.h index 85561563..e27d8f19 100644 --- a/SandboxiePlus/SandMan/Windows/PopUpWindow.h +++ b/SandboxiePlus/SandMan/Windows/PopUpWindow.h @@ -3,9 +3,9 @@ #include #include "ui_PopUpWindow.h" #include "../SbiePlusAPI.h" - -class CPopUpEntry: public QWidget -{ + +class CPopUpEntry: public QWidget +{ Q_OBJECT public: CPopUpEntry(const QString& Message, QWidget* parent = 0) : QWidget(parent) @@ -19,15 +19,15 @@ public: virtual ~CPopUpEntry() {} virtual QString GetMessageText() { return m_Message; } - -protected: - - QGridLayout* m_pMainLayout; - QString m_Message; -}; - -class CPopUpMessage : public CPopUpEntry -{ + +protected: + + QGridLayout* m_pMainLayout; + QString m_Message; +}; + +class CPopUpMessage : public CPopUpEntry +{ Q_OBJECT public: CPopUpMessage(const QString& Message, quint32 MsgCode, const QStringList& MsgData, QWidget* parent = 0) : CPopUpEntry(Message, parent) @@ -44,7 +44,7 @@ public: { QToolButton* pHelp = new QToolButton(); pHelp->setText(tr("?")); - pHelp->setToolTip(tr("Visit %1 for a detailes explenation.").arg(QString("https://xanasoft.com/sandboxie/sbie%1/").arg(GetMsgId()))); + pHelp->setToolTip(tr("Visit %1 for a detailed explanation.").arg(QString("https://xanasoft.com/sandboxie/sbie%1/").arg(GetMsgId()))); pHelp->setMaximumWidth(16); QObject::connect(pHelp, SIGNAL(pressed()), this, SLOT(OnHelp())); m_pMainLayout->addWidget(pHelp, 0, 1); @@ -67,21 +67,21 @@ public: quint32 GetMsgId() { return m_MsgCode & 0xFFFF; } QStringList GetMsgData() { return m_MsgData; } QString GetMsgData(int Index) { return m_MsgData.size() <= Index ? QString() : m_MsgData[Index]; } - -signals: - void Dismiss(); - void Hide(); - -private slots: - void OnHelp() { QDesktopServices::openUrl(QUrl(QString("https://xanasoft.com/sandboxie/sbie%1/").arg(GetMsgId()))); } - -protected: - quint32 m_MsgCode; - QStringList m_MsgData; -}; - -class CPopUpPrompt : public CPopUpEntry -{ + +signals: + void Dismiss(); + void Hide(); + +private slots: + void OnHelp() { QDesktopServices::openUrl(QUrl(QString("https://xanasoft.com/sandboxie/sbie%1/").arg(GetMsgId()))); } + +protected: + quint32 m_MsgCode; + QStringList m_MsgData; +}; + +class CPopUpPrompt : public CPopUpEntry +{ Q_OBJECT public: CPopUpPrompt(const QString& Message, quint32 RequestId, QVariantMap Result, const CBoxedProcessPtr& pProcess, QWidget* parent = 0) : CPopUpEntry(Message, parent) @@ -104,16 +104,16 @@ public: m_pMainLayout->addWidget(m_pTimeOut, 1, 1); - m_pYes = new QToolButton(); - m_pYes->setText(tr("Yes")); - connect(m_pYes, SIGNAL(pressed()), this, SLOT(OnAccepted())); - m_pMainLayout->addWidget(m_pYes, 1, 2); - - m_pNo = new QToolButton(); - m_pNo->setText(tr("No")); + m_pYes = new QToolButton(); + m_pYes->setText(tr("Yes")); + connect(m_pYes, SIGNAL(pressed()), this, SLOT(OnAccepted())); + m_pMainLayout->addWidget(m_pYes, 1, 2); + + m_pNo = new QToolButton(); + m_pNo->setText(tr("No")); connect(m_pNo, SIGNAL(pressed()), this, SLOT(OnRejected())); - m_pMainLayout->addWidget(m_pNo, 1, 3); - + m_pMainLayout->addWidget(m_pNo, 1, 3); + m_pTerminate = new QToolButton(); m_pTerminate->setText(tr("Terminate")); connect(m_pTerminate, SIGNAL(pressed()), this, SLOT(OnTerminate())); @@ -126,23 +126,23 @@ public: m_uTimerID = -1; else m_uTimerID = startTimer(1000); - } - ~CPopUpPrompt() { - if(m_uTimerID != -1) - killTimer(m_uTimerID); - } - -signals: - void PromptResult(int retval); - -private slots: - void OnAccepted() { emit PromptResult(1); } - void OnRejected() { emit PromptResult(0); } - void OnTerminate() { emit PromptResult(-1); } - -protected: - friend class CPopUpWindow; - + } + ~CPopUpPrompt() { + if(m_uTimerID != -1) + killTimer(m_uTimerID); + } + +signals: + void PromptResult(int retval); + +private slots: + void OnAccepted() { emit PromptResult(1); } + void OnRejected() { emit PromptResult(0); } + void OnTerminate() { emit PromptResult(-1); } + +protected: + friend class CPopUpWindow; + void timerEvent(QTimerEvent* pEvent) { if (pEvent->timerId() != m_uTimerID) @@ -173,35 +173,35 @@ protected: m_pYes->setEnabled(false); } } - int m_uTimerID; - - virtual void paintEvent(QPaintEvent *event) - { - QWidget::paintEvent(event); - + int m_uTimerID; + + virtual void paintEvent(QPaintEvent *event) + { + QWidget::paintEvent(event); + extern bool CPopUpWindow__DarkMode; - if (!CPopUpWindow__DarkMode && (m_iTimeOutSec % 2) != 0) - { - QPainter p(this); - p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xFF, 0xCC, 0xCC)); - } - } - - quint32 m_RequestId; - QVariantMap m_Result; - CBoxedProcessPtr m_pProcess; - - QLabel* m_pLabel; - QCheckBox* m_pRemember; - qint32 m_iTimeOutSec; - QLabel* m_pTimeOut; - QToolButton* m_pYes; - QToolButton* m_pNo; - QToolButton* m_pTerminate; -}; - -class CPopUpRecovery : public CPopUpEntry -{ + if (!CPopUpWindow__DarkMode && (m_iTimeOutSec % 2) != 0) + { + QPainter p(this); + p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xFF, 0xCC, 0xCC)); + } + } + + quint32 m_RequestId; + QVariantMap m_Result; + CBoxedProcessPtr m_pProcess; + + QLabel* m_pLabel; + QCheckBox* m_pRemember; + qint32 m_iTimeOutSec; + QLabel* m_pTimeOut; + QToolButton* m_pYes; + QToolButton* m_pNo; + QToolButton* m_pTerminate; +}; + +class CPopUpRecovery : public CPopUpEntry +{ Q_OBJECT public: CPopUpRecovery(const QString& Message, const QString& FilePath, const QString& BoxName, QWidget* parent = 0) : CPopUpEntry(Message, parent) @@ -225,7 +225,7 @@ public: pRecover->setToolTip(tr("Recover the file to original location")); pRecover->setPopupMode(QToolButton::MenuButtonPopup); QMenu* pRecMenu = new QMenu(); - pRecMenu->addAction(tr("Recover file to sellected folder"), this, SLOT(OnRecoverTo())); + pRecMenu->addAction(tr("Recover file to selected folder"), this, SLOT(OnRecoverTo())); pRecMenu->addAction(tr("Open file recovery for this box"), this, SIGNAL(OpenRecovery())); pRecover->setMenu(pRecMenu); //QObject::connect(pRecover, SIGNAL(triggered(QAction*)), , SLOT()); @@ -244,39 +244,39 @@ public: //QObject::connect(pDismiss, SIGNAL(triggered(QAction*)), , SLOT()); QObject::connect(pDismiss, SIGNAL(pressed()), this, SIGNAL(Dismiss())); m_pMainLayout->addWidget(pDismiss, 1, 2); - } - -signals: - void Dismiss(int iFlag = 0); - void RecoverFile(bool bBrowse); - void OpenRecovery(); - -private slots: - void OnDisable() { emit Dismiss(0x03); } - void OnDismissAll() { emit Dismiss(0x01); } - void OnRecover() { emit RecoverFile(false); } - void OnRecoverTo() { emit RecoverFile(true); } - -protected: - friend class CPopUpWindow; - - virtual void paintEvent(QPaintEvent *event) - { - QWidget::paintEvent(event); - + } + +signals: + void Dismiss(int iFlag = 0); + void RecoverFile(bool bBrowse); + void OpenRecovery(); + +private slots: + void OnDisable() { emit Dismiss(0x03); } + void OnDismissAll() { emit Dismiss(0x01); } + void OnRecover() { emit RecoverFile(false); } + void OnRecoverTo() { emit RecoverFile(true); } + +protected: + friend class CPopUpWindow; + + virtual void paintEvent(QPaintEvent *event) + { + QWidget::paintEvent(event); + extern bool CPopUpWindow__DarkMode; - if (!CPopUpWindow__DarkMode) { - QPainter p(this); - p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xCC, 0xFF, 0xCC)); - } - } - - QString m_FilePath; - QString m_BoxName; -}; - -class CPopUpProgress : public CPopUpEntry -{ + if (!CPopUpWindow__DarkMode) { + QPainter p(this); + p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xCC, 0xFF, 0xCC)); + } + } + + QString m_FilePath; + QString m_BoxName; +}; + +class CPopUpProgress : public CPopUpEntry +{ Q_OBJECT public: CPopUpProgress(const QString& Message, const QString& ID, quint64 Total, QWidget* parent = 0) : CPopUpEntry(Message, parent) @@ -311,27 +311,27 @@ public: m_iTimeOutSec = 5; m_uTimerID = startTimer(1000); - } - ~CPopUpProgress() { - if (m_uTimerID != -1) - killTimer(m_uTimerID); - } - - void UpdateProgress(const QString& Message, quint64 Value) - { - if(m_Total != 0) - m_pProgressBar->setValue(100 - (100 * Value / m_Total)); - m_pLabel->setText(Message); - m_iTimeOutSec = 5; - } - -signals: - void Dismiss(bool bHide = true); - //void Hide(); - -protected: - friend class CPopUpWindow; - + } + ~CPopUpProgress() { + if (m_uTimerID != -1) + killTimer(m_uTimerID); + } + + void UpdateProgress(const QString& Message, quint64 Value) + { + if(m_Total != 0) + m_pProgressBar->setValue(100 - (100 * Value / m_Total)); + m_pLabel->setText(Message); + m_iTimeOutSec = 5; + } + +signals: + void Dismiss(bool bHide = true); + //void Hide(); + +protected: + friend class CPopUpWindow; + void timerEvent(QTimerEvent* pEvent) { if (pEvent->timerId() != m_uTimerID) @@ -342,17 +342,17 @@ protected: emit Dismiss(false); } } - int m_uTimerID; - - QString m_ID; - quint64 m_Total; - - QLabel* m_pLabel; - QProgressBar* m_pProgressBar; - qint32 m_iTimeOutSec; -}; - - + int m_uTimerID; + + QString m_ID; + quint64 m_Total; + + QLabel* m_pLabel; + QProgressBar* m_pProgressBar; + qint32 m_iTimeOutSec; +}; + + class CPopUpWindow : public QMainWindow { Q_OBJECT @@ -380,8 +380,8 @@ private slots: virtual void OnPromptResult(int retval); - virtual void OnDismiss(int iFlag); - virtual void OnRecoverFile(bool bBrowse); + virtual void OnDismiss(int iFlag); + virtual void OnRecoverFile(bool bBrowse); virtual void OnOpenRecovery(); virtual void OnDismissProgress(bool bHide);