mirror of
https://github.com/status-im/snorenotify.git
synced 2025-01-24 23:41:10 +00:00
extended gntp with app icon
This commit is contained in:
parent
f558e1420a
commit
7e34fbaecf
@ -40,11 +40,9 @@ public:
|
||||
|
||||
SnoreIconData(const QString &url){
|
||||
if(url.startsWith(":/")){
|
||||
qDebug()<<url<<"is resource";
|
||||
_img = QImage(url);
|
||||
_isLocalFile = false;
|
||||
}else if(QFile(url).exists()){
|
||||
qDebug()<<url<<"is local File icon";
|
||||
_isLocalFile = true;
|
||||
_localFileName = url;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
|
||||
QString const SnoreServer::version(){
|
||||
return "0.1.5";
|
||||
return "0.15";
|
||||
}
|
||||
|
||||
QString const SnoreServer::snoreTMP(){
|
||||
|
@ -51,7 +51,7 @@ void FreedesktopNotification_Frontend::actionInvoked(Notification notification)
|
||||
void FreedesktopNotification_Frontend::notificationClosed(Notification notification) {
|
||||
|
||||
qDebug()<<"Closing Dbus notification"<<notification.id()<<"reason:"<<(int)notification.closeReason();
|
||||
activeNotifications.take(notification.id());
|
||||
activeNotifications.remove(notification.id());
|
||||
emit NotificationClosed(notification.id(),notification.closeReason());
|
||||
}
|
||||
|
||||
|
@ -163,18 +163,21 @@ private:
|
||||
std::string hostname_;
|
||||
std::string port_;
|
||||
std::string password_;
|
||||
std::string icon_;
|
||||
CryptoPP::AutoSeededRandomPool rng;
|
||||
public:
|
||||
gntp(std::string application = "gntp-send", std::string password = "",
|
||||
gntp(std::string application = "gntp-send", std::string icon = "" ,std::string password = "",
|
||||
std::string hostname = "localhost", std::string port = "23053") :
|
||||
application_(application),
|
||||
password_(password),
|
||||
hostname_(hostname),
|
||||
port_(port) { }
|
||||
port_(port),
|
||||
icon_(icon){ }
|
||||
|
||||
void regist(const char* name) throw (std::runtime_error) {
|
||||
std::stringstream stm;
|
||||
stm << "Application-Name: " << sanitize_text(application_) << "\r\n";
|
||||
stm << "Application-Icon: " << sanitize_text(icon_) <<"\r\n";
|
||||
stm << "Notifications-Count: 1\r\n";
|
||||
stm << "\r\n";
|
||||
make_regist(stm, name);
|
||||
@ -185,6 +188,7 @@ public:
|
||||
void regist(const char* name) throw (std::runtime_error) {
|
||||
std::stringstream stm;
|
||||
stm << "Application-Name: " << sanitize_text(application_) << "\r\n";
|
||||
stm << "Application-Icon: " << sanitize_text(icon_) <<"\r\n";
|
||||
stm << "Notifications-Count: 1\r\n";
|
||||
stm << "\r\n";
|
||||
make_regist(stm, name);
|
||||
|
@ -38,7 +38,7 @@ Growl_Backend::~Growl_Backend(){
|
||||
}
|
||||
|
||||
void Growl_Backend::registerApplication(Application *application){
|
||||
gntp *growl = new gntp(application->name().toUtf8().constData());
|
||||
gntp *growl = new gntp(application->name().toUtf8().constData(),application->icon().localUrl().toUtf8().constData());
|
||||
foreach(Alert *a,application->alerts()){
|
||||
try{
|
||||
growl->regist(a->name().toUtf8().constData());
|
||||
|
Loading…
x
Reference in New Issue
Block a user