fix(ui): set firewall dialog to skip taskbar, modify main logic(bug#194718)
This commit is contained in:
parent
520bd25635
commit
435749c5c7
|
@ -20,6 +20,9 @@
|
||||||
#include "firewalldialog.h"
|
#include "firewalldialog.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include "windowmanager/windowmanager.h"
|
||||||
|
#include "kwindowsystem.h"
|
||||||
|
#include "kwindowsystem_export.h"
|
||||||
|
|
||||||
#define THEME_SCHAME "org.ukui.style"
|
#define THEME_SCHAME "org.ukui.style"
|
||||||
#define COLOR_THEME "styleName"
|
#define COLOR_THEME "styleName"
|
||||||
|
@ -30,6 +33,7 @@ FirewallDialog::FirewallDialog(QWidget *parent): KDialog(parent)
|
||||||
initUI();
|
initUI();
|
||||||
this->setWindowIcon(QIcon::fromTheme("kylin-network"));
|
this->setWindowIcon(QIcon::fromTheme("kylin-network"));
|
||||||
this->setFixedSize(480, 204);
|
this->setFixedSize(480, 204);
|
||||||
|
KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
// centerToScreen();
|
// centerToScreen();
|
||||||
connect(qApp, &QApplication::paletteChanged, this, &FirewallDialog::onPaletteChanged);
|
connect(qApp, &QApplication::paletteChanged, this, &FirewallDialog::onPaletteChanged);
|
||||||
|
|
|
@ -141,10 +141,11 @@ int main(int argc, char *argv[])
|
||||||
QDBusReply<uint> pid = interface1->servicePid(serviceName);
|
QDBusReply<uint> pid = interface1->servicePid(serviceName);
|
||||||
qDebug() << "current display " << getenv("DISPLAY") << QApplication::applicationPid()
|
qDebug() << "current display " << getenv("DISPLAY") << QApplication::applicationPid()
|
||||||
<< "exist kylin-nm display" << displayFromPid(pid.value());
|
<< "exist kylin-nm display" << displayFromPid(pid.value());
|
||||||
if (getenv("DISPLAY") != displayFromPid(pid.value())) {
|
if (getenv("DISPLAY") == displayFromPid(pid.value())) {
|
||||||
return 0;
|
interface.call(QStringLiteral("showKylinNM"), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QThread *thread = new QThread();
|
QThread *thread = new QThread();
|
||||||
|
|
Loading…
Reference in New Issue