diff options
author | Alex Borisov <b0ric.alex@gmail.com> | 2012-01-21 17:43:02 +0200 |
---|---|---|
committer | Alex Borisov <b0ric.alex@gmail.com> | 2012-01-21 17:43:02 +0200 |
commit | 128c2dd624a78ef1e218871a4e4729625be56c04 (patch) | |
tree | 1cdd5e6fb619d15909116fe345ed15a841b5e4ec /client/Dialog.cpp | |
parent | 6f8e7cae703145cd6eb103c08681045ced28f5e5 (diff) |
Restart Proxifier to apply new configuration
Diffstat (limited to 'client/Dialog.cpp')
-rw-r--r-- | client/Dialog.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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) { |