From 128c2dd624a78ef1e218871a4e4729625be56c04 Mon Sep 17 00:00:00 2001 From: Alex Borisov Date: Sat, 21 Jan 2012 17:43:02 +0200 Subject: Restart Proxifier to apply new configuration --- client/Dialog.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'client/Dialog.cpp') diff --git a/client/Dialog.cpp b/client/Dialog.cpp index b08213a..ab3f66e 100644 --- a/client/Dialog.cpp +++ b/client/Dialog.cpp @@ -22,6 +22,8 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent) return; } + connect(this, SIGNAL(finished(int)), this, SLOT(Closed(int))); + /* generic proxy panel */ topLabel = new QLabel(QString::fromLocal8Bit(cfg->TopPanelText.c_str())); topLabel->setObjectName("topLabel"); @@ -111,6 +113,19 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent) setLayout(mainLayout); } +void ProxyDialog::Closed(int i) +{ + Logger::Trace("Dialog closed\n"); + Proxifier *proxifier = Proxifier::GetInstance(); + if (!proxifier->IsValid()) + { + Logger::Fatal("No valid proxifier configuration file found!\n"); + } + if (!proxifier->Restart()) + { + Logger::Error("Unable to restart Proxifier process!\n"); + } +} void ProxyDialog::ProxyToggled(bool on) { -- cgit v1.2.3