Merge remote-tracking branch 'refs/remotes/upstream/dbus-interface' into d-interface

This commit is contained in:
king 2021-10-15 09:14:20 +08:00
commit 10ae024e48
9 changed files with 42 additions and 16 deletions

3
debian/control vendored
View File

@ -16,14 +16,13 @@ Build-Depends: debhelper (>=9),
libx11-dev,
libqt5svg5-dev,
libkf5networkmanagerqt-dev (>= 5.36.0),
libnm-dev,
libnm-dev,
libcap-dev,
Standards-Version: 4.5.0
Rules-Requires-Root: no
Homepage: https://github.com/ukui/kylin-nm
Vcs-Git: https://github.com/ukui/kylin-nm.git
Vcs-Browser: https://github.com/ukui/kylin-nm
Package: kylin-nm
Architecture: any
Depends: network-manager (>=1.2.6),

4
debian/rules vendored
View File

@ -28,3 +28,7 @@ override_dh_auto_clean:
override_dh_auto_build:
dh_auto_build -- $(MAKE_OPTS)
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info

View File

@ -17,6 +17,8 @@
*/
#include "kylinnetworkresourcemanager.h"
#define SIGNAL_DELAY 80000
#define EMIT_DELAY 10000
KyNetworkResourceManager* KyNetworkResourceManager::m_pInstance = nullptr;
@ -556,9 +558,10 @@ void KyNetworkResourceManager::onActiveConnectionChanged(
if (activeConnect->isValid()) {
qDebug()<<"!New state change activate connect"<<activeConnect->uuid();
qDebug()<<"!New the active connect state"<<state;
::usleep(SIGNAL_DELAY);
while(activeConnect->state() != state) {
qDebug()<<"connect real state"<<activeConnect->state() <<"change state"<<state;
::usleep(10000);
::usleep(EMIT_DELAY);
}
emit activeConnectStateChangeReason(activeConnect->uuid(), state,
NetworkManager::ActiveConnection::Reason::UknownReason);

View File

@ -32,7 +32,7 @@ LanListItem::LanListItem(KyConnectItem *data, QString deviceName, QWidget *paren
LanListItem::LanListItem(QWidget *parent) : ListItem(parent)
{
m_isActive = false;
m_netButton->setButtonIcon(QIcon::fromTheme("network-wireless-signal-none-symbolic"));
m_netButton->setButtonIcon(QIcon::fromTheme("network-offline-symbolic"));
const QString str=tr("Not connected");
m_nameLabel->setText(str);
this->m_infoButton->hide();

View File

@ -0,0 +1,6 @@
#include "detailitem.h"
DetailItem::DetailItem(QWidget *parent) : QWidget(parent)
{
}

View File

@ -0,0 +1,16 @@
#ifndef DETAILITEM_H
#define DETAILITEM_H
#include <QWidget>
class DetailItem : public QWidget
{
Q_OBJECT
public:
explicit DetailItem(QWidget *parent = nullptr);
signals:
};
#endif // DETAILITEM_H

View File

@ -22,6 +22,7 @@ LanPage::LanPage(QWidget *parent) : TabPage(parent)
m_activeResourse = new KyActiveConnectResourse(this);
m_connectResourse = new KyConnectResourse(this);
m_deviceResource = new KyNetworkDeviceResourse(this);
m_wiredConnectOperation = new KyWiredConnectOperation(this);
initUI();
initNetSwitch();
@ -679,14 +680,13 @@ void LanPage::initUI()
inactiveLanListLayout->addWidget(m_inactivatedLanListWidget);
m_settingsLabel->installEventFilter(this);
// emit this->lanConnectChanged();
}
QListWidgetItem *LanPage::addNewItem(KyConnectItem *itemData, QListWidget *listWidget)
{
QListWidgetItem *p_listWidgetItem = new QListWidgetItem(listWidget);
QListWidgetItem *p_listWidgetItem = new QListWidgetItem();
p_listWidgetItem->setSizeHint(QSize(listWidget->width(),ITEM_HEIGHT));
listWidget->addItem(p_listWidgetItem);
listWidget->insertItem(0, p_listWidgetItem);
LanListItem *p_lanItem = nullptr;
if (itemData != nullptr) {

View File

@ -85,6 +85,7 @@ int main(int argc, char *argv[])
QtSingleApplication a(id, argc, argv);
qInstallMessageHandler(messageOutput);
if (a.isRunning()) {
qInfo() << "Kylin-Network-Manager Is Already Launched, just show";
auto connection = QDBusConnection::sessionBus();
QDBusInterface iface("com.kylin.network",
"/com/kylin/network",
@ -94,22 +95,19 @@ int main(int argc, char *argv[])
return 0;
}
qDebug()<<"Kylin Network Manager Is Already Launched";
QApplication::setQuitOnLastWindowClosed(false);
// Internationalization
QString locale = QLocale::system().name();
QTranslator trans_global;
if (locale == "zh_CN") {
trans_global.load(":/translations/kylin-nm_zh_CN.qm");
qDebug() << "QLocale " << QLocale();
if (trans_global.load(QLocale(), "kylin-nm", "_", ":/translations/"))
{
a.installTranslator(&trans_global);
qDebug()<<"Translations load success";
} else {
qWarning() << "Translations load fail";
}
if (locale == "tr_TR") {
trans_global.load(":/translations/kylin-nm_tr.qm");
a.installTranslator(&trans_global);
}
qDebug()<<"Translations Are Already Loaded";
MainWindow w;
w.setProperty("useStyleWindowManager", false); //禁用拖动

Binary file not shown.