settings_general_widget_general.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "settings_general_widget_general.h"
00022 #include "version.h"
00023 #include <QDebug>
00024
00025 settings_general_widget_general::settings_general_widget_general(QWidget *parent)
00026 : QWidget(parent)
00027 {
00028 setupUi(this);
00029 connect(kcfg_streamripperCommand,
00030 SIGNAL(textChanged(const QString&)),
00031 &versionInfo,
00032 SLOT(setStreamripperCommand(const QString&)));
00033 connect(kcfg_streamripperCommand,
00034 SIGNAL(textChanged(const QString&)),
00035 info_usedStreamripperVersion,
00036 SLOT(clear()));
00037 connect(&versionInfo,
00038 SIGNAL(versionNumberDeterminated(const PropertyValue&)),
00039 this,
00040 SLOT(displayVersionNumber(const PropertyValue&)));
00041 #ifdef LIBPROXY_FOUND
00042 connect(kcfg_proxyConfiguration,
00043 SIGNAL(valueChanged(const int)),
00044 this,
00045 SLOT(initializeRadioButtons(const int)));
00046 connect(radioButton_automatic,
00047 SIGNAL(toggled(const bool)),
00048 this,
00049 SLOT(writeProxyConfig_automatic(const bool)));
00050 #else
00051 radioButton_manual->setChecked(true);
00052 radioButton_automatic->setEnabled(false);
00053 #endif
00054 }
00055
00056 #ifdef LIBPROXY_FOUND
00057 void settings_general_widget_general::initializeRadioButtons(const int index)
00058 {
00059 qDebug() << "test";
00060 disconnect(kcfg_proxyConfiguration,
00061 SIGNAL(valueChanged(const int)),
00062 this,
00063 SLOT(initializeRadioButtons(const int)));
00064 if (index == 0) {
00065 radioButton_automatic->setChecked(true);
00066 } else {
00067 radioButton_manual->setChecked(true);
00068 };
00069 }
00070 #endif
00071
00072 settings_general_widget_general::~settings_general_widget_general()
00073 {
00074 }
00075
00076 void settings_general_widget_general::writeProxyConfig_automatic(const bool enabled)
00077 {
00078 if (enabled) {
00079 kcfg_proxyConfiguration->setValue(0);
00080 } else {
00081 kcfg_proxyConfiguration->setValue(1);
00082 };
00083 }
00084
00085 void settings_general_widget_general::displayVersionNumber(const PropertyValue & value)
00086 {
00087 if (value.type == PropertyValue::value) {
00088 info_usedStreamripperVersion->setText(value.formatedValue);
00089 } else {
00090 info_usedStreamripperVersion->setText("");
00091 };
00092 }