update kylin-nm.pro and rules

This commit is contained in:
eightplus 2020-02-25 21:52:01 +08:00
parent 27f944359c
commit ab57c80aa0
11 changed files with 65 additions and 19 deletions

View File

@ -19,6 +19,7 @@
#include "backthread.h"
#include <unistd.h>
#include <stdlib.h>
#include <QFile>
#include <QRegExp>

View File

@ -21,6 +21,9 @@
#include "kylin-network-interface.h"
#include "backthread.h"
#include <unistd.h>
#include <stdlib.h>
extern QString llname, lwname;
ConfForm::ConfForm(QWidget *parent) :

3
debian/changelog vendored
View File

@ -4,6 +4,9 @@ kylin-nm (1.2.0-1) unstable; urgency=medium
* debian/control:
- Bump standards-version to 4.5.0.
[ lixiang ]
* update kylin-nm.pro and rules.
-- handsome_feng <jianfengli@ubuntukylin.com> Tue, 25 Feb 2020 14:12:29 +0800
kylin-nm (1.0.4-1) unstable; urgency=medium

12
debian/control vendored
View File

@ -3,10 +3,15 @@ Section: utils
Priority: optional
Maintainer: Kylin Team <team+kylin@tracker.debian.org>
Uploaders: handsome_feng <jianfengli@ubuntukylin.com>
Build-Depends: debhelper-compat (= 12),
Build-Depends: debhelper-compat (>= 12),
qtbase5-dev,
qt5-qmake,
qtchooser,
qtscript5-dev,
qttools5-dev-tools,
qtbase5-dev-tools,
libnotify-bin,
libqt5x11extras5-dev (>= 5.11.1-2),
libqt5x11extras5-dev,
Standards-Version: 4.5.0
Rules-Requires-Root: no
Homepage: https://github.com/ukui/kylin-nm
@ -15,8 +20,7 @@ Vcs-Browser: https://github.com/ukui/kylin-nm
Package: kylin-nm
Architecture: any
Depends: libqt5x11extras5 (>= 5.11.1-2),
network-manager (>=1.12.4),
Depends: network-manager (>=1.12.4),
libnotify-bin,
${shlibs:Depends},
${misc:Depends}

28
debian/rules vendored
View File

@ -1,8 +1,30 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export QT_SELECT := qt5
export QT_SELECT=5
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
QMAKE_OPTS = DEFINES+=NO_DEBUG_ON_CONSOLE
MAKE_OPTS = PREFIX=/usr QMAKE=qmake LRELEASE=lrelease QMAKE_OPTS="$(QMAKE_OPTS)"
override_dh_auto_configure:
QT_SELECT=qt5 dh_auto_configure \
-- "QMAKE_CXXFLAGS=$(CFLAGS)" \
kylin-nm.pro
%:
dh $@
override_dh_install:
dh_install
override_dh_missing:
dh_missing --fail-missing
override_dh_auto_clean:
[ ! -d .moc ] || $(RM) -r .moc
[ ! -d .obj ] || $(RM) -r .obj
[ ! -d .ui ] || $(RM) -r .ui
[ ! -f Makefile ] || dh_auto_clean
override_dh_auto_build:
dh_auto_build -- $(MAKE_OPTS)

View File

@ -21,6 +21,7 @@
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <stdlib.h>
#include <linux/route.h>
#include <netinet/ether.h>
#include <net/ethernet.h>

View File

@ -9,7 +9,7 @@ QT += core gui x11extras dbus
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = kylin-nm
TEMPLATE = app
#CONFIG += link_pkgconfig
#PKGCONFIG += libnm glib-2.0 gio-2.0 dbus-glib-1
#PKGCONFIG += Qt5Svg
@ -23,8 +23,6 @@ desktop.files = kylin-nm.desktop
INSTALLS += target \
desktop
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
@ -36,6 +34,11 @@ DEFINES += QT_DEPRECATED_WARNINGS
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
QMAKE_CPPFLAGS *= $(shell dpkg-buildflags --get CPPFLAGS)
QMAKE_CFLAGS *= $(shell dpkg-buildflags --get CFLAGS)
QMAKE_CXXFLAGS *= $(shell dpkg-buildflags --get CXXFLAGS)
QMAKE_LFLAGS *= $(shell dpkg-buildflags --get LDFLAGS)
SOURCES += \
main.cpp \
@ -105,5 +108,11 @@ FORMS += \
RESOURCES += \
nmqrc.qrc
unix {
UI_DIR = .ui
MOC_DIR = .moc
OBJECTS_DIR = .obj
}
TRANSLATIONS = translations/kylin-nm_zh_CN.ts \
translations/kylin-nm_bo.ts

View File

@ -96,7 +96,7 @@ MainWindow::MainWindow(QWidget *parent) :
"QPushButton:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}");
btnAddNet->setFocusPolicy(Qt::NoFocus);
btnAddNet->show();
connect(btnAddNet,SIGNAL(clicked()),this,SLOT(on_btnAddNet_clicked()));
connect(btnAddNet,SIGNAL(clicked()),this,SLOT(onBtnAddNetClicked()));
scrollAreal = new QScrollArea(ui->centralWidget);
scrollAreal->move(41, 158);
@ -1034,7 +1034,7 @@ void MainWindow::loadWifiListDone(QStringList slist)
"QPushButton:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}");
btnAddNet->setFocusPolicy(Qt::NoFocus);
btnAddNet->show();
connect(btnAddNet,SIGNAL(clicked()),this,SLOT(on_btnAddNet_clicked()));
connect(btnAddNet,SIGNAL(clicked()),this,SLOT(onBtnAddNetClicked()));
// 清空wifi列表
wifiListWidget = new QWidget(scrollAreaw);
@ -1476,7 +1476,7 @@ void MainWindow::on_btnWifiList_clicked()
"QPushButton:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}");
btnAddNet->setFocusPolicy(Qt::NoFocus);
btnAddNet->show();
connect(btnAddNet,SIGNAL(clicked()),this,SLOT(on_btnAddNet_clicked()));
connect(btnAddNet,SIGNAL(clicked()),this,SLOT(onBtnAddNetClicked()));
// 清空wifi列表
wifiListWidget = new QWidget(scrollAreaw);
@ -2265,7 +2265,7 @@ void MainWindow::on_btnHotspotState()
is_hot_sopt_on = 0;
}
void MainWindow::on_btnAddNet_clicked()
void MainWindow::onBtnAddNetClicked()
{
QApplication::setQuitOnLastWindowClosed(false);
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0, this);

View File

@ -105,6 +105,8 @@ public:
QString currSelNetName = ""; //当前ScrollArea中选中的网络名称
void on_btnNetList_clicked(int flag=0);
public slots:
void onPhysicalCarrierChanged(bool flag);
void onCarrierUpHandle();
@ -196,7 +198,6 @@ private slots:
void on_btnNet_clicked();
void on_btnWifi_clicked();
void on_btnNetList_clicked(int flag=0);
void on_btnWifiList_clicked();
void getLanListDone(QStringList slist);
@ -234,7 +235,7 @@ private slots:
void iconStep();
void on_btnFlyMode_clicked();
void on_btnAddNet_clicked();
void onBtnAddNetClicked();
signals:
void deleteRedundantNet();

View File

@ -1,4 +1,5 @@
#include "networkspeed.h"
#include <stdio.h>
NetworkSpeed::NetworkSpeed(QObject *parent) :QObject(parent)
{
@ -9,10 +10,10 @@ int NetworkSpeed::getCurrentDownloadRates(char *netname, long *save_rate, long *
{
FILE * net_dev_file; //文件指针
char buffer[1024]; //文件中的内容暂存在字符缓冲区里
size_t bytes_read; //实际读取的内容大小
//size_t bytes_read; //实际读取的内容大小
char * match; //用以保存所匹配字符串及之后的内容
int counter = 0;
int i = 0;
//int i = 0;
char tmp_value[128];
if((NULL == netname)||(NULL == save_rate)||(NULL == tx_rate)){
@ -39,7 +40,7 @@ int NetworkSpeed::getCurrentDownloadRates(char *netname, long *save_rate, long *
memset(tmp_value,0,sizeof(tmp_value));
sscanf(match,"%s ",tmp_value);
match = match + strlen(tmp_value);
for(i=0;i<strlen(buffer);i++){
for(size_t i=0;i<strlen(buffer);i++){
if(0x20 == *match){
match ++;
} else{

View File

@ -23,6 +23,7 @@
#include "backthread.h"
#include "mainwindow.h"
#include <unistd.h>
#include <stdlib.h>
DlgConnHidWifiWpa::DlgConnHidWifiWpa(int type, MainWindow *mainWindow, QWidget *parent) :
isUsed(type),