bool CNotificationBase::SendMessageEx( const uint64_t Idx, const std::string &Name, const std::string &Subject, const std::string &Text, const std::string &ExtraData, const int Priority, const std::string &Sound, const bool bFromNotification) { if (!IsConfigured()) { // subsystem not configured, skip return false; } if (bFromNotification) { if (!m_IsEnabled) return true; //not enabled } std::string fSubject = Subject; std::string fText = Text; if (_options & OPTIONS_HTML_SUBJECT) { fSubject = MakeHtml(Subject); } if (_options & OPTIONS_HTML_BODY) { fText = MakeHtml(Text); } if (_options & OPTIONS_URL_SUBJECT) { fSubject = CURLEncode::URLEncode(fSubject); } if (_options & OPTIONS_URL_BODY) { fText = CURLEncode::URLEncode(fText); } bool bRet = SendMessageImplementation(Idx, Name, fSubject, fText, ExtraData, Priority, Sound, bFromNotification); if (_subsystemid != "gcm") { if (bRet) { _log.Log(LOG_NORM, std::string(std::string("Notification sent (") + _subsystemid + std::string(") => Success")).c_str()); } else { _log.Log(LOG_ERROR, std::string(std::string("Notification sent (") + _subsystemid + std::string(") => Failed")).c_str()); } } return bRet; }
QString About::MakeHtml() const { QString ret = QString( "<p><a href=\"%1\">%2</a></p>" "<p><b>%3:</b>").arg(kUrl, kUrl, tr("Authors")); for (const Person& person : authors_) { ret += "<br />" + MakeHtml(person); } ret += QString("</p><p><b>%3:</b>").arg(tr("Thanks to")); for (const Person& person : thanks_to_) { ret += "<br />" + MakeHtml(person); } ret += QString( "<br />" + tr("All the translators") + " <<a href=\"https://www.transifex.com/projects/p/clementine/\">" "https://www.transifex.com/projects/p/clementine/</a>>"); ret += QString("<br />%1</p>").arg(tr("...and all the Amarok contributors")); ret += QString("<p><b>%1</b>").arg(tr("And:")); ret += QString("<br /><a href=\"http://rainymood.com\">Rainy Mood</a>"); ret += QString( "<br /><a href=\"http://www.smitelli.com/?page=blog&p=54\">Scott " "Smitelli</a>"); ret += QString( "<br /><a href=\"http://hyperboleandahalf.blogspot.com\">Allie " "Brosh</a></p>"); ret += "<p>This product uses Music by Spotify but is not endorsed, certified " "or otherwise approved in any way by Spotify. Spotify is the registered " "trade mark of the Spotify Group.</p>"; return ret; }
About::About(QWidget* parent) : QDialog(parent) { ui_.setupUi(this); setWindowTitle(tr("About %1").arg(QCoreApplication::applicationName())); ui_.title->setText(QCoreApplication::applicationName()); ui_.version->setText( tr("Version %1").arg(QCoreApplication::applicationVersion())); QFont title_font; title_font.setBold(true); title_font.setPointSize(title_font.pointSize() + 4); ui_.title->setFont(title_font); authors_ << Person("David Sansome", "*****@*****.**") << Person("John Maguire", "*****@*****.**") << Person(QString::fromUtf8("Paweł Bara"), "*****@*****.**") << Person("Arnaud Bienner", "*****@*****.**"); thanks_to_ << Person("Mark Kretschmann", "*****@*****.**") << Person("Max Howell", "*****@*****.**") << Person(QString::fromUtf8("Bartłomiej Burdukiewicz"), "*****@*****.**") << Person("Jakub Stachowski", "*****@*****.**") << Person("Paul Cifarelli", "*****@*****.**") << Person("Felipe Rivera", "*****@*****.**") << Person("Alexander Peitz") << Person("Artur Rona", "*****@*****.**") << Person("Andreas Muttscheller", "*****@*****.**"); qSort(authors_); qSort(thanks_to_); ui_.content->setHtml(MakeHtml()); ui_.buttonBox->button(QDialogButtonBox::Close) ->setShortcut(QKeySequence::Close); }