-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove discover tab because it was kinda pointless (might revisit the concept later). Show confirmation prompt when removing game. Make app not fail completely when Steam is missing or can't be found (just gotta add the games manually). Style adjustments.
- Loading branch information
Showing
26 changed files
with
195 additions
and
319 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,25 @@ | ||
use serde::Serialize; | ||
use tauri::Manager; | ||
|
||
use crate::{ | ||
result::Result, | ||
serializable_enum, | ||
}; | ||
use crate::serializable_enum; | ||
|
||
serializable_enum!(AppEvent { | ||
SyncInstalledGames, | ||
SyncOwnedGames, | ||
SyncDiscoverGames, | ||
SyncMods, | ||
ExecutedSteamCommand, | ||
GameAdded, | ||
GameRemoved, | ||
Error, | ||
}); | ||
|
||
pub trait EventEmitter { | ||
fn emit_event<TPayload: Serialize + Clone>(&self, event: AppEvent, payload: TPayload) | ||
-> Result; | ||
fn emit_event<TPayload: Serialize + Clone>(&self, event: AppEvent, payload: TPayload); | ||
} | ||
|
||
impl EventEmitter for tauri::AppHandle { | ||
fn emit_event<TPayload: Serialize + Clone>( | ||
&self, | ||
event: AppEvent, | ||
payload: TPayload, | ||
) -> Result { | ||
Ok(self.emit_all(&event.to_string(), payload)?) | ||
fn emit_event<TPayload: Serialize + Clone>(&self, event: AppEvent, payload: TPayload) { | ||
self.emit_all(&event.to_string(), payload) | ||
.unwrap_or_else(|err| eprintln!("Failed to emit event: {err}")); | ||
} | ||
} |
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
pub mod appinfo; | ||
pub mod command; | ||
pub mod discover_games; | ||
pub mod id_lists; | ||
pub mod thumbnail; |
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
Oops, something went wrong.