应用代理界面

This commit is contained in:
zhangyuanyuan1 2022-09-24 17:08:28 +08:00
parent 2428c19b66
commit 8c357e15df
17 changed files with 3145 additions and 1 deletions

3
debian/kylin-nm.preinst vendored Normal file → Executable file
View File

@ -4,3 +4,6 @@ set -e
path="/usr/lib/`/usr/bin/dpkg-architecture -qDEB_TARGET_MULTIARCH`/ukui-control-center/libnetconnect.so"
dpkg-divert --package kylin-nm --rename --divert "$path"".old" --add $path
path2="/usr/lib/`/usr/bin/dpkg-architecture -qDEB_TARGET_MULTIARCH`/ukui-control-center/libproxy.so"
dpkg-divert --package kylin-nm --rename --divert "$path2"".old" --add $path2

View File

@ -2,4 +2,5 @@ TEMPLATE = subdirs
SUBDIRS = \
netconnect \
wlanconnect \
mobilehotspot
mobilehotspot \
proxy

View File

@ -0,0 +1,138 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "applistwidget.h"
#include <QDebug>
AppListWidget::AppListWidget(QString path, QWidget *parent)
: m_path(path), QWidget(parent)
{
initUI();
initDbus();
}
AppListWidget::~AppListWidget()
{
}
/**
* @brief AppListWidget::setAppChecked
* @param flag 使
*/
void AppListWidget::setAppChecked(bool flag)
{
m_checkBox->setChecked(flag);
}
/**
* @brief AppListWidget::setAppIcon
* @param icon
*/
void AppListWidget::setAppIcon(const QPixmap &icon)
{
m_iconLabel->setAlignment(Qt::AlignCenter);
m_iconLabel->setPixmap(icon);
}
/**
* @brief AppListWidget::setAppName
* @param text
*/
void AppListWidget::setAppName(const QString &text)
{
m_nameLabel->setText(text);
}
/**
* @brief AppListWidget::onAppCheckStateChanged
* checkBox是否选中
*/
void AppListWidget::onAppCheckStateChanged()
{
if (m_checkBox->isChecked()) {
AddAppProxyConfig();
} else {
RemoveAppProxyConfig();
}
}
/**
* @brief AppListWidget::AddAppProxyConfig
*
*/
void AppListWidget::AddAppProxyConfig()
{
if(!m_dbusInterface->isValid()) {
qWarning ()<< "init AppProxy dbus error";
}
qDebug() << "call QDBusInterface addAppIntoProxy";
m_dbusInterface->call("addAppIntoProxy", m_path);
}
/**
* @brief AppListWidget::RemoveAppProxyConfig
*
*/
void AppListWidget::RemoveAppProxyConfig()
{
if(!m_dbusInterface->isValid()) {
qWarning ()<< "init AppProxy dbus error";
}
qDebug() << "call QDBusInterface delAppIntoProxy";
m_dbusInterface->call("delAppIntoProxy", m_path);
}
void AppListWidget::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
m_checkBox->setChecked(!m_checkBox->isChecked());
onAppCheckStateChanged();
}
return QWidget::mousePressEvent(event);
}
void AppListWidget::initUI()
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setContentsMargins(17, 0, 17, 0);
mainLayout->setSpacing(8);
m_checkBox = new QCheckBox(this);
m_checkBox->setFixedSize(16, 16);
m_checkBox->setAttribute(Qt::WA_TransparentForMouseEvents, true); //m_checkBox不响应鼠标事件,将其传递给父窗口
m_iconLabel = new QLabel(this);
m_iconLabel->setFixedSize(24, 24);
m_nameLabel = new QLabel(this);
mainLayout->addWidget(m_checkBox);
mainLayout->addSpacing(8);
mainLayout->addWidget(m_iconLabel);
mainLayout->addWidget(m_nameLabel);
mainLayout->addStretch();
}
void AppListWidget::initDbus()
{
m_dbusInterface = new QDBusInterface("org.ukui.SettingsDaemon",
"/org/ukui/SettingsDaemon/AppProxy",
"org.ukui.SettingsDaemon.AppProxy",
QDBusConnection::sessionBus());
}

View File

@ -0,0 +1,60 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef APPLISTWIDGET_H
#define APPLISTWIDGET_H
#include <QObject>
#include <QWidget>
#include <QMouseEvent>
#include <QCheckBox>
#include <QLabel>
#include <QHBoxLayout>
#include <QDBusInterface>
#include <QDBusReply>
class AppListWidget : public QWidget
{
Q_OBJECT
public:
explicit AppListWidget(QString path, QWidget *parent = nullptr);
~AppListWidget();
void setAppChecked(bool flag);
void setAppIcon(const QPixmap &icon);
void setAppName(const QString &text);
void onAppCheckStateChanged();
void AddAppProxyConfig();
void RemoveAppProxyConfig();
protected:
void mousePressEvent(QMouseEvent *event);
private:
void initUI();
void initDbus();
QCheckBox *m_checkBox = nullptr;
QLabel *m_iconLabel = nullptr;
QLabel *m_nameLabel = nullptr;
QString m_path = nullptr;
QDBusInterface *m_dbusInterface = nullptr;
};
#endif // APPLISTWIDGET_H

32
plugins/proxy/aptinfo.h Normal file
View File

@ -0,0 +1,32 @@
#ifndef APTINFO_H
#define APTINFO_H
#include <QHash>
#include <QVariant>
#include <QString>
#include <QDBusArgument>
struct AptInfo
{
QString arg;
QDBusVariant out;
};
QDBusArgument &operator<<(QDBusArgument &argument, const AptInfo &mystruct)
{
argument.beginStructure();
argument << mystruct.arg << mystruct.out;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, AptInfo &mystruct)
{
argument.beginStructure();
argument >> mystruct.arg >> mystruct.out;
argument.endStructure();
return argument;
}
Q_DECLARE_METATYPE(AptInfo)
#endif // APTINFO_H

View File

@ -0,0 +1,127 @@
#include "aptproxydialog.h"
#include <QDebug>
#include <QLineEdit>
#include <QSpacerItem>
#include <QLabel>
#include <QPushButton>
#include "proxy.h"
AptProxyDialog::AptProxyDialog(QWidget *parent ):
QDialog(parent)
{
initUi();
setupComponent();
initConnect();
}
AptProxyDialog::~AptProxyDialog()
{
}
void AptProxyDialog::initUi()
{
setWindowTitle(tr("Set Apt Proxy"));
this->setFixedSize(480, 200);
QVBoxLayout *mAptProxyLyt = new QVBoxLayout(this);
mAptProxyLyt->setContentsMargins(24, 24, 24, 24);
mAptProxyLyt->setSpacing(16);
QFrame *mHostFrame = new QFrame(this);
mHostFrame->setFixedSize(432, 36);
mHostFrame->setFrameShape(QFrame::NoFrame);
QHBoxLayout *mLyt_1= new QHBoxLayout(mHostFrame);
mLyt_1->setContentsMargins(0, 0, 0, 0);
mLyt_1->setSpacing(8);
FixLabel *mSetHostLabel = new FixLabel(mHostFrame);
mSetHostLabel->setFixedSize(92, 36);
mSetHostLabel->setText(tr("Server Address"));
mHostEdit = new QLineEdit(mHostFrame);
mHostEdit->setAttribute(Qt::WA_InputMethodEnabled, false); //限制中文输入法
mHostEdit->setFixedSize(332, 36);
mHostEdit->installEventFilter(this);
mLyt_1->addWidget(mSetHostLabel);
mLyt_1->addWidget(mHostEdit);
QFrame *mPortFrame = new QFrame(this);
mPortFrame->setFixedSize(432, 36);
mPortFrame->setFrameShape(QFrame::NoFrame);
QHBoxLayout *mLyt_2= new QHBoxLayout(mPortFrame);
mLyt_2->setContentsMargins(0, 0, 0, 0);
mLyt_2->setSpacing(8);
QLabel *mSetPortLabel = new QLabel(tr("Port") ,mPortFrame);
mSetPortLabel->setFixedSize(92, 36);
mPortEdit = new QLineEdit(mPortFrame);
mPortEdit->setAttribute(Qt::WA_InputMethodEnabled, false); //限制中文输入法
mPortEdit->setFixedSize(332, 36);
mPortEdit->installEventFilter(this);
mLyt_2->addWidget(mSetPortLabel);
mLyt_2->addWidget(mPortEdit);
QFrame *mChooseFrame = new QFrame(this);
mChooseFrame->setFixedWidth(432);
mChooseFrame->setFrameShape(QFrame::NoFrame);
QHBoxLayout *mLyt_3= new QHBoxLayout(mChooseFrame);
mLyt_3->setContentsMargins(0, 0, 0, 0);
mLyt_3->setSpacing(16);
mCancelBtn = new QPushButton(mChooseFrame);
mCancelBtn->setMinimumWidth(96);
mCancelBtn->setText(tr("Cancel"));
mConfirmBtn = new QPushButton(mChooseFrame);
mConfirmBtn->setMinimumWidth(96);
mConfirmBtn->setText(tr("Confirm"));
mLyt_3->addStretch();
mLyt_3->addWidget(mCancelBtn);
mLyt_3->addWidget(mConfirmBtn);
mAptProxyLyt->addWidget(mHostFrame);
mAptProxyLyt->addWidget(mPortFrame);
mAptProxyLyt->addSpacing(16);
mAptProxyLyt->addWidget(mChooseFrame);
}
void AptProxyDialog::initConnect()
{
connect(mHostEdit, &QLineEdit::textEdited, this, [=]() {
if (mHostEdit->text().isEmpty()) {
mConfirmBtn->setEnabled(false);
} else {
mConfirmBtn->setEnabled(true);
}
});
connect(mCancelBtn, &QPushButton::clicked, this, [=]() {
this->close();
});
connect(mConfirmBtn, &QPushButton::clicked, this, [=]() {
Proxy::setAptProxy(mHostEdit->text() , mPortEdit->text() , true);
this->close();
});
}
void AptProxyDialog::setupComponent()
{
QString host = Proxy::getAptProxy()["ip"].toString();
QString port = Proxy::getAptProxy()["port"].toString();;
mHostEdit->setText(host);
mPortEdit->setText(port);
if (host.isEmpty()) {
mConfirmBtn->setEnabled(false);
}
}

View File

@ -0,0 +1,38 @@
#ifndef APTPROXYDIALOG_H
#define APTPROXYDIALOG_H
#include <QObject>
#include <QWidget>
#include <QVBoxLayout>
#include <QGSettings>
#include <QLabel>
#include <QLineEdit>
#include <QDialog>
#include "fixlabel.h"
#define APT_PROXY_SCHEMA "org.ukui.control-center.apt.proxy"
#define APT_PROXY_ENABLED "enabled"
#define APT_PROXY_HOST_KEY "host"
#define APT_PROXY_PORT_KEY "port"
class AptProxyDialog : public QDialog
{
Q_OBJECT
public:
AptProxyDialog(QWidget *parent = nullptr);
~AptProxyDialog();
void initUi();
private:
QLineEdit *mHostEdit;
QLineEdit *mPortEdit;
QPushButton *mCancelBtn;
QPushButton *mConfirmBtn;
private:
void initConnect();
void setupComponent();
};
#endif // APTPROXYDIALOG_H

View File

@ -0,0 +1,31 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef CERTIFICATIONDIALOG_H
#define CERTIFICATIONDIALOG_H
#include <QDialog>
#define HTTP_PROXY_SCHEMA "org.gnome.system.proxy.http"
#define HTTP_AUTH_KEY "use-authentication"
#define HTTP_AUTH_USER_KEY "authentication-user"
#define HTTP_AUTH_PASSWD_KEY "authentication-password"
#endif // CERTIFICATIONDIALOG_H

View File

@ -0,0 +1,342 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CertificationDialog</class>
<widget class="QDialog" name="CertificationDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>246</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>246</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>500</width>
<height>246</height>
</size>
</property>
<property name="windowTitle">
<string>UserCertification</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>20</number>
</property>
<property name="leftMargin">
<number>20</number>
</property>
<property name="topMargin">
<number>25</number>
</property>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="activeHLayout" stretch="0">
<property name="spacing">
<number>10</number>
</property>
<property name="leftMargin">
<number>20</number>
</property>
<item>
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>UserCertification</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>60</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>User:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="userLineEdit">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>60</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Passwd:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="pwdLineEdit">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="closePushBtn">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>80</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

1348
plugins/proxy/proxy.cpp Normal file

File diff suppressed because it is too large Load Diff

285
plugins/proxy/proxy.h Normal file
View File

@ -0,0 +1,285 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef PROXY_H
#define PROXY_H
#include <QObject>
#include <QtPlugin>
#include <QFileSystemWatcher>
#include <QDialog>
#include <QLineEdit>
#include "certificationdialog.h"
#include <QGSettings>
#include <QRadioButton>
#include <QLineEdit>
#include <QCheckBox>
#include <QTextEdit>
#include <QButtonGroup>
#include <QComboBox>
#include <QListWidget>
#include <QFormLayout>
#include <QDBusInterface>
#include <QDBusConnection>
#include <QDBusError>
#include <QDBusReply>
#include <QMessageBox>
#include <QtDBus/QDBusMetaType>
#include "interface.h"
#include "titlelabel.h"
#include "hoverwidget.h"
#include "applistwidget.h"
#include "kswitchbutton.h"
#include "kpasswordedit.h"
using namespace kdk;
/* qt会将glib里的signals成员识别为宏所以取消该宏
* signals时使Q_SIGNALS代替即可
**/
#ifdef signals
#undef signals
#endif
#include <glib.h>
#include <gio/gio.h>
struct GSData
{
QString key;
QString schema;
};
typedef enum{
NONE,
MANUAL,
AUTO
}ProxyMode;
//自定义类型使用QVariant需要使用 Q_DECLARE_METATYPE 注册
Q_DECLARE_METATYPE(ProxyMode)
Q_DECLARE_METATYPE(GSData)
namespace Ui {
class Proxy;
}
class Proxy : public QObject, CommonInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.ukcc.CommonInterface")
Q_INTERFACES(CommonInterface)
public:
Proxy();
~Proxy();
QString plugini18nName() Q_DECL_OVERRIDE;
int pluginTypes() Q_DECL_OVERRIDE;
QWidget * pluginUi() Q_DECL_OVERRIDE;
void plugin_leave()Q_DECL_OVERRIDE;
const QString name() const Q_DECL_OVERRIDE;
bool isShowOnHomePage() const Q_DECL_OVERRIDE;
QIcon icon() const Q_DECL_OVERRIDE;
bool isEnable() const Q_DECL_OVERRIDE;
public:
void initUi(QWidget *widget);
void initSearchText();
void retranslateUi();
void setupComponent();
void setupConnect();
void initProxyModeStatus();
void initAutoProxyStatus();
void initManualProxyStatus();
void initIgnoreHostStatus();
void initDbus();
void initAppProxyStatus();
void manualProxyTextChanged(QString txt);
int _getCurrentProxyMode();
void _setSensitivity();
bool getAptProxyInfo(bool status);
static void setAptProxy(QString host ,QString port ,bool status); // apt代理对应的配置文件的写入或删除
static QHash<QString, QVariant> getAptProxy();
void setAptInfo();
void reboot(); // 调用重启接口
void setFrame_Noframe(QFrame *frame);
QFrame *setLine(QFrame *frame);
bool getAppProxyState(); //获取应用代理开启状态--调用Dbus
void setAppProxyState(bool state); //设置应用代理开启状态--调用Dbus
static QStringList getAppProxyConf(); //获取应用代理配置信息--调用Dbus
void setAppProxyConf(QStringList list); //设置应用代理配置信息--调用Dbus
static QMap<QString, QStringList> getAppListProxy();
// bool checkIsChanged(QStringList info);
private:
void setAppProxyFrameUi(QWidget *widget);
void setAppListFrameUi(QWidget *widget);
void appProxyInfoPadding();
void appListPadding();
bool getipEditState(QString text);
QString pluginName;
int pluginType;
QWidget * pluginWidget;
TitleLabel *mTitleLabel;
TitleLabel *m_appProxyLabel;
TitleLabel *mAptProxyLabel;
QLabel *mUrlLabel;
QLabel *mHTTPLabel;
QLabel *mHTTPPortLabel;
QLabel *mHTTPSLabel;
QLabel *mHTTPSPortLabel;
QLabel *mFTPLabel;
QLabel *mFTPPortLabel;
QLabel *mSOCKSLabel;
QLabel *mSOCKSPortLabel;
QLabel *mIgnoreLabel;
QLabel *mAptLabel;
QLabel *mAPTHostLabel_1;
QLabel *mAPTHostLabel_2;
QLabel *mAPTPortLabel_1;
QLabel *mAPTPortLabel_2;
QLabel *mCertificationLabel;
QLabel *mUserNameLabel;
QLabel *mPwdLabel;
QLabel *m_appEnableLabel;
QLabel *m_proxyTypeLabel;
QLabel *m_ipAddressLabel;
QLabel *m_ipHintsLabel;
QLabel *m_portLabel;
QLabel *m_userNameLabel;
QLabel *m_pwdLabel;
QLabel *m_allowAppProxyLabel;
QFrame *mProxyFrame;
QFrame *mEnableFrame;
QFrame *mSelectFrame;
QFrame *mUrlFrame;
QFrame *mHTTPFrame;
QFrame *mHTTPSFrame;
QFrame *mFTPFrame;
QFrame *mSOCKSFrame;
QFrame *mIgnoreFrame;
QFrame *mCertificationFrame_1;
QFrame *m_appEnableFrame;
QFrame *m_appProxyFrame;
QFrame *m_proxyTypeFrame;
QFrame *m_ipAddressFrame;
QFrame *m_portFrame;
QFrame *m_userNameFrame;
QFrame *m_pwdFrame;
// QFrame *m_appBtnFrame;
QFrame *m_appListFrame;
QFrame *mAPTFrame;
QFrame *mAPTFrame_1;
QFrame *mAPTFrame_2;
QFrame *line_1;
QFrame *line_2;
QFrame *line_3;
QFrame *line_4;
QFrame *line_5;
QFrame *line_6;
QFrame *line_7;
QFrame *line_8;
QFrame *m_appLine1;
QFrame *m_appLine2;
QFrame *m_appLine3;
QFrame *m_appLine4;
QFrame *m_appLine5;
QRadioButton *mAutoBtn;
QRadioButton *mManualBtn;
KSwitchButton *mEnableBtn;
KSwitchButton *mAptBtn;
QPushButton *mEditBtn;
QCheckBox *mCertificationBtn;
QButtonGroup *mProxyBtnGroup;
QLineEdit *mUrlLineEdit;
QLineEdit *mHTTPLineEdit_1;
QLineEdit *mHTTPLineEdit_2;
QLineEdit *mHTTPSLineEdit_1;
QLineEdit *mHTTPSLineEdit_2;
QLineEdit *mFTPLineEdit_1;
QLineEdit *mFTPLineEdit_2;
QLineEdit *mSOCKSLineEdit_1;
QLineEdit *mSOCKSLineEdit_2;
QLineEdit *mUserNameLineEdit;
QLineEdit *mPwdLineEdit;
QLineEdit *m_ipAddressLineEdit;
QLineEdit *m_portLineEdit;
QLineEdit *m_userNameLineEdit;
KSwitchButton *m_appEnableBtn;
QComboBox *m_proxyTypeComboBox;
KPasswordEdit *m_pwdLineEdit = nullptr;
// QPushButton *m_cancelBtn;
// QPushButton *m_saveBtn;
QListWidget *m_appListWidget = nullptr;
QTextEdit *mIgnoreLineEdit;
QGSettings * proxysettings;
QGSettings * httpsettings;
QGSettings * securesettings;
QGSettings * ftpsettings;
QGSettings * sockssettings;
QGSettings * aptsettings;
QFileSystemWatcher *mfileWatch_1;
QFileSystemWatcher *mfileWatch_2;
QDBusInterface *mAptproxyDbus;
QDBusInterface *m_appProxyDbus;
bool isExistSettings = false;
bool settingsCreate;
bool mFirstLoad;
QStringList m_appProxyInfo;
QStringList m_appCheckedList;
private slots:
void setAptProxySlot(); //处理apt代理前端交互逻辑
void onappProxyEnableChanged(bool enable); //IP地址无效提示
void onipEditStateChanged(); //IP地址无效提示
void onAppProxyConfChanged(); //应用代理配置信息变化
void onAppProxyConfEditFinished();
// void onCancelBtnClicked();
// void onSaveBtnClicked();
// void setBtnEnable();
};
#endif // PROXY_H

52
plugins/proxy/proxy.pro Normal file
View File

@ -0,0 +1,52 @@
#include(../../../env.pri)
QT += widgets dbus
TEMPLATE = lib
CONFIG += plugin
TARGET = $$qtLibraryTarget(proxy)
DESTDIR = ../..
target.path = $$[QT_INSTALL_LIBS]/ukui-control-center
trans.files = translations/*
trans.path = /usr/share/kylin-nm/proxy/
INCLUDEPATH += \
$$PROJECT_COMPONENTSOURCE \
$$PROJECT_ROOTDIR \
/usr/include/ukcc/interface \
/usr/include/ukcc/widgets
LIBS += -L$$[QT_INSTALL_LIBS] -lgsettings-qt -lukcc
##加载gio库和gio-unix库用于获取和设置enum类型的gsettings
CONFIG += link_pkgconfig \
C++11
PKGCONFIG += gio-2.0 \
gio-unix-2.0 \
gsettings-qt \
kysdk-qtwidgets
#DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
applistwidget.cpp \
aptproxydialog.cpp \
proxy.cpp
HEADERS += \
applistwidget.h \
aptinfo.h \
aptproxydialog.h \
proxy.h \
certificationdialog.h
FORMS +=
INSTALLS += target \
trans
TRANSLATIONS += \
translations/zh_CN.ts \
translations/tr.ts \
translations/bo.ts

Binary file not shown.

View File

@ -0,0 +1,229 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="bo_CN">
<context>
<name>AptProxyDialog</name>
<message>
<location filename="../aptproxydialog.cpp" line="24"/>
<source>Set Apt Proxy</source>
<translation>APTལས</translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="41"/>
<source>Server Address</source>
<translation></translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="59"/>
<source>Port</source>
<translation></translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="80"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="84"/>
<source>Confirm</source>
<translation></translation>
</message>
</context>
<context>
<name>Proxy</name>
<message>
<location filename="../proxy.cpp" line="55"/>
<source>Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="185"/>
<source>Start using</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="198"/>
<source>Proxy mode</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="202"/>
<source>Auto</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="205"/>
<source>Manual</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="360"/>
<source>Application Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="435"/>
<source>System Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="437"/>
<source>Auto url</source>
<translation>URL</translation>
<extra-contents_path>/Proxy/Auto url</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="439"/>
<source>Http Proxy</source>
<translation>HTTP </translation>
<extra-contents_path>/Proxy/Http Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="441"/>
<source>Https Proxy</source>
<translation>HTTPS </translation>
<extra-contents_path>/Proxy/Https Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="443"/>
<source>Ftp Proxy</source>
<translation>FTP </translation>
<extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="445"/>
<source>Socks Proxy</source>
<translation>SOCKS </translation>
<extra-contents_path>/Proxy/Socks Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="446"/>
<location filename="../proxy.cpp" line="447"/>
<location filename="../proxy.cpp" line="448"/>
<location filename="../proxy.cpp" line="449"/>
<location filename="../proxy.cpp" line="934"/>
<source>Port</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="450"/>
<source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source>
<translation> ;</translation>
</message>
<message>
<location filename="../proxy.cpp" line="453"/>
<source>Apt Proxy</source>
<translation>APT </translation>
<extra-contents_path>/Proxy/Apt Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="454"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="455"/>
<source>Server Address : </source>
<translation>: </translation>
</message>
<message>
<location filename="../proxy.cpp" line="456"/>
<source>Port : </source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="457"/>
<source>Edit</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="555"/>
<source>The apt proxy has been turned off and needs to be restarted to take effect</source>
<translation>APTལས</translation>
</message>
<message>
<location filename="../proxy.cpp" line="556"/>
<location filename="../proxy.cpp" line="777"/>
<source>Reboot Later</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="557"/>
<location filename="../proxy.cpp" line="778"/>
<source>Reboot Now</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="776"/>
<source>The system needs to be restarted to set the Apt proxy, whether to reboot</source>
<translation>APTལས</translation>
</message>
<message>
<location filename="../proxy.cpp" line="883"/>
<source>Proxy type</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="891"/>
<source>HTTP</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="892"/>
<source>socks4</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="893"/>
<source>socks5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="900"/>
<source>IP address</source>
<translation>IP </translation>
</message>
<message>
<location filename="../proxy.cpp" line="906"/>
<location filename="../proxy.cpp" line="937"/>
<source>Required</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="927"/>
<source>Invalid IP Address</source>
<translation>IPས</translation>
</message>
<message>
<location filename="../proxy.cpp" line="948"/>
<source>Username</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="951"/>
<location filename="../proxy.cpp" line="965"/>
<source>Optional</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="961"/>
<source>Password</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="983"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="984"/>
<source>Save</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1034"/>
<source>The following applications are allowed to use this configuration:</source>
<translation></translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,229 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>AptProxyDialog</name>
<message>
<location filename="../aptproxydialog.cpp" line="24"/>
<source>Set Apt Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="41"/>
<source>Server Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="59"/>
<source>Port</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="80"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="84"/>
<source>Confirm</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Proxy</name>
<message>
<location filename="../proxy.cpp" line="55"/>
<source>Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="185"/>
<source>Start using</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="198"/>
<source>Proxy mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="202"/>
<source>Auto</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="205"/>
<source>Manual</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="360"/>
<source>Application Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="435"/>
<source>System Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="437"/>
<source>Auto url</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Auto url</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="439"/>
<source>Http Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Http Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="441"/>
<source>Https Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Https Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="443"/>
<source>Ftp Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="445"/>
<source>Socks Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Socks Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="446"/>
<location filename="../proxy.cpp" line="447"/>
<location filename="../proxy.cpp" line="448"/>
<location filename="../proxy.cpp" line="449"/>
<location filename="../proxy.cpp" line="934"/>
<source>Port</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="450"/>
<source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="453"/>
<source>Apt Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Apt Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="454"/>
<source>Open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="455"/>
<source>Server Address : </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="456"/>
<source>Port : </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="457"/>
<source>Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="555"/>
<source>The apt proxy has been turned off and needs to be restarted to take effect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="556"/>
<location filename="../proxy.cpp" line="777"/>
<source>Reboot Later</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="557"/>
<location filename="../proxy.cpp" line="778"/>
<source>Reboot Now</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="776"/>
<source>The system needs to be restarted to set the Apt proxy, whether to reboot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="883"/>
<source>Proxy type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="891"/>
<source>HTTP</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="892"/>
<source>socks4</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="893"/>
<source>socks5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="900"/>
<source>IP address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="906"/>
<location filename="../proxy.cpp" line="937"/>
<source>Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="927"/>
<source>Invalid IP Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="948"/>
<source>Username</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="951"/>
<location filename="../proxy.cpp" line="965"/>
<source>Optional</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="961"/>
<source>Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="983"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="984"/>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1034"/>
<source>The following applications are allowed to use this configuration:</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@ -0,0 +1,229 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context>
<name>AptProxyDialog</name>
<message>
<location filename="../aptproxydialog.cpp" line="24"/>
<source>Set Apt Proxy</source>
<translation>APT代理</translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="41"/>
<source>Server Address</source>
<translation></translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="59"/>
<source>Port</source>
<translation></translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="80"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../aptproxydialog.cpp" line="84"/>
<source>Confirm</source>
<translation></translation>
</message>
</context>
<context>
<name>Proxy</name>
<message>
<location filename="../proxy.cpp" line="55"/>
<source>Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="185"/>
<source>Start using</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="198"/>
<source>Proxy mode</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="202"/>
<source>Auto</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="205"/>
<source>Manual</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="360"/>
<source>Application Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="435"/>
<source>System Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="437"/>
<source>Auto url</source>
<translation>URL</translation>
<extra-contents_path>/Proxy/Auto url</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="439"/>
<source>Http Proxy</source>
<translation>HTTP代理</translation>
<extra-contents_path>/Proxy/Http Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="441"/>
<source>Https Proxy</source>
<translation>HTTPS代理</translation>
<extra-contents_path>/Proxy/Https Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="443"/>
<source>Ftp Proxy</source>
<translation>FTP代理</translation>
<extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="445"/>
<source>Socks Proxy</source>
<translation>SOCKS代理</translation>
<extra-contents_path>/Proxy/Socks Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="446"/>
<location filename="../proxy.cpp" line="447"/>
<location filename="../proxy.cpp" line="448"/>
<location filename="../proxy.cpp" line="449"/>
<location filename="../proxy.cpp" line="934"/>
<source>Port</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="450"/>
<source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source>
<translation>使;</translation>
</message>
<message>
<location filename="../proxy.cpp" line="453"/>
<source>Apt Proxy</source>
<translation>APT代理</translation>
<extra-contents_path>/Proxy/Apt Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="454"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="455"/>
<source>Server Address : </source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="456"/>
<source>Port : </source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="457"/>
<source>Edit</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="555"/>
<source>The apt proxy has been turned off and needs to be restarted to take effect</source>
<translation>APT代理已关闭</translation>
</message>
<message>
<location filename="../proxy.cpp" line="556"/>
<location filename="../proxy.cpp" line="777"/>
<source>Reboot Later</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="557"/>
<location filename="../proxy.cpp" line="778"/>
<source>Reboot Now</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="776"/>
<source>The system needs to be restarted to set the Apt proxy, whether to reboot</source>
<translation>APT代理需要重启系统后生效</translation>
</message>
<message>
<location filename="../proxy.cpp" line="883"/>
<source>Proxy type</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="891"/>
<source>HTTP</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="892"/>
<source>socks4</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="893"/>
<source>socks5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="900"/>
<source>IP address</source>
<translation>IP地址</translation>
</message>
<message>
<location filename="../proxy.cpp" line="906"/>
<location filename="../proxy.cpp" line="937"/>
<source>Required</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="927"/>
<source>Invalid IP Address</source>
<translation>IP地址</translation>
</message>
<message>
<location filename="../proxy.cpp" line="948"/>
<source>Username</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="951"/>
<location filename="../proxy.cpp" line="965"/>
<source>Optional</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="961"/>
<source>Password</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="983"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="984"/>
<source>Save</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1034"/>
<source>The following applications are allowed to use this configuration:</source>
<translation>使</translation>
</message>
</context>
</TS>