summaryrefslogtreecommitdiff
path: root/client/Dialog.cpp
diff options
context:
space:
mode:
authorAlex Borisov <b0ric.alex@gmail.com>2012-01-21 17:43:02 +0200
committerAlex Borisov <b0ric.alex@gmail.com>2012-01-21 17:43:02 +0200
commit128c2dd624a78ef1e218871a4e4729625be56c04 (patch)
tree1cdd5e6fb619d15909116fe345ed15a841b5e4ec /client/Dialog.cpp
parent6f8e7cae703145cd6eb103c08681045ced28f5e5 (diff)
Restart Proxifier to apply new configuration
Diffstat (limited to 'client/Dialog.cpp')
-rw-r--r--client/Dialog.cpp15
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)
{