Merge pull request #261 from cricri-pingouin/master

Fixed some typos
This commit is contained in:
DavidXanatos 2020-12-22 22:04:28 +01:00 committed by GitHub
commit 4510080a39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 297 additions and 297 deletions

View File

@ -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("<p>Do you want to go to the <a href=\"%1\">download page</a>?</p>").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 about 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;
}
*/
*/

View File

@ -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);
}
}
}

View File

@ -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<SB_STATUS>() << Status);
else
accept();
}
}

View File

@ -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, "!<StartRunAccess>", eClosed, "*");
else
DelAccessEntry(eIPC, "!<StartRunAccess>", eClosed, "*");
// all except sellected
// all except selected
Enable = ui.radStartExcept->isChecked();
if (Enable)
SetAccessEntry(eIPC, "<StartRunAccess>", 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<QPair<QString, QString>>::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();
}
}

View File

@ -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<CSandBoxPlus>()->IsRecoverySuspended())
return;
CSandBoxPtr pBox = theAPI->GetBoxByName(BoxName);
if (!pBox.isNull() && pBox.objectCast<CSandBoxPlus>()->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<CPopUpRecovery*>(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<CSandBoxPlus>()->SetSuspendRecovery();
}
if ((iFlag & 0x01) != 0) // dismiss all fromt his box
void CPopUpWindow::OnDismiss(int iFlag)
{
CPopUpRecovery* pEntry = qobject_cast<CPopUpRecovery*>(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<CSandBoxPlus>()->SetSuspendRecovery();
}
if ((iFlag & 0x01) != 0) // dismiss all from this box
{
for (int i = 0; i < ui.table->rowCount(); i++)
{
CPopUpRecovery* pCurEntry = qobject_cast<CPopUpRecovery*>(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<CPopUpRecovery*>(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<CPopUpRecovery*>(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<QPair<QString, QString>> 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<QPair<QString, QString>> 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<CPopUpRecovery*>(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<CPopUpRecovery*>(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<CPopUpProgress*>(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<CPopUpProgress*>(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<CPopUpEntry*>(ui.table->cellWidget(Index.row(), 0));
Messages.append(pCurEntry->GetMessageText());
}
QApplication::clipboard()->setText(Messages.join("\n"));
}
AddEntry(pEntry);
}
else
pEntry->UpdateProgress(Message, SizeLeft);
}
void CPopUpWindow::OnDismissProgress(bool bHide)
{
CPopUpProgress* pEntry = qobject_cast<CPopUpProgress*>(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<CPopUpEntry*>(ui.table->cellWidget(Index.row(), 0));
Messages.append(pCurEntry->GetMessageText());
}
QApplication::clipboard()->setText(Messages.join("\n"));
}

View File

@ -3,9 +3,9 @@
#include <QtWidgets/QMainWindow>
#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);

View File

@ -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 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()));
@ -172,4 +172,4 @@ void CSnapshotsWindow::HandleResult(SB_PROGRESS Status)
else if (Status.IsError())
CSandMan::CheckResults(QList<SB_STATUS>() << Status);
UpdateSnapshots();
}
}