forked from lapce/lapce
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement logic for getting the installation progress (lapce#1281)
* implement logic for getting the installation progress * get the progress bar in the ui * add status text to progress bar * remove unused volt_downloader.rs + add suggestion from PR * add progress indication if app is removed * remove progress percentage + add ability for error text * use rect height as distance to next progress, so it show's like a list * use different font color if there is a error while installation * handle remove_volt remove_dir_all error * add error handeling for removing in progressbar * remove redundant if statement in drawing progress * show error messages from download plugins in the status bar * run rustfmt * Satisfy clippy: To big variants * Satisfy clippy: adjust error check accordingly * run rustfmt * Satisfy clippy: fix local issues * apply review changes * only save (workspace) plugins if neccessary * fix brackets after merge again
- Loading branch information
Showing
9 changed files
with
351 additions
and
50 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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#[derive(Copy, Clone, Debug, PartialEq, Eq)] | ||
pub enum PluginInstallType { | ||
Installation, | ||
Uninstallation, | ||
} | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct PluginInstallStatus { | ||
error: String, | ||
plugin_name: String, | ||
install_type: PluginInstallType, | ||
} | ||
|
||
impl PluginInstallStatus { | ||
pub fn new( | ||
install_type: PluginInstallType, | ||
plugin_name: &str, | ||
error: String, | ||
) -> Self { | ||
Self { | ||
error, | ||
plugin_name: plugin_name.to_string(), | ||
install_type, | ||
} | ||
} | ||
|
||
pub fn set_error(&mut self, error_string: &str) { | ||
self.error = error_string.to_string(); | ||
} | ||
|
||
pub fn error_string(&self) -> &str { | ||
&self.error | ||
} | ||
|
||
pub fn install_type(&self) -> &PluginInstallType { | ||
&self.install_type | ||
} | ||
|
||
pub fn plugin_name(&self) -> &str { | ||
&self.plugin_name | ||
} | ||
} |
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
Oops, something went wrong.