Skip to content

Commit

Permalink
try to display the notification even if the system reports they are d…
Browse files Browse the repository at this point in the history
…isabled
  • Loading branch information
TheOneRing committed Jun 3, 2015
1 parent 6564598 commit 4744ab7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void help(const std::wstring &error)

void version()
{
std::wcout << L"SnoreToast version 0.3.99" << std::endl
std::wcout << L"SnoreToast version "<< SnoreToasts::version() << std::endl
<< L"Copyright (C) 2015 Patrick von Reth <vonreth@kde.org>" << std::endl
<< L"SnoreToast is free software: you can redistribute it and/or modify" << std::endl
<< L"it under the terms of the GNU Lesser General Public License as published by" << std::endl
Expand Down
9 changes: 7 additions & 2 deletions src/snoretoasts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ void SnoreToasts::printXML()
HSTRING string;
s->GetXml(&string);
PCWSTR str = WindowsGetStringRawBuffer(string, NULL);
std::wcout << L"------------------------" << std::endl
std::wcout << L"------------------------" << std::endl
<< L"SnoreToast " << version() << std::endl
<< L"------------------------" << std::endl
<< m_appID << std::endl
<< L"------------------------" << std::endl
<< str << std::endl
Expand All @@ -333,7 +335,6 @@ HRESULT SnoreToasts::createToast()
if (setting == NotificationSetting_Enabled) {
hr = setEventHandler(m_notification);
} else {
hr = E_FAIL;
std::wcout << L"Notifications are disabled" << std::endl
<< L"Reason: ";

Expand Down Expand Up @@ -365,3 +366,7 @@ HRESULT SnoreToasts::createToast()
return hr;
}


std::wstring SnoreToasts::version(){
return L"0.3.99";
}
3 changes: 3 additions & 0 deletions src/snoretoasts.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class SnoreToasts
Dismissed,
Timeout
};

static std::wstring version();

SnoreToasts(const std::wstring &appID);
~SnoreToasts();

Expand Down

0 comments on commit 4744ab7

Please sign in to comment.