Skip to content

Commit

Permalink
Updated docs for updating ueli
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Jul 20, 2018
1 parent e50fd6c commit 2551f53
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,13 @@ You can customize multiple fallback web search engines which are used if ueli do

### Updater

To check if a new version is available right click on the tray icon. The first item in the context menu shows you if there is an update available or if you are running the latest version. If there is an update available click on "Download and install update".
To check if a new version is available right click on the tray icon. The first item in the context menu shows you if there is an update available or if you are running the latest version.

![Updater](img/doc/ueli-updater.png)
![Update available](img/doc/ueli-update-is-available.png)

If there is an update available search for "Download and install update" and hit enter:

![Download and install update](img/doc/ueli-download-and-install-update.png)

## Customization

Expand Down
Binary file added img/doc/ueli-download-and-install-update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/doc/ueli-update-is-available.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/doc/ueli-updater.png
Binary file not shown.
17 changes: 13 additions & 4 deletions src/ts/search-plugins/ueli-commands-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ const ueliCommands: UeliCommand[] = [
},
];

let updateAvailable = false;

export class UeliCommandsSearchPlugin implements SearchPlugin {
private updateAvailable: boolean;
private icon = `<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 600 600" xml:space="preserve">
<path d="M59,121.6l81.3-46.9c5.9-3.4,13.1-3.4,18.9,0l80.8,46.9c5.8,3.4,9.4,9.6,9.4,16.4v187.2c0,14.6,15.8,23.7,28.4,16.4l62.4-36
c5.9-3.4,9.5-9.6,9.5-16.4l0-209c0-6.8,3.6-13,9.5-16.4l81-46.8c5.9-3.4,13.1-3.4,18.9,0l81,46.8c5.9,3.4,9.5,9.6,9.5,16.4v324.4
Expand All @@ -33,14 +36,20 @@ export class UeliCommandsSearchPlugin implements SearchPlugin {

public constructor() {
ipcMain.on(IpcChannels.ueliUpdateWasFound, (): void => {
ueliCommands.push({
executionArgument: IpcChannels.ueliUpdateUeli,
name: "Download and install update for ueli",
});
updateAvailable = true;
});
}

public getAllItems(): SearchResultItem[] {
const commands = ueliCommands;

if (updateAvailable && commands.filter((c) => c.executionArgument === IpcChannels.ueliUpdateUeli).length === 0) {
commands.push({
executionArgument: IpcChannels.ueliUpdateUeli,
name: "Download and install update for ueli",
});
}

return ueliCommands.map((i): SearchResultItem => {
return {
executionArgument: i.executionArgument,
Expand Down

0 comments on commit 2551f53

Please sign in to comment.