1 diff --git a/src/dbusservice/dbusscreenshotservice.cpp b/src/dbusservice/dbusscreenshotservice.cpp
2 index 75ea15b..de057f3 100644
3 --- a/src/dbusservice/dbusscreenshotservice.cpp
4 +++ b/src/dbusservice/dbusscreenshotservice.cpp
5 @@ -80,8 +80,10 @@ void DBusScreenshotService::NoNotifyScreenshot()
7 qDebug() << "DBus screenshot service! nonofiy screenshot";
8 // handle method call com.deepin.Screenshot.NoNotify
9 - if (!m_singleInstance)
10 - parent()->noNotifyScreenshot();
11 + if (!m_singleInstance) {
12 + parent()->noNotify();
13 + parent()->startScreenshot();
15 m_singleInstance = true;
18 diff --git a/src/main.cpp b/src/main.cpp
19 index 2ce8658..74668c6 100644
22 @@ -91,6 +91,11 @@ int main(int argc, char *argv[])
26 + if (cmdParser.isSet(prohibitNotifyOption)) {
27 + qDebug() << "screenshot no notify!";
31 if (cmdParser.isSet(dbusOption))
33 qDebug() << "dbus register waiting!";
34 @@ -108,9 +113,6 @@ int main(int argc, char *argv[])
35 } else if (cmdParser.isSet(savePathOption)) {
36 qDebug() << "cmd savepath screenshot";
37 w.savePathScreenshot(cmdParser.value(savePathOption));
38 - } else if (cmdParser.isSet(prohibitNotifyOption)) {
39 - qDebug() << "screenshot no notify!";
40 - w.noNotifyScreenshot();
41 } else if (cmdParser.isSet(iconOption)) {
42 w.delayScreenshot(0.2);
44 diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
45 index def901e..f1e0a59 100644
46 --- a/src/mainwindow.cpp
47 +++ b/src/mainwindow.cpp
48 @@ -1042,8 +1042,9 @@ void MainWindow::saveSpecificedPath(QString path)
50 QString summary = QString(tr("Picture has been saved to %1")).arg(savePath);
52 - m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", "",
53 - summary, actions, hints, 0);
55 + m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", "",
56 + summary, actions, hints, 0);
60 @@ -1073,15 +1074,7 @@ void MainWindow::saveSpecificedPath(QString path)
62 void MainWindow::noNotify()
64 - m_controlCenterDBInterface = new DBusControlCenter(this);
65 - m_hotZoneInterface = new DBusZone(this);
66 - m_interfaceExist = true;
75 void MainWindow::topWindow()
76 @@ -1414,7 +1407,8 @@ void MainWindow::sendNotify(SaveAction saveAction, QString saveFilePath, const b
79 const auto tips = tr("Save failed. Please save it in your home directory.");
80 - m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", QString(), tips, QStringList(), QVariantMap(), 0);
82 + m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", QString(), tips, QStringList(), QVariantMap(), 0);
86 diff --git a/src/mainwindow.h b/src/mainwindow.h
87 index d27eade..8915eff 100644
88 --- a/src/mainwindow.h
89 +++ b/src/mainwindow.h
90 @@ -72,6 +72,7 @@ public:
91 void initShapeWidget(QString type);
92 void initDBusInterface();
98 @@ -86,7 +87,6 @@ public slots:
99 void savePath(const QString &path);
100 void saveSpecificedPath(QString path);
101 // void delayScreenshot(int num);
104 void expressSaveScreenshot();
105 //Indicate that this program's started by clicking desktop file.
106 diff --git a/src/screenshot.cpp b/src/screenshot.cpp
107 index 4ced427..94542f4 100644
108 --- a/src/screenshot.cpp
109 +++ b/src/screenshot.cpp
110 @@ -38,6 +38,14 @@ Screenshot::Screenshot(QObject *parent)
111 void Screenshot::initUI() {
112 m_eventContainer = new EventContainer(this);
113 m_window = new MainWindow;
115 + m_window->noNotify();
119 +void Screenshot::noNotify()
124 void Screenshot::startScreenshot()
125 @@ -54,7 +62,7 @@ void Screenshot::delayScreenshot(double num)
126 QStringList actions = QStringList();
128 DBusNotify* notifyDBus = new DBusNotify(this);
130 + if (num >= 2 && !m_noNotify) {
131 notifyDBus->Notify("Deepin Screenshot", 0, "deepin-screenshot", "",
132 summary, actions, hints, 0);
134 @@ -82,13 +90,6 @@ void Screenshot::topWindowScreenshot()
135 m_window->topWindow();
138 -void Screenshot::noNotifyScreenshot()
142 - m_window->noNotify();
145 void Screenshot::savePathScreenshot(const QString &path)
148 diff --git a/src/screenshot.h b/src/screenshot.h
149 index 76d3e72..1c1f0dd 100644
150 --- a/src/screenshot.h
151 +++ b/src/screenshot.h
152 @@ -29,12 +29,13 @@ public:
153 Screenshot(QObject* parent = 0);
159 void startScreenshot();
160 void delayScreenshot(double num);
161 void fullscreenScreenshot();
162 void topWindowScreenshot();
163 - void noNotifyScreenshot();
164 void savePathScreenshot(const QString &path);
167 @@ -42,7 +43,7 @@ private:
169 EventContainer* m_eventContainer = nullptr;
170 MainWindow* m_window = nullptr;
172 + bool m_noNotify = false;
175 #endif // SCREENSHOT_H