-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple notification for new wallpapers
- Loading branch information
Showing
5 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const Main = imports.ui.main; | ||
|
||
import {HistoryEntry} from './history.js'; | ||
|
||
/** | ||
* A convenience class for presenting notifications to the user. | ||
*/ | ||
class Notification { | ||
/** | ||
* Show a notification for the newly set wallpapers. | ||
* | ||
* @param {HistoryEntry[]} historyEntries The history elements representing the new wallpapers | ||
*/ | ||
static newWallpaper(historyEntries: HistoryEntry[]): void { | ||
const infoString = `Source: ${historyEntries.map(h => `${h.source.source}`).join(', ')}`; | ||
const message = `A new wallpaper was set!\n${infoString}`; | ||
Main.notify('New Wallpaper', message); | ||
} | ||
} | ||
|
||
export {Notification}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters