From e46ba714e124b095f74c2d634eece0127465c58d Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Mon, 10 Apr 2023 17:39:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=98=E7=9B=98ui=E5=BE=AE=E8=B0=83=20?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/vpn/translations/zh_CN.qm | Bin 0 -> 594 bytes src-vpn/frontend/single-pages/singlepage.h | 2 +- src-vpn/frontend/single-pages/vpnpage.cpp | 42 +++++++------------ src-vpn/frontend/single-pages/vpnpage.h | 2 +- src-vpn/translations/kylin-vpn_bo_CN.qm | 1 + src-vpn/translations/kylin-vpn_bo_CN.ts | 45 ++++++++++----------- src-vpn/translations/kylin-vpn_zh_CN.qm | Bin 0 -> 11091 bytes src-vpn/translations/kylin-vpn_zh_CN.ts | 45 ++++++++++----------- 8 files changed, 60 insertions(+), 77 deletions(-) create mode 100644 plugins/vpn/translations/zh_CN.qm create mode 100644 src-vpn/translations/kylin-vpn_bo_CN.qm create mode 100644 src-vpn/translations/kylin-vpn_zh_CN.qm diff --git a/plugins/vpn/translations/zh_CN.qm b/plugins/vpn/translations/zh_CN.qm new file mode 100644 index 0000000000000000000000000000000000000000..56074df7001ff23cc82b4642556a596316b3c298 GIT binary patch literal 594 zcmcE7ks@*G{hX<16=n7(EZlq7iGhJ3fq@~~4@mE3V2I5F($|=D5412aFq*Nf(OC+l zJ6OFBTmg!IWX+rQ8Avm*vy@E%ic7FBi`4^iL%9-vn*jOixKh2J0O>>?c}69mcniPK z&)Gm)BNHfigZV!YZ~(asY(UKAn3AI4Uy_kpRLlP5i+b`Q-}vc?uzk#o0-TMIg=0Kts@+#2gmjhf@k-B}5lcJ6r6h{(H$w z;Z|@a=jY|6CYPk9;4pzLGq)hWs01MkG9+CK#Sq@S{1OE$1_70_peST_hS&x&jUDI_ oP(XmgfF(#_S_<4zY%ZxesU@kHs#4d+Gr(1GxnveYEk#iY0QPo`1^@s6 literal 0 HcmV?d00001 diff --git a/src-vpn/frontend/single-pages/singlepage.h b/src-vpn/frontend/single-pages/singlepage.h index c822c4f4..2855b96b 100644 --- a/src-vpn/frontend/single-pages/singlepage.h +++ b/src-vpn/frontend/single-pages/singlepage.h @@ -43,7 +43,7 @@ using namespace kdk; #define MAIN_LAYOUT_SPACING 0 #define TITLE_FRAME_HEIGHT 60 //TabWidget的tab和widget有间隙,和设计稿看起来一致就不能设为设计稿里的高度 #define TITLE_LAYOUT_MARGINS 24,0,24,0 -#define NET_LAYOUT_MARGINS 8,8,8,8 +#define NET_LAYOUT_MARGINS 8,8,0,8 #define TEXT_HEIGHT 20 #define SETTINGS_LAYOUT_MARGINS 23,0,24,0 diff --git a/src-vpn/frontend/single-pages/vpnpage.cpp b/src-vpn/frontend/single-pages/vpnpage.cpp index 41c8cb70..e2cb274b 100644 --- a/src-vpn/frontend/single-pages/vpnpage.cpp +++ b/src-vpn/frontend/single-pages/vpnpage.cpp @@ -147,11 +147,7 @@ void VpnPage::constructItemArea() } } - if (m_listWidget->count() <= MAX_ITEMS) { - m_listFrame->setFixedWidth(MIN_WIDTH); - } else { - m_listFrame->setFixedWidth(MAX_WIDTH); - } + resetListWidgetWidth(); } void VpnPage::initVpnArea() @@ -174,14 +170,6 @@ void VpnPage::resetPageHeight() m_listFrame->show(); m_netDivider->show(); } - - for (int i = 0; i < m_mainLayout->count(); i ++) { - QWidget *w = m_mainLayout->itemAt(i)->widget(); - if (w != nullptr && w->isHidden() != true) { - height += w->height(); - } - } - this->setFixedHeight(height + PAGE_SPACE); } bool VpnPage::removeConnectionItem(QMap &connectMap, @@ -203,9 +191,7 @@ bool VpnPage::removeConnectionItem(QMap &connectMap, p_listWidgetItem = nullptr; iter = connectMap.erase(iter); - if (m_listWidget->count() <= MAX_ITEMS) { - m_listFrame->setFixedWidth(MIN_WIDTH); - } + resetListWidgetWidth(); return true; } } @@ -249,9 +235,7 @@ void VpnPage::onAddConnection(QString uuid) //新增一个有线 delete p_newItem; p_newItem = nullptr; - if (m_listWidget->count() >= MAX_ITEMS) { - m_listFrame->setFixedWidth(MAX_WIDTH); - } + resetListWidgetWidth(); resetPageHeight(); resetWindowPosition(); this->update(); @@ -338,9 +322,8 @@ void VpnPage::updateActivatedConnectionArea(KyConnectItem *p_newItem) deleteConnectionMapItem(m_activeItemMap, m_listWidget, p_newItem->m_connectUuid); QListWidgetItem *p_listWidgetItem = addNewItem(p_newItem, m_listWidget); m_activeItemMap.insert(p_newItem->m_connectUuid, p_listWidgetItem); - if (m_listWidget->count() <= MAX_ITEMS) { - m_listFrame->setFixedWidth(MIN_WIDTH); - } + + resetListWidgetWidth(); return; } @@ -356,11 +339,7 @@ void VpnPage::updateConnectionArea(KyConnectItem *p_newItem) QListWidgetItem *p_listWidgetItem = insertNewItem(p_newItem, m_listWidget); m_vpnItemMap.insert(p_newItem->m_connectUuid, p_listWidgetItem); - if (m_listWidget->count() <= MAX_ITEMS) { - m_listFrame->setFixedWidth(MIN_WIDTH); - } else { - m_listFrame->setFixedWidth(MAX_WIDTH); - } + resetListWidgetWidth(); } void VpnPage::updateConnectionState(QMap &connectMap, @@ -700,3 +679,12 @@ void VpnPage::resetWindowPosition() kdk::WindowManager::setGeometry(this->windowHandle(), rect); qDebug() << " Position of ukui-panel is " << position << "; Position of mainwindow is " << this->geometry() << "." << Q_FUNC_INFO << __LINE__; } + +void VpnPage::resetListWidgetWidth() +{ + if (m_listWidget->count() <= MAX_ITEMS) { + m_listFrame->setFixedWidth(MIN_WIDTH); + } else { + m_listFrame->setFixedWidth(MAX_WIDTH); + } +} diff --git a/src-vpn/frontend/single-pages/vpnpage.h b/src-vpn/frontend/single-pages/vpnpage.h index 0b7dec31..e5748723 100644 --- a/src-vpn/frontend/single-pages/vpnpage.h +++ b/src-vpn/frontend/single-pages/vpnpage.h @@ -97,7 +97,7 @@ private: QListWidget *vpnListWidget, QString uuid); void resetWindowPosition(); - + void resetListWidgetWidth(); Q_SIGNALS: void vpnAdd(QStringList info); diff --git a/src-vpn/translations/kylin-vpn_bo_CN.qm b/src-vpn/translations/kylin-vpn_bo_CN.qm new file mode 100644 index 00000000..be651eed --- /dev/null +++ b/src-vpn/translations/kylin-vpn_bo_CN.qm @@ -0,0 +1 @@ +VPN Server + + + VPN + + + + + Auto Connection + + + + + Confirm + + + + + Cancel + + vpnConfigPage @@ -90,7 +110,7 @@ - vpnDetail + VpnDetail @@ -113,29 +133,6 @@ - - vpnDetailPage - - - VPN - - - - - Auto Connection - - - - - Confirm - - - - - Cancel - - - vpnObject diff --git a/src-vpn/translations/kylin-vpn_zh_CN.qm b/src-vpn/translations/kylin-vpn_zh_CN.qm new file mode 100644 index 0000000000000000000000000000000000000000..75c3ce3eeb33b3c82c7d390a8ecdccbfec254f57 GIT binary patch literal 11091 zcmbU{3v?6LmCtx2jmDDv!GQTcFvN!PF%$@pY+56m;04LDM}|<7z*ri|6H7D7%*a@f zhR{G7R%|fg8#bGUG&D)+a+0Q-EoqhwJwV!IY15OiX}4|uX;V(l!X_mINb0?B#u{mm zMs^ksj6V0?cmKbqn|~UvdF8?*`_4|8@E;ov|N9@8Aw<1~kgXLV`Yb}7euVJX_2;y| z*Pqi{5%p^dV74Rb&wCM?d;y;O0j?6+nvVe9VPspe5TUW(N4C|?@cxqi9D5eodI8?~ zGP1qIBQ)tK^7_vqRP`a+{?`_SM%SUIKK~FQ=Ajb%vnhn8%+;S$PnA^sn+>6gGbNFJ zC%{EZP7^xJ)RO;fdKk{#qCckwOFsVSb>RQK5wl-<0-k{)G%eBVI0jXY3M$s@2jzZQO=XO#{`rWC47CjN^<7eRP`l={KDwQ$}w>iPC7 zfd2{geE3n&i%h+`_*IbaW&K&Zj{0Dt2lTL=`gq|+gr;7D=K=UWLS1y<0(6#A7q`Io zw2QiO@C}42C)sS??Fdc3%Vs+b`kQ{vw&=$xpns=rap&ED_s{yXcD^k-aV$ck?z0_u z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U^5X#y;X;Q;wLm--$j#YNP-D%yMkN)p_6g(+4*PcaqOx{Lrq4HeKlb zoITqxA`6cvpm})WfQ$5d1b)X>0uP@y;E6h%-`yv69wMIx&--TvZXR%@FW(!y``U)5 zdbizu?Vh(cA6D(b+Zsj~ig*QfD==y;Wm+O63UD~HnZtsDlL{Z6g<;@{Ll1|$cq}Cn zl0x=|s-zWdxUGV&Da>n-b1=}Tn^%{`B=scQgX&a(Ca!C!(|}V_5_3>&MA+{rNqDib zTL^Vym}8RK5db?2!!;GBb)=#SlIz$e*)H zp#v>`>>b=`6|fX#3N$)*mNIBGch}!<$9ri%v>YDJpk-oW5gw8ZP`?ST($pn=auzr zyRRTYY$hm)u@oj$)owi|v?WUcs>58d6u`7cHr@Lr%Ngom*f{K}aEOz&eP;m-I`4;{`nKmm_W{Fscqr56v(Lsu1PJdu=#`TLwn&4%2KLt*r4*m9?Ckqhuk6Wt1%Vu#J*Mp-c&d#64NEWjtgR z^dl|MoajH>;s0elGF*>o5|mI8XnS;~iL{&CdkrG!7hl9dvIm$_OC~Ki0K{;L!5z>% literal 0 HcmV?d00001 diff --git a/src-vpn/translations/kylin-vpn_zh_CN.ts b/src-vpn/translations/kylin-vpn_zh_CN.ts index d0afe821..29c04c79 100644 --- a/src-vpn/translations/kylin-vpn_zh_CN.ts +++ b/src-vpn/translations/kylin-vpn_zh_CN.ts @@ -756,6 +756,26 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a VPN Server 服务器地址 + + + VPN + + + + + Auto Connection + 自动连接 + + + + Confirm + 确定 + + + + Cancel + 取消 + vpnConfigPage @@ -765,7 +785,7 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a - vpnDetail + VpnDetail @@ -804,29 +824,6 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a 确定 - - vpnDetailPage - - - VPN - - - - - Auto Connection - 自动连接 - - - - Confirm - 确定 - - - - Cancel - 取消 - - vpnObject