merge(代码合并):合并主线代码,更新upstream

This commit is contained in:
jzxc95 2023-09-20 15:59:02 +08:00
commit c051d72b6b
197 changed files with 11661 additions and 4548 deletions

View File

@ -2,24 +2,12 @@ TEMPLATE = subdirs
CONFIG += \ CONFIG += \
ordered \ ordered \
qt qt \
SUBDIRS = \ SUBDIRS = \
plugins/plugin.pro \ plugins/plugin.pro \
src-vpn/src-vpn.pro \ src-vpn/src-vpn.pro \
src src \
sys-dbus-register \
TRANSLATIONS += \ QT += widgets
translations/kylin-nm_zh_CN.ts \
translations/kylin-nm_tr.ts \
translations/kylin-nm_bo.ts \
translations/kylin-nm_bo_CN.ts
CONFIG(release, debug|release) {
!system($$PWD/translate_generation.sh): error("Failed to generate translation")
}
qm_files.path = $${PREFIX}/share/kylin-nm/kylin-nm/
qm_files.files = translations/*.qm
INSTALLS += qm_files \

View File

@ -79,17 +79,16 @@ void AddNetBtn::leaveEvent(QEvent *event){
void AddNetBtn::paintEvent(QPaintEvent *event) void AddNetBtn::paintEvent(QPaintEvent *event)
{ {
// QPalette pal = qApp->palette();
QPainter painter(this); QPainter painter(this);
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿 painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
painter.setPen(Qt::NoPen); painter.setPen(Qt::NoPen);
painter.setBrush(this->palette().base().color()); painter.setBrush(this->palette().base().color());
// QColor color = pal.color(QPalette::Button); QPalette pal = qApp->palette();
// color.setAlphaF(0.5); QColor color = pal.color(QPalette::Button);
// pal.setColor(QPalette::Button, color); color.setAlphaF(0.5);
// this->setPalette(pal); pal.setColor(QPalette::Button, color);
this->setPalette(pal);
QRect rect = this->rect(); QRect rect = this->rect();
QPainterPath path; QPainterPath path;

View File

@ -22,7 +22,6 @@
#include <QPainter> #include <QPainter>
#include <QApplication> #include <QApplication>
#include <QDebug> #include <QDebug>
#include <QPainterPath>
#define BUTTON_SIZE 36,36 #define BUTTON_SIZE 36,36
#define ICON_SIZE 16,16 #define ICON_SIZE 16,16

View File

@ -4,6 +4,11 @@ CONFIG += plugin
TARGET = $$qtLibraryTarget(mobilehotspot) TARGET = $$qtLibraryTarget(mobilehotspot)
DESTDIR = ../.. DESTDIR = ../..
CONFIG(release, debug|release) {
!system($$PWD/translate_generation.sh): error("Failed to generate translation")
}
target.path = $$[QT_INSTALL_LIBS]/ukui-control-center target.path = $$[QT_INSTALL_LIBS]/ukui-control-center
trans.files = translations/* trans.files = translations/*
trans.path = /usr/share/kylin-nm/mobilehotspot/ trans.path = /usr/share/kylin-nm/mobilehotspot/
@ -50,4 +55,5 @@ TRANSLATIONS += \
translations/tr.ts \ translations/tr.ts \
translations/bo.ts\ translations/bo.ts\
translations/bo_CN.ts \ translations/bo_CN.ts \
translations/en_US.ts translations/en_US.ts \
translations/mn.ts

View File

@ -35,10 +35,10 @@
#define LINE_MIN_SIZE 0, 1 #define LINE_MIN_SIZE 0, 1
#define ICON_SIZE 24,24 #define ICON_SIZE 24,24
#define PASSWORD_FRAME_MIN_HIGHT 60 #define PASSWORD_FRAME_MIN_HIGHT 60
#define PASSWORD_FRAME_FIX_HIGHT 80 #define PASSWORD_FRAME_FIX_HIGHT 90
#define PASSWORD_FRAME_MIN_SIZE 550, 60 #define PASSWORD_FRAME_MIN_SIZE 550, 60
#define PASSWORD_FRAME_MAX_SIZE 16777215, 86 #define PASSWORD_FRAME_MAX_SIZE 16777215, 86
#define PASSWORD_ITEM_MARGINS 16, 12, 16, 14 #define PASSWORD_ITEM_MARGINS 16, 10, 16, 10
#define WIRELESS 1 #define WIRELESS 1
@ -58,10 +58,10 @@ void MobileHotspotWidget::showDesktopNotify(const QString &message)
"org.freedesktop.Notifications", "org.freedesktop.Notifications",
QDBusConnection::sessionBus()); QDBusConnection::sessionBus());
QList<QVariant> args; QList<QVariant> args;
args<<(tr("ukui control center")) args<<(tr("Settings"))
<<((unsigned int) 0) <<((unsigned int) 0)
<<QString("ukui-control-center") <<QString("ukui-control-center")
<<tr("ukui control center desktop message") //显示的是什么类型的信息 <<tr("Settings desktop message") //显示的是什么类型的信息
<<message //显示的具体信息 <<message //显示的具体信息
<<QStringList() <<QStringList()
<<QVariantMap() <<QVariantMap()
@ -114,10 +114,18 @@ MobileHotspotWidget::MobileHotspotWidget(QWidget *parent) : QWidget(parent)
m_Vlayout->addStretch(); m_Vlayout->addStretch();
connect(m_switchBtn, &KSwitchButton::stateChanged, this, &MobileHotspotWidget::setUiEnabled); connect(m_switchBtn, &KSwitchButton::stateChanged, this, &MobileHotspotWidget::setUiEnabled);
connect(m_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MobileHotspotWidget::onInterfaceChanged);
connect(m_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=]() { connect(m_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=]() {
UkccCommon::buriedSettings("MobileHotspot", "Net card", QString("select"), m_interfaceComboBox->currentText());
m_interfaceName = m_interfaceComboBox->currentText(); m_interfaceName = m_interfaceComboBox->currentText();
updateBandCombox(); updateBandCombox();
}); });
connect(m_freqBandComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](){
if (m_isUserSelect && !m_freqBandComboBox->currentText().isEmpty()) {
UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText());
}
});
onInterfaceChanged();
#ifdef HOTSPOT_CONTROL #ifdef HOTSPOT_CONTROL
m_connectDevPage->refreshStalist(); m_connectDevPage->refreshStalist();
@ -139,7 +147,6 @@ bool MobileHotspotWidget::eventFilter(QObject *watched, QEvent *event)
return true; return true;
} }
if (watched == m_switchBtn) { if (watched == m_switchBtn) {
if (event->type() == QEvent::MouseButtonRelease) { if (event->type() == QEvent::MouseButtonRelease) {
if (!m_interface->isValid()) { if (!m_interface->isValid()) {
@ -149,6 +156,7 @@ bool MobileHotspotWidget::eventFilter(QObject *watched, QEvent *event)
showDesktopNotify(tr("wirless switch is close or no wireless device")); showDesktopNotify(tr("wirless switch is close or no wireless device"));
return true; return true;
} }
UkccCommon::buriedSettings("MobileHotspot", "Open", QString("settings"), !m_switchBtn->isChecked() ? "true":"false");
if (m_switchBtn->isChecked()) { if (m_switchBtn->isChecked()) {
// showDesktopNotify(tr("start to close hotspot")); // showDesktopNotify(tr("start to close hotspot"));
QDBusReply<void> reply = m_interface->call("deactiveWirelessAp", m_apNameLine->text(), m_uuid); QDBusReply<void> reply = m_interface->call("deactiveWirelessAp", m_apNameLine->text(), m_uuid);
@ -258,7 +266,7 @@ void MobileHotspotWidget::initDbusConnect()
if(m_interface->isValid()) { if(m_interface->isValid()) {
connect(m_interface,SIGNAL(activateFailed(QString)), this, SLOT(onActivateFailed(QString)), Qt::QueuedConnection); connect(m_interface,SIGNAL(activateFailed(QString)), this, SLOT(onActivateFailed(QString)), Qt::QueuedConnection);
connect(m_interface,SIGNAL(deactivateFailed(QString)), this, SLOT(onDeactivateFailed(QString)), Qt::QueuedConnection); connect(m_interface,SIGNAL(deactivateFailed(QString)), this, SLOT(onDeactivateFailed(QString)), Qt::QueuedConnection);
connect(m_interface,SIGNAL(deviceStatusChanged()), this, SLOT(onDeviceStatusChanged()), Qt::QueuedConnection); connect(m_interface,SIGNAL(wirelessDeviceStatusChanged()), this, SLOT(onDeviceStatusChanged()), Qt::QueuedConnection);
connect(m_interface,SIGNAL(deviceNameChanged(QString, QString, int)), this, SLOT(onDeviceNameChanged(QString, QString, int)), Qt::QueuedConnection); connect(m_interface,SIGNAL(deviceNameChanged(QString, QString, int)), this, SLOT(onDeviceNameChanged(QString, QString, int)), Qt::QueuedConnection);
connect(m_interface,SIGNAL(hotspotDeactivated(QString, QString)), this, SLOT(onHotspotDeactivated(QString, QString)), Qt::QueuedConnection); connect(m_interface,SIGNAL(hotspotDeactivated(QString, QString)), this, SLOT(onHotspotDeactivated(QString, QString)), Qt::QueuedConnection);
connect(m_interface,SIGNAL(hotspotActivated(QString, QString, QString, QString, QString)), this, SLOT(onHotspotActivated(QString, QString, QString, QString, QString)), Qt::QueuedConnection); connect(m_interface,SIGNAL(hotspotActivated(QString, QString, QString, QString, QString)), this, SLOT(onHotspotActivated(QString, QString, QString, QString, QString)), Qt::QueuedConnection);
@ -268,7 +276,6 @@ void MobileHotspotWidget::initDbusConnect()
connect(m_interface, SIGNAL(wirelessSwitchBtnChanged(bool)), this, SLOT(onWirelessBtnChanged(bool)), Qt::QueuedConnection); connect(m_interface, SIGNAL(wirelessSwitchBtnChanged(bool)), this, SLOT(onWirelessBtnChanged(bool)), Qt::QueuedConnection);
} }
connect(m_apNameLine, &QLineEdit::textEdited, this, &MobileHotspotWidget::onApLineEditTextEdit); connect(m_apNameLine, &QLineEdit::textEdited, this, &MobileHotspotWidget::onApLineEditTextEdit);
#ifdef HOTSPOT_CONTROL #ifdef HOTSPOT_CONTROL
connect(m_connectDevPage, SIGNAL(setStaIntoBlacklist(QString, QString)), m_blacklistPage, SLOT(onsetStaIntoBlacklist(QString, QString))); connect(m_connectDevPage, SIGNAL(setStaIntoBlacklist(QString, QString)), m_blacklistPage, SLOT(onsetStaIntoBlacklist(QString, QString)));
@ -284,11 +291,10 @@ void MobileHotspotWidget::onApLineEditTextEdit(QString text)
for ( ; i < text.length(); ++i) { for ( ; i < text.length(); ++i) {
count += text.mid(i,1).toLocal8Bit().length(); count += text.mid(i,1).toLocal8Bit().length();
if (count > AP_NAME_MAX_LENGTH) { if (count > AP_NAME_MAX_LENGTH) {
break; m_apNameLine->setText(text.left(i));
return;
} }
} }
m_apNameLine->setText(text.left(i));
} }
void MobileHotspotWidget::onPwdTextChanged() void MobileHotspotWidget::onPwdTextChanged()
@ -304,6 +310,47 @@ void MobileHotspotWidget::onPwdTextChanged()
this->update(); this->update();
} }
void MobileHotspotWidget::onInterfaceChanged()
{
m_interfaceName = m_interfaceComboBox->currentText();
if(m_interface->isValid()) {
QDBusMessage result = m_interface->call(QStringLiteral("getWirelessList"));
if(result.type() == QDBusMessage::ErrorMessage)
{
qWarning() << "getWirelessList error:" << result.errorMessage();
return;
}
bool flag = false;
auto dbusArg = result.arguments().at(0).value<QDBusArgument>();
QMap<QString, QVector<QStringList>> variantList;
dbusArg >> variantList;
if (variantList.size() != 0) {
QMap<QString, QVector<QStringList>>::iterator iter;
for (iter = variantList.begin(); iter != variantList.end(); iter++) {
if (m_interfaceName == iter.key()) {
QVector<QStringList> wlanListInfo = iter.value();
if (!wlanListInfo.isEmpty() && wlanListInfo.at(0).size() > 1) {
flag = true;
}
break;
}
}
}
if (flag) {
m_interfaceWarnLabel->setText(tr("use ") + m_interfaceName +
tr(" share network, will interrupt local wireless connection"));
m_interfaceFrame->setFixedHeight(PASSWORD_FRAME_FIX_HIGHT);
m_warnWidget->show();
} else {
m_interfaceFrame->setFixedHeight(PASSWORD_FRAME_MIN_HIGHT);
m_warnWidget->hide();
}
resetFrameSize();
}
updateBandCombox();
}
void MobileHotspotWidget::onActiveConnectionChanged(QString deviceName, QString ssid, QString uuid, int status) void MobileHotspotWidget::onActiveConnectionChanged(QString deviceName, QString ssid, QString uuid, int status)
{ {
if(m_uuid == uuid && status == 4) { if(m_uuid == uuid && status == 4) {
@ -312,11 +359,19 @@ void MobileHotspotWidget::onActiveConnectionChanged(QString deviceName, QString
setUiEnabled(false); setUiEnabled(false);
m_uuid.clear(); m_uuid.clear();
} }
if (deviceName != m_interfaceName) {
return;
}
if (m_interfaceComboBox && status == 2) {
onInterfaceChanged();
}
} }
void MobileHotspotWidget::onWirelessBtnChanged(bool state) void MobileHotspotWidget::onWirelessBtnChanged(bool state)
{ {
if (!state) { if (!state) {
m_switchBtn->setChecked(state); m_switchBtn->setChecked(state);
m_uuid.clear(); m_uuid.clear();
m_switchBtn->setCheckable(false); m_switchBtn->setCheckable(false);
@ -330,6 +385,10 @@ void MobileHotspotWidget::initInterfaceInfo()
if(!m_interface->isValid()) { if(!m_interface->isValid()) {
return; return;
} }
if (m_interfaceComboBox->isVisible()) {
m_interfaceComboBox->hidePopup();
}
m_interfaceComboBox->clear(); m_interfaceComboBox->clear();
QDBusReply<QMap<QString, bool> > reply = m_interface->call("getDeviceListAndEnabled",WIRELESS); QDBusReply<QMap<QString, bool> > reply = m_interface->call("getDeviceListAndEnabled",WIRELESS);
@ -348,7 +407,6 @@ void MobileHotspotWidget::initInterfaceInfo()
} }
QMap<QString, int> devCapMap = capReply.value(); QMap<QString, int> devCapMap = capReply.value();
if (devMap.isEmpty()) { if (devMap.isEmpty()) {
qDebug() << LOG_HEAD << "no wireless device"; qDebug() << LOG_HEAD << "no wireless device";
setWidgetHidden(true); setWidgetHidden(true);
@ -357,7 +415,7 @@ void MobileHotspotWidget::initInterfaceInfo()
QMap<QString, bool>::Iterator iter = devMap.begin(); QMap<QString, bool>::Iterator iter = devMap.begin();
while (iter != devMap.end()) { while (iter != devMap.end()) {
QString interfaceName = iter.key(); QString interfaceName = iter.key();
if (devCapMap[interfaceName] & 0x01) { if (!(devCapMap[interfaceName] & 0x01)) {
m_interfaceComboBox->addItem(interfaceName); m_interfaceComboBox->addItem(interfaceName);
} }
iter++; iter++;
@ -402,24 +460,32 @@ void MobileHotspotWidget::getApInfo()
m_pwdNameLine->setText("12345678"); m_pwdNameLine->setText("12345678");
return; return;
} else { } else {
m_apNameLine->setText(apInfo.at(0));
m_pwdNameLine->setText(apInfo.at(1));
int index = m_interfaceComboBox->findText(apInfo.at(2)); int index = m_interfaceComboBox->findText(apInfo.at(2));
if (index >= 0) { if (index >= 0) {
m_apNameLine->setText(apInfo.at(0));
m_pwdNameLine->setText(apInfo.at(1));
m_interfaceComboBox->setCurrentIndex(index); m_interfaceComboBox->setCurrentIndex(index);
m_interfaceName = apInfo.at(2); m_interfaceName = apInfo.at(2);
if (apInfo.at(3) == "true") {
m_switchBtn->setChecked(true);
setUiEnabled(true);
m_uuid = apInfo.at(4);
} else {
m_switchBtn->setChecked(false);
setUiEnabled(false);
m_uuid = apInfo.at(4);
}
} else { } else {
qDebug() << LOG_HEAD << "no such interface " << apInfo.at(2); qDebug() << LOG_HEAD << "no such interface " << apInfo.at(2);
} }
if (apInfo.at(3) == "true") {
m_switchBtn->setChecked(true);
setUiEnabled(true);
m_uuid = apInfo.at(4);
} else {
m_switchBtn->setChecked(false);
setUiEnabled(false);
m_uuid = apInfo.at(4);
}
int i = m_freqBandComboBox->findText(apInfo.at(5));
if (i >= 0) {
m_isUserSelect = false;
m_freqBandComboBox->setCurrentIndex(i);
m_isUserSelect = true;
}
} }
} }
@ -496,10 +562,12 @@ void MobileHotspotWidget::setPasswordFrame()
pwdInputVLayout->addWidget(m_pwdNameLine); pwdInputVLayout->addWidget(m_pwdNameLine);
pwdInputVLayout->addWidget(m_pwdHintLabel); pwdInputVLayout->addWidget(m_pwdHintLabel);
QFormLayout *pwdLayout = new QFormLayout(m_passwordFrame); QGridLayout *pwdLayout = new QGridLayout(m_passwordFrame);
pwdLayout->setContentsMargins(PASSWORD_ITEM_MARGINS); pwdLayout->setContentsMargins(PASSWORD_ITEM_MARGINS);
pwdLayout->setSpacing(0); pwdLayout->setSpacing(0);
pwdLayout->addRow(m_pwdLabel, pwdInputWidget); pwdLayout->addWidget(m_pwdLabel, 0, 0);
pwdLayout->addWidget(m_pwdNameLine, 0, 1);
pwdLayout->addWidget(m_pwdHintLabel, 1, 1);
m_passwordFrame->setLayout(pwdLayout); m_passwordFrame->setLayout(pwdLayout);
@ -516,8 +584,9 @@ void MobileHotspotWidget::setFreqBandFrame()
QHBoxLayout *freqBandHLayout = new QHBoxLayout(m_freqBandFrame); QHBoxLayout *freqBandHLayout = new QHBoxLayout(m_freqBandFrame);
m_freqBandLabel = new QLabel(tr("Frequency band"), this); m_freqBandLabel = new FixLabel(this);
m_freqBandLabel->setMinimumWidth(LABLE_MIN_WIDTH); m_freqBandLabel->setText(tr("Frequency band"));
m_freqBandLabel->setFixedWidth(LABLE_MIN_WIDTH - 8);
m_freqBandComboBox = new QComboBox(this); m_freqBandComboBox = new QComboBox(this);
m_freqBandComboBox->setInsertPolicy(QComboBox::NoInsert); m_freqBandComboBox->setInsertPolicy(QComboBox::NoInsert);
m_freqBandComboBox->setMinimumWidth(COMBOBOX_MIN_WIDTH); m_freqBandComboBox->setMinimumWidth(COMBOBOX_MIN_WIDTH);
@ -525,7 +594,7 @@ void MobileHotspotWidget::setFreqBandFrame()
m_freqBandComboBox->addItem("2.4GHz"); m_freqBandComboBox->addItem("2.4GHz");
m_freqBandComboBox->addItem("5GHz"); m_freqBandComboBox->addItem("5GHz");
freqBandHLayout->setContentsMargins(ITEM_MARGINS); freqBandHLayout->setContentsMargins(ITEM_MARGINS);
freqBandHLayout->setSpacing(0); freqBandHLayout->setSpacing(8);
freqBandHLayout->addWidget(m_freqBandLabel); freqBandHLayout->addWidget(m_freqBandLabel);
freqBandHLayout->addWidget(m_freqBandComboBox); freqBandHLayout->addWidget(m_freqBandComboBox);
@ -537,23 +606,48 @@ void MobileHotspotWidget::setInterFaceFrame()
/* key tips */ /* key tips */
m_interfaceFrame = new QFrame(this); m_interfaceFrame = new QFrame(this);
m_interfaceFrame->setFrameShape(QFrame::Shape::NoFrame); m_interfaceFrame->setFrameShape(QFrame::Shape::NoFrame);
m_interfaceFrame->setMinimumSize(FRAME_MIN_SIZE); m_interfaceFrame->setMinimumSize(PASSWORD_FRAME_MIN_SIZE);
m_interfaceFrame->setMaximumSize(CONTECT_FRAME_MAX_SIZE); m_interfaceFrame->setMaximumSize(PASSWORD_FRAME_MAX_SIZE);
QHBoxLayout *interfaceHLayout = new QHBoxLayout(m_interfaceFrame);
m_interfaceLabel = new QLabel(tr("Net card"), this); m_interfaceLabel = new QLabel(tr("Net card"), this);
m_interfaceLabel->setMinimumWidth(LABLE_MIN_WIDTH); m_interfaceLabel->setFixedWidth(LABLE_MIN_WIDTH);
m_interfaceComboBox = new QComboBox(this); m_interfaceComboBox = new QComboBox(this);
m_interfaceComboBox->setInsertPolicy(QComboBox::NoInsert); m_interfaceComboBox->setInsertPolicy(QComboBox::NoInsert);
m_interfaceComboBox->setMinimumWidth(COMBOBOX_MIN_WIDTH); m_interfaceComboBox->setMinimumWidth(COMBOBOX_MIN_WIDTH);
m_interfaceComboBox->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
interfaceHLayout->setContentsMargins(ITEM_MARGINS);
interfaceHLayout->setSpacing(0);
interfaceHLayout->addWidget(m_interfaceLabel);
interfaceHLayout->addWidget(m_interfaceComboBox);
m_interfaceFrame->setLayout(interfaceHLayout); m_warnWidget = new QWidget(this);
m_warnWidget->setFixedHeight(20);
m_warnWidget->setContentsMargins(8,0,0,0);
QHBoxLayout *warnTextHLayout = new QHBoxLayout(m_warnWidget);
QLabel* warnIcon = new QLabel(this);
warnIcon->setContentsMargins(0,0,0,0);
warnIcon->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(16,16));
m_interfaceWarnLabel= new FixLabel(this);
m_interfaceWarnLabel->setFixedHeight(20);
QPalette hintTextColor;
hintTextColor.setColor(QPalette::WindowText, Qt::red);
m_interfaceWarnLabel->setPalette(hintTextColor);
warnTextHLayout->setSpacing(8);
warnTextHLayout->setContentsMargins(0,0,0,0);
warnTextHLayout->addWidget(warnIcon);
warnTextHLayout->addWidget(m_interfaceWarnLabel);
warnIcon->setFixedWidth(16);
m_warnWidget->setLayout(warnTextHLayout);
QGridLayout *interfaceFLayout = new QGridLayout(m_interfaceFrame);
interfaceFLayout->setContentsMargins(PASSWORD_ITEM_MARGINS);
interfaceFLayout->setSpacing(0);
interfaceFLayout->addWidget(m_interfaceLabel, 0, 0);
interfaceFLayout->addWidget(m_interfaceComboBox, 0, 1);
interfaceFLayout->addWidget(m_warnWidget, 1, 1);
m_interfaceFrame->setLayout(interfaceFLayout);
m_warnWidget->hide();
} }
void MobileHotspotWidget::onActivateFailed(QString errorMessage) void MobileHotspotWidget::onActivateFailed(QString errorMessage)
@ -590,6 +684,12 @@ void MobileHotspotWidget::onDeviceNameChanged(QString oldName, QString newName,
m_interfaceName = newName; m_interfaceName = newName;
} }
} }
QTimer::singleShot(100, this, [=]() {
if (m_interfaceComboBox->currentText() == newName) {
updateBandCombox();
}
});
} }
//热点断开 //热点断开
@ -650,15 +750,15 @@ void MobileHotspotWidget::onHotspotActivated(QString devName, QString ssid, QStr
updateBandCombox(); updateBandCombox();
index = m_freqBandComboBox->findText(info.at(1)); index = m_freqBandComboBox->findText(info.at(1));
if (index >= 0) { if (index >= 0) {
m_isUserSelect = false;
m_freqBandComboBox->setCurrentIndex(index); m_freqBandComboBox->setCurrentIndex(index);
m_isUserSelect = true;
} }
m_uuid = uuid; m_uuid = uuid;
} else { } else {
qDebug() << "no such device in combo box"; qDebug() << "no such device in combo box";
} }
} }
} }
bool MobileHotspotWidget::getApInfoBySsid(QString devName, QString ssid, QStringList &info) bool MobileHotspotWidget::getApInfoBySsid(QString devName, QString ssid, QStringList &info)
@ -724,6 +824,7 @@ void MobileHotspotWidget::setWidgetHidden(bool isHidden)
void MobileHotspotWidget::updateBandCombox() void MobileHotspotWidget::updateBandCombox()
{ {
QString tmp = m_freqBandComboBox->currentText();
m_freqBandComboBox->clear(); m_freqBandComboBox->clear();
QDBusReply<QMap<QString, int> > capReply = m_interface->call("getWirelessDeviceCap"); QDBusReply<QMap<QString, int> > capReply = m_interface->call("getWirelessDeviceCap");
if (!capReply.isValid()) { if (!capReply.isValid()) {
@ -731,6 +832,8 @@ void MobileHotspotWidget::updateBandCombox()
setWidgetHidden(true); setWidgetHidden(true);
return; return;
} }
m_isUserSelect = false;
QMap<QString, int> devCapMap = capReply.value(); QMap<QString, int> devCapMap = capReply.value();
if (devCapMap[m_interfaceName] & 0x02) { if (devCapMap[m_interfaceName] & 0x02) {
m_freqBandComboBox->addItem("2.4GHz"); m_freqBandComboBox->addItem("2.4GHz");
@ -738,6 +841,12 @@ void MobileHotspotWidget::updateBandCombox()
if (devCapMap[m_interfaceName] & 0x04) { if (devCapMap[m_interfaceName] & 0x04) {
m_freqBandComboBox->addItem("5GHz"); m_freqBandComboBox->addItem("5GHz");
} }
int index = m_freqBandComboBox->findText(tmp);
if (index >= 0) {
m_freqBandComboBox->setCurrentIndex(index);
}
m_isUserSelect = true;
} }
QFrame* MobileHotspotWidget::myLine() QFrame* MobileHotspotWidget::myLine()

View File

@ -46,8 +46,11 @@
#include "connectdevlistitem.h" #include "connectdevlistitem.h"
#include "blacklistpage.h" #include "blacklistpage.h"
#include "connectdevpage.h" #include "connectdevpage.h"
#include "fixlabel.h"
#include "ukcccommon.h"
using namespace kdk; using namespace kdk;
using namespace ukcc;
class MobileHotspotWidget : public QWidget class MobileHotspotWidget : public QWidget
{ {
@ -71,7 +74,7 @@ private:
QLabel *m_apNameLabel; QLabel *m_apNameLabel;
QLabel *m_pwdLabel; QLabel *m_pwdLabel;
QLabel *m_pwdHintLabel; QLabel *m_pwdHintLabel;
QLabel *m_freqBandLabel; FixLabel *m_freqBandLabel;
QLabel *m_interfaceLabel; QLabel *m_interfaceLabel;
QFrame *switchAndApNameLine; QFrame *switchAndApNameLine;
@ -87,6 +90,9 @@ private:
QComboBox *m_freqBandComboBox; QComboBox *m_freqBandComboBox;
QComboBox *m_interfaceComboBox; QComboBox *m_interfaceComboBox;
FixLabel *m_interfaceWarnLabel;
QWidget* m_warnWidget;
QDBusInterface *m_interface = nullptr; QDBusInterface *m_interface = nullptr;
QString m_interfaceName = ""; QString m_interfaceName = "";
@ -138,6 +144,8 @@ private:
void initConnectDevPage(); void initConnectDevPage();
void initBlackListPage(); void initBlackListPage();
bool m_isUserSelect = true; //是否用户操作
signals: signals:
private slots: private slots:
@ -158,6 +166,8 @@ private slots:
void onApLineEditTextEdit(QString text); void onApLineEditTextEdit(QString text);
void onPwdTextChanged(); void onPwdTextChanged();
void onInterfaceChanged();
}; };
#endif // MOBILEHOTSPOTWIDGET_H #endif // MOBILEHOTSPOTWIDGET_H

View File

@ -0,0 +1,15 @@
#!/bin/bash
ts_list=(`ls translations/*.ts`)
source /etc/os-release
version=(`echo $ID`)
for ts in "${ts_list[@]}"
do
printf "\nprocess ${ts}\n"
if [ "$version" == "fedora" ] || [ "$version" == "opensuse-leap" ] || [ "$version" == "opensuse-tumbleweed" ];then
lrelease-qt5 "${ts}"
else
lrelease "${ts}"
fi
done

View File

@ -1 +0,0 @@
<クd<>箆!ソ`。スン

View File

@ -56,69 +56,79 @@
<context> <context>
<name>MobileHotspotWidget</name> <name>MobileHotspotWidget</name>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="61"/> <location filename="../mobilehotspotwidget.cpp" line="156"/>
<source>ukui control center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>ukui control center desktop message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="149"/>
<source>wirless switch is close or no wireless device</source> <source>wirless switch is close or no wireless device</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="169"/> <location filename="../mobilehotspotwidget.cpp" line="177"/>
<source>hotpots name or device is invalid</source> <source>hotpots name or device is invalid</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="490"/> <location filename="../mobilehotspotwidget.cpp" line="556"/>
<source>Contains at least 8 characters</source> <source>Contains at least 8 characters</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="223"/> <location filename="../mobilehotspotwidget.cpp" line="231"/>
<source>Hotspot</source> <source>Hotspot</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="310"/> <location filename="../mobilehotspotwidget.cpp" line="61"/>
<location filename="../mobilehotspotwidget.cpp" line="605"/> <source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>Settings desktop message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="340"/>
<source>use </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="341"/>
<source> share network, will interrupt local wireless connection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="357"/>
<location filename="../mobilehotspotwidget.cpp" line="705"/>
<source>hotspot already close</source> <source>hotspot already close</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="436"/> <location filename="../mobilehotspotwidget.cpp" line="502"/>
<source>Open</source> <source>Open</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="457"/> <location filename="../mobilehotspotwidget.cpp" line="523"/>
<source>Wi-Fi Name</source> <source>Wi-Fi Name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="478"/> <location filename="../mobilehotspotwidget.cpp" line="544"/>
<source>Password</source> <source>Password</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="519"/> <location filename="../mobilehotspotwidget.cpp" line="588"/>
<source>Frequency band</source> <source>Frequency band</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="545"/> <location filename="../mobilehotspotwidget.cpp" line="612"/>
<source>Net card</source> <source>Net card</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="635"/> <location filename="../mobilehotspotwidget.cpp" line="735"/>
<location filename="../mobilehotspotwidget.cpp" line="643"/> <location filename="../mobilehotspotwidget.cpp" line="743"/>
<source>hotspot already open</source> <source>hotspot already open</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -56,17 +56,15 @@
<context> <context>
<name>MobileHotspotWidget</name> <name>MobileHotspotWidget</name>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="61"/>
<source>ukui control center</source> <source>ukui control center</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>ukui control center desktop message</source> <source>ukui control center desktop message</source>
<translation>ukui </translation> <translation type="vanished">ukui </translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="149"/> <location filename="../mobilehotspotwidget.cpp" line="156"/>
<source>wirless switch is close or no wireless device</source> <source>wirless switch is close or no wireless device</source>
<translation></translation> <translation></translation>
</message> </message>
@ -75,7 +73,7 @@
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="169"/> <location filename="../mobilehotspotwidget.cpp" line="177"/>
<source>hotpots name or device is invalid</source> <source>hotpots name or device is invalid</source>
<translation></translation> <translation></translation>
</message> </message>
@ -88,49 +86,69 @@
<translation type="vanished"> </translation> <translation type="vanished"> </translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="490"/> <location filename="../mobilehotspotwidget.cpp" line="556"/>
<source>Contains at least 8 characters</source> <source>Contains at least 8 characters</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="223"/> <location filename="../mobilehotspotwidget.cpp" line="231"/>
<source>Hotspot</source> <source>Hotspot</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="310"/> <location filename="../mobilehotspotwidget.cpp" line="61"/>
<location filename="../mobilehotspotwidget.cpp" line="605"/> <source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>Settings desktop message</source>
<translation> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="340"/>
<source>use </source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="341"/>
<source> share network, will interrupt local wireless connection</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="357"/>
<location filename="../mobilehotspotwidget.cpp" line="705"/>
<source>hotspot already close</source> <source>hotspot already close</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="436"/> <location filename="../mobilehotspotwidget.cpp" line="502"/>
<source>Open</source> <source>Open</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="457"/> <location filename="../mobilehotspotwidget.cpp" line="523"/>
<source>Wi-Fi Name</source> <source>Wi-Fi Name</source>
<translation>Wi-Fiཡི</translation> <translation>Wi-Fiཡི</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="478"/> <location filename="../mobilehotspotwidget.cpp" line="544"/>
<source>Password</source> <source>Password</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="519"/> <location filename="../mobilehotspotwidget.cpp" line="588"/>
<source>Frequency band</source> <source>Frequency band</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="545"/> <location filename="../mobilehotspotwidget.cpp" line="612"/>
<source>Net card</source> <source>Net card</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="635"/> <location filename="../mobilehotspotwidget.cpp" line="735"/>
<location filename="../mobilehotspotwidget.cpp" line="643"/> <location filename="../mobilehotspotwidget.cpp" line="743"/>
<source>hotspot already open</source> <source>hotspot already open</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -56,69 +56,87 @@
<context> <context>
<name>MobileHotspotWidget</name> <name>MobileHotspotWidget</name>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="61"/>
<source>ukui control center</source> <source>ukui control center</source>
<translation>ukui control center</translation> <translation type="vanished">ukui control center</translation>
</message>
<message>
<source>ukui control center desktop message</source>
<translation type="vanished">ukui control center desktop message</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="61"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="64"/> <location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>ukui control center desktop message</source> <source>Settings desktop message</source>
<translation>ukui control center desktop message</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="149"/> <location filename="../mobilehotspotwidget.cpp" line="156"/>
<source>wirless switch is close or no wireless device</source> <source>wirless switch is close or no wireless device</source>
<translation>wirless switch is close or no wireless device</translation> <translation>wirless switch is close or no wireless device</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="169"/> <location filename="../mobilehotspotwidget.cpp" line="177"/>
<source>hotpots name or device is invalid</source> <source>hotpots name or device is invalid</source>
<translation>hotpots name or device is invalid</translation> <translation>hotpots name or device is invalid</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="223"/> <location filename="../mobilehotspotwidget.cpp" line="231"/>
<source>Hotspot</source> <source>Hotspot</source>
<translation>Hotspot</translation> <translation>Hotspot</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="310"/> <location filename="../mobilehotspotwidget.cpp" line="340"/>
<location filename="../mobilehotspotwidget.cpp" line="605"/> <source>use </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="341"/>
<source> share network, will interrupt local wireless connection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="357"/>
<location filename="../mobilehotspotwidget.cpp" line="705"/>
<source>hotspot already close</source> <source>hotspot already close</source>
<translation>hotspot already close</translation> <translation>hotspot already close</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="436"/> <location filename="../mobilehotspotwidget.cpp" line="502"/>
<source>Open</source> <source>Open</source>
<translation>Open</translation> <translation>Open</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="457"/> <location filename="../mobilehotspotwidget.cpp" line="523"/>
<source>Wi-Fi Name</source> <source>Wi-Fi Name</source>
<translation>Wi-Fi Name</translation> <translation>Wi-Fi Name</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="478"/> <location filename="../mobilehotspotwidget.cpp" line="544"/>
<source>Password</source> <source>Password</source>
<translation>Password</translation> <translation>Password</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="490"/> <location filename="../mobilehotspotwidget.cpp" line="556"/>
<source>Contains at least 8 characters</source> <source>Contains at least 8 characters</source>
<translation>Contains at least 8 characters</translation> <translation>Contains at least 8 characters</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="519"/> <location filename="../mobilehotspotwidget.cpp" line="588"/>
<source>Frequency band</source> <source>Frequency band</source>
<translation>Frequency band</translation> <translation>Frequency band</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="545"/> <location filename="../mobilehotspotwidget.cpp" line="612"/>
<source>Net card</source> <source>Net card</source>
<translation>Net card</translation> <translation>Net card</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="635"/> <location filename="../mobilehotspotwidget.cpp" line="735"/>
<location filename="../mobilehotspotwidget.cpp" line="643"/> <location filename="../mobilehotspotwidget.cpp" line="743"/>
<source>hotspot already open</source> <source>hotspot already open</source>
<translation>hotspot already open</translation> <translation>hotspot already open</translation>
</message> </message>

View File

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="mn">
<context>
<name>BlacklistItem</name>
<message>
<location filename="../blacklistitem.cpp" line="50"/>
<source>Remove</source>
<translation> </translation>
</message>
</context>
<context>
<name>BlacklistPage</name>
<message>
<location filename="../blacklistpage.cpp" line="47"/>
<source>Blacklist</source>
<translation> </translation>
</message>
</context>
<context>
<name>ConnectDevListItem</name>
<message>
<location filename="../connectdevlistitem.cpp" line="50"/>
<source>drag into blacklist</source>
<translation> </translation>
</message>
</context>
<context>
<name>ConnectdevPage</name>
<message>
<location filename="../connectdevpage.cpp" line="48"/>
<source>Connect device</source>
<translation> </translation>
</message>
</context>
<context>
<name>MobileHotspot</name>
<message>
<location filename="../mobilehotspot.cpp" line="35"/>
<source>MobileHotspot</source>
<translation> </translation>
</message>
<message>
<location filename="../mobilehotspot.cpp" line="101"/>
<source>mobilehotspot</source>
<translation> </translation>
<extra-contents_path>/mobilehotspot/mobilehotspot</extra-contents_path>
</message>
<message>
<location filename="../mobilehotspot.cpp" line="103"/>
<source>mobilehotspot open</source>
<translation> </translation>
<extra-contents_path>/mobilehotspot/mobilehotspot open</extra-contents_path>
</message>
</context>
<context>
<name>MobileHotspotWidget</name>
<message>
<source>ukui control center</source>
<translation type="vanished"> </translation>
</message>
<message>
<source>ukui control center desktop message</source>
<translation type="vanished"> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="156"/>
<source>wirless switch is close or no wireless device</source>
<translation> </translation>
</message>
<message>
<source>start to close hotspot</source>
<translation type="vanished"> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="177"/>
<source>hotpots name or device is invalid</source>
<translation> </translation>
</message>
<message>
<source>can not create hotspot with password length less than eight!</source>
<translation type="vanished"></translation>
</message>
<message>
<source>start to open hotspot </source>
<translation type="vanished"> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="556"/>
<source>Contains at least 8 characters</source>
<translation> 8 </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="231"/>
<source>Hotspot</source>
<translation> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="61"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>Settings desktop message</source>
<translation> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="340"/>
<source>use </source>
<translation> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="341"/>
<source> share network, will interrupt local wireless connection</source>
<translation> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="357"/>
<location filename="../mobilehotspotwidget.cpp" line="705"/>
<source>hotspot already close</source>
<translation> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="502"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="523"/>
<source>Wi-Fi Name</source>
<translation>Wi-Fi </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="544"/>
<source>Password</source>
<translation> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="588"/>
<source>Frequency band</source>
<translation> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="612"/>
<source>Net card</source>
<translation> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="735"/>
<location filename="../mobilehotspotwidget.cpp" line="743"/>
<source>hotspot already open</source>
<translation> </translation>
</message>
</context>
</TS>

View File

@ -1 +0,0 @@
<クd<>箆!ソ`。スン

View File

@ -56,69 +56,79 @@
<context> <context>
<name>MobileHotspotWidget</name> <name>MobileHotspotWidget</name>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="61"/> <location filename="../mobilehotspotwidget.cpp" line="156"/>
<source>ukui control center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>ukui control center desktop message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="149"/>
<source>wirless switch is close or no wireless device</source> <source>wirless switch is close or no wireless device</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="169"/> <location filename="../mobilehotspotwidget.cpp" line="177"/>
<source>hotpots name or device is invalid</source> <source>hotpots name or device is invalid</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="490"/> <location filename="../mobilehotspotwidget.cpp" line="556"/>
<source>Contains at least 8 characters</source> <source>Contains at least 8 characters</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="223"/> <location filename="../mobilehotspotwidget.cpp" line="231"/>
<source>Hotspot</source> <source>Hotspot</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="310"/> <location filename="../mobilehotspotwidget.cpp" line="61"/>
<location filename="../mobilehotspotwidget.cpp" line="605"/> <source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>Settings desktop message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="340"/>
<source>use </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="341"/>
<source> share network, will interrupt local wireless connection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="357"/>
<location filename="../mobilehotspotwidget.cpp" line="705"/>
<source>hotspot already close</source> <source>hotspot already close</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="436"/> <location filename="../mobilehotspotwidget.cpp" line="502"/>
<source>Open</source> <source>Open</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="457"/> <location filename="../mobilehotspotwidget.cpp" line="523"/>
<source>Wi-Fi Name</source> <source>Wi-Fi Name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="478"/> <location filename="../mobilehotspotwidget.cpp" line="544"/>
<source>Password</source> <source>Password</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="519"/> <location filename="../mobilehotspotwidget.cpp" line="588"/>
<source>Frequency band</source> <source>Frequency band</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="545"/> <location filename="../mobilehotspotwidget.cpp" line="612"/>
<source>Net card</source> <source>Net card</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="635"/> <location filename="../mobilehotspotwidget.cpp" line="735"/>
<location filename="../mobilehotspotwidget.cpp" line="643"/> <location filename="../mobilehotspotwidget.cpp" line="743"/>
<source>hotspot already open</source> <source>hotspot already open</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -56,17 +56,15 @@
<context> <context>
<name>MobileHotspotWidget</name> <name>MobileHotspotWidget</name>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="61"/>
<source>ukui control center</source> <source>ukui control center</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>ukui control center desktop message</source> <source>ukui control center desktop message</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="149"/> <location filename="../mobilehotspotwidget.cpp" line="156"/>
<source>wirless switch is close or no wireless device</source> <source>wirless switch is close or no wireless device</source>
<translation>线线</translation> <translation>线线</translation>
</message> </message>
@ -75,7 +73,7 @@
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="169"/> <location filename="../mobilehotspotwidget.cpp" line="177"/>
<source>hotpots name or device is invalid</source> <source>hotpots name or device is invalid</source>
<translation></translation> <translation></translation>
</message> </message>
@ -88,49 +86,69 @@
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="490"/> <location filename="../mobilehotspotwidget.cpp" line="556"/>
<source>Contains at least 8 characters</source> <source>Contains at least 8 characters</source>
<translation>8</translation> <translation>8</translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="223"/> <location filename="../mobilehotspotwidget.cpp" line="231"/>
<source>Hotspot</source> <source>Hotspot</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="310"/> <location filename="../mobilehotspotwidget.cpp" line="61"/>
<location filename="../mobilehotspotwidget.cpp" line="605"/> <source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>Settings desktop message</source>
<translation> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="340"/>
<source>use </source>
<translation>使 </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="341"/>
<source> share network, will interrupt local wireless connection</source>
<translation> 线</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="357"/>
<location filename="../mobilehotspotwidget.cpp" line="705"/>
<source>hotspot already close</source> <source>hotspot already close</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="436"/> <location filename="../mobilehotspotwidget.cpp" line="502"/>
<source>Open</source> <source>Open</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="457"/> <location filename="../mobilehotspotwidget.cpp" line="523"/>
<source>Wi-Fi Name</source> <source>Wi-Fi Name</source>
<translation>Wi-Fi名称</translation> <translation>Wi-Fi </translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="478"/> <location filename="../mobilehotspotwidget.cpp" line="544"/>
<source>Password</source> <source>Password</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="519"/> <location filename="../mobilehotspotwidget.cpp" line="588"/>
<source>Frequency band</source> <source>Frequency band</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="545"/> <location filename="../mobilehotspotwidget.cpp" line="612"/>
<source>Net card</source> <source>Net card</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../mobilehotspotwidget.cpp" line="635"/> <location filename="../mobilehotspotwidget.cpp" line="735"/>
<location filename="../mobilehotspotwidget.cpp" line="643"/> <location filename="../mobilehotspotwidget.cpp" line="743"/>
<source>hotspot already open</source> <source>hotspot already open</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -87,8 +87,6 @@ LanItem::~LanItem()
} }
void LanItem::updateIcon() void LanItem::updateIcon()
{ {
if (currentIconIndex > 6) { if (currentIconIndex > 6) {
@ -145,17 +143,16 @@ void LanItem::onDeletetTriggered()
void LanItem::paintEvent(QPaintEvent *event) void LanItem::paintEvent(QPaintEvent *event)
{ {
// QPalette pal = qApp->palette();
QPainter painter(this); QPainter painter(this);
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿 painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
painter.setPen(Qt::NoPen); painter.setPen(Qt::NoPen);
painter.setBrush(this->palette().base().color()); painter.setBrush(this->palette().base().color());
// QColor color = pal.color(QPalette::Button); QPalette pal = qApp->palette();
// color.setAlphaF(0.5); QColor color = pal.color(QPalette::Button);
// pal.setColor(QPalette::Button, color); color.setAlphaF(0.5);
// this->setPalette(pal); pal.setColor(QPalette::Button, color);
this->setPalette(pal);
QRect rect = this->rect(); QRect rect = this->rect();

View File

@ -64,10 +64,10 @@ void NetConnect::showDesktopNotify(const QString &message)
"org.freedesktop.Notifications", "org.freedesktop.Notifications",
QDBusConnection::sessionBus()); QDBusConnection::sessionBus());
QList<QVariant> args; QList<QVariant> args;
args<<(tr("ukui control center")) args<<(tr("Settings"))
<<((unsigned int) 0) <<((unsigned int) 0)
<<QString("gnome-dev-ethernet") <<QString("gnome-dev-ethernet")
<<tr("ukui control center desktop message") //显示的是什么类型的信息 <<tr("Settings desktop message") //显示的是什么类型的信息
<<message //显示的具体信息 <<message //显示的具体信息
<<QStringList() <<QStringList()
<<QVariantMap() <<QVariantMap()
@ -171,6 +171,7 @@ bool NetConnect::eventFilter(QObject *w, QEvent *e) {
if (!wiredSwitch->isCheckable()) { if (!wiredSwitch->isCheckable()) {
showDesktopNotify(tr("No ethernet device avaliable")); showDesktopNotify(tr("No ethernet device avaliable"));
} else { } else {
UkccCommon::buriedSettings(QString("netconnect"), QString("Open"), QString("settings"),wiredSwitch->isChecked()?"false":"true");
if (m_interface != nullptr && m_interface->isValid()) { if (m_interface != nullptr && m_interface->isValid()) {
m_interface->call(QStringLiteral("setWiredSwitchEnable"), !wiredSwitch->isChecked()); m_interface->call(QStringLiteral("setWiredSwitchEnable"), !wiredSwitch->isChecked());
} }
@ -240,6 +241,7 @@ void NetConnect::initComponent() {
connect(ui->detailBtn, &QPushButton::clicked, this, [=](bool checked) { connect(ui->detailBtn, &QPushButton::clicked, this, [=](bool checked) {
Q_UNUSED(checked) Q_UNUSED(checked)
UkccCommon::buriedSettings(QString("netconnect"), QString("Advanced settings"), QString("clicked"));
runExternalApp(); runExternalApp();
}); });
} }
@ -466,6 +468,7 @@ void NetConnect::addLanItem(ItemFrame *frame, QString devName, QStringList infoL
if (m_interface == nullptr || !m_interface->isValid()) { if (m_interface == nullptr || !m_interface->isValid()) {
return; return;
} }
UkccCommon::buriedSettings(QString("netconnect"), QString("info"), QString("clicked"));
qDebug() << "[NetConnect]call showPropertyWidget" << __LINE__; qDebug() << "[NetConnect]call showPropertyWidget" << __LINE__;
m_interface->call(QStringLiteral("showPropertyWidget"), devName, infoList.at(1)); m_interface->call(QStringLiteral("showPropertyWidget"), devName, infoList.at(1));
qDebug() << "[NetConnect]call showPropertyWidget respond" << __LINE__; qDebug() << "[NetConnect]call showPropertyWidget respond" << __LINE__;
@ -539,6 +542,7 @@ void NetConnect::addDeviceFrame(QString devName)
qDebug() << "[NetConnect]deviceFrameMap insert" << devName; qDebug() << "[NetConnect]deviceFrameMap insert" << devName;
connect(itemFrame->deviceFrame, &DeviceFrame::deviceSwitchClicked ,this, [=] (bool checked) { connect(itemFrame->deviceFrame, &DeviceFrame::deviceSwitchClicked ,this, [=] (bool checked) {
UkccCommon::buriedSettings(QString("netconnect"), "device open", QString("settings"), checked?"true":"fasle");
qDebug() << "[NetConnect]call setDeviceEnable" << devName << checked << __LINE__; qDebug() << "[NetConnect]call setDeviceEnable" << devName << checked << __LINE__;
m_interface->call(QStringLiteral("setDeviceEnable"), devName, checked); m_interface->call(QStringLiteral("setDeviceEnable"), devName, checked);
qDebug() << "[NetConnect]call setDeviceEnable Respond" << __LINE__; qDebug() << "[NetConnect]call setDeviceEnable Respond" << __LINE__;
@ -563,6 +567,7 @@ void NetConnect::addDeviceFrame(QString devName)
}); });
connect(itemFrame->addLanWidget, &AddNetBtn::clicked, this, [=](){ connect(itemFrame->addLanWidget, &AddNetBtn::clicked, this, [=](){
UkccCommon::buriedSettings(pluginName, "Add net", QString("clicked"));
if (m_interface != nullptr && m_interface->isValid()) { if (m_interface != nullptr && m_interface->isValid()) {
qDebug() << "[NetConnect]call showCreateWiredConnectWidget" << devName << __LINE__; qDebug() << "[NetConnect]call showCreateWiredConnectWidget" << devName << __LINE__;
m_interface->call(QStringLiteral("showCreateWiredConnectWidget"), devName); m_interface->call(QStringLiteral("showCreateWiredConnectWidget"), devName);
@ -763,6 +768,7 @@ void NetConnect::addOneLanFrame(ItemFrame *frame, QString deviceName, QStringLis
if (m_interface == nullptr || !m_interface->isValid()) { if (m_interface == nullptr || !m_interface->isValid()) {
return; return;
} }
UkccCommon::buriedSettings(QString("netconnect"), QString("info"), QString("clicked"));
qDebug() << "[NetConnect]call showPropertyWidget" << deviceName << connUuid << __LINE__; qDebug() << "[NetConnect]call showPropertyWidget" << deviceName << connUuid << __LINE__;
m_interface->call(QStringLiteral("showPropertyWidget"), deviceName, connUuid); m_interface->call(QStringLiteral("showPropertyWidget"), deviceName, connUuid);
qDebug() << "[NetConnect]call showPropertyWidget respond" << __LINE__; qDebug() << "[NetConnect]call showPropertyWidget respond" << __LINE__;
@ -906,7 +912,6 @@ void NetConnect::itemActiveConnectionStatusChanged(LanItem *item, int status)
item->statusLabel->setText(tr("not connected")); item->statusLabel->setText(tr("not connected"));
} }
item->setConnectActionText(item->isAcitve); item->setConnectActionText(item->isAcitve);
// QIcon searchIcon = QIcon::fromTheme(iconPath); // QIcon searchIcon = QIcon::fromTheme(iconPath);
// item->iconLabel->setPixmap(searchIcon.pixmap(searchIcon.actualSize(QSize(24, 24)))); // item->iconLabel->setPixmap(searchIcon.pixmap(searchIcon.actualSize(QSize(24, 24))));
} }

View File

@ -54,8 +54,10 @@
#include "itemframe.h" #include "itemframe.h"
#include "kwidget.h" #include "kwidget.h"
#include "kswitchbutton.h" #include "kswitchbutton.h"
#include "ukcccommon.h"
using namespace kdk; using namespace kdk;
using namespace ukcc;
enum { enum {
DISCONNECTED, DISCONNECTED,
@ -100,7 +102,6 @@ private:
int getInsertPos(QString connName, QString deviceName); int getInsertPos(QString connName, QString deviceName);
void deleteOneLan(QString ssid, int type); void deleteOneLan(QString ssid, int type);
void activeConnect(QString ssid, QString deviceName, int type); void activeConnect(QString ssid, QString deviceName, int type);
void deActiveConnect(QString ssid, QString deviceName, int type); void deActiveConnect(QString ssid, QString deviceName, int type);

View File

@ -7,6 +7,11 @@ include(../component/addbtn.pri)
TARGET = $$qtLibraryTarget(netconnect) TARGET = $$qtLibraryTarget(netconnect)
DESTDIR = ../.. DESTDIR = ../..
CONFIG(release, debug|release) {
!system($$PWD/translate_generation.sh): error("Failed to generate translation")
}
target.path = $$[QT_INSTALL_LIBS]/ukui-control-center target.path = $$[QT_INSTALL_LIBS]/ukui-control-center
trans.files = translations/* trans.files = translations/*
trans.path = /usr/share/kylin-nm/netconnect/ trans.path = /usr/share/kylin-nm/netconnect/
@ -52,4 +57,5 @@ TRANSLATIONS += \
translations/tr.ts \ translations/tr.ts \
translations/bo.ts \ translations/bo.ts \
translations/bo_CN.ts \ translations/bo_CN.ts \
translations/en_US.ts translations/en_US.ts \
translations/mn.ts

View File

@ -0,0 +1,15 @@
#!/bin/bash
ts_list=(`ls translations/*.ts`)
source /etc/os-release
version=(`echo $ID`)
for ts in "${ts_list[@]}"
do
printf "\nprocess ${ts}\n"
if [ "$version" == "fedora" ] || [ "$version" == "opensuse-leap" ] || [ "$version" == "opensuse-tumbleweed" ];then
lrelease-qt5 "${ts}"
else
lrelease "${ts}"
fi
done

View File

@ -14,26 +14,6 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>LanItem</name>
<message>
<location filename="../lanitem.cpp" line="57"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lanitem.cpp" line="120"/>
<location filename="../lanitem.cpp" line="133"/>
<source>Disconnect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lanitem.cpp" line="122"/>
<location filename="../lanitem.cpp" line="131"/>
<source>Connect</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>NetConnect</name> <name>NetConnect</name>
<message> <message>
@ -43,54 +23,47 @@
</message> </message>
<message> <message>
<location filename="../netconnect.ui" line="112"/> <location filename="../netconnect.ui" line="112"/>
<location filename="../netconnect.cpp" line="158"/> <location filename="../netconnect.cpp" line="155"/>
<source>open</source> <source>open</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/netconnect/open</extra-contents_path> <extra-contents_path>/netconnect/open</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../netconnect.ui" line="198"/> <location filename="../netconnect.ui" line="198"/>
<location filename="../netconnect.cpp" line="155"/> <location filename="../netconnect.cpp" line="152"/>
<source>Advanced settings</source> <source>Advanced settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path> <extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path>
</message> </message>
<message>
<location filename="../netconnect.cpp" line="64"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="../netconnect.cpp" line="67"/> <location filename="../netconnect.cpp" line="67"/>
<source>ukui control center</source> <source>Settings desktop message</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="70"/> <location filename="../netconnect.cpp" line="81"/>
<source>ukui control center desktop message</source> <location filename="../netconnect.cpp" line="153"/>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="84"/>
<location filename="../netconnect.cpp" line="156"/>
<source>LAN</source> <source>LAN</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="172"/> <location filename="../netconnect.cpp" line="169"/>
<source>No ethernet device avaliable</source> <source>No ethernet device avaliable</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="450"/> <location filename="../netconnect.cpp" line="437"/>
<location filename="../netconnect.cpp" line="896"/> <location filename="../netconnect.cpp" line="861"/>
<source>connected</source> <source>connected</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="452"/> <location filename="../netconnect.cpp" line="504"/>
<location filename="../netconnect.cpp" line="749"/>
<location filename="../netconnect.cpp" line="906"/>
<source>not connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="528"/>
<source>card</source> <source>card</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -14,26 +14,6 @@
<translation></translation> <translation></translation>
</message> </message>
</context> </context>
<context>
<name>LanItem</name>
<message>
<location filename="../lanitem.cpp" line="57"/>
<source>Delete</source>
<translation></translation>
</message>
<message>
<location filename="../lanitem.cpp" line="120"/>
<location filename="../lanitem.cpp" line="133"/>
<source>Disconnect</source>
<translation></translation>
</message>
<message>
<location filename="../lanitem.cpp" line="122"/>
<location filename="../lanitem.cpp" line="131"/>
<source>Connect</source>
<translation></translation>
</message>
</context>
<context> <context>
<name>NetConnect</name> <name>NetConnect</name>
<message> <message>
@ -43,58 +23,59 @@
</message> </message>
<message> <message>
<location filename="../netconnect.ui" line="112"/> <location filename="../netconnect.ui" line="112"/>
<location filename="../netconnect.cpp" line="158"/> <location filename="../netconnect.cpp" line="155"/>
<source>open</source> <source>open</source>
<translation></translation> <translation></translation>
<extra-contents_path>/netconnect/open</extra-contents_path> <extra-contents_path>/netconnect/open</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../netconnect.ui" line="198"/> <location filename="../netconnect.ui" line="198"/>
<location filename="../netconnect.cpp" line="155"/> <location filename="../netconnect.cpp" line="152"/>
<source>Advanced settings</source> <source>Advanced settings</source>
<translation></translation> <translation></translation>
<extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path> <extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="67"/>
<source>ukui control center</source> <source>ukui control center</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="70"/>
<source>ukui control center desktop message</source> <source>ukui control center desktop message</source>
<translation>ukui </translation> <translation type="vanished">ukui </translation>
</message> </message>
<message> <message>
<source>WiredConnect</source> <source>WiredConnect</source>
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="84"/> <location filename="../netconnect.cpp" line="64"/>
<location filename="../netconnect.cpp" line="156"/> <source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="67"/>
<source>Settings desktop message</source>
<translation> </translation>
</message>
<message>
<location filename="../netconnect.cpp" line="81"/>
<location filename="../netconnect.cpp" line="153"/>
<source>LAN</source> <source>LAN</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="172"/> <location filename="../netconnect.cpp" line="169"/>
<source>No ethernet device avaliable</source> <source>No ethernet device avaliable</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="450"/> <location filename="../netconnect.cpp" line="437"/>
<location filename="../netconnect.cpp" line="896"/> <location filename="../netconnect.cpp" line="861"/>
<source>connected</source> <source>connected</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="452"/> <location filename="../netconnect.cpp" line="504"/>
<location filename="../netconnect.cpp" line="749"/>
<location filename="../netconnect.cpp" line="906"/>
<source>not connected</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="528"/>
<source>card</source> <source>card</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -14,26 +14,6 @@
<translation>Add WiredNetork</translation> <translation>Add WiredNetork</translation>
</message> </message>
</context> </context>
<context>
<name>LanItem</name>
<message>
<location filename="../lanitem.cpp" line="57"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lanitem.cpp" line="120"/>
<location filename="../lanitem.cpp" line="133"/>
<source>Disconnect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lanitem.cpp" line="122"/>
<location filename="../lanitem.cpp" line="131"/>
<source>Connect</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>NetConnect</name> <name>NetConnect</name>
<message> <message>
@ -43,54 +23,55 @@
</message> </message>
<message> <message>
<location filename="../netconnect.ui" line="112"/> <location filename="../netconnect.ui" line="112"/>
<location filename="../netconnect.cpp" line="158"/> <location filename="../netconnect.cpp" line="155"/>
<source>open</source> <source>open</source>
<translation>open</translation> <translation>open</translation>
<extra-contents_path>/netconnect/open</extra-contents_path> <extra-contents_path>/netconnect/open</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../netconnect.ui" line="198"/> <location filename="../netconnect.ui" line="198"/>
<location filename="../netconnect.cpp" line="155"/> <location filename="../netconnect.cpp" line="152"/>
<source>Advanced settings</source> <source>Advanced settings</source>
<translation>Advanced settings</translation> <translation>Advanced settings</translation>
<extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path> <extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="67"/>
<source>ukui control center</source> <source>ukui control center</source>
<translation>ukui control center</translation> <translation type="vanished">ukui control center</translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="70"/>
<source>ukui control center desktop message</source> <source>ukui control center desktop message</source>
<translation>ukui control center desktop message</translation> <translation type="vanished">ukui control center desktop message</translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="84"/> <location filename="../netconnect.cpp" line="64"/>
<location filename="../netconnect.cpp" line="156"/> <source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="67"/>
<source>Settings desktop message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="81"/>
<location filename="../netconnect.cpp" line="153"/>
<source>LAN</source> <source>LAN</source>
<translation>LAN</translation> <translation>LAN</translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="172"/> <location filename="../netconnect.cpp" line="169"/>
<source>No ethernet device avaliable</source> <source>No ethernet device avaliable</source>
<translation>No ethernet device avaliable</translation> <translation>No ethernet device avaliable</translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="450"/> <location filename="../netconnect.cpp" line="437"/>
<location filename="../netconnect.cpp" line="896"/> <location filename="../netconnect.cpp" line="861"/>
<source>connected</source> <source>connected</source>
<translation>connected</translation> <translation>connected</translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="452"/> <location filename="../netconnect.cpp" line="504"/>
<location filename="../netconnect.cpp" line="749"/>
<location filename="../netconnect.cpp" line="906"/>
<source>not connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="528"/>
<source>card</source> <source>card</source>
<translation>card</translation> <translation>card</translation>
</message> </message>

View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="mn">
<context>
<name>AddNetBtn</name>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation> </translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation> </translation>
</message>
</context>
<context>
<name>NetConnect</name>
<message>
<location filename="../netconnect.ui" line="50"/>
<source>Wired Network</source>
<translation> </translation>
</message>
<message>
<location filename="../netconnect.ui" line="112"/>
<location filename="../netconnect.cpp" line="155"/>
<source>open</source>
<translation></translation>
<extra-contents_path>/netconnect/open</extra-contents_path>
</message>
<message>
<location filename="../netconnect.ui" line="198"/>
<location filename="../netconnect.cpp" line="152"/>
<source>Advanced settings</source>
<translation> </translation>
<extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path>
</message>
<message>
<source>ukui control center</source>
<translation type="vanished"> </translation>
</message>
<message>
<source>ukui control center desktop message</source>
<translation type="vanished"> </translation>
</message>
<message>
<source>WiredConnect</source>
<translation type="vanished"> </translation>
</message>
<message>
<location filename="../netconnect.cpp" line="64"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="67"/>
<source>Settings desktop message</source>
<translation> </translation>
</message>
<message>
<location filename="../netconnect.cpp" line="81"/>
<location filename="../netconnect.cpp" line="153"/>
<source>LAN</source>
<translation> </translation>
</message>
<message>
<location filename="../netconnect.cpp" line="169"/>
<source>No ethernet device avaliable</source>
<translation> </translation>
</message>
<message>
<location filename="../netconnect.cpp" line="437"/>
<location filename="../netconnect.cpp" line="861"/>
<source>connected</source>
<translation> </translation>
</message>
<message>
<location filename="../netconnect.cpp" line="504"/>
<source>card</source>
<translation> </translation>
</message>
</context>
</TS>

View File

@ -14,26 +14,6 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>LanItem</name>
<message>
<location filename="../lanitem.cpp" line="57"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lanitem.cpp" line="120"/>
<location filename="../lanitem.cpp" line="133"/>
<source>Disconnect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lanitem.cpp" line="122"/>
<location filename="../lanitem.cpp" line="131"/>
<source>Connect</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>NetConnect</name> <name>NetConnect</name>
<message> <message>
@ -43,54 +23,47 @@
</message> </message>
<message> <message>
<location filename="../netconnect.ui" line="112"/> <location filename="../netconnect.ui" line="112"/>
<location filename="../netconnect.cpp" line="158"/> <location filename="../netconnect.cpp" line="155"/>
<source>open</source> <source>open</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/netconnect/open</extra-contents_path> <extra-contents_path>/netconnect/open</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../netconnect.ui" line="198"/> <location filename="../netconnect.ui" line="198"/>
<location filename="../netconnect.cpp" line="155"/> <location filename="../netconnect.cpp" line="152"/>
<source>Advanced settings</source> <source>Advanced settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path> <extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path>
</message> </message>
<message>
<location filename="../netconnect.cpp" line="64"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="../netconnect.cpp" line="67"/> <location filename="../netconnect.cpp" line="67"/>
<source>ukui control center</source> <source>Settings desktop message</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="70"/> <location filename="../netconnect.cpp" line="81"/>
<source>ukui control center desktop message</source> <location filename="../netconnect.cpp" line="153"/>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="84"/>
<location filename="../netconnect.cpp" line="156"/>
<source>LAN</source> <source>LAN</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="172"/> <location filename="../netconnect.cpp" line="169"/>
<source>No ethernet device avaliable</source> <source>No ethernet device avaliable</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="450"/> <location filename="../netconnect.cpp" line="437"/>
<location filename="../netconnect.cpp" line="896"/> <location filename="../netconnect.cpp" line="861"/>
<source>connected</source> <source>connected</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="452"/> <location filename="../netconnect.cpp" line="504"/>
<location filename="../netconnect.cpp" line="749"/>
<location filename="../netconnect.cpp" line="906"/>
<source>not connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="528"/>
<source>card</source> <source>card</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -14,26 +14,6 @@
<translation>线</translation> <translation>线</translation>
</message> </message>
</context> </context>
<context>
<name>LanItem</name>
<message>
<location filename="../lanitem.cpp" line="57"/>
<source>Delete</source>
<translation></translation>
</message>
<message>
<location filename="../lanitem.cpp" line="120"/>
<location filename="../lanitem.cpp" line="133"/>
<source>Disconnect</source>
<translation></translation>
</message>
<message>
<location filename="../lanitem.cpp" line="122"/>
<location filename="../lanitem.cpp" line="131"/>
<source>Connect</source>
<translation></translation>
</message>
</context>
<context> <context>
<name>NetConnect</name> <name>NetConnect</name>
<message> <message>
@ -43,58 +23,59 @@
</message> </message>
<message> <message>
<location filename="../netconnect.ui" line="112"/> <location filename="../netconnect.ui" line="112"/>
<location filename="../netconnect.cpp" line="158"/> <location filename="../netconnect.cpp" line="155"/>
<source>open</source> <source>open</source>
<translation></translation> <translation></translation>
<extra-contents_path>/netconnect/open</extra-contents_path> <extra-contents_path>/netconnect/open</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../netconnect.ui" line="198"/> <location filename="../netconnect.ui" line="198"/>
<location filename="../netconnect.cpp" line="155"/> <location filename="../netconnect.cpp" line="152"/>
<source>Advanced settings</source> <source>Advanced settings</source>
<translation></translation> <translation></translation>
<extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path> <extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="67"/>
<source>ukui control center</source> <source>ukui control center</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="70"/>
<source>ukui control center desktop message</source> <source>ukui control center desktop message</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<source>WiredConnect</source> <source>WiredConnect</source>
<translation type="vanished">线</translation> <translation type="vanished">线</translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="84"/> <location filename="../netconnect.cpp" line="64"/>
<location filename="../netconnect.cpp" line="156"/> <source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="67"/>
<source>Settings desktop message</source>
<translation> </translation>
</message>
<message>
<location filename="../netconnect.cpp" line="81"/>
<location filename="../netconnect.cpp" line="153"/>
<source>LAN</source> <source>LAN</source>
<translation>线</translation> <translation>线</translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="172"/> <location filename="../netconnect.cpp" line="169"/>
<source>No ethernet device avaliable</source> <source>No ethernet device avaliable</source>
<translation>线</translation> <translation>线</translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="450"/> <location filename="../netconnect.cpp" line="437"/>
<location filename="../netconnect.cpp" line="896"/> <location filename="../netconnect.cpp" line="861"/>
<source>connected</source> <source>connected</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../netconnect.cpp" line="452"/> <location filename="../netconnect.cpp" line="504"/>
<location filename="../netconnect.cpp" line="749"/>
<location filename="../netconnect.cpp" line="906"/>
<source>not connected</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="528"/>
<source>card</source> <source>card</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -43,12 +43,11 @@ void AppListWidget::setAppChecked(bool flag)
/** /**
* @brief AppListWidget::setAppIcon * @brief AppListWidget::setAppIcon
* @param icon * @param icon
*/ */
void AppListWidget::setAppIcon(const QPixmap &icon) void AppListWidget::setAppIcon(const QIcon &icon)
{ {
m_iconLabel->setAlignment(Qt::AlignCenter); m_iconBtn->setIcon(icon);
m_iconLabel->setPixmap(icon);
} }
/** /**
@ -119,12 +118,19 @@ void AppListWidget::initUI()
mainLayout->setSpacing(8); mainLayout->setSpacing(8);
m_checkBox = new QCheckBox(this); m_checkBox = new QCheckBox(this);
m_checkBox->setAttribute(Qt::WA_TransparentForMouseEvents, true); //m_checkBox不响应鼠标事件,将其传递给父窗口 m_checkBox->setAttribute(Qt::WA_TransparentForMouseEvents, true); //m_checkBox不响应鼠标事件,将其传递给父窗口
m_iconLabel = new QLabel(this);
m_iconLabel->setFixedSize(24, 24); m_iconBtn = new QToolButton(this);
m_iconBtn->setToolButtonStyle(Qt::ToolButtonStyle::ToolButtonIconOnly);
m_iconBtn->setAttribute(Qt::WA_TranslucentBackground, true); //透明
m_iconBtn->setAttribute(Qt::WA_TransparentForMouseEvents, true);
m_iconBtn->setAutoRaise(true);
m_iconBtn->setFixedSize(24, 24);
m_iconBtn->setIconSize(QSize(24, 24));
m_nameLabel = new QLabel(this); m_nameLabel = new QLabel(this);
mainLayout->addWidget(m_checkBox); mainLayout->addWidget(m_checkBox);
mainLayout->addWidget(m_iconLabel); mainLayout->addWidget(m_iconBtn);
mainLayout->addWidget(m_nameLabel); mainLayout->addWidget(m_nameLabel);
mainLayout->addStretch(); mainLayout->addStretch();
} }

View File

@ -28,6 +28,7 @@
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QDBusInterface> #include <QDBusInterface>
#include <QDBusReply> #include <QDBusReply>
#include <QToolButton>
class AppListWidget : public QWidget class AppListWidget : public QWidget
{ {
@ -37,7 +38,7 @@ public:
~AppListWidget(); ~AppListWidget();
void setAppChecked(bool flag); void setAppChecked(bool flag);
void setAppIcon(const QPixmap &icon); void setAppIcon(const QIcon &icon);
void setAppName(const QString &text); void setAppName(const QString &text);
void onAppCheckStateChanged(); void onAppCheckStateChanged();
void AddAppProxyConfig(); void AddAppProxyConfig();
@ -51,7 +52,7 @@ private:
void initDbus(); void initDbus();
QCheckBox *m_checkBox = nullptr; QCheckBox *m_checkBox = nullptr;
QLabel *m_iconLabel = nullptr; QToolButton *m_iconBtn = nullptr;
QLabel *m_nameLabel = nullptr; QLabel *m_nameLabel = nullptr;
QString m_path = nullptr; QString m_path = nullptr;
QDBusInterface *m_dbusInterface = nullptr; QDBusInterface *m_dbusInterface = nullptr;

View File

@ -21,7 +21,7 @@ AptProxyDialog::~AptProxyDialog()
void AptProxyDialog::initUi() void AptProxyDialog::initUi()
{ {
setWindowTitle(tr("Set Apt Proxy")); setWindowTitle(tr("Set APT Proxy"));
this->setFixedSize(480, 200); this->setFixedSize(480, 200);
QVBoxLayout *mAptProxyLyt = new QVBoxLayout(this); QVBoxLayout *mAptProxyLyt = new QVBoxLayout(this);

View File

@ -127,6 +127,7 @@ QWidget *Proxy::pluginUi() {
} else { } else {
qCritical() << "Xml needed by Proxy is not installed"; qCritical() << "Xml needed by Proxy is not installed";
} }
setUkccProxySettings();
} }
return pluginWidget; return pluginWidget;
} }
@ -428,14 +429,21 @@ void Proxy::initUi(QWidget *widget)
AptLayout->addWidget(line_7); AptLayout->addWidget(line_7);
AptLayout->addWidget(mAPTFrame_2); AptLayout->addWidget(mAPTFrame_2);
m_sysSpacerFrame = new QFrame(widget);
m_sysSpacerFrame->setFixedHeight(32);
m_appListSpacerFrame = new QFrame(widget);
m_appListSpacerFrame->setFixedHeight(4);
m_appSpacerFrame = new QFrame(widget);;
m_appSpacerFrame->setFixedHeight(32);;
mverticalLayout->addWidget(mTitleLabel); mverticalLayout->addWidget(mTitleLabel);
mverticalLayout->addWidget(mProxyFrame); mverticalLayout->addWidget(mProxyFrame);
mverticalLayout->addSpacing(32); mverticalLayout->addWidget(m_sysSpacerFrame);
mverticalLayout->addWidget(m_appProxyLabel); mverticalLayout->addWidget(m_appProxyLabel);
mverticalLayout->addWidget(m_appProxyFrame); mverticalLayout->addWidget(m_appProxyFrame);
mverticalLayout->addSpacing(4); mverticalLayout->addWidget(m_appListSpacerFrame);
mverticalLayout->addWidget(m_appListFrame); mverticalLayout->addWidget(m_appListFrame);
mverticalLayout->addSpacing(32); mverticalLayout->addWidget(m_appSpacerFrame);
mverticalLayout->addWidget(mAptProxyLabel); mverticalLayout->addWidget(mAptProxyLabel);
mverticalLayout->addWidget(mAPTFrame); mverticalLayout->addWidget(mAPTFrame);
mverticalLayout->addStretch(); mverticalLayout->addStretch();
@ -464,8 +472,11 @@ void Proxy::retranslateUi()
mSOCKSPortLabel->setText(tr("Port")); mSOCKSPortLabel->setText(tr("Port"));
mIgnoreLabel->setText(tr("List of ignored hosts. more than one entry, please separate with english semicolon(;)")); mIgnoreLabel->setText(tr("List of ignored hosts. more than one entry, please separate with english semicolon(;)"));
//~ contents_path /Proxy/Apt Proxy //~ contents_path /Proxy/App Proxy
mAptProxyLabel->setText(tr("Apt Proxy")); tr("App Proxy");
//~ contents_path /Proxy/APT Proxy
mAptProxyLabel->setText(tr("APT Proxy"));
mAptLabel->setText(tr("Open")); mAptLabel->setText(tr("Open"));
mAPTHostLabel_1->setText(tr("Server Address : ")); mAPTHostLabel_1->setText(tr("Server Address : "));
mAPTPortLabel_1->setText(tr("Port : ")); mAPTPortLabel_1->setText(tr("Port : "));
@ -517,6 +528,7 @@ void Proxy::setupComponent(){
void Proxy::setupConnect(){ void Proxy::setupConnect(){
connect(mEnableBtn, &KSwitchButton::stateChanged, this ,[=](bool checked) { connect(mEnableBtn, &KSwitchButton::stateChanged, this ,[=](bool checked) {
UkccCommon::buriedSettings(QString("Proxy"), QString("System Proxy Open"), QString("settings"), checked?"true":"false");
mSelectFrame->setVisible(checked); mSelectFrame->setVisible(checked);
line_8->setVisible(checked); line_8->setVisible(checked);
mAutoBtn->setChecked(checked); mAutoBtn->setChecked(checked);
@ -530,9 +542,11 @@ void Proxy::setupConnect(){
connect(mProxyBtnGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), [=](QAbstractButton * eBtn){ connect(mProxyBtnGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), [=](QAbstractButton * eBtn){
if (eBtn == mAutoBtn) { if (eBtn == mAutoBtn) {
UkccCommon::buriedSettings(QString("Proxy"), QString("auto"), QString("clicked"));
mManualBtn->setChecked(false); mManualBtn->setChecked(false);
proxysettings->set(PROXY_MODE_KEY,"auto"); proxysettings->set(PROXY_MODE_KEY,"auto");
} else if (eBtn == mManualBtn){ } else if (eBtn == mManualBtn){
UkccCommon::buriedSettings(QString("Proxy"), QString("manual"), QString("clicked"));
mAutoBtn->setChecked(false); mAutoBtn->setChecked(false);
proxysettings->set(PROXY_MODE_KEY,"manual"); proxysettings->set(PROXY_MODE_KEY,"manual");
} }
@ -557,6 +571,7 @@ void Proxy::setupConnect(){
}); });
connect(mAptBtn , &KSwitchButton::stateChanged, this ,[=](bool checked){ connect(mAptBtn , &KSwitchButton::stateChanged, this ,[=](bool checked){
UkccCommon::buriedSettings(QString("Proxy"), QString("Apt Proxy Open"), QString("settings"), checked?"true":"false");
if (checked) { if (checked) {
emit mEditBtn->click(); emit mEditBtn->click();
} else { // 关闭APT代理删除对应的配置文件 } else { // 关闭APT代理删除对应的配置文件
@ -567,7 +582,7 @@ void Proxy::setupConnect(){
} else { } else {
QMessageBox *mReboot = new QMessageBox(pluginWidget->topLevelWidget()); QMessageBox *mReboot = new QMessageBox(pluginWidget->topLevelWidget());
mReboot->setIcon(QMessageBox::Warning); mReboot->setIcon(QMessageBox::Warning);
mReboot->setText(tr("The apt proxy has been turned off and needs to be restarted to take effect")); mReboot->setText(tr("The APT proxy has been turned off and needs to be restarted to take effect"));
QPushButton *laterbtn = mReboot->addButton(tr("Reboot Later"), QMessageBox::RejectRole); QPushButton *laterbtn = mReboot->addButton(tr("Reboot Later"), QMessageBox::RejectRole);
QPushButton *nowbtn = mReboot->addButton(tr("Reboot Now"), QMessageBox::AcceptRole); QPushButton *nowbtn = mReboot->addButton(tr("Reboot Now"), QMessageBox::AcceptRole);
mReboot->exec(); mReboot->exec();
@ -716,13 +731,10 @@ void Proxy::initDbus()
void Proxy::initAppProxyStatus() void Proxy::initAppProxyStatus()
{ {
bool state = getAppProxyState(); bool state = getAppProxyState();
m_appEnableBtn->setChecked(state);
onappProxyEnableChanged(state);
appProxyInfoPadding(); appProxyInfoPadding();
// m_cancelBtn->setEnabled(false);
// m_saveBtn->setEnabled(false);
appListPadding(); appListPadding();
m_appEnableBtn->setChecked(state);
setAppProxyUiEnable(state);
} }
int Proxy::_getCurrentProxyMode(){ int Proxy::_getCurrentProxyMode(){
@ -807,7 +819,7 @@ void Proxy::setAptInfo()
{ {
QMessageBox *mReboot = new QMessageBox(pluginWidget->topLevelWidget()); QMessageBox *mReboot = new QMessageBox(pluginWidget->topLevelWidget());
mReboot->setIcon(QMessageBox::Warning); mReboot->setIcon(QMessageBox::Warning);
mReboot->setText(tr("The system needs to be restarted to set the Apt proxy, whether to reboot")); mReboot->setText(tr("The system needs to be restarted to set the APT proxy, whether to reboot"));
QPushButton *laterbtn = mReboot->addButton(tr("Reboot Later"), QMessageBox::RejectRole); QPushButton *laterbtn = mReboot->addButton(tr("Reboot Later"), QMessageBox::RejectRole);
QPushButton *nowbtn = mReboot->addButton(tr("Reboot Now"), QMessageBox::AcceptRole); QPushButton *nowbtn = mReboot->addButton(tr("Reboot Now"), QMessageBox::AcceptRole);
mReboot->exec(); mReboot->exec();
@ -967,6 +979,50 @@ QMap<QString, QStringList> Proxy::getAppListProxy()
return appList; return appList;
} }
void Proxy::setUkccProxySettings()
{
setSystemProxyFrameHidden(false);
setAppProxyFrameHidden(false);
setAPTProxyFrameHidden(false);
QDBusInterface ukccDbusInterface("org.ukui.ukcc.session",
"/",
"org.ukui.ukcc.session.interface",
QDBusConnection::sessionBus());
if(!ukccDbusInterface.isValid()) {
qWarning() << "ukccDbusInterface is invalid";
return;
}
QDBusReply<QMap<QString, QVariant> > reply = ukccDbusInterface.call("getModuleHideStatus");
if (!reply.isValid()) {
qWarning() << "reply of getModuleHideStatus is invalid";
return;
}
QStringList proxySettingList;
if (reply.value().contains("proxySettings")) {
QString proxySettings = reply.value()["proxySettings"].toString();
qDebug() << "proxySettings" << proxySettings;
if (proxySettings.isEmpty()) {
return;
}
proxySettingList = proxySettings.split(",");
}
for (const QString setting : proxySettingList) {
if (setting.contains("SystemProxyFrame") && setting.contains("false")) {
setSystemProxyFrameHidden(true);
} else if (setting.contains("AppProxyFrame") && setting.contains("false")) {
setAppProxyFrameHidden(true);
} else if (setting.contains("APTProxyFrame") && setting.contains("false")) {
setAPTProxyFrameHidden(true);
}
}
}
#if 0 #if 0
bool Proxy::checkIsChanged(QStringList info) bool Proxy::checkIsChanged(QStringList info)
{ {
@ -1130,22 +1186,32 @@ void Proxy::setAppProxyFrameUi(QWidget *widget)
m_appLine4 = setLine(m_appProxyFrame); m_appLine4 = setLine(m_appProxyFrame);
m_appLine5 = setLine(m_appProxyFrame); m_appLine5 = setLine(m_appProxyFrame);
m_appProxyInfoWidget = new QWidget(m_appProxyFrame);
QVBoxLayout *widgetHLayout = new QVBoxLayout(m_appProxyInfoWidget);
widgetHLayout->setContentsMargins(0, 0, 0, 0);
widgetHLayout->setSpacing(0);
widgetHLayout->addWidget(m_appLine1);
widgetHLayout->addWidget(m_proxyTypeFrame);
widgetHLayout->addWidget(m_appLine2);
widgetHLayout->addWidget(m_ipAddressFrame);
widgetHLayout->addWidget(m_appLine3);
widgetHLayout->addWidget(m_portFrame);
widgetHLayout->addWidget(m_appLine4);
widgetHLayout->addWidget(m_userNameFrame);
widgetHLayout->addWidget(m_appLine5);
widgetHLayout->addWidget(m_pwdFrame);
appProxyLayout->addWidget(m_appEnableFrame); appProxyLayout->addWidget(m_appEnableFrame);
appProxyLayout->addWidget(m_appLine1); appProxyLayout->addWidget(m_appProxyInfoWidget);
appProxyLayout->addWidget(m_proxyTypeFrame);
appProxyLayout->addWidget(m_appLine2);
appProxyLayout->addWidget(m_ipAddressFrame);
appProxyLayout->addWidget(m_appLine3);
appProxyLayout->addWidget(m_portFrame);
appProxyLayout->addWidget(m_appLine4);
appProxyLayout->addWidget(m_userNameFrame);
appProxyLayout->addWidget(m_appLine5);
appProxyLayout->addWidget(m_pwdFrame);
// appProxyLayout->addWidget(line5); // appProxyLayout->addWidget(line5);
// appProxyLayout->addWidget(m_appBtnFrame); // appProxyLayout->addWidget(m_appBtnFrame);
connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::onappProxyEnableChanged); connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::setAppProxyUiEnable);
connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::setAppProxyState); connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::setAppProxyState);
connect(m_appEnableBtn, &KSwitchButton::stateChanged, [=](bool checked) {
UkccCommon::buriedSettings(QString("Proxy"), QString("App Proxy Open"), QString("settings"), checked?"true":"false");
});
connect(m_proxyTypeComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(onAppProxyConfChanged())); connect(m_proxyTypeComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(onAppProxyConfChanged()));
connect(m_ipAddressLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onipEditStateChanged())); connect(m_ipAddressLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onipEditStateChanged()));
connect(m_ipAddressLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onAppProxyConfChanged())); connect(m_ipAddressLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onAppProxyConfChanged()));
@ -1180,6 +1246,7 @@ void Proxy::setAppListFrameUi(QWidget *widget)
m_appListWidget->setMinimumHeight(240); m_appListWidget->setMinimumHeight(240);
m_appListWidget->setFocusPolicy(Qt::FocusPolicy::NoFocus); m_appListWidget->setFocusPolicy(Qt::FocusPolicy::NoFocus);
m_appListWidget->setFrameShape(QFrame::Shape::Panel); m_appListWidget->setFrameShape(QFrame::Shape::Panel);
m_appListWidget->setVerticalScrollMode(QAbstractItemView::ScrollMode::ScrollPerPixel);
appListLayout->addWidget(m_allowAppProxyLabel); appListLayout->addWidget(m_allowAppProxyLabel);
appListLayout->addWidget(m_appListWidget); appListLayout->addWidget(m_appListWidget);
@ -1223,7 +1290,7 @@ void Proxy::appListPadding()
AppListWidget *appWidget = new AppListWidget(index, m_appListWidget); AppListWidget *appWidget = new AppListWidget(index, m_appListWidget);
appWidget->setAppName(appInfo.value(0)); appWidget->setAppName(appInfo.value(0));
appWidget->setAppIcon(QIcon::fromTheme(appInfo.value(1)).pixmap(24, 24)); appWidget->setAppIcon(QIcon::fromTheme(appInfo.value(1)));
appWidget->setAppChecked(flag); appWidget->setAppChecked(flag);
QListWidgetItem *appListWidgetItem = new QListWidgetItem(m_appListWidget); QListWidgetItem *appListWidgetItem = new QListWidgetItem(m_appListWidget);
@ -1247,6 +1314,32 @@ bool Proxy::getipEditState(QString text)
return match; return match;
} }
void Proxy::setSystemProxyFrameHidden(bool state)
{
mTitleLabel->setHidden(state);
mProxyFrame->setHidden(state);
m_sysSpacerFrame->setHidden(state);
}
void Proxy::setAppProxyFrameHidden(bool state)
{
m_appProxyLabel->setHidden(state);
m_appProxyFrame->setHidden(state);
if (state) {
m_appListFrame->setHidden(state);
} else {
m_appListFrame->setHidden(!m_appEnableBtn->isChecked());
}
m_appListSpacerFrame->setHidden(state);
m_appSpacerFrame->setHidden(state);
}
void Proxy::setAPTProxyFrameHidden(bool state)
{
mAptProxyLabel->setHidden(state);
mAPTFrame->setHidden(state);
}
void Proxy::onipEditStateChanged() void Proxy::onipEditStateChanged()
{ {
if (!getipEditState(m_ipAddressLineEdit->text())) { if (!getipEditState(m_ipAddressLineEdit->text())) {
@ -1298,19 +1391,15 @@ void Proxy::onPaletteChanged()
m_appListWidget->setPalette(mpal); m_appListWidget->setPalette(mpal);
} }
void Proxy::onappProxyEnableChanged(bool enable) void Proxy::setAppProxyUiEnable(bool enable)
{ {
m_proxyTypeFrame->setVisible(enable); if (enable) {
m_ipAddressFrame->setVisible(enable); m_appProxyInfoWidget->show();
m_portFrame->setVisible(enable); m_appListFrame->show();
m_userNameFrame->setVisible(enable); } else {
m_pwdFrame->setVisible(enable); m_appProxyInfoWidget->hide();
m_appListFrame->setVisible(enable); m_appListFrame->hide();
m_appLine1->setVisible(enable); }
m_appLine2->setVisible(enable);
m_appLine3->setVisible(enable);
m_appLine4->setVisible(enable);
m_appLine5->setVisible(enable);
} }
#if 0 #if 0

View File

@ -52,8 +52,10 @@
#include "kswitchbutton.h" #include "kswitchbutton.h"
#include "kpasswordedit.h" #include "kpasswordedit.h"
#include "ukcccommon.h"
using namespace kdk; using namespace kdk;
using namespace ukcc;
/* qt会将glib里的signals成员识别为宏所以取消该宏 /* qt会将glib里的signals成员识别为宏所以取消该宏
* signals时使Q_SIGNALS代替即可 * signals时使Q_SIGNALS代替即可
@ -136,13 +138,20 @@ public:
void setAppProxyConf(QStringList list); //设置应用代理配置信息--调用Dbus void setAppProxyConf(QStringList list); //设置应用代理配置信息--调用Dbus
static QMap<QString, QStringList> getAppListProxy(); static QMap<QString, QStringList> getAppListProxy();
// bool checkIsChanged(QStringList info); // bool checkIsChanged(QStringList info);
void setUkccProxySettings(); // 设置控制面板代理模块显示/隐藏
private: private:
void setAppProxyFrameUi(QWidget *widget); void setAppProxyFrameUi(QWidget *widget);
void setAppListFrameUi(QWidget *widget); void setAppListFrameUi(QWidget *widget);
void appProxyInfoPadding(); void appProxyInfoPadding();
void appListPadding(); void appListPadding();
bool getipEditState(QString text); bool getipEditState(QString text);
void setSystemProxyFrameHidden(bool state);
void setAppProxyFrameHidden(bool state);
void setAPTProxyFrameHidden(bool state);
QFrame *m_sysSpacerFrame;
QFrame *m_appListSpacerFrame;
QFrame *m_appSpacerFrame;
QString pluginName; QString pluginName;
int pluginType; int pluginType;
@ -250,6 +259,7 @@ private:
// QPushButton *m_cancelBtn; // QPushButton *m_cancelBtn;
// QPushButton *m_saveBtn; // QPushButton *m_saveBtn;
QListWidget *m_appListWidget = nullptr; QListWidget *m_appListWidget = nullptr;
QWidget *m_appProxyInfoWidget;
QTextEdit *mIgnoreLineEdit; QTextEdit *mIgnoreLineEdit;
@ -274,7 +284,7 @@ private:
private slots: private slots:
void setAptProxySlot(); //处理apt代理前端交互逻辑 void setAptProxySlot(); //处理apt代理前端交互逻辑
void onappProxyEnableChanged(bool enable); //IP地址无效提示 void setAppProxyUiEnable(bool enable);
void onipEditStateChanged(); //IP地址无效提示 void onipEditStateChanged(); //IP地址无效提示
void onAppProxyConfChanged(); //应用代理配置信息变化 void onAppProxyConfChanged(); //应用代理配置信息变化
void onAppProxyConfEditFinished(); void onAppProxyConfEditFinished();

View File

@ -7,6 +7,11 @@ CONFIG += plugin
TARGET = $$qtLibraryTarget(proxy) TARGET = $$qtLibraryTarget(proxy)
DESTDIR = ../.. DESTDIR = ../..
CONFIG(release, debug|release) {
!system($$PWD/translate_generation.sh): error("Failed to generate translation")
}
target.path = $$[QT_INSTALL_LIBS]/ukui-control-center target.path = $$[QT_INSTALL_LIBS]/ukui-control-center
trans.files = translations/* trans.files = translations/*
trans.path = /usr/share/kylin-nm/proxy/ trans.path = /usr/share/kylin-nm/proxy/
@ -49,4 +54,9 @@ INSTALLS += target \
TRANSLATIONS += \ TRANSLATIONS += \
translations/zh_CN.ts \ translations/zh_CN.ts \
translations/tr.ts \ translations/tr.ts \
translations/bo_CN.ts translations/bo_CN.ts \
translations/en_US.ts \
translations/mn.ts
DISTFILES += \
translations/en_US.ts

View File

@ -0,0 +1,15 @@
#!/bin/bash
ts_list=(`ls translations/*.ts`)
source /etc/os-release
version=(`echo $ID`)
for ts in "${ts_list[@]}"
do
printf "\nprocess ${ts}\n"
if [ "$version" == "fedora" ] || [ "$version" == "opensuse-leap" ] || [ "$version" == "opensuse-tumbleweed" ];then
lrelease-qt5 "${ts}"
else
lrelease "${ts}"
fi
done

Binary file not shown.

View File

@ -5,8 +5,8 @@
<name>AptProxyDialog</name> <name>AptProxyDialog</name>
<message> <message>
<location filename="../aptproxydialog.cpp" line="24"/> <location filename="../aptproxydialog.cpp" line="24"/>
<source>Set Apt Proxy</source> <source>Set APT Proxy</source>
<translation>Apt </translation> <translation>APT </translation>
</message> </message>
<message> <message>
<location filename="../aptproxydialog.cpp" line="41"/> <location filename="../aptproxydialog.cpp" line="41"/>
@ -37,130 +37,136 @@
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="194"/> <location filename="../proxy.cpp" line="200"/>
<source>Start using</source> <source>Start using</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="207"/> <location filename="../proxy.cpp" line="213"/>
<source>Proxy mode</source> <source>Proxy mode</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="211"/> <location filename="../proxy.cpp" line="217"/>
<source>Auto</source> <source>Auto</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="214"/> <location filename="../proxy.cpp" line="220"/>
<source>Manual</source> <source>Manual</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="369"/> <location filename="../proxy.cpp" line="375"/>
<source>Application Proxy</source> <source>Application Proxy</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="444"/> <location filename="../proxy.cpp" line="450"/>
<source>System Proxy</source> <source>System Proxy</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="446"/> <location filename="../proxy.cpp" line="452"/>
<source>Auto url</source> <source>Auto url</source>
<translation></translation> <translation></translation>
<extra-contents_path>/Proxy/Auto url</extra-contents_path> <extra-contents_path>/Proxy/Auto url</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="448"/> <location filename="../proxy.cpp" line="454"/>
<source>Http Proxy</source> <source>Http Proxy</source>
<translation>HTTP </translation> <translation>HTTP </translation>
<extra-contents_path>/Proxy/Http Proxy</extra-contents_path> <extra-contents_path>/Proxy/Http Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="450"/> <location filename="../proxy.cpp" line="456"/>
<source>Https Proxy</source> <source>Https Proxy</source>
<translation>HTTPS </translation> <translation>HTTPS </translation>
<extra-contents_path>/Proxy/Https Proxy</extra-contents_path> <extra-contents_path>/Proxy/Https Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="452"/> <location filename="../proxy.cpp" line="458"/>
<source>Ftp Proxy</source> <source>Ftp Proxy</source>
<translation>FTP </translation> <translation>FTP </translation>
<extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path> <extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="454"/> <location filename="../proxy.cpp" line="460"/>
<source>Socks Proxy</source> <source>Socks Proxy</source>
<translation>SOCKS </translation> <translation>SOCKS </translation>
<extra-contents_path>/Proxy/Socks Proxy</extra-contents_path> <extra-contents_path>/Proxy/Socks Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="455"/> <location filename="../proxy.cpp" line="461"/>
<location filename="../proxy.cpp" line="456"/> <location filename="../proxy.cpp" line="462"/>
<location filename="../proxy.cpp" line="457"/> <location filename="../proxy.cpp" line="463"/>
<location filename="../proxy.cpp" line="458"/> <location filename="../proxy.cpp" line="464"/>
<location filename="../proxy.cpp" line="1047"/> <location filename="../proxy.cpp" line="1068"/>
<source>Port</source> <source>Port</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="459"/> <location filename="../proxy.cpp" line="465"/>
<source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source> <source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source>
<translation> (;)</translation> <translation> (;)</translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="462"/> <location filename="../proxy.cpp" line="468"/>
<source>Apt Proxy</source> <source>App Proxy</source>
<translation>APT </translation> <translation></translation>
<extra-contents_path>/Proxy/Apt Proxy</extra-contents_path> <extra-contents_path>/Proxy/App Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="463"/> <location filename="../proxy.cpp" line="471"/>
<location filename="../proxy.cpp" line="984"/> <source>APT Proxy</source>
<translation>APT </translation>
<extra-contents_path>/Proxy/APT Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="472"/>
<location filename="../proxy.cpp" line="1005"/>
<source>Open</source> <source>Open</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="464"/> <location filename="../proxy.cpp" line="473"/>
<source>Server Address : </source> <source>Server Address : </source>
<translation> </translation> <translation> </translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="465"/> <location filename="../proxy.cpp" line="474"/>
<source>Port : </source> <source>Port : </source>
<translation> </translation> <translation> </translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="466"/> <location filename="../proxy.cpp" line="475"/>
<source>Edit</source> <source>Edit</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="564"/> <location filename="../proxy.cpp" line="573"/>
<source>The apt proxy has been turned off and needs to be restarted to take effect</source> <source>The APT proxy has been turned off and needs to be restarted to take effect</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="565"/> <location filename="../proxy.cpp" line="574"/>
<location filename="../proxy.cpp" line="797"/> <location filename="../proxy.cpp" line="814"/>
<source>Reboot Later</source> <source>Reboot Later</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="566"/> <location filename="../proxy.cpp" line="575"/>
<location filename="../proxy.cpp" line="798"/> <location filename="../proxy.cpp" line="815"/>
<source>Reboot Now</source> <source>Reboot Now</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="796"/> <location filename="../proxy.cpp" line="813"/>
<source>The system needs to be restarted to set the Apt proxy, whether to reboot</source> <source>The system needs to be restarted to set the APT proxy, whether to reboot</source>
<translation>Aptཡ </translation> <translation>APT </translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="996"/> <location filename="../proxy.cpp" line="1017"/>
<source>Proxy type</source> <source>Proxy type</source>
<translation></translation> <translation></translation>
</message> </message>
@ -177,49 +183,49 @@
<translation type="vanished">5</translation> <translation type="vanished">5</translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1013"/> <location filename="../proxy.cpp" line="1034"/>
<source>IP address</source> <source>IP address</source>
<translation>IPས</translation> <translation>IPས</translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1019"/> <location filename="../proxy.cpp" line="1040"/>
<location filename="../proxy.cpp" line="1050"/> <location filename="../proxy.cpp" line="1071"/>
<source>Required</source> <source>Required</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1040"/> <location filename="../proxy.cpp" line="1061"/>
<source>Invalid IP Address</source> <source>Invalid IP Address</source>
<translation>IPས</translation> <translation>IPས</translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1061"/> <location filename="../proxy.cpp" line="1082"/>
<source>Username</source> <source>Username</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1064"/> <location filename="../proxy.cpp" line="1085"/>
<location filename="../proxy.cpp" line="1078"/> <location filename="../proxy.cpp" line="1099"/>
<source>Optional</source> <source>Optional</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1074"/> <location filename="../proxy.cpp" line="1095"/>
<source>Password</source> <source>Password</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1097"/> <location filename="../proxy.cpp" line="1118"/>
<source>Cancel</source> <source>Cancel</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1098"/> <location filename="../proxy.cpp" line="1119"/>
<source>Save</source> <source>Save</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1160"/> <location filename="../proxy.cpp" line="1181"/>
<source>The following applications are allowed to use this configuration:</source> <source>The following applications are allowed to use this configuration:</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -0,0 +1,221 @@
<?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="200"/>
<source>Start using</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="213"/>
<source>Proxy mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="217"/>
<source>Auto</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="220"/>
<source>Manual</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="375"/>
<source>Application Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="450"/>
<source>System Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="452"/>
<source>Auto url</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Auto url</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="454"/>
<source>Http Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Http Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="456"/>
<source>Https Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Https Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="458"/>
<source>Ftp Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="460"/>
<source>Socks Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Socks Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="461"/>
<location filename="../proxy.cpp" line="462"/>
<location filename="../proxy.cpp" line="463"/>
<location filename="../proxy.cpp" line="464"/>
<location filename="../proxy.cpp" line="1068"/>
<source>Port</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="465"/>
<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="468"/>
<source>App Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/App Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="471"/>
<source>APT Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/APT Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="472"/>
<location filename="../proxy.cpp" line="1005"/>
<source>Open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="473"/>
<source>Server Address : </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="474"/>
<source>Port : </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="475"/>
<source>Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="573"/>
<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="574"/>
<location filename="../proxy.cpp" line="814"/>
<source>Reboot Later</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="575"/>
<location filename="../proxy.cpp" line="815"/>
<source>Reboot Now</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="813"/>
<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="1017"/>
<source>Proxy type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1034"/>
<source>IP address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1040"/>
<location filename="../proxy.cpp" line="1071"/>
<source>Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1061"/>
<source>Invalid IP Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1082"/>
<source>Username</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1085"/>
<location filename="../proxy.cpp" line="1099"/>
<source>Optional</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1095"/>
<source>Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1118"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1119"/>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1181"/>
<source>The following applications are allowed to use this configuration:</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,221 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="mn">
<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="200"/>
<source>Start using</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="213"/>
<source>Proxy mode</source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="217"/>
<source>Auto</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="220"/>
<source>Manual</source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="375"/>
<source>Application Proxy</source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="450"/>
<source>System Proxy</source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="452"/>
<source>Auto url</source>
<translation>URL </translation>
<extra-contents_path>/Proxy/Auto url</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="454"/>
<source>Http Proxy</source>
<translation>HTTP </translation>
<extra-contents_path>/Proxy/Http Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="456"/>
<source>Https Proxy</source>
<translation>HTTPS </translation>
<extra-contents_path>/Proxy/Https Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="458"/>
<source>Ftp Proxy</source>
<translation>FTP </translation>
<extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="460"/>
<source>Socks Proxy</source>
<translation>SOCKS </translation>
<extra-contents_path>/Proxy/Socks Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="461"/>
<location filename="../proxy.cpp" line="462"/>
<location filename="../proxy.cpp" line="463"/>
<location filename="../proxy.cpp" line="464"/>
<location filename="../proxy.cpp" line="1068"/>
<source>Port</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="465"/>
<source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source>
<translation> (;)</translation>
</message>
<message>
<location filename="../proxy.cpp" line="468"/>
<source>App Proxy</source>
<translation> </translation>
<extra-contents_path>/Proxy/App Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="471"/>
<source>APT Proxy</source>
<translation>APT </translation>
<extra-contents_path>/Proxy/APT Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="472"/>
<location filename="../proxy.cpp" line="1005"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="473"/>
<source>Server Address : </source>
<translation> : </translation>
</message>
<message>
<location filename="../proxy.cpp" line="474"/>
<source>Port : </source>
<translation> : </translation>
</message>
<message>
<location filename="../proxy.cpp" line="475"/>
<source>Edit</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="573"/>
<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="574"/>
<location filename="../proxy.cpp" line="814"/>
<source>Reboot Later</source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="575"/>
<location filename="../proxy.cpp" line="815"/>
<source>Reboot Now</source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="813"/>
<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="1017"/>
<source>Proxy type</source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="1034"/>
<source>IP address</source>
<translation>IP </translation>
</message>
<message>
<location filename="../proxy.cpp" line="1040"/>
<location filename="../proxy.cpp" line="1071"/>
<source>Required</source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="1061"/>
<source>Invalid IP Address</source>
<translation> IP </translation>
</message>
<message>
<location filename="../proxy.cpp" line="1082"/>
<source>Username</source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="1085"/>
<location filename="../proxy.cpp" line="1099"/>
<source>Optional</source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="1095"/>
<source>Password</source>
<translation> </translation>
</message>
<message>
<location filename="../proxy.cpp" line="1118"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1119"/>
<source>Save</source>
<translation></translation>
</message>
<message>
<location filename="../proxy.cpp" line="1181"/>
<source>The following applications are allowed to use this configuration:</source>
<translation> :</translation>
</message>
</context>
</TS>

View File

@ -5,7 +5,7 @@
<name>AptProxyDialog</name> <name>AptProxyDialog</name>
<message> <message>
<location filename="../aptproxydialog.cpp" line="24"/> <location filename="../aptproxydialog.cpp" line="24"/>
<source>Set Apt Proxy</source> <source>Set APT Proxy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
@ -37,177 +37,183 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="194"/> <location filename="../proxy.cpp" line="200"/>
<source>Start using</source> <source>Start using</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="207"/> <location filename="../proxy.cpp" line="213"/>
<source>Proxy mode</source> <source>Proxy mode</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="211"/> <location filename="../proxy.cpp" line="217"/>
<source>Auto</source> <source>Auto</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="214"/> <location filename="../proxy.cpp" line="220"/>
<source>Manual</source> <source>Manual</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="369"/> <location filename="../proxy.cpp" line="375"/>
<source>Application Proxy</source> <source>Application Proxy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="444"/> <location filename="../proxy.cpp" line="450"/>
<source>System Proxy</source> <source>System Proxy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="446"/> <location filename="../proxy.cpp" line="452"/>
<source>Auto url</source> <source>Auto url</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Auto url</extra-contents_path> <extra-contents_path>/Proxy/Auto url</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="448"/> <location filename="../proxy.cpp" line="454"/>
<source>Http Proxy</source> <source>Http Proxy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Http Proxy</extra-contents_path> <extra-contents_path>/Proxy/Http Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="450"/> <location filename="../proxy.cpp" line="456"/>
<source>Https Proxy</source> <source>Https Proxy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Https Proxy</extra-contents_path> <extra-contents_path>/Proxy/Https Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="452"/> <location filename="../proxy.cpp" line="458"/>
<source>Ftp Proxy</source> <source>Ftp Proxy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path> <extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="454"/> <location filename="../proxy.cpp" line="460"/>
<source>Socks Proxy</source> <source>Socks Proxy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Socks Proxy</extra-contents_path> <extra-contents_path>/Proxy/Socks Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="455"/> <location filename="../proxy.cpp" line="461"/>
<location filename="../proxy.cpp" line="456"/> <location filename="../proxy.cpp" line="462"/>
<location filename="../proxy.cpp" line="457"/> <location filename="../proxy.cpp" line="463"/>
<location filename="../proxy.cpp" line="458"/> <location filename="../proxy.cpp" line="464"/>
<location filename="../proxy.cpp" line="1047"/> <location filename="../proxy.cpp" line="1068"/>
<source>Port</source> <source>Port</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="459"/> <location filename="../proxy.cpp" line="465"/>
<source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source> <source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="462"/> <location filename="../proxy.cpp" line="468"/>
<source>Apt Proxy</source> <source>App Proxy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/Proxy/Apt Proxy</extra-contents_path> <extra-contents_path>/Proxy/App Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="463"/> <location filename="../proxy.cpp" line="471"/>
<location filename="../proxy.cpp" line="984"/> <source>APT Proxy</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Proxy/APT Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="472"/>
<location filename="../proxy.cpp" line="1005"/>
<source>Open</source> <source>Open</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="464"/> <location filename="../proxy.cpp" line="473"/>
<source>Server Address : </source> <source>Server Address : </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="465"/> <location filename="../proxy.cpp" line="474"/>
<source>Port : </source> <source>Port : </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="466"/> <location filename="../proxy.cpp" line="475"/>
<source>Edit</source> <source>Edit</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="564"/> <location filename="../proxy.cpp" line="573"/>
<source>The apt proxy has been turned off and needs to be restarted to take effect</source> <source>The APT proxy has been turned off and needs to be restarted to take effect</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="565"/> <location filename="../proxy.cpp" line="574"/>
<location filename="../proxy.cpp" line="797"/> <location filename="../proxy.cpp" line="814"/>
<source>Reboot Later</source> <source>Reboot Later</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="566"/> <location filename="../proxy.cpp" line="575"/>
<location filename="../proxy.cpp" line="798"/> <location filename="../proxy.cpp" line="815"/>
<source>Reboot Now</source> <source>Reboot Now</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="796"/> <location filename="../proxy.cpp" line="813"/>
<source>The system needs to be restarted to set the Apt proxy, whether to reboot</source> <source>The system needs to be restarted to set the APT proxy, whether to reboot</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="996"/> <location filename="../proxy.cpp" line="1017"/>
<source>Proxy type</source> <source>Proxy type</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1013"/> <location filename="../proxy.cpp" line="1034"/>
<source>IP address</source> <source>IP address</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1019"/> <location filename="../proxy.cpp" line="1040"/>
<location filename="../proxy.cpp" line="1050"/> <location filename="../proxy.cpp" line="1071"/>
<source>Required</source> <source>Required</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1040"/> <location filename="../proxy.cpp" line="1061"/>
<source>Invalid IP Address</source> <source>Invalid IP Address</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1061"/> <location filename="../proxy.cpp" line="1082"/>
<source>Username</source> <source>Username</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1064"/> <location filename="../proxy.cpp" line="1085"/>
<location filename="../proxy.cpp" line="1078"/> <location filename="../proxy.cpp" line="1099"/>
<source>Optional</source> <source>Optional</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1074"/> <location filename="../proxy.cpp" line="1095"/>
<source>Password</source> <source>Password</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1097"/> <location filename="../proxy.cpp" line="1118"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1098"/> <location filename="../proxy.cpp" line="1119"/>
<source>Save</source> <source>Save</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1160"/> <location filename="../proxy.cpp" line="1181"/>
<source>The following applications are allowed to use this configuration:</source> <source>The following applications are allowed to use this configuration:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

Binary file not shown.

View File

@ -5,8 +5,8 @@
<name>AptProxyDialog</name> <name>AptProxyDialog</name>
<message> <message>
<location filename="../aptproxydialog.cpp" line="24"/> <location filename="../aptproxydialog.cpp" line="24"/>
<source>Set Apt Proxy</source> <source>Set APT Proxy</source>
<translation>APT代理</translation> <translation> APT </translation>
</message> </message>
<message> <message>
<location filename="../aptproxydialog.cpp" line="41"/> <location filename="../aptproxydialog.cpp" line="41"/>
@ -37,177 +37,183 @@
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="194"/> <location filename="../proxy.cpp" line="200"/>
<source>Start using</source> <source>Start using</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="207"/> <location filename="../proxy.cpp" line="213"/>
<source>Proxy mode</source> <source>Proxy mode</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="211"/> <location filename="../proxy.cpp" line="217"/>
<source>Auto</source> <source>Auto</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="214"/> <location filename="../proxy.cpp" line="220"/>
<source>Manual</source> <source>Manual</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="369"/> <location filename="../proxy.cpp" line="375"/>
<source>Application Proxy</source> <source>Application Proxy</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="444"/> <location filename="../proxy.cpp" line="450"/>
<source>System Proxy</source> <source>System Proxy</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="446"/> <location filename="../proxy.cpp" line="452"/>
<source>Auto url</source> <source>Auto url</source>
<translation>URL</translation> <translation> URL</translation>
<extra-contents_path>/Proxy/Auto url</extra-contents_path> <extra-contents_path>/Proxy/Auto url</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="448"/> <location filename="../proxy.cpp" line="454"/>
<source>Http Proxy</source> <source>Http Proxy</source>
<translation>HTTP代理</translation> <translation>HTTP </translation>
<extra-contents_path>/Proxy/Http Proxy</extra-contents_path> <extra-contents_path>/Proxy/Http Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="450"/> <location filename="../proxy.cpp" line="456"/>
<source>Https Proxy</source> <source>Https Proxy</source>
<translation>HTTPS代理</translation> <translation>HTTPS </translation>
<extra-contents_path>/Proxy/Https Proxy</extra-contents_path> <extra-contents_path>/Proxy/Https Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="452"/> <location filename="../proxy.cpp" line="458"/>
<source>Ftp Proxy</source> <source>Ftp Proxy</source>
<translation>FTP代理</translation> <translation>FTP </translation>
<extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path> <extra-contents_path>/Proxy/Ftp Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="454"/> <location filename="../proxy.cpp" line="460"/>
<source>Socks Proxy</source> <source>Socks Proxy</source>
<translation>SOCKS代理</translation> <translation>SOCKS </translation>
<extra-contents_path>/Proxy/Socks Proxy</extra-contents_path> <extra-contents_path>/Proxy/Socks Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="455"/> <location filename="../proxy.cpp" line="461"/>
<location filename="../proxy.cpp" line="456"/> <location filename="../proxy.cpp" line="462"/>
<location filename="../proxy.cpp" line="457"/> <location filename="../proxy.cpp" line="463"/>
<location filename="../proxy.cpp" line="458"/> <location filename="../proxy.cpp" line="464"/>
<location filename="../proxy.cpp" line="1047"/> <location filename="../proxy.cpp" line="1068"/>
<source>Port</source> <source>Port</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="459"/> <location filename="../proxy.cpp" line="465"/>
<source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source> <source>List of ignored hosts. more than one entry, please separate with english semicolon(;)</source>
<translation>使;</translation> <translation>使;</translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="462"/> <location filename="../proxy.cpp" line="468"/>
<source>Apt Proxy</source> <source>App Proxy</source>
<translation>APT代</translation> <translation></translation>
<extra-contents_path>/Proxy/Apt Proxy</extra-contents_path> <extra-contents_path>/Proxy/App Proxy</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="463"/> <location filename="../proxy.cpp" line="471"/>
<location filename="../proxy.cpp" line="984"/> <source>APT Proxy</source>
<translation>APT </translation>
<extra-contents_path>/Proxy/APT Proxy</extra-contents_path>
</message>
<message>
<location filename="../proxy.cpp" line="472"/>
<location filename="../proxy.cpp" line="1005"/>
<source>Open</source> <source>Open</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="464"/> <location filename="../proxy.cpp" line="473"/>
<source>Server Address : </source> <source>Server Address : </source>
<translation> </translation> <translation> </translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="465"/> <location filename="../proxy.cpp" line="474"/>
<source>Port : </source> <source>Port : </source>
<translation> </translation> <translation> </translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="466"/> <location filename="../proxy.cpp" line="475"/>
<source>Edit</source> <source>Edit</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="564"/> <location filename="../proxy.cpp" line="573"/>
<source>The apt proxy has been turned off and needs to be restarted to take effect</source> <source>The APT proxy has been turned off and needs to be restarted to take effect</source>
<translation>APT代理已关闭</translation> <translation>APT </translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="565"/> <location filename="../proxy.cpp" line="574"/>
<location filename="../proxy.cpp" line="797"/> <location filename="../proxy.cpp" line="814"/>
<source>Reboot Later</source> <source>Reboot Later</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="566"/> <location filename="../proxy.cpp" line="575"/>
<location filename="../proxy.cpp" line="798"/> <location filename="../proxy.cpp" line="815"/>
<source>Reboot Now</source> <source>Reboot Now</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="796"/> <location filename="../proxy.cpp" line="813"/>
<source>The system needs to be restarted to set the Apt proxy, whether to reboot</source> <source>The system needs to be restarted to set the APT proxy, whether to reboot</source>
<translation>APT代理需要重启系统后生效</translation> <translation> APT </translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="996"/> <location filename="../proxy.cpp" line="1017"/>
<source>Proxy type</source> <source>Proxy type</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1013"/> <location filename="../proxy.cpp" line="1034"/>
<source>IP address</source> <source>IP address</source>
<translation>IP地址</translation> <translation>IP </translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1019"/> <location filename="../proxy.cpp" line="1040"/>
<location filename="../proxy.cpp" line="1050"/> <location filename="../proxy.cpp" line="1071"/>
<source>Required</source> <source>Required</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1040"/> <location filename="../proxy.cpp" line="1061"/>
<source>Invalid IP Address</source> <source>Invalid IP Address</source>
<translation>IP地址</translation> <translation> IP </translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1061"/> <location filename="../proxy.cpp" line="1082"/>
<source>Username</source> <source>Username</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1064"/> <location filename="../proxy.cpp" line="1085"/>
<location filename="../proxy.cpp" line="1078"/> <location filename="../proxy.cpp" line="1099"/>
<source>Optional</source> <source>Optional</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1074"/> <location filename="../proxy.cpp" line="1095"/>
<source>Password</source> <source>Password</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1097"/> <location filename="../proxy.cpp" line="1118"/>
<source>Cancel</source> <source>Cancel</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1098"/> <location filename="../proxy.cpp" line="1119"/>
<source>Save</source> <source>Save</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../proxy.cpp" line="1160"/> <location filename="../proxy.cpp" line="1181"/>
<source>The following applications are allowed to use this configuration:</source> <source>The following applications are allowed to use this configuration:</source>
<translation>使</translation> <translation>使</translation>
</message> </message>

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,

View File

@ -0,0 +1,15 @@
#!/bin/bash
ts_list=(`ls translations/*.ts`)
source /etc/os-release
version=(`echo $ID`)
for ts in "${ts_list[@]}"
do
printf "\nprocess ${ts}\n"
if [ "$version" == "fedora" ] || [ "$version" == "opensuse-leap" ] || [ "$version" == "opensuse-tumbleweed" ];then
lrelease-qt5 "${ts}"
else
lrelease "${ts}"
fi
done

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN" sourcelanguage="en">
<context>
<name>AddNetBtn</name>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation></translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation></translation>
</message>
</context>
<context>
<name>ItemFrame</name>
<message>
<location filename="../itemframe.cpp" line="38"/>
<source>Add VPN</source>
<translation>VPN</translation>
</message>
</context>
<context>
<name>Vpn</name>
<message>
<location filename="../vpn.ui" line="53"/>
<location filename="../vpn.cpp" line="68"/>
<source>VPN</source>
<translation></translation>
</message>
<message>
<location filename="../vpn.ui" line="68"/>
<source>import</source>
<translation></translation>
</message>
<message>
<location filename="../vpn.cpp" line="157"/>
<location filename="../vpn.cpp" line="284"/>
<source>Show on Taskbar</source>
<translation></translation>
<extra-contents_path>/Vpn/Show on Taskbar</extra-contents_path>
</message>
<message>
<location filename="../vpn.cpp" line="286"/>
<source>Add VPN</source>
<translation type="unfinished">VPN</translation>
<extra-contents_path>/Vpn/Add VPN</extra-contents_path>
</message>
<message>
<location filename="../vpn.cpp" line="372"/>
<location filename="../vpn.cpp" line="479"/>
<source>connected</source>
<translation></translation>
</message>
<message>
<location filename="../vpn.cpp" line="374"/>
<location filename="../vpn.cpp" line="489"/>
<source>not connected</source>
<translation></translation>
</message>
</context>
<context>
<name>VpnItem</name>
<message>
<location filename="../vpnitem.cpp" line="56"/>
<source>Delete</source>
<translation></translation>
</message>
<message>
<location filename="../vpnitem.cpp" line="108"/>
<location filename="../vpnitem.cpp" line="121"/>
<source>Disconnect</source>
<translation></translation>
</message>
<message>
<location filename="../vpnitem.cpp" line="110"/>
<location filename="../vpnitem.cpp" line="119"/>
<source>Connect</source>
<translation></translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>AddNetBtn</name>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ItemFrame</name>
<message>
<location filename="../itemframe.cpp" line="38"/>
<source>Add VPN</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Vpn</name>
<message>
<location filename="../vpn.ui" line="53"/>
<location filename="../vpn.cpp" line="68"/>
<source>VPN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../vpn.ui" line="68"/>
<source>import</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../vpn.cpp" line="157"/>
<location filename="../vpn.cpp" line="284"/>
<source>Show on Taskbar</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Vpn/Show on Taskbar</extra-contents_path>
</message>
<message>
<location filename="../vpn.cpp" line="286"/>
<source>Add VPN</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Vpn/Add VPN</extra-contents_path>
</message>
<message>
<location filename="../vpn.cpp" line="372"/>
<location filename="../vpn.cpp" line="479"/>
<source>connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../vpn.cpp" line="374"/>
<location filename="../vpn.cpp" line="489"/>
<source>not connected</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VpnItem</name>
<message>
<location filename="../vpnitem.cpp" line="56"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../vpnitem.cpp" line="108"/>
<location filename="../vpnitem.cpp" line="121"/>
<source>Disconnect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../vpnitem.cpp" line="110"/>
<location filename="../vpnitem.cpp" line="119"/>
<source>Connect</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="mn" sourcelanguage="en">
<context>
<name>AddNetBtn</name>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="47"/>
<source>Add Others</source>
<translation> </translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="51"/>
<source>Add WiredNetork</source>
<translation> </translation>
</message>
</context>
<context>
<name>ItemFrame</name>
<message>
<location filename="../itemframe.cpp" line="38"/>
<source>Add VPN</source>
<translation>VPN </translation>
</message>
</context>
<context>
<name>Vpn</name>
<message>
<location filename="../vpn.ui" line="53"/>
<source>VPN</source>
<translation></translation>
</message>
<message>
<location filename="../vpn.ui" line="68"/>
<source>import</source>
<translation></translation>
</message>
<message>
<location filename="../vpn.cpp" line="151"/>
<source>Show on Taskbar</source>
<translation> </translation>
</message>
<message>
<location filename="../vpn.cpp" line="347"/>
<location filename="../vpn.cpp" line="454"/>
<source>connected</source>
<translation></translation>
</message>
<message>
<location filename="../vpn.cpp" line="349"/>
<location filename="../vpn.cpp" line="464"/>
<source>not connected</source>
<translation> </translation>
</message>
</context>
<context>
<name>VpnItem</name>
<message>
<location filename="../vpnitem.cpp" line="58"/>
<source>Delete</source>
<translation></translation>
</message>
<message>
<location filename="../vpnitem.cpp" line="111"/>
<location filename="../vpnitem.cpp" line="124"/>
<source>Disconnect</source>
<translation></translation>
</message>
<message>
<location filename="../vpnitem.cpp" line="113"/>
<location filename="../vpnitem.cpp" line="122"/>
<source>Connect</source>
<translation></translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@ -4,12 +4,12 @@
<context> <context>
<name>AddNetBtn</name> <name>AddNetBtn</name>
<message> <message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="47"/> <location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source> <source>Add Others</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="51"/> <location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source> <source>Add WiredNetork</source>
<translation></translation> <translation></translation>
</message> </message>
@ -19,13 +19,14 @@
<message> <message>
<location filename="../itemframe.cpp" line="38"/> <location filename="../itemframe.cpp" line="38"/>
<source>Add VPN</source> <source>Add VPN</source>
<translation>VPN</translation> <translation> VPN</translation>
</message> </message>
</context> </context>
<context> <context>
<name>Vpn</name> <name>Vpn</name>
<message> <message>
<location filename="../vpn.ui" line="53"/> <location filename="../vpn.ui" line="53"/>
<location filename="../vpn.cpp" line="68"/>
<source>VPN</source> <source>VPN</source>
<translation></translation> <translation></translation>
</message> </message>
@ -35,24 +36,27 @@
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../vpn.cpp" line="68"/> <location filename="../vpn.cpp" line="157"/>
<source>VPN</source> <location filename="../vpn.cpp" line="284"/>
<translation></translation>
</message>
<message>
<location filename="../vpn.cpp" line="151"/>
<source>Show on Taskbar</source> <source>Show on Taskbar</source>
<translation></translation> <translation></translation>
<extra-contents_path>/Vpn/Show on Taskbar</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../vpn.cpp" line="347"/> <location filename="../vpn.cpp" line="286"/>
<location filename="../vpn.cpp" line="454"/> <source>Add VPN</source>
<translation> VPN </translation>
<extra-contents_path>/Vpn/Add VPN</extra-contents_path>
</message>
<message>
<location filename="../vpn.cpp" line="372"/>
<location filename="../vpn.cpp" line="479"/>
<source>connected</source> <source>connected</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../vpn.cpp" line="349"/> <location filename="../vpn.cpp" line="374"/>
<location filename="../vpn.cpp" line="464"/> <location filename="../vpn.cpp" line="489"/>
<source>not connected</source> <source>not connected</source>
<translation></translation> <translation></translation>
</message> </message>
@ -60,19 +64,19 @@
<context> <context>
<name>VpnItem</name> <name>VpnItem</name>
<message> <message>
<location filename="../vpnitem.cpp" line="58"/> <location filename="../vpnitem.cpp" line="56"/>
<source>Delete</source> <source>Delete</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../vpnitem.cpp" line="111"/> <location filename="../vpnitem.cpp" line="108"/>
<location filename="../vpnitem.cpp" line="124"/> <location filename="../vpnitem.cpp" line="121"/>
<source>Disconnect</source> <source>Disconnect</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../vpnitem.cpp" line="113"/> <location filename="../vpnitem.cpp" line="110"/>
<location filename="../vpnitem.cpp" line="122"/> <location filename="../vpnitem.cpp" line="119"/>
<source>Connect</source> <source>Connect</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -107,6 +107,7 @@ QWidget *Vpn::pluginUi(){
initComponent(); initComponent();
initConnect(); initConnect();
initNet(); initNet();
initSearchText();
} }
return m_pluginWidget; return m_pluginWidget;
} }
@ -131,6 +132,11 @@ bool Vpn::isEnable() const
return true; return true;
} }
QString Vpn::translationPath() const
{
return "/usr/share/kylin-nm/vpn/%1.ts";
}
void Vpn::initComponent(){ void Vpn::initComponent(){
//在任务栏上显示图标 //在任务栏上显示图标
//显示已连接时间 //显示已连接时间
@ -187,6 +193,7 @@ void Vpn::initComponent(){
ui->verticalLayout_3->addWidget(m_listFrame); ui->verticalLayout_3->addWidget(m_listFrame);
connect(m_listFrame->m_addVpnWidget, &AddNetBtn::clicked, this, [=]() { connect(m_listFrame->m_addVpnWidget, &AddNetBtn::clicked, this, [=]() {
UkccCommon::buriedSettings(QString("VPN"), QString("Add VPN"), QString("clicked"));
runExternalApp(); runExternalApp();
}); });
@ -211,6 +218,10 @@ void Vpn::initComponent(){
} }
}); });
connect(m_showBtn, &KSwitchButton::clicked, this, [=](bool checked){
UkccCommon::buriedSettings(QString("VPN"), QString("Show on Taskbar"), QString("settings"), checked ? "true":"false");
});
// connect(m_timeBtn, &KSwitchButton::stateChanged, this, [=](bool state){ // connect(m_timeBtn, &KSwitchButton::stateChanged, this, [=](bool state){
// if (m_switchGsettings != nullptr) { // if (m_switchGsettings != nullptr) {
// m_switchGsettings->set(VISIBLE, state); // m_switchGsettings->set(VISIBLE, state);
@ -266,6 +277,14 @@ void Vpn::setShowSwitchStatus()
} }
} }
void Vpn::initSearchText()
{
//~ contents_path /Vpn/Show on Taskbar
tr("Show on Taskbar");
//~ contents_path /Vpn/Add VPN
tr("Add VPN");
}
void Vpn::runExternalApp(){ void Vpn::runExternalApp(){
// QString cmd = "nm-connection-editor"; // QString cmd = "nm-connection-editor";
// QProcess process(this); // QProcess process(this);
@ -487,6 +506,10 @@ int Vpn::getInsertPos(QString connName)
auto dbusArg = result.arguments().at(0).value<QDBusArgument>(); auto dbusArg = result.arguments().at(0).value<QDBusArgument>();
QVector<QStringList> variantList; QVector<QStringList> variantList;
dbusArg >> variantList; dbusArg >> variantList;
if (variantList.isEmpty()) {
qDebug() << "[Vpn] virtualList is empty, getInsertPos return 0";
return 0;
}
for (int i = 0; i < variantList.size(); ++i ) { for (int i = 0; i < variantList.size(); ++i ) {
if (variantList.at(i).at(0) == connName) { if (variantList.at(i).at(0) == connName) {
qDebug() << "pos in kylin-nm is " << i; qDebug() << "pos in kylin-nm is " << i;

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -32,8 +32,10 @@
#include "kwidget.h" #include "kwidget.h"
#include "kswitchbutton.h" #include "kswitchbutton.h"
#include "itemframe.h" #include "itemframe.h"
#include "ukcccommon.h"
using namespace kdk; using namespace kdk;
using namespace ukcc;
namespace Ui { namespace Ui {
class Vpn; class Vpn;
@ -56,6 +58,7 @@ public:
bool isShowOnHomePage() const Q_DECL_OVERRIDE; bool isShowOnHomePage() const Q_DECL_OVERRIDE;
QIcon icon() const Q_DECL_OVERRIDE; QIcon icon() const Q_DECL_OVERRIDE;
bool isEnable() const Q_DECL_OVERRIDE; bool isEnable() const Q_DECL_OVERRIDE;
QString translationPath() const Q_DECL_OVERRIDE;
public: public:
void initComponent(); void initComponent();
@ -106,8 +109,9 @@ private:
//单个lan连接状态变化 //单个lan连接状态变化
void itemActiveConnectionStatusChanged(VpnItem *item, int status); void itemActiveConnectionStatusChanged(VpnItem *item, int status);
void setShowSwitchStatus(); void setShowSwitchStatus();
// 搜索词条
void initSearchText();
private slots: private slots:
void onVpnAdd(QStringList); void onVpnAdd(QStringList);

View File

@ -47,4 +47,11 @@ INSTALLS += target \
trans trans
TRANSLATIONS += \ TRANSLATIONS += \
translations/zh_CN.ts translations/zh_CN.ts \
translations/bo_CN.ts \
translations/en_US.ts \
translations/mn.ts
CONFIG(release, debug|release) {
!system($$PWD/translate_generation.sh): error("Failed to generate translation")
}

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -19,6 +19,8 @@
*/ */
#include "vpnitem.h" #include "vpnitem.h"
#include <QPainter> #include <QPainter>
#include <QPainterPath>
#include <QApplication>
#define FRAME_SPEED 150 #define FRAME_SPEED 150
#define LIMIT_TIME 60*1000 #define LIMIT_TIME 60*1000
#define TOTAL_PAGE 8 #define TOTAL_PAGE 8
@ -33,11 +35,6 @@ VpnItem::VpnItem(bool bAcitve, QWidget *parent)
this->setMinimumSize(550, 58); this->setMinimumSize(550, 58);
this->setProperty("useButtonPalette", true); this->setProperty("useButtonPalette", true);
this->setFlat(true); this->setFlat(true);
QPalette pal = this->palette();
QColor color = pal.color(QPalette::Button);
color.setAlphaF(0.5);
pal.setColor(QPalette::Button, color);
this->setPalette(pal);
QHBoxLayout *mLanLyt = new QHBoxLayout(this); QHBoxLayout *mLanLyt = new QHBoxLayout(this);
mLanLyt->setContentsMargins(16,0,16,0); mLanLyt->setContentsMargins(16,0,16,0);
mLanLyt->setSpacing(16); mLanLyt->setSpacing(16);
@ -136,12 +133,16 @@ void VpnItem::onDeletetTriggered()
void VpnItem::paintEvent(QPaintEvent *event) void VpnItem::paintEvent(QPaintEvent *event)
{ {
QPalette pal = this->palette();
QPainter painter(this); QPainter painter(this);
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿 painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
painter.setPen(Qt::NoPen); painter.setPen(Qt::NoPen);
painter.setBrush(pal.color(QPalette::Base)); painter.setBrush(this->palette().base().color());
QPalette pal = qApp->palette();
QColor color = pal.color(QPalette::Button);
color.setAlphaF(0.5);
pal.setColor(QPalette::Button, color);
this->setPalette(pal);
QRect rect = this->rect(); QRect rect = this->rect();
@ -175,11 +176,11 @@ bool VpnItem::eventFilter(QObject *watched, QEvent *event)
{ {
//菜单右边界与按钮右边界对齐 //菜单右边界与按钮右边界对齐
if (event->type() == QEvent::Show && watched == m_moreMenu) { if (event->type() == QEvent::Show && watched == m_moreMenu) {
int menuXPos = m_moreMenu->pos().x();
int menuWidth = m_moreMenu->size().width(); int menuWidth = m_moreMenu->size().width();
int btnWidth = m_moreButton->size().width(); int btnWidth = m_moreButton->size().width();
int btnGlobalXPos = mapToGlobal(m_moreButton->pos()).x();
QPoint pos = QPoint (menuXPos - menuWidth + btnWidth, m_moreMenu->pos().y()); QPoint pos = QPoint (btnGlobalXPos - menuWidth + btnWidth, m_moreMenu->pos().y());
m_moreMenu->move(pos); m_moreMenu->move(pos);
return true; return true;
} }

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,

View File

@ -0,0 +1,15 @@
#!/bin/bash
ts_list=(`ls translations/*.ts`)
source /etc/os-release
version=(`echo $ID`)
for ts in "${ts_list[@]}"
do
printf "\nprocess ${ts}\n"
if [ "$version" == "fedora" ] || [ "$version" == "opensuse-leap" ] || [ "$version" == "opensuse-tumbleweed" ];then
lrelease-qt5 "${ts}"
else
lrelease "${ts}"
fi
done

View File

@ -1 +0,0 @@
<クd<>箆!ソ`。スン

View File

@ -23,49 +23,49 @@
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="35"/> <location filename="../wlanconnect.ui" line="35"/>
<location filename="../wlanconnect.cpp" line="144"/> <location filename="../wlanconnect.cpp" line="140"/>
<location filename="../wlanconnect.cpp" line="215"/> <location filename="../wlanconnect.cpp" line="211"/>
<source>WLAN</source> <source>WLAN</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="94"/> <location filename="../wlanconnect.ui" line="94"/>
<location filename="../wlanconnect.cpp" line="217"/> <location filename="../wlanconnect.cpp" line="213"/>
<source>open</source> <source>open</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/wlanconnect/open</extra-contents_path> <extra-contents_path>/wlanconnect/open</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="147"/> <location filename="../wlanconnect.ui" line="147"/>
<location filename="../wlanconnect.cpp" line="214"/> <location filename="../wlanconnect.cpp" line="210"/>
<source>Advanced settings</source> <source>Advanced settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path> <extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="127"/> <location filename="../wlanconnect.cpp" line="123"/>
<source>ukui control center</source> <source>Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="130"/> <location filename="../wlanconnect.cpp" line="126"/>
<source>ukui control center desktop message</source> <source>Settings desktop message</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="232"/> <location filename="../wlanconnect.cpp" line="228"/>
<source>No wireless network card detected</source> <source>No wireless network card detected</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="368"/> <location filename="../wlanconnect.cpp" line="364"/>
<location filename="../wlanconnect.cpp" line="1039"/> <location filename="../wlanconnect.cpp" line="1033"/>
<location filename="../wlanconnect.cpp" line="1101"/> <location filename="../wlanconnect.cpp" line="1095"/>
<source>connected</source> <source>connected</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="976"/> <location filename="../wlanconnect.cpp" line="970"/>
<source>card</source> <source>card</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -23,49 +23,57 @@
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="35"/> <location filename="../wlanconnect.ui" line="35"/>
<location filename="../wlanconnect.cpp" line="144"/> <location filename="../wlanconnect.cpp" line="140"/>
<location filename="../wlanconnect.cpp" line="215"/> <location filename="../wlanconnect.cpp" line="211"/>
<source>WLAN</source> <source>WLAN</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="94"/> <location filename="../wlanconnect.ui" line="94"/>
<location filename="../wlanconnect.cpp" line="217"/> <location filename="../wlanconnect.cpp" line="213"/>
<source>open</source> <source>open</source>
<translation></translation> <translation></translation>
<extra-contents_path>/wlanconnect/open</extra-contents_path> <extra-contents_path>/wlanconnect/open</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="147"/> <location filename="../wlanconnect.ui" line="147"/>
<location filename="../wlanconnect.cpp" line="214"/> <location filename="../wlanconnect.cpp" line="210"/>
<source>Advanced settings</source> <source>Advanced settings</source>
<translation></translation> <translation></translation>
<extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path> <extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="127"/>
<source>ukui control center</source> <source>ukui control center</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="130"/>
<source>ukui control center desktop message</source> <source>ukui control center desktop message</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="232"/> <location filename="../wlanconnect.cpp" line="123"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="126"/>
<source>Settings desktop message</source>
<translation> </translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="228"/>
<source>No wireless network card detected</source> <source>No wireless network card detected</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="368"/> <location filename="../wlanconnect.cpp" line="364"/>
<location filename="../wlanconnect.cpp" line="1039"/> <location filename="../wlanconnect.cpp" line="1033"/>
<location filename="../wlanconnect.cpp" line="1101"/> <location filename="../wlanconnect.cpp" line="1095"/>
<source>connected</source> <source>connected</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="976"/> <location filename="../wlanconnect.cpp" line="970"/>
<source>card</source> <source>card</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -23,49 +23,57 @@
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="35"/> <location filename="../wlanconnect.ui" line="35"/>
<location filename="../wlanconnect.cpp" line="144"/> <location filename="../wlanconnect.cpp" line="140"/>
<location filename="../wlanconnect.cpp" line="215"/> <location filename="../wlanconnect.cpp" line="211"/>
<source>WLAN</source> <source>WLAN</source>
<translation>WLAN</translation> <translation>WLAN</translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="94"/> <location filename="../wlanconnect.ui" line="94"/>
<location filename="../wlanconnect.cpp" line="217"/> <location filename="../wlanconnect.cpp" line="213"/>
<source>open</source> <source>open</source>
<translation>open</translation> <translation>open</translation>
<extra-contents_path>/wlanconnect/open</extra-contents_path> <extra-contents_path>/wlanconnect/open</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="147"/> <location filename="../wlanconnect.ui" line="147"/>
<location filename="../wlanconnect.cpp" line="214"/> <location filename="../wlanconnect.cpp" line="210"/>
<source>Advanced settings</source> <source>Advanced settings</source>
<translation>Advanced settings</translation> <translation>Advanced settings</translation>
<extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path> <extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="127"/>
<source>ukui control center</source> <source>ukui control center</source>
<translation>ukui control center</translation> <translation type="vanished">ukui control center</translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="130"/>
<source>ukui control center desktop message</source> <source>ukui control center desktop message</source>
<translation>ukui control center desktop message</translation> <translation type="vanished">ukui control center desktop message</translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="232"/> <location filename="../wlanconnect.cpp" line="123"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="126"/>
<source>Settings desktop message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="228"/>
<source>No wireless network card detected</source> <source>No wireless network card detected</source>
<translation>No wireless network card detected</translation> <translation>No wireless network card detected</translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="368"/> <location filename="../wlanconnect.cpp" line="364"/>
<location filename="../wlanconnect.cpp" line="1039"/> <location filename="../wlanconnect.cpp" line="1033"/>
<location filename="../wlanconnect.cpp" line="1101"/> <location filename="../wlanconnect.cpp" line="1095"/>
<source>connected</source> <source>connected</source>
<translation>connected</translation> <translation>connected</translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="976"/> <location filename="../wlanconnect.cpp" line="970"/>
<source>card</source> <source>card</source>
<translation>card</translation> <translation>card</translation>
</message> </message>

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="mn">
<context>
<name>AddNetBtn</name>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation> </translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation> </translation>
</message>
</context>
<context>
<name>WlanConnect</name>
<message>
<location filename="../wlanconnect.ui" line="14"/>
<source>WlanConnect</source>
<translation> </translation>
</message>
<message>
<location filename="../wlanconnect.ui" line="35"/>
<location filename="../wlanconnect.cpp" line="140"/>
<location filename="../wlanconnect.cpp" line="211"/>
<source>WLAN</source>
<translation> </translation>
</message>
<message>
<location filename="../wlanconnect.ui" line="94"/>
<location filename="../wlanconnect.cpp" line="213"/>
<source>open</source>
<translation></translation>
<extra-contents_path>/wlanconnect/open</extra-contents_path>
</message>
<message>
<location filename="../wlanconnect.ui" line="147"/>
<location filename="../wlanconnect.cpp" line="210"/>
<source>Advanced settings</source>
<translation> </translation>
<extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path>
</message>
<message>
<source>ukui control center</source>
<translation type="vanished"> </translation>
</message>
<message>
<source>ukui control center desktop message</source>
<translation type="vanished"> </translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="123"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="126"/>
<source>Settings desktop message</source>
<translation> </translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="228"/>
<source>No wireless network card detected</source>
<translation> </translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="364"/>
<location filename="../wlanconnect.cpp" line="1033"/>
<location filename="../wlanconnect.cpp" line="1095"/>
<source>connected</source>
<translation> </translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="970"/>
<source>card</source>
<translation> </translation>
</message>
</context>
</TS>

View File

@ -1 +0,0 @@
<クd<>箆!ソ`。スン

View File

@ -23,49 +23,49 @@
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="35"/> <location filename="../wlanconnect.ui" line="35"/>
<location filename="../wlanconnect.cpp" line="144"/> <location filename="../wlanconnect.cpp" line="140"/>
<location filename="../wlanconnect.cpp" line="215"/> <location filename="../wlanconnect.cpp" line="211"/>
<source>WLAN</source> <source>WLAN</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="94"/> <location filename="../wlanconnect.ui" line="94"/>
<location filename="../wlanconnect.cpp" line="217"/> <location filename="../wlanconnect.cpp" line="213"/>
<source>open</source> <source>open</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/wlanconnect/open</extra-contents_path> <extra-contents_path>/wlanconnect/open</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="147"/> <location filename="../wlanconnect.ui" line="147"/>
<location filename="../wlanconnect.cpp" line="214"/> <location filename="../wlanconnect.cpp" line="210"/>
<source>Advanced settings</source> <source>Advanced settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
<extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path> <extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="127"/> <location filename="../wlanconnect.cpp" line="123"/>
<source>ukui control center</source> <source>Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="130"/> <location filename="../wlanconnect.cpp" line="126"/>
<source>ukui control center desktop message</source> <source>Settings desktop message</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="232"/> <location filename="../wlanconnect.cpp" line="228"/>
<source>No wireless network card detected</source> <source>No wireless network card detected</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="368"/> <location filename="../wlanconnect.cpp" line="364"/>
<location filename="../wlanconnect.cpp" line="1039"/> <location filename="../wlanconnect.cpp" line="1033"/>
<location filename="../wlanconnect.cpp" line="1101"/> <location filename="../wlanconnect.cpp" line="1095"/>
<source>connected</source> <source>connected</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="976"/> <location filename="../wlanconnect.cpp" line="970"/>
<source>card</source> <source>card</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -23,49 +23,57 @@
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="35"/> <location filename="../wlanconnect.ui" line="35"/>
<location filename="../wlanconnect.cpp" line="144"/> <location filename="../wlanconnect.cpp" line="140"/>
<location filename="../wlanconnect.cpp" line="215"/> <location filename="../wlanconnect.cpp" line="211"/>
<source>WLAN</source> <source>WLAN</source>
<translation>线</translation> <translation>线</translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="94"/> <location filename="../wlanconnect.ui" line="94"/>
<location filename="../wlanconnect.cpp" line="217"/> <location filename="../wlanconnect.cpp" line="213"/>
<source>open</source> <source>open</source>
<translation></translation> <translation></translation>
<extra-contents_path>/wlanconnect/open</extra-contents_path> <extra-contents_path>/wlanconnect/open</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../wlanconnect.ui" line="147"/> <location filename="../wlanconnect.ui" line="147"/>
<location filename="../wlanconnect.cpp" line="214"/> <location filename="../wlanconnect.cpp" line="210"/>
<source>Advanced settings</source> <source>Advanced settings</source>
<translation></translation> <translation></translation>
<extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path> <extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="127"/>
<source>ukui control center</source> <source>ukui control center</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="130"/>
<source>ukui control center desktop message</source> <source>ukui control center desktop message</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="232"/> <location filename="../wlanconnect.cpp" line="123"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="126"/>
<source>Settings desktop message</source>
<translation> </translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="228"/>
<source>No wireless network card detected</source> <source>No wireless network card detected</source>
<translation>线</translation> <translation>线</translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="368"/> <location filename="../wlanconnect.cpp" line="364"/>
<location filename="../wlanconnect.cpp" line="1039"/> <location filename="../wlanconnect.cpp" line="1033"/>
<location filename="../wlanconnect.cpp" line="1101"/> <location filename="../wlanconnect.cpp" line="1095"/>
<source>connected</source> <source>connected</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../wlanconnect.cpp" line="976"/> <location filename="../wlanconnect.cpp" line="970"/>
<source>card</source> <source>card</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -124,10 +124,10 @@ void WlanConnect::showDesktopNotify(const QString &message)
"org.freedesktop.Notifications", "org.freedesktop.Notifications",
QDBusConnection::sessionBus()); QDBusConnection::sessionBus());
QList<QVariant> args; QList<QVariant> args;
args<<(tr("ukui control center")) args<<(tr("Settings"))
<<((unsigned int) 0) <<((unsigned int) 0)
<<QString("gnome-dev-ethernet") <<QString("gnome-dev-ethernet")
<<tr("ukui control center desktop message") //显示的是什么类型的信息 <<tr("Settings desktop message") //显示的是什么类型的信息
<<message //显示的具体信息 <<message //显示的具体信息
<<QStringList() <<QStringList()
<<QVariantMap() <<QVariantMap()
@ -231,6 +231,7 @@ bool WlanConnect::eventFilter(QObject *w, QEvent *e) {
if (!getSwitchBtnEnable()) { if (!getSwitchBtnEnable()) {
showDesktopNotify(tr("No wireless network card detected")); showDesktopNotify(tr("No wireless network card detected"));
} else { } else {
UkccCommon::buriedSettings(QString("wlanconnect"), QString("Open"), QString("settings"),!getSwitchBtnState()?"true":"false");
if (m_interface != nullptr && m_interface->isValid()) { if (m_interface != nullptr && m_interface->isValid()) {
m_interface->call(QStringLiteral("setWirelessSwitchEnable"), !getSwitchBtnState()); m_interface->call(QStringLiteral("setWirelessSwitchEnable"), !getSwitchBtnState());
} }
@ -276,7 +277,7 @@ void WlanConnect::initComponent() {
//删除无线网络 //删除无线网络
connect(m_interface, SIGNAL(wlanRemove(QString, QString)), this, SLOT(onNetworkRemove(QString, QString)), Qt::QueuedConnection); connect(m_interface, SIGNAL(wlanRemove(QString, QString)), this, SLOT(onNetworkRemove(QString, QString)), Qt::QueuedConnection);
//网卡插拔处理 //网卡插拔处理
connect(m_interface, SIGNAL(deviceStatusChanged()), this, SLOT(onDeviceStatusChanged()), Qt::QueuedConnection); connect(m_interface, SIGNAL(wirelessDeviceStatusChanged()), this, SLOT(onDeviceStatusChanged()), Qt::QueuedConnection);
//信号更新处理 改为每过固定时间 主动获取 //信号更新处理 改为每过固定时间 主动获取
// connect(m_interface, SIGNAL(signalStrengthChange(QString, QString, int)), this, SLOT(updateStrengthList(QString, QString, int))); // connect(m_interface, SIGNAL(signalStrengthChange(QString, QString, int)), this, SLOT(updateStrengthList(QString, QString, int)));
//网卡name处理 //网卡name处理
@ -287,6 +288,7 @@ void WlanConnect::initComponent() {
//高级设置 //高级设置
connect(ui->detailBtn, &QPushButton::clicked, this, [=](bool checked) { connect(ui->detailBtn, &QPushButton::clicked, this, [=](bool checked) {
Q_UNUSED(checked) Q_UNUSED(checked)
UkccCommon::buriedSettings(QString("wlanconnect"), QString("Advanced settings"), QString("clicked"));
runExternalApp(); runExternalApp();
}); });
@ -607,23 +609,33 @@ void WlanConnect::onActiveConnectionChanged(QString deviceName, QString ssid, QS
if (!deviceFrameMap.contains(deviceName)) { if (!deviceFrameMap.contains(deviceName)) {
return; return;
} }
for (int i = 0; i < deviceFrameMap[deviceName]->itemMap.size(); ++i) { if (deviceFrameMap[deviceName]->itemMap.contains(ssid)) {
if (deviceFrameMap[deviceName]->itemMap.contains(ssid)) { item = deviceFrameMap[deviceName]->itemMap[ssid];
item = deviceFrameMap[deviceName]->itemMap[ssid]; if (status == ACTIVATED || status == ACTIVATING) {
if (status == ACTIVATED || status == ACTIVATING) { deviceFrameMap[deviceName]->itemMap[ssid]->uuid = uuid;
deviceFrameMap[deviceName]->itemMap[ssid]->uuid = uuid; deviceFrameMap[deviceName]->uuid = uuid;
deviceFrameMap[deviceName]->uuid = uuid; if (status == ACTIVATED) {
if (status == ACTIVATED) { deviceFrameMap[deviceName]->lanItemLayout->removeWidget(item);
deviceFrameMap[deviceName]->lanItemLayout->removeWidget(item); deviceFrameMap[deviceName]->lanItemLayout->insertWidget(0,item);
deviceFrameMap[deviceName]->lanItemLayout->insertWidget(0,item); deviceFrameMap[deviceName]->filletStyleChange();
deviceFrameMap[deviceName]->filletStyleChange(); }
} } else if (status == DEACTIVATED) {
} else if (status == DEACTIVATED) { deviceFrameMap[deviceName]->itemMap[ssid]->uuid.clear();
deviceFrameMap[deviceName]->itemMap[ssid]->uuid.clear(); deviceFrameMap[deviceName]->uuid.clear();
deviceFrameMap[deviceName]->uuid.clear(); //todo 断开后排序 现在等下次更新列表 自动排序
//todo 断开后排序 现在等下次更新列表 自动排序 }
} else {
if (uuid == deviceFrameMap[deviceName]->uuid) {
QMap<QString, WlanItem*>::iterator itemIter;
for (itemIter = deviceFrameMap[deviceName]->itemMap.begin(); itemIter != deviceFrameMap[deviceName]->itemMap.end(); itemIter++) {
if (itemIter.value()->uuid == uuid ) {
item = itemIter.value();
if (status == DEACTIVATED) {
itemIter.value()->uuid.clear();
}
break;
}
} }
break;
} }
} }
} }
@ -704,7 +716,14 @@ void WlanConnect::getDeviceList(QStringList &list)
auto dbusArg = result.arguments().at(0).value<QDBusArgument>(); auto dbusArg = result.arguments().at(0).value<QDBusArgument>();
QMap<QString,bool> map; QMap<QString,bool> map;
dbusArg >> map; dbusArg >> map;
list = map.keys();
//筛选已托管(managed)网卡
QMap<QString, bool>::iterator iters;
for (iters = map.begin(); iters != map.end(); ++iters) {
if (iters.value() == true) {
list << iters.key();
}
}
} }
void WlanConnect::initSwtichState() void WlanConnect::initSwtichState()
@ -977,6 +996,7 @@ void WlanConnect::addDeviceFrame(QString devName)
deviceFrameMap.insert(devName, itemFrame); deviceFrameMap.insert(devName, itemFrame);
connect(itemFrame->addWlanWidget, &AddNetBtn::clicked, this, [=](){ connect(itemFrame->addWlanWidget, &AddNetBtn::clicked, this, [=](){
UkccCommon::buriedSettings(QString("wlanconnect"), QString("Add wlan"), QString("clicked"));
if (m_interface != nullptr && m_interface->isValid()) { if (m_interface != nullptr && m_interface->isValid()) {
qDebug() << "[NetConnect]call showAddOtherWlanWidget" << devName << __LINE__; qDebug() << "[NetConnect]call showAddOtherWlanWidget" << devName << __LINE__;
m_interface->call(QStringLiteral("showAddOtherWlanWidget"), devName); m_interface->call(QStringLiteral("showAddOtherWlanWidget"), devName);
@ -1048,6 +1068,7 @@ void WlanConnect::addOneWlanFrame(ItemFrame *frame, QString deviceName, QString
if (m_interface == nullptr || !m_interface->isValid()) { if (m_interface == nullptr || !m_interface->isValid()) {
return; return;
} }
UkccCommon::buriedSettings(QString("wlanconnect"), QString("info"), QString("clicked"));
qDebug() << "[WlanConnect]call showPropertyWidget" << __LINE__; qDebug() << "[WlanConnect]call showPropertyWidget" << __LINE__;
m_interface->call(QStringLiteral("showPropertyWidget"), deviceName, name); m_interface->call(QStringLiteral("showPropertyWidget"), deviceName, name);
qDebug() << "[WlanConnect]call showPropertyWidget respond" << __LINE__; qDebug() << "[WlanConnect]call showPropertyWidget respond" << __LINE__;

View File

@ -47,8 +47,10 @@
#include "wlanitem.h" #include "wlanitem.h"
#include "kwidget.h" #include "kwidget.h"
#include "kswitchbutton.h" #include "kswitchbutton.h"
#include "ukcccommon.h"
using namespace kdk; using namespace kdk;
using namespace ukcc;
namespace Ui { namespace Ui {
class WlanConnect; class WlanConnect;
@ -148,8 +150,8 @@ private:
return m_wifiSwitch->isChecked(); return m_wifiSwitch->isChecked();
} }
} }
bool LaunchApp(QString desktopFile); bool LaunchApp(QString desktopFile);
protected: protected:
bool eventFilter(QObject *w,QEvent *e); bool eventFilter(QObject *w,QEvent *e);

View File

@ -7,6 +7,11 @@ include(../component/addbtn.pri)
TARGET = $$qtLibraryTarget(wlanconnect) TARGET = $$qtLibraryTarget(wlanconnect)
DESTDIR = ../.. DESTDIR = ../..
CONFIG(release, debug|release) {
!system($$PWD/translate_generation.sh): error("Failed to generate translation")
}
target.path = $$[QT_INSTALL_LIBS]/ukui-control-center target.path = $$[QT_INSTALL_LIBS]/ukui-control-center
trans.files = translations/* trans.files = translations/*
trans.path = /usr/share/kylin-nm/wlanconnect/ trans.path = /usr/share/kylin-nm/wlanconnect/
@ -52,4 +57,5 @@ TRANSLATIONS += \
translations/tr.ts \ translations/tr.ts \
translations/bo.ts \ translations/bo.ts \
translations/bo_CN.ts \ translations/bo_CN.ts \
translations/en_US.ts translations/en_US.ts \
translations/mn.ts

View File

@ -92,17 +92,16 @@ void WlanItem::stopLoading(){
void WlanItem::paintEvent(QPaintEvent *event) void WlanItem::paintEvent(QPaintEvent *event)
{ {
// QPalette pal = qApp->palette();
QPainter painter(this); QPainter painter(this);
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿 painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
painter.setPen(Qt::NoPen); painter.setPen(Qt::NoPen);
painter.setBrush(this->palette().base().color()); painter.setBrush(this->palette().base().color());
// QColor color = pal.color(QPalette::Button); QPalette pal = qApp->palette();
// color.setAlphaF(0.5); QColor color = pal.color(QPalette::Button);
// pal.setColor(QPalette::Button, color); color.setAlphaF(0.5);
// this->setPalette(pal); pal.setColor(QPalette::Button, color);
this->setPalette(pal);
QRect rect = this->rect(); QRect rect = this->rect();

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -19,6 +19,7 @@
*/ */
#include "listitem.h" #include "listitem.h"
#include <QDebug> #include <QDebug>
#include "themepalette.h"
#define MAIN_LAYOUT_MARGINS 0,0,0,0 #define MAIN_LAYOUT_MARGINS 0,0,0,0
#define MAIN_LAYOUT_SPACING 0 #define MAIN_LAYOUT_SPACING 0
@ -28,8 +29,9 @@
#define FRAME_WIDTH 404 #define FRAME_WIDTH 404
#define INFO_ICON_WIDTH 16 #define INFO_ICON_WIDTH 16
#define INFO_ICON_HEIGHT 16 #define INFO_ICON_HEIGHT 16
#define LIGHT_HOVER_COLOR QColor(240,240,240,255)
#define DARK_HOVER_COLOR QColor(15,15,15,255) #define THEME_SCHAME "org.ukui.style"
#define COLOR_THEME "styleName"
ListItem::ListItem(QWidget *parent) : QFrame(parent) ListItem::ListItem(QWidget *parent) : QFrame(parent)
{ {
@ -39,6 +41,7 @@ ListItem::ListItem(QWidget *parent) : QFrame(parent)
initConnection(); initConnection();
connect(qApp, &QApplication::paletteChanged, this, &ListItem::onPaletteChanged); connect(qApp, &QApplication::paletteChanged, this, &ListItem::onPaletteChanged);
// m_itemFrame->installEventFilter(this); // m_itemFrame->installEventFilter(this);
onPaletteChanged();
} }
ListItem::~ListItem() ListItem::~ListItem()
@ -144,8 +147,22 @@ void ListItem::initConnection()
void ListItem::onPaletteChanged() void ListItem::onPaletteChanged()
{ {
// QPalette pal = qApp->palette(); QPalette pal = qApp->palette();
// pal.setColor(QPalette::Window, qApp->palette().base().color()); QGSettings * styleGsettings = nullptr;
// this->setPalette(pal); const QByteArray style_id(THEME_SCHAME);
if (QGSettings::isSchemaInstalled(style_id)) {
styleGsettings = new QGSettings(style_id, QByteArray(), this);
QString currentTheme = styleGsettings->get(COLOR_THEME).toString();
if(currentTheme == "ukui-default"){
pal = themePalette(true, this);
}
}
this->setPalette(pal);
if (m_menu != nullptr) {
pal.setColor(QPalette::Base, pal.color(QPalette::Base));
pal.setColor(QPalette::Text, pal.color(QPalette::Text));
m_menu->setPalette(pal);
}
} }

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -74,10 +74,10 @@ public:
private: private:
void initUI(); void initUI();
void initConnection(); void initConnection();
void onPaletteChanged();
public Q_SLOTS: public Q_SLOTS:
virtual void onNetButtonClicked() = 0; virtual void onNetButtonClicked() = 0;
void onPaletteChanged();
virtual void onMenuTriggered(QAction *action)=0; virtual void onMenuTriggered(QAction *action)=0;
Q_SIGNALS: Q_SIGNALS:

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -191,11 +191,16 @@ void VpnListItem::runExternalApp() {
void VpnListItem::onInfoButtonClicked() void VpnListItem::onInfoButtonClicked()
{ {
#ifdef VPNDETAIL
if (m_vpnConnectItem.m_itemType != NetworkManager::ConnectionSettings::ConnectionType::Vpn) { if (m_vpnConnectItem.m_itemType != NetworkManager::ConnectionSettings::ConnectionType::Vpn) {
#else
if (true) {
#endif
runExternalApp(); runExternalApp();
return; return;
} }
#ifdef VPNDETAIL
if(m_vpnDetail != nullptr){ if(m_vpnDetail != nullptr){
m_vpnDetail->activateWindow(); m_vpnDetail->activateWindow();
return; return;
@ -209,6 +214,7 @@ void VpnListItem::onInfoButtonClicked()
m_vpnDetail->show(); m_vpnDetail->show();
m_vpnDetail->centerToScreen(); m_vpnDetail->centerToScreen();
#endif
} }
void VpnListItem::updateConnectionState(ConnectState state) void VpnListItem::updateConnectionState(ConnectState state)

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -23,14 +23,19 @@
#include <QLabel> #include <QLabel>
#include <QApplication> #include <QApplication>
#include <QDBusReply> #include <QDBusReply>
#include <QPainterPath>
#include <KWindowEffects> #include <KWindowEffects>
#define THEME_SCHAME "org.ukui.style"
#define COLOR_THEME "styleName"
SinglePage::SinglePage(QWidget *parent) : QWidget(parent) SinglePage::SinglePage(QWidget *parent) : QWidget(parent)
{ {
setThemePalette();
initUI(); initUI();
initWindowProperties(); initWindowProperties();
initTransparency(); initTransparency();
initWindowTheme();
} }
SinglePage::~SinglePage() SinglePage::~SinglePage()
@ -53,7 +58,7 @@ void SinglePage::initUI()
m_titleLayout->addWidget(m_titleLabel); m_titleLayout->addWidget(m_titleLabel);
m_titleLayout->addStretch(); m_titleLayout->addStretch();
m_netDivider = new Divider(this); m_netDivider = new Divider(true, this);
m_listFrame = new QFrame(this); m_listFrame = new QFrame(this);
m_listLayout = new QVBoxLayout(m_listFrame); m_listLayout = new QVBoxLayout(m_listFrame);
@ -61,8 +66,9 @@ void SinglePage::initUI()
m_listFrame->setLayout(m_listLayout); m_listFrame->setLayout(m_listLayout);
m_listWidget = new QListWidget(m_listFrame); m_listWidget = new QListWidget(m_listFrame);
m_listLayout->addWidget(m_listWidget); m_listLayout->addWidget(m_listWidget);
m_listWidget->setProperty("needTranslucent", true);
m_setDivider = new Divider(this); m_setDivider = new Divider(true, this);
m_settingsFrame = new QFrame(this); m_settingsFrame = new QFrame(this);
m_settingsFrame->setFixedHeight(TITLE_FRAME_HEIGHT); m_settingsFrame->setFixedHeight(TITLE_FRAME_HEIGHT);
@ -104,6 +110,20 @@ void SinglePage::initWindowProperties()
} }
} }
/**
* @brief SinglePage::initWindowTheme
*/
void SinglePage::initWindowTheme()
{
const QByteArray style_id(THEME_SCHAME);
if (QGSettings::isSchemaInstalled(style_id)) {
m_styleGsettings = new QGSettings(style_id, QByteArray(), this);
connect(m_styleGsettings, &QGSettings::changed, this, &SinglePage::onThemeChanged);
} else {
qWarning() << "Gsettings interface \"org.ukui.style\" is not exist!" << Q_FUNC_INFO << __LINE__;
}
}
void SinglePage::showDesktopNotify(const QString &message, QString soundName) void SinglePage::showDesktopNotify(const QString &message, QString soundName)
{ {
QDBusInterface iface("org.freedesktop.Notifications", QDBusInterface iface("org.freedesktop.Notifications",
@ -111,8 +131,8 @@ void SinglePage::showDesktopNotify(const QString &message, QString soundName)
"org.freedesktop.Notifications", "org.freedesktop.Notifications",
QDBusConnection::sessionBus()); QDBusConnection::sessionBus());
QStringList actions; //跳转动作 QStringList actions; //跳转动作
actions.append("kylin-vpn"); actions.append("default");
actions.append("default"); //默认动作:点击消息体时打开麒麟录音 actions.append("kylin-vpn"); //默认动作:点击消息体时打开麒麟录音
QMap<QString, QVariant> hints; QMap<QString, QVariant> hints;
if (!soundName.isEmpty()) { if (!soundName.isEmpty()) {
hints.insert("sound-name",soundName); //添加声音 hints.insert("sound-name",soundName); //添加声音
@ -134,7 +154,7 @@ void SinglePage::paintEvent(QPaintEvent *event) {
QPainter painter(this); QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing); painter.setRenderHint(QPainter::Antialiasing);
painter.setPen(Qt::transparent); painter.setPen(Qt::transparent);
QColor col = qApp->palette().window().color(); QColor col = this->palette().window().color();
QPainterPath rectPath; QPainterPath rectPath;
@ -165,10 +185,37 @@ void SinglePage::onTransChanged()
paintWithTrans(); paintWithTrans();
} }
void SinglePage::onThemeChanged(const QString &key)
{
if (key == COLOR_THEME) {
setThemePalette();
paintWithTrans();
Q_EMIT qApp->paletteChanged(qApp->palette());
} else if ("themeColor" == key) {
setThemePalette();
}
}
void SinglePage::setThemePalette()
{
QPalette pal = qApp->palette();
QGSettings * styleGsettings = nullptr;
const QByteArray style_id(THEME_SCHAME);
if (QGSettings::isSchemaInstalled(style_id)) {
styleGsettings = new QGSettings(style_id, QByteArray(), this);
QString currentTheme = styleGsettings->get(COLOR_THEME).toString();
if(currentTheme == "ukui-default"){
pal = themePalette(true, this);
}
}
pal.setColor(QPalette::Background, pal.base().color());
this->setPalette(pal);
}
void SinglePage::paintWithTrans() void SinglePage::paintWithTrans()
{ {
QPalette pal = this->palette(); QPalette pal = this->palette();
QColor color = qApp->palette().base().color(); QColor color = this->palette().base().color();
color.setAlphaF(m_transparency); color.setAlphaF(m_transparency);
pal.setColor(QPalette::Window, color); pal.setColor(QPalette::Window, color);
this->setPalette(pal); this->setPalette(pal);
@ -181,5 +228,3 @@ void SinglePage::keyPressEvent(QKeyEvent *event)
} }
return QWidget::keyPressEvent(event); return QWidget::keyPressEvent(event);
} }

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -41,9 +41,9 @@ using namespace kdk;
#define MAIN_LAYOUT_MARGINS 0,0,0,0 #define MAIN_LAYOUT_MARGINS 0,0,0,0
#define MAIN_LAYOUT_SPACING 0 #define MAIN_LAYOUT_SPACING 0
#define TITLE_FRAME_HEIGHT 60 //TabWidget的tab和widget有间隙和设计稿看起来一致就不能设为设计稿里的高度 #define TITLE_FRAME_HEIGHT 50
#define TITLE_LAYOUT_MARGINS 24,0,24,0 #define TITLE_LAYOUT_MARGINS 24,0,24,0
#define NET_LAYOUT_MARGINS 8,8,0,8 #define NET_LAYOUT_MARGINS 8,4,0,4
#define TEXT_HEIGHT 20 #define TEXT_HEIGHT 20
#define SETTINGS_LAYOUT_MARGINS 23,0,24,0 #define SETTINGS_LAYOUT_MARGINS 23,0,24,0
@ -71,6 +71,8 @@ Q_SIGNALS:
private Q_SLOTS: private Q_SLOTS:
void onTransChanged(); void onTransChanged();
void onThemeChanged(const QString &key);
void setThemePalette();
protected: protected:
void paintEvent(QPaintEvent *event); void paintEvent(QPaintEvent *event);
@ -84,6 +86,7 @@ protected:
private: private:
void initWindowProperties(); void initWindowProperties();
void initWindowTheme();
protected: protected:
QVBoxLayout * m_mainLayout = nullptr; QVBoxLayout * m_mainLayout = nullptr;
@ -106,6 +109,8 @@ protected:
QGSettings * m_transGsettings = nullptr; QGSettings * m_transGsettings = nullptr;
double m_transparency = 1.0; //透明度 double m_transparency = 1.0; //透明度
//监听主题的Gsettings
QGSettings * m_styleGsettings = nullptr;
}; };

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -628,8 +628,7 @@ void VpnPage::showUI()
void VpnPage::resetWindowPosition() void VpnPage::resetWindowPosition()
{ {
#define MARGIN 8
#define MARGIN 4
#define PANEL_TOP 1 #define PANEL_TOP 1
#define PANEL_LEFT 2 #define PANEL_LEFT 2
#define PANEL_RIGHT 3 #define PANEL_RIGHT 3

View File

@ -4,7 +4,7 @@
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -38,7 +38,7 @@
#define VPNPAGE_LAYOUT_MARGINS 0,0,0,0 #define VPNPAGE_LAYOUT_MARGINS 0,0,0,0
#define VPN_LIST_SPACING 0 #define VPN_LIST_SPACING 0
#define ITEM_HEIGHT 50 #define ITEM_HEIGHT 50
#define ITEM_SPACE 16 #define ITEM_SPACE 8
#define PAGE_SPACE 22 #define PAGE_SPACE 22
#define LOG_FLAG "[VpnPage]" #define LOG_FLAG "[VpnPage]"

View File

@ -1,18 +1,26 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#include "vpnaddpage.h" #include "vpnaddpage.h"
#include <QDebug> #include <QDebug>
#include "vpnconfigpage.h" #include "vpnconfigpage.h"
#define VPNADDPAGE_SIZE 520,272
#define MAINLAYOUT_MARGINS 24, 16, 24, 24
#define MAINLAYOUT_SPACE 24
#define NULL_MARGINS 0,0,0,0
#define NULL_SPACE 0
#define VPNADDPAGE_NAME_MAX_LENGTH 32
#define VPNADDPAGE_LABLE_FIXEDWIDTH 112
#define VPNADDPAGE_COMBOBOX_FIXEDWIDTH 360
#define VPNADDPAGE_INPUTBOX_FIXEDWIDTH 360
vpnAddPage::vpnAddPage(QWidget *parent) : QWidget(parent) vpnAddPage::vpnAddPage(QWidget *parent) : QWidget(parent)
{ {
m_vpnConnOperation = new KyVpnConnectOperation(this); m_vpnConnOperation = new KyVpnConnectOperation(this);
@ -44,8 +52,8 @@ void vpnAddPage::initWindow()
void vpnAddPage::initUI() void vpnAddPage::initUI()
{ {
QVBoxLayout *mainLayout = new QVBoxLayout(this); QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(MAINLAYOUT_MARGINS); mainLayout->setContentsMargins(VPNADDPAGE_MAINLAYOUT_MARGINS);
mainLayout->setSpacing(MAINLAYOUT_SPACE); mainLayout->setSpacing(VPNADDPAGE_NULLSPACE);
initVpnTypeFrame(); initVpnTypeFrame();
initVpnNameFrame(); initVpnNameFrame();
@ -65,10 +73,11 @@ void vpnAddPage::initVpnTypeFrame()
{ {
m_vpnTypeFrame = new QFrame(this); m_vpnTypeFrame = new QFrame(this);
m_vpnTypeFrame->setFrameShape(QFrame::Shape::NoFrame); m_vpnTypeFrame->setFrameShape(QFrame::Shape::NoFrame);
m_vpnTypeFrame->setFixedSize(VPNADDPAGE_FRAME_FIXEDSIZE);
QHBoxLayout *typeLayout = new QHBoxLayout(m_vpnTypeFrame); QHBoxLayout *typeLayout = new QHBoxLayout(m_vpnTypeFrame);
typeLayout->setContentsMargins(NULL_MARGINS); typeLayout->setContentsMargins(VPNADDPAGE_ITEM_MARGINS);
typeLayout->setSpacing(NULL_SPACE); typeLayout->setSpacing(VPNADDPAGE_NULLSPACE);
QLabel *vpnTypeLabel = new QLabel(tr("VPN Type"), this); QLabel *vpnTypeLabel = new QLabel(tr("VPN Type"), this);
vpnTypeLabel->setFixedWidth(VPNADDPAGE_LABLE_FIXEDWIDTH); vpnTypeLabel->setFixedWidth(VPNADDPAGE_LABLE_FIXEDWIDTH);
@ -93,10 +102,11 @@ void vpnAddPage::initVpnNameFrame()
{ {
m_vpnNameFrame = new QFrame(this); m_vpnNameFrame = new QFrame(this);
m_vpnNameFrame->setFrameShape(QFrame::Shape::NoFrame); m_vpnNameFrame->setFrameShape(QFrame::Shape::NoFrame);
m_vpnNameFrame->setFixedSize(VPNADDPAGE_FRAME_FIXEDSIZE);
QHBoxLayout *nameLayout = new QHBoxLayout(m_vpnNameFrame); QHBoxLayout *nameLayout = new QHBoxLayout(m_vpnNameFrame);
nameLayout->setContentsMargins(NULL_MARGINS); nameLayout->setContentsMargins(VPNADDPAGE_ITEM_MARGINS);
nameLayout->setSpacing(NULL_SPACE); nameLayout->setSpacing(VPNADDPAGE_NULLSPACE);
QLabel *vpnNameLabel = new QLabel(tr("VPN Name"), this); QLabel *vpnNameLabel = new QLabel(tr("VPN Name"), this);
vpnNameLabel->setFixedWidth(VPNADDPAGE_LABLE_FIXEDWIDTH); vpnNameLabel->setFixedWidth(VPNADDPAGE_LABLE_FIXEDWIDTH);
@ -115,10 +125,11 @@ void vpnAddPage::initVpnServerFrame()
{ {
m_vpnServerFrame = new QFrame(this); m_vpnServerFrame = new QFrame(this);
m_vpnServerFrame->setFrameShape(QFrame::Shape::NoFrame); m_vpnServerFrame->setFrameShape(QFrame::Shape::NoFrame);
m_vpnServerFrame->setFixedSize(VPNADDPAGE_FRAME_FIXEDSIZE);
QHBoxLayout *serverLayout = new QHBoxLayout(m_vpnServerFrame); QHBoxLayout *serverLayout = new QHBoxLayout(m_vpnServerFrame);
serverLayout->setContentsMargins(NULL_MARGINS); serverLayout->setContentsMargins(VPNADDPAGE_ITEM_MARGINS);
serverLayout->setSpacing(NULL_SPACE); serverLayout->setSpacing(VPNADDPAGE_NULLSPACE);
QLabel *vpnServerLabel = new QLabel(tr("VPN Server"), this); QLabel *vpnServerLabel = new QLabel(tr("VPN Server"), this);
vpnServerLabel->setFixedWidth(VPNADDPAGE_LABLE_FIXEDWIDTH); vpnServerLabel->setFixedWidth(VPNADDPAGE_LABLE_FIXEDWIDTH);
@ -140,22 +151,35 @@ void vpnAddPage::initVpnServerFrame()
void vpnAddPage::initButtonFrame() void vpnAddPage::initButtonFrame()
{ {
m_buttonFrame = new QFrame(this); m_buttonFrame = new QFrame(this);
m_buttonFrame->setFixedSize(VPNDETAILPAGE_FRAME_FIXEDSIZE);
QHBoxLayout *buttonLayout = new QHBoxLayout(m_buttonFrame); QHBoxLayout *buttonLayout = new QHBoxLayout(m_buttonFrame);
buttonLayout->setContentsMargins(NULL_MARGINS); buttonLayout->setContentsMargins(VPNDETAILPAGE_ITEM_MARGINS);
buttonLayout->setSpacing(NULL_SPACE); buttonLayout->setSpacing(VPNDETAILPAGE_NULLSPACE);
QLabel *autoConnectLabel = new QLabel(this);
m_autoConnectBox = new QCheckBox(this); m_autoConnectBox = new QCheckBox(this);
m_autoConnectBox->setText(tr("Auto Connection")); autoConnectLabel->setText(tr("Auto Connection"));
QWidget *autoConWidget = new QWidget(this);
QHBoxLayout *autoLayout = new QHBoxLayout(autoConWidget);
autoLayout->setContentsMargins(VPNDETAILPAGE_NULLMAGINS);
autoLayout->setSpacing(VPNDETAILPAGE_NULLSPACE);
autoLayout->addWidget(m_autoConnectBox);
autoLayout->addWidget(autoConnectLabel);
autoConWidget->setLayout(autoLayout);
m_confimBtn = new QPushButton(this); m_confimBtn = new QPushButton(this);
m_confimBtn->setFixedSize(VPNDETAILPAGE_BUTTON_FIXEDSIZE);
m_confimBtn->setText(tr("Confirm")); m_confimBtn->setText(tr("Confirm"));
m_cancelBtn = new QPushButton(this); m_cancelBtn = new QPushButton(this);
m_cancelBtn->setFixedSize(VPNDETAILPAGE_BUTTON_FIXEDSIZE);
m_cancelBtn->setText(tr("Cancel")); m_cancelBtn->setText(tr("Cancel"));
buttonLayout->addWidget(m_autoConnectBox); buttonLayout->addWidget(autoConWidget);
buttonLayout->addStretch(); buttonLayout->addStretch();
buttonLayout->addWidget(m_cancelBtn); buttonLayout->addWidget(m_cancelBtn);
buttonLayout->addSpacing(16); buttonLayout->addSpacing(VPNDETAILPAGE_BUTTON_SPACE);
buttonLayout->addWidget(m_confimBtn); buttonLayout->addWidget(m_confimBtn);
m_buttonFrame->setLayout(buttonLayout); m_buttonFrame->setLayout(buttonLayout);
} }
@ -227,14 +251,3 @@ vpnAddPage::~vpnAddPage()
{ {
Q_EMIT this->closed(); Q_EMIT this->closed();
} }
void vpnAddPage::paintEvent(QPaintEvent *event)
{
QPalette pal = qApp->palette();
QPainter painter(this);
painter.setBrush(pal.color(QPalette::Base));
painter.drawRect(this->rect());
painter.fillRect(rect(), QBrush(pal.color(QPalette::Base)));
return QWidget::paintEvent(event);
}

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#ifndef VPNADDPAGE_H #ifndef VPNADDPAGE_H
#define VPNADDPAGE_H #define VPNADDPAGE_H
@ -13,10 +32,33 @@
#include <QFormLayout> #include <QFormLayout>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QApplication> #include <QApplication>
#include <QPainter>
#include "kyvpnconnectoperation.h" #include "kyvpnconnectoperation.h"
#define VPNADDPAGE_MAINLAYOUT_MARGINS 0, 12, 0, 12
#define VPNADDPAGE_ITEM_MARGINS 24, 0, 24, 0
#define VPNADDPAGE_NULLMAGINS 0, 0, 0, 0
#define VPNADDPAGE_SIZE 520,312
#define VPNADDPAGE_FRAME_FIXEDSIZE 520, 60
#define VPNADDPAGE_BUTTON_FIXEDSIZE 96, 36
#define VPNADDPAGE_NULLSPACE 0
#define VPNADDPAGE_BUTTON_SPACE 16
#define VPNADDPAGE_NAME_MAX_LENGTH 32
#define VPNADDPAGE_LABLE_FIXEDWIDTH 112
#define VPNADDPAGE_COMBOBOX_FIXEDWIDTH 360
#define VPNADDPAGE_INPUTBOX_FIXEDWIDTH 360
#define VPNDETAILPAGE_ITEM_MARGINS 24, 0, 24, 0
#define VPNDETAILPAGE_NULLMAGINS 0, 0, 0, 0
#define VPNDETAILPAGE_FRAME_FIXEDSIZE 520, 60
#define VPNDETAILPAGE_BUTTON_FIXEDSIZE 96, 36
#define VPNDETAILPAGE_NULLSPACE 0
#define VPNDETAILPAGE_BUTTON_SPACE 16
class vpnAddPage : public QWidget class vpnAddPage : public QWidget
{ {
Q_OBJECT Q_OBJECT
@ -25,9 +67,6 @@ public:
void centerToScreen(); void centerToScreen();
~vpnAddPage(); ~vpnAddPage();
protected:
void paintEvent(QPaintEvent *event);
private: private:
void initWindow(); void initWindow();
void initUI(); void initUI();
@ -41,6 +80,7 @@ private:
bool checkConfimBtnIsEnabled(); bool checkConfimBtnIsEnabled();
bool createVpnConnect(); bool createVpnConnect();
private:
QFrame *m_vpnTypeFrame = nullptr; QFrame *m_vpnTypeFrame = nullptr;
QFrame *m_vpnNameFrame = nullptr; QFrame *m_vpnNameFrame = nullptr;
QFrame *m_vpnServerFrame = nullptr; QFrame *m_vpnServerFrame = nullptr;

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#include "vpnadvancedpage.h" #include "vpnadvancedpage.h"
#include <QApplication> #include <QApplication>

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#ifndef VPNADVANCEDPAGE_H #ifndef VPNADVANCEDPAGE_H
#define VPNADVANCEDPAGE_H #define VPNADVANCEDPAGE_H

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#include "vpnconfigpage.h" #include "vpnconfigpage.h"
#include <QApplication> #include <QApplication>
#include <QFileDialog> #include <QFileDialog>

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#ifndef VPNCONFIGPAGE_H #ifndef VPNCONFIGPAGE_H
#define VPNCONFIGPAGE_H #define VPNCONFIGPAGE_H

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#include "vpndetail.h" #include "vpndetail.h"
#define WINDOW_WIDTH 520 #define WINDOW_WIDTH 520
@ -83,7 +102,7 @@ void VpnDetail::initUI()
m_topWidget = new QWidget(this); m_topWidget = new QWidget(this);
m_centerWidget = new QWidget(this); m_centerWidget = new QWidget(this);
m_bottomWidget = new QWidget(this); m_bottomWidget = new QWidget(this);
m_divider = new Divider(this); m_divider = new Divider(false, this);
m_vpnTabBar = new VpnTabBar(this); m_vpnTabBar = new VpnTabBar(this);
m_autoConnectBox = new QCheckBox(this); m_autoConnectBox = new QCheckBox(this);
m_autoConnectLabel = new QLabel(this); m_autoConnectLabel = new QLabel(this);

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#ifndef VPNDETAIL_H #ifndef VPNDETAIL_H
#define VPNDETAIL_H #define VPNDETAIL_H

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#include "vpnipv4page.h" #include "vpnipv4page.h"
#include "math.h" #include "math.h"
#include <QDebug> #include <QDebug>
@ -90,7 +109,6 @@ void VpnIpv4Page::updateVpnIpv4Info(KyVpnConfig &vpnInfo)
QString netMask(""); QString netMask("");
QString gateWay(""); QString gateWay("");
vpnInfo.setIpConfigType(IPADDRESS_V4, CONFIG_IP_DHCP); vpnInfo.setIpConfigType(IPADDRESS_V4, CONFIG_IP_DHCP);
vpnInfo.ipv4AddressConstruct(ipv4address, netMask, gateWay);
qDebug() << LOG_FLAG << "IPv4 method" << vpnInfo.m_ipv4ConfigIpType; qDebug() << LOG_FLAG << "IPv4 method" << vpnInfo.m_ipv4ConfigIpType;
qDebug() << LOG_FLAG << "Update IPv4 info finished"; qDebug() << LOG_FLAG << "Update IPv4 info finished";
} else { } else {
@ -99,7 +117,6 @@ void VpnIpv4Page::updateVpnIpv4Info(KyVpnConfig &vpnInfo)
QString gateWay = m_gateWayEdit->text(); QString gateWay = m_gateWayEdit->text();
qDebug() << ipv4address << netMask << gateWay; qDebug() << ipv4address << netMask << gateWay;
vpnInfo.setIpConfigType(IPADDRESS_V4, CONFIG_IP_MANUAL); vpnInfo.setIpConfigType(IPADDRESS_V4, CONFIG_IP_MANUAL);
vpnInfo.ipv4AddressConstruct(ipv4address, netMask, gateWay);
vpnInfo.dumpInfo(); vpnInfo.dumpInfo();
qDebug() << LOG_FLAG << "Update IPv4 info finished"; qDebug() << LOG_FLAG << "Update IPv4 info finished";
} }
@ -109,7 +126,6 @@ void VpnIpv4Page::updateVpnIpv4Info(KyVpnConfig &vpnInfo)
if (!m_dnsServerEdit->text().isEmpty()) { if (!m_dnsServerEdit->text().isEmpty()) {
ipv4DnsList.append(QHostAddress(m_dnsServerEdit->text())); ipv4DnsList.append(QHostAddress(m_dnsServerEdit->text()));
} }
vpnInfo.ipv4DnsConstruct(ipv4DnsList);
vpnInfo.m_ipv4DnsSearch.clear(); vpnInfo.m_ipv4DnsSearch.clear();
vpnInfo.m_ipv4DnsSearch.append(m_searchDomainEdit->text()); vpnInfo.m_ipv4DnsSearch.append(m_searchDomainEdit->text());

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#ifndef VPNIPV4PAGE_H #ifndef VPNIPV4PAGE_H
#define VPNIPV4PAGE_H #define VPNIPV4PAGE_H

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#include "vpnipv6page.h" #include "vpnipv6page.h"
#include "math.h" #include "math.h"
#include <QDebug> #include <QDebug>
@ -83,7 +102,6 @@ void VpnIpv6Page::updateVpnIpv6Info(KyVpnConfig &vpnInfo)
QString netMask(""); QString netMask("");
QString gateWay(""); QString gateWay("");
vpnInfo.setIpConfigType(IPADDRESS_V6, CONFIG_IP_DHCP); vpnInfo.setIpConfigType(IPADDRESS_V6, CONFIG_IP_DHCP);
vpnInfo.ipv6AddressConstruct(ipv6address, netMask, gateWay);
qDebug() << LOG_FLAG << "IPv6 method" << vpnInfo.m_ipv6ConfigIpType; qDebug() << LOG_FLAG << "IPv6 method" << vpnInfo.m_ipv6ConfigIpType;
qDebug() << LOG_FLAG << "Update IPv6 info finished"; qDebug() << LOG_FLAG << "Update IPv6 info finished";
} else { } else {
@ -92,7 +110,6 @@ void VpnIpv6Page::updateVpnIpv6Info(KyVpnConfig &vpnInfo)
QString gateWay = m_gateWayEdit->text(); QString gateWay = m_gateWayEdit->text();
qDebug() << ipv6address << netMask << gateWay; qDebug() << ipv6address << netMask << gateWay;
vpnInfo.setIpConfigType(IPADDRESS_V6, CONFIG_IP_MANUAL); vpnInfo.setIpConfigType(IPADDRESS_V6, CONFIG_IP_MANUAL);
vpnInfo.ipv6AddressConstruct(ipv6address, netMask, gateWay);
vpnInfo.dumpInfo(); vpnInfo.dumpInfo();
qDebug() << LOG_FLAG << "Update IPv6 info finished"; qDebug() << LOG_FLAG << "Update IPv6 info finished";
} }
@ -102,7 +119,6 @@ void VpnIpv6Page::updateVpnIpv6Info(KyVpnConfig &vpnInfo)
if (!m_dnsServerEdit->text().isEmpty()) { if (!m_dnsServerEdit->text().isEmpty()) {
ipv6DnsList.append(QHostAddress(m_dnsServerEdit->text())); ipv6DnsList.append(QHostAddress(m_dnsServerEdit->text()));
} }
vpnInfo.ipv6DnsConstruct(ipv6DnsList);
vpnInfo.m_ipv6DnsSearch.clear(); vpnInfo.m_ipv6DnsSearch.clear();
vpnInfo.m_ipv6DnsSearch.append(m_searchDomainEdit->text()); vpnInfo.m_ipv6DnsSearch.append(m_searchDomainEdit->text());

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#ifndef VPNIPV6PAGE_H #ifndef VPNIPV6PAGE_H
#define VPNIPV6PAGE_H #define VPNIPV6PAGE_H

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#include "vpnobject.h" #include "vpnobject.h"
#include <QApplication> #include <QApplication>
@ -127,13 +146,41 @@ void vpnObject::onTabletModeChanged(bool mode)
m_vpnPage->hide(); m_vpnPage->hide();
} }
bool vpnObject::launchApp(QString desktopFile)
{
QDBusInterface appManagerDbusInterface(KYLIN_APP_MANAGER_NAME,
KYLIN_APP_MANAGER_PATH,
KYLIN_APP_MANAGER_INTERFACE,
QDBusConnection::sessionBus());
if (!appManagerDbusInterface.isValid()) {
qWarning()<<"appManagerDbusInterface init error";
return false;
} else {
QDBusReply<bool> reply = appManagerDbusInterface.call("LaunchApp", desktopFile);
return reply;
}
}
void vpnObject::runExternalApp() {
if (!launchApp("nm-connection-editor.desktop")){
QString cmd = "nm-connection-editor";
QProcess process(this);
process.startDetached(cmd);
}
}
void vpnObject::showVpnAddWidget() void vpnObject::showVpnAddWidget()
{ {
#ifdef VPNDETAIL
if (m_vpnAddPage == nullptr) { if (m_vpnAddPage == nullptr) {
m_vpnAddPage = new vpnAddPage(); m_vpnAddPage = new vpnAddPage();
connect(m_vpnAddPage, &vpnAddPage::closed, [&] () {m_vpnAddPage = nullptr;}); connect(m_vpnAddPage, &vpnAddPage::closed, [&] () {m_vpnAddPage = nullptr;});
m_vpnAddPage->show(); m_vpnAddPage->show();
m_vpnAddPage->centerToScreen();
} }
m_vpnAddPage->raise(); m_vpnAddPage->raise();
#else
runExternalApp();
return;
#endif
} }

View File

@ -1,3 +1,22 @@
/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see <https://www.gnu.org/licenses/>.
*
*
*/
#ifndef VPNOBJECT_H #ifndef VPNOBJECT_H
#define VPNOBJECT_H #define VPNOBJECT_H
@ -40,6 +59,8 @@ private:
void initVpnIconVisible(); void initVpnIconVisible();
void initDbusConnnect(); void initDbusConnnect();
bool launchApp(QString desktopFile);
void runExternalApp();
private: private:
VpnPage *m_vpnPage = nullptr; VpnPage *m_vpnPage = nullptr;

View File

@ -88,17 +88,31 @@ int main(int argc, char *argv[])
QApplication::setQuitOnLastWindowClosed(false); QApplication::setQuitOnLastWindowClosed(false);
QThread thread; QDBusInterface interface("com.kylin.kylinvpn",
"/com/kylin/kylinvpn",
"com.kylin.kylinvpn",
QDBusConnection::sessionBus());
if(interface.isValid()) {
return 0;
}
QThread *thread = new QThread();
KyNetworkResourceManager *p_networkResource = KyNetworkResourceManager::getInstance(); KyNetworkResourceManager *p_networkResource = KyNetworkResourceManager::getInstance();
p_networkResource->moveToThread(&thread); p_networkResource->moveToThread(thread);
QObject::connect(&thread, SIGNAL(started()), p_networkResource, SLOT(onInitNetwork())); QObject::connect(thread, &QThread::started, p_networkResource, &KyNetworkResourceManager::onInitNetwork);
thread.start(); QObject::connect(&a,&QtSingleApplication::aboutToQuit, thread, &QThread::quit);
QObject::connect(thread, &QThread::finished, thread, &QThread::deleteLater);
QObject::connect(thread, &QThread::finished, [=](){
qDebug() << "release" ;
p_networkResource->Release();
});
thread->start();
// Internationalization // Internationalization
QString locale = QLocale::system().name(); QString locale = QLocale::system().name();
QTranslator trans_global; QTranslator trans_global;
qDebug() << "QLocale " << QLocale(); qDebug() << "QLocale " << QLocale();
if (trans_global.load(QLocale(), "kylin-vpn", "_", ":/translations/")) if (trans_global.load(QLocale(), "kylin-vpn", "_", "/usr/share/kylin-nm/kylin-vpn/"))
{ {
a.installTranslator(&trans_global); a.installTranslator(&trans_global);
qDebug()<<"Translations load success"; qDebug()<<"Translations load success";

View File

@ -19,7 +19,8 @@ PKGCONFIG +=kysdk-sysinfo
INCLUDEPATH += /usr/include/KF5/NetworkManagerQt INCLUDEPATH += /usr/include/KF5/NetworkManagerQt
LIBS += -L/usr/lib/ -lgsettings-qt -lX11 -lKF5NetworkManagerQt -lukui-log4qt -lkysec LIBS += -L/usr/lib/ -lgsettings-qt -lX11 -lKF5NetworkManagerQt -lukui-log4qt
#LIBS += -lkysec
target.path = /usr/bin target.path = /usr/bin
target.source += $$TARGET target.source += $$TARGET
@ -27,10 +28,13 @@ desktop.path = /etc/xdg/autostart/
desktop.files = kylin-vpn.desktop desktop.files = kylin-vpn.desktop
gschema.files = org.ukui.kylin-vpn.switch.gschema.xml gschema.files = org.ukui.kylin-vpn.switch.gschema.xml
gschema.path = /usr/share/glib-2.0/schemas/ gschema.path = /usr/share/glib-2.0/schemas/
qm_files.path = $${PREFIX}/share/kylin-nm/kylin-vpn/
qm_files.files = translations/*.qm
INSTALLS += target \ INSTALLS += target \
desktop \ desktop \
gschema \ gschema \
qm_files \
# The following define makes your compiler emit warnings if you use # The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings # any feature of Qt which has been marked as deprecated (the exact warnings
@ -53,9 +57,6 @@ include(singleapplication/qt-single-application.pri)
include(backend/backend.pri) include(backend/backend.pri)
include(frontend/frontend.pri) include(frontend/frontend.pri)
RESOURCES += \
vpnqrc.qrc
SOURCES += \ SOURCES += \
main.cpp main.cpp
@ -70,4 +71,9 @@ DISTFILES += \
TRANSLATIONS += \ TRANSLATIONS += \
translations/kylin-vpn_zh_CN.ts \ translations/kylin-vpn_zh_CN.ts \
translations/kylin-vpn_bo_CN.ts translations/kylin-vpn_bo_CN.ts \
translations/kylin-vpn_mn.ts
CONFIG(release, debug|release) {
!system($$PWD/translate_generation.sh): error("Failed to generate translation")
}

15
src-vpn/translate_generation.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
ts_list=(`ls translations/*.ts`)
source /etc/os-release
version=(`echo $ID`)
for ts in "${ts_list[@]}"
do
printf "\nprocess ${ts}\n"
if [ "$version" == "fedora" ] || [ "$version" == "opensuse-leap" ] || [ "$version" == "opensuse-tumbleweed" ];then
lrelease-qt5 "${ts}"
else
lrelease "${ts}"
fi
done

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,835 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="mn">
<context>
<name>SinglePage</name>
<message>
<location filename="../frontend/single-pages/singlepage.cpp" line="73"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/single-pages/singlepage.cpp" line="121"/>
<source>Kylin VPN</source>
<translation>VPN </translation>
</message>
<message>
<location filename="../frontend/single-pages/singlepage.cpp" line="124"/>
<source>kylin vpn applet desktop message</source>
<translation>VPN </translation>
</message>
</context>
<context>
<name>VpnAdvancedPage</name>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="791"/>
<source>MPPE encryption algorithm:</source>
<translation>MPPE :</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="792"/>
<source>Use Stateful encryption</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="793"/>
<source>Send PPP echo packets</source>
<translation>PPP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="794"/>
<source>Authentication Mode:</source>
<translation> :</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="795"/>
<source>PAP authentication</source>
<translation>PAP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="796"/>
<source>CHAP authentication</source>
<translation>CHAP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="797"/>
<source>MSCHAP authentication</source>
<translation>MSCHAP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="798"/>
<source>MSCHAP2 authentication</source>
<translation>MSCHAP2 </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="799"/>
<source>EAP authentication</source>
<translation>EAP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="800"/>
<source>Compression Mode:</source>
<translation> :</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="801"/>
<source>Allow BSD data compression</source>
<translation>BSD </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="802"/>
<source>Allow Default data compression</source>
<translation>Default </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="803"/>
<source>Allow TCP header compression</source>
<translation>TCP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="804"/>
<source>Use protocol field compression negotiation</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="805"/>
<source>Use Address/Control compression</source>
<translation> / </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="811"/>
<source>All Available</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="812"/>
<source>128-bit</source>
<translation>128- </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="813"/>
<source>40-bit</source>
<translation>40- </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1010"/>
<source>Use custom gateway port</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1011"/>
<source>Use compression</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1012"/>
<source>Use a TCP connection</source>
<translation>TCP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1013"/>
<source>Set virtual device type</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1014"/>
<source>Set virtual device name</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1015"/>
<source>Limit TCP Maximum Segment Size(MSS)</source>
<translation>TCP / MSS</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1016"/>
<source>Randomize remote hosts</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1017"/>
<source>IPv6 tun link</source>
<translation>IPv6 tun </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1018"/>
<source>Specify ping interval</source>
<translation>ping / </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1019"/>
<source>Specify exit or restart ping</source>
<translation> ping / </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1020"/>
<source>Specify max routes</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1021"/>
<source>Infinite retry on error</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1022"/>
<source>Use custom key size</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1023"/>
<source>Choose</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1026"/>
<source>Use custom renegotiation interval</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1028"/>
<source>Use custom tunnel Maximum Transmission Umit(MTU)</source>
<translation> MTU</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1030"/>
<source>Use custom UDP fragment size</source>
<translation> UDP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1032"/>
<source>Accept authenticated packets from any address (Float)</source>
<translation> (Float) </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1034"/>
<source>Subject Match</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1035"/>
<source>Key File</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1036"/>
<source>Key Direction</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1038"/>
<source>Server Address</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1039"/>
<source>Port</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1040"/>
<source>Proxy USername</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1041"/>
<source>Proxy Password</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1043"/>
<source>General</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1044"/>
<source>TLS settings</source>
<translation>TLS </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1045"/>
<source>Server Certificate Check</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1047"/>
<source>Use the previous authentication end (server) certificate</source>
<translation> ( ) </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1049"/>
<source>Verify peer (server) certificate nsCertType specification</source>
<translation> ( ) nsCertType / </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1050"/>
<source>Mode</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1051"/>
<source>Proxies</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1052"/>
<source>Proxy Type</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1053"/>
<source>Security</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1054"/>
<source>HMAC Authentication</source>
<translation>HMAC </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1064"/>
<source>Input content</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1066"/>
<source>No</source>
<translation>/ </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1070"/>
<source>Self-adaption</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1071"/>
<source>Automatic</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1076"/>
<source>Exit</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1077"/>
<source>Restart</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1079"/>
<source>Don&apos;t verify certificate identification</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1080"/>
<source>Verify the entire subject exactly</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1081"/>
<source>Verify name exactly</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1082"/>
<source>Verify name by prefix</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1084"/>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1087"/>
<source>Server</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1085"/>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1088"/>
<source>Client</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1090"/>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1094"/>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1103"/>
<source>None</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1091"/>
<source>TLS-Certification</source>
<translation>TLS- </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1092"/>
<source>TLS-Encryption</source>
<translation>TLS- </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1098"/>
<source>Not Required</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1102"/>
<source>Default</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1176"/>
<source>Options:</source>
<translation>:</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1179"/>
<source>Request an inner IP address</source>
<translation> IP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1180"/>
<source>Enforce UDP encapsulation</source>
<translation> UDP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1181"/>
<source>Use IP compression</source>
<translation>IP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnadvancedpage.cpp" line="1182"/>
<source>Enable custom password suggestions</source>
<translation> </translation>
</message>
</context>
<context>
<name>VpnConfigPage</name>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="312"/>
<source>Type</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="313"/>
<source>Name</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="314"/>
<source>Static Key</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="315"/>
<source>Local IP</source>
<translation> IP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="316"/>
<source>Remote IP</source>
<translation> IP </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="317"/>
<source>PIN Code</source>
<translation>PIN </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="318"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="790"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="797"/>
<source>Password</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="319"/>
<source>NT Domain</source>
<translation>NT </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="321"/>
<source>Server Address</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="322"/>
<source>Authentication Mode</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="323"/>
<source>CA Certificate</source>
<translation>CA </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="324"/>
<source>User Certificate</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="325"/>
<source>Key Direction</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="326"/>
<source>Private Key</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="327"/>
<source>Private Key Password</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="328"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="330"/>
<source>Password Options</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="329"/>
<source>Username</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="333"/>
<source>Notice:
If key direction is used, it must be opposite to the VPN side used. If &apos;1&apos; is used, the connection must use &apos;0&apos;. If you are not sure which value to use, please contact your system administrator.</source>
<translation>:
VPN &apos;1&apos; / &apos;0&apos; / .</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="340"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="341"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="342"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="343"/>
<source>Choose</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="350"/>
<source>None</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="354"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="360"/>
<source>Save password only for this user</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="355"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="361"/>
<source>Save password for all users</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="356"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="362"/>
<source>Ask password every time</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="357"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="363"/>
<source>Don&apos;t require a password</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="366"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="367"/>
<source>Required</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="795"/>
<source>Certificate(TLS)</source>
<translation> (TLS)</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="796"/>
<source>Static key</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="798"/>
<source>Password and certificate(TLS)</source>
<translation> TLS</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="807"/>
<source>Certificate/Private key</source>
<translation> / </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="808"/>
<source>Certificate/ssh-agent</source>
<translation> /ssh-agent</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="809"/>
<source>Smart card</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="864"/>
<source>Choose a private key</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="866"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="905"/>
<source>Key Files (*.key *.pem *.der *.p12 *.pfx)</source>
<translation> (*.key *.pem *.der *.p12 *.pfx)</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="877"/>
<source>Choose a CA certificate</source>
<translation>CA </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="879"/>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="892"/>
<source>CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx)</source>
<translation>CA (*.pem *.der *.p12 *.crt *.cer *.pfx)</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="890"/>
<source>Choose a User certificate</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnconfigpage.cpp" line="903"/>
<source>Choose a Static key</source>
<translation> </translation>
</message>
</context>
<context>
<name>VpnIpv4Page</name>
<message>
<location filename="../frontend/vpndetails/vpnipv4page.cpp" line="152"/>
<source>IPv4 Config</source>
<translation>IPv4 </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv4page.cpp" line="153"/>
<source>Address</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv4page.cpp" line="154"/>
<source>Netmask</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv4page.cpp" line="155"/>
<source>Default Gateway</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv4page.cpp" line="156"/>
<source>DNS Server</source>
<translation>DNS </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv4page.cpp" line="157"/>
<source>Search Domain</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv4page.cpp" line="158"/>
<source>DHCP Client ID</source>
<translation>DHCP ID</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv4page.cpp" line="160"/>
<source>Auto(DHCP)</source>
<translation> (DHCP)</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv4page.cpp" line="161"/>
<source>Manual</source>
<translation> </translation>
</message>
</context>
<context>
<name>VpnIpv6Page</name>
<message>
<location filename="../frontend/vpndetails/vpnipv6page.cpp" line="141"/>
<source>IPv6 Config</source>
<translation>IPv6 </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv6page.cpp" line="142"/>
<source>Address</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv6page.cpp" line="143"/>
<source>Netmask</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv6page.cpp" line="144"/>
<source>Default Gateway</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv6page.cpp" line="145"/>
<source>DNS Server</source>
<translation>DNS </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv6page.cpp" line="146"/>
<source>Search Domain</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv6page.cpp" line="148"/>
<source>Auto(DHCP)</source>
<translation> (DHCP)</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnipv6page.cpp" line="149"/>
<source>Manual</source>
<translation> </translation>
</message>
</context>
<context>
<name>VpnListItem</name>
<message>
<location filename="../frontend/list-items/vpnlistitem.cpp" line="61"/>
<source>Not connected</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/list-items/vpnlistitem.cpp" line="160"/>
<location filename="../frontend/list-items/vpnlistitem.cpp" line="176"/>
<source>Disconnect</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/list-items/vpnlistitem.cpp" line="162"/>
<location filename="../frontend/list-items/vpnlistitem.cpp" line="174"/>
<source>Connect</source>
<translation></translation>
</message>
</context>
<context>
<name>VpnPage</name>
<message>
<location filename="../frontend/single-pages/vpnpage.cpp" line="259"/>
<source>VPN</source>
<translation>vpn</translation>
</message>
<message>
<location filename="../frontend/single-pages/vpnpage.cpp" line="270"/>
<source>VPN Settings</source>
<translation>VPN </translation>
</message>
</context>
<context>
<name>vpnAddPage</name>
<message>
<location filename="../frontend/vpndetails/vpnaddpage.cpp" line="15"/>
<source>create VPN</source>
<translation>VPN </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnaddpage.cpp" line="47"/>
<source>VPN Type</source>
<translation>VPN </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnaddpage.cpp" line="75"/>
<source>VPN Name</source>
<translation>VPN </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnaddpage.cpp" line="81"/>
<location filename="../frontend/vpndetails/vpnaddpage.cpp" line="103"/>
<source>Required</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpnaddpage.cpp" line="98"/>
<source>VPN Server</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="12"/>
<source>VPN</source>
<translation>vpn</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="41"/>
<source>Auto Connection</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="53"/>
<source>Confirm</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="56"/>
<source>Cancel</source>
<translation></translation>
</message>
</context>
<context>
<name>vpnConfigPage</name>
<message>
<source>VPN Type</source>
<translation type="vanished">VPN类型</translation>
</message>
</context>
<context>
<name>VpnDetail</name>
<message>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="61"/>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="145"/>
<source>VPN</source>
<translation>vpn</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="146"/>
<source>IPv4</source>
<translation>ipv4</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="148"/>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="225"/>
<source>IPv6</source>
<translation>ipv6</translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="153"/>
<source>Advanced</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="158"/>
<source>Auto Connection</source>
<translation> </translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="159"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="160"/>
<source>Confirm</source>
<translation></translation>
</message>
</context>
<context>
<name>vpnObject</name>
<message>
<location filename="../frontend/vpnobject.cpp" line="31"/>
<source>vpn tool</source>
<translation>vpn </translation>
</message>
</context>
</TS>

Some files were not shown because too many files have changed in this diff Show More