Codebase list deepin-picker / 6dad29c
Adjust translation and move notify code to the front of copy clipboard. Andy Stewart 6 years ago
2 changed file(s) with 14 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
5757 Settings *settings = new Settings();
5858 settings->setOption("color_type", colorType);
5959
60 // Copy to clipbard.
61 QClipboard *clipboard = QApplication::clipboard();
62 clipboard->setText(colorString);
63
6460 // Popup notify.
61 // We need poup notify in first time, because copy to clipboard maybe block event loop.
6562 QDBusInterface notification("org.freedesktop.Notifications",
6663 "/org/freedesktop/Notifications",
6764 "org.freedesktop.Notifications",
7168 QVariantMap hints;
7269
7370 QList<QVariant> arg;
74 arg << (QCoreApplication::applicationName()) // appname
75 << ((unsigned int) 0) // id
76 << QString("deepin-picker") // icon
77 << tr("Deepin Picker") // summary
78 << QString(tr("Copy color %1 to system clipboard")).arg(colorString) // body
79 << actions // actions
80 << hints // hints
81 << (int) -1; // timeout
71 arg << (QCoreApplication::applicationName()) // appname
72 << ((unsigned int) 0) // id
73 << QString("deepin-picker") // icon
74 << "" // summary
75 << QString(tr("Copy color %1 to clipboard")).arg(colorString) // body
76 << actions // actions
77 << hints // hints
78 << (int) -1; // timeout
8279 notification.callWithArgumentList(QDBus::AutoDetect, "Notify", arg);
80
81 // Copy to clipbard.
82 QClipboard *clipboard = QApplication::clipboard();
83 clipboard->setText(colorString);
8384
8485 // Quit application.
8586 QApplication::quit();
33 <context>
44 <name>Clipboard</name>
55 <message>
6 <source>Deepin Picker</source>
7 <translation type="unfinished"></translation>
8 </message>
9 <message>
10 <source>Copy color %1 to system clipboard</source>
6 <source>Has copied the color %1 to the clipboard</source>
117 <translation type="unfinished"></translation>
128 </message>
139 </context>