!12 代理界面

Merge pull request !12 from zhaoshixu/1112
This commit is contained in:
zhaoshixu 2022-11-21 07:46:46 +00:00 committed by Gitee
commit c1e685fc9e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
18 changed files with 3142 additions and 3 deletions

10
debian/changelog vendored
View File

@ -1,10 +1,16 @@
kylin-nm (3.14.0.0+0512-2k11) v101; urgency=medium
kylin-nm (3.14.0.0+0512-3k11) yangtz; urgency=medium
* 合并3.22需求
-- zhaoshixu <zhaoshixu@kylinos.cn> Mon, 21 Nov 2022 15:31:28 +0800
kylin-nm (3.14.0.0+0512-2k11) yangtz; urgency=medium
* 修改因有线连接未指定网卡造成VPN托盘崩溃的问题
-- zhaoshixu <zhaoshixu@kylinos.cn> Fri, 21 Oct 2022 16:35:19 +0800
kylin-nm (3.14.0.0+0512-2k10) v101; urgency=medium
kylin-nm (3.14.0.0+0512-2k10) yangtz; urgency=medium
* 托盘vpn需求

View File

@ -5,5 +5,8 @@ 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/libvpn.so"
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
path3="/usr/lib/`/usr/bin/dpkg-architecture -qDEB_TARGET_MULTIARCH`/ukui-control-center/libvpn.so"
dpkg-divert --package kylin-nm --rename --divert "$path3"".old" --add $path3

View File

@ -3,4 +3,5 @@ SUBDIRS = \
netconnect \
wlanconnect \
mobilehotspot \
proxy \
vpn \

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>

1367
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_CN.ts

Binary file not shown.

View File

@ -0,0 +1,227 @@
<?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="63"/>
<source>Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="194"/>
<source>Start using</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="207"/>
<source>Proxy mode</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="211"/>
<source>Auto</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="214"/>
<source>Manual</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="369"/>
<source>Application Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="444"/>
<source>System Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="446"/>
<source>Auto url</source>
<translation></translation>
<extra-contents_path>/Proxy/Auto url</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="448"/>
<source>Http Proxy</source>
<translation>HTTP </translation>
<extra-contents_path>/Proxy/Http Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="450"/>
<source>Https Proxy</source>
<translation>HTTPS </translation>
<extra-contents_path>/Proxy/Https Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="452"/>
<source>Ftp Proxy</source>
<translation>FTP </translation>
<extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="454"/>
<source>Socks Proxy</source>
<translation>SOCKS </translation>
<extra-contents_path>/Proxy/Socks Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="455"/>
<location filename="../proxy.cpp" line="456"/>
<location filename="../proxy.cpp" line="457"/>
<location filename="../proxy.cpp" line="458"/>
<location filename="../proxy.cpp" line="1047"/>
<source>Port</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="459"/>
<source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source>
<translation> (;)</translation>
</message>
<message>
<location filename="../proxy.cpp" line="462"/>
<source>Apt Proxy</source>
<translation>APT </translation>
<extra-contents_path>/Proxy/Apt Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="463"/>
<location filename="../proxy.cpp" line="984"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="464"/>
<source>Server Address : </source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="465"/>
<source>Port : </source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="466"/>
<source>Edit</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="564"/>
<source>The apt proxy has been turned off and needs to be restarted to take effect</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="565"/>
<location filename="../proxy.cpp" line="797"/>
<source>Reboot Later</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="566"/>
<location filename="../proxy.cpp" line="798"/>
<source>Reboot Now</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="796"/>
<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="996"/>
<source>Proxy type</source>
<translation></translation>
</message>
<message>
<source>HTTP</source>
<translation type="vanished">HTTP</translation>
</message>
<message>
<source>socks4</source>
<translation type="vanished">4</translation>
</message>
<message>
<source>socks5</source>
<translation type="vanished">5</translation>
</message>
<message>
<location filename="../proxy.cpp" line="1013"/>
<source>IP address</source>
<translation>IPས</translation>
</message>
<message>
<location filename="../proxy.cpp" line="1019"/>
<location filename="../proxy.cpp" line="1050"/>
<source>Required</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1040"/>
<source>Invalid IP Address</source>
<translation>IPས</translation>
</message>
<message>
<location filename="../proxy.cpp" line="1061"/>
<source>Username</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1064"/>
<location filename="../proxy.cpp" line="1078"/>
<source>Optional</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1074"/>
<source>Password</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1097"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1098"/>
<source>Save</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1160"/>
<source>The following applications are allowed to use this configuration:</source>
<translation></translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,215 @@
<?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="63"/>
<source>Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="194"/>
<source>Start using</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="207"/>
<source>Proxy mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="211"/>
<source>Auto</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="214"/>
<source>Manual</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="369"/>
<source>Application Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="444"/>
<source>System Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="446"/>
<source>Auto url</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Auto url</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="448"/>
<source>Http Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Http Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="450"/>
<source>Https Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Https Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="452"/>
<source>Ftp Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="454"/>
<source>Socks Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Socks Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="455"/>
<location filename="../proxy.cpp" line="456"/>
<location filename="../proxy.cpp" line="457"/>
<location filename="../proxy.cpp" line="458"/>
<location filename="../proxy.cpp" line="1047"/>
<source>Port</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="459"/>
<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="462"/>
<source>Apt Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Apt Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="463"/>
<location filename="../proxy.cpp" line="984"/>
<source>Open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="464"/>
<source>Server Address : </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="465"/>
<source>Port : </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="466"/>
<source>Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="564"/>
<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="565"/>
<location filename="../proxy.cpp" line="797"/>
<source>Reboot Later</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="566"/>
<location filename="../proxy.cpp" line="798"/>
<source>Reboot Now</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="796"/>
<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="996"/>
<source>Proxy type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1013"/>
<source>IP address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1019"/>
<location filename="../proxy.cpp" line="1050"/>
<source>Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1040"/>
<source>Invalid IP Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1061"/>
<source>Username</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1064"/>
<location filename="../proxy.cpp" line="1078"/>
<source>Optional</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1074"/>
<source>Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1097"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1098"/>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1160"/>
<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,215 @@
<?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="63"/>
<source>Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="194"/>
<source>Start using</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="207"/>
<source>Proxy mode</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="211"/>
<source>Auto</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="214"/>
<source>Manual</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="369"/>
<source>Application Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="444"/>
<source>System Proxy</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="446"/>
<source>Auto url</source>
<translation>URL</translation>
<extra-contents_path>/Proxy/Auto url</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="448"/>
<source>Http Proxy</source>
<translation>HTTP代理</translation>
<extra-contents_path>/Proxy/Http Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="450"/>
<source>Https Proxy</source>
<translation>HTTPS代理</translation>
<extra-contents_path>/Proxy/Https Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="452"/>
<source>Ftp Proxy</source>
<translation>FTP代理</translation>
<extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="454"/>
<source>Socks Proxy</source>
<translation>SOCKS代理</translation>
<extra-contents_path>/Proxy/Socks Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="455"/>
<location filename="../proxy.cpp" line="456"/>
<location filename="../proxy.cpp" line="457"/>
<location filename="../proxy.cpp" line="458"/>
<location filename="../proxy.cpp" line="1047"/>
<source>Port</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="459"/>
<source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source>
<translation>使;</translation>
</message>
<message>
<location filename="../proxy.cpp" line="462"/>
<source>Apt Proxy</source>
<translation>APT代理</translation>
<extra-contents_path>/Proxy/Apt Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="463"/>
<location filename="../proxy.cpp" line="984"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="464"/>
<source>Server Address : </source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="465"/>
<source>Port : </source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="466"/>
<source>Edit</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="564"/>
<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="565"/>
<location filename="../proxy.cpp" line="797"/>
<source>Reboot Later</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="566"/>
<location filename="../proxy.cpp" line="798"/>
<source>Reboot Now</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="796"/>
<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="996"/>
<source>Proxy type</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1013"/>
<source>IP address</source>
<translation>IP地址</translation>
</message>
<message>
<location filename="../proxy.cpp" line="1019"/>
<location filename="../proxy.cpp" line="1050"/>
<source>Required</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1040"/>
<source>Invalid IP Address</source>
<translation>IP地址</translation>
</message>
<message>
<location filename="../proxy.cpp" line="1061"/>
<source>Username</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1064"/>
<location filename="../proxy.cpp" line="1078"/>
<source>Optional</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1074"/>
<source>Password</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1097"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1098"/>
<source>Save</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1160"/>
<source>The following applications are allowed to use this configuration:</source>
<translation>使</translation>
</message>
</context>
</TS>