Skip to content

Commit

Permalink
Merge branch 'main' into powerlevel-reset-modal
Browse files Browse the repository at this point in the history
  • Loading branch information
peps authored Jan 11, 2025
2 parents c9d385e + a822b07 commit 8bac2d0
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 72 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ jobs:
- name: cargo tauri build
working-directory: ./src-tauri
run: |
cargo install tauri-cli --version "^2" --locked
cargo install tauri-cli --version "2.1.0" --locked
cargo tauri --version
cargo tauri build --ci --bundles deb
cargo tauri build --ci --no-bundle
file-licenses:
name: file-licenses
Expand Down
13 changes: 6 additions & 7 deletions ci/windows-dev-environment-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,15 @@ found 0 vulnerabilities
```

# Install Cargo tools - tauri-cli
```PowerShell
cd src/universe
cargo install tauri-cli --version "1.6.4"
```Pow/universe
cargo install tauri-cli --version "2.1.0"
```
sample output:
```
PS C:\Users\leet\src\universe> cargo install tauri-cli --version "1.6.4"
PS C:\Users\leet\src\universe> cargo install tauri-cli --version "2.1.0"
>>
Updating crates.io index
Installing tauri-cli v1.6.4
Installing tauri-cli v2.1.0
Updating crates.io index
Fetch [===========> ] 48 complete; 1 pending
```
Expand All @@ -291,14 +290,14 @@ PS C:\Users\leet\src\universe> cargo install tauri-cli --version "1.6.4"
Building [=======================> ] 491/492: cargo-tauri(bin)
Finished `release` profile [optimized] target(s) in 13m 14s
Installing C:\Users\leet\.cargo\bin\cargo-tauri.exe
Installed package `tauri-cli v1.6.4` (executable `cargo-tauri.exe`)
Installed package `tauri-cli v2.1.0` (executable `cargo-tauri.exe`)
```
```PowerShell
cargo tauri --version
```
sample output:
```
tauri-cli 1.6.4
tauri-cli 2.1.0
```

# Build from source for ```Tari Universe Alpha```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tari-universe",
"private": true,
"version": "0.8.40",
"version": "0.8.41",
"type": "module",
"scripts": {
"dev": "vite dev --mode development",
Expand Down
5 changes: 1 addition & 4 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "Tari Universe"
edition = "2021"
name = "tari-universe"
repository = "https://github.com/tari-project/universe"
version = "0.8.40"
version = "0.8.41"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down Expand Up @@ -74,7 +74,6 @@ tauri = { git = "https://github.com/tari-project/tauri.git", rev = "67a06c8a9bae
"image-ico",
"tray-icon",
"devtools", # TODO: Remove this before mainnet
"tracing", # TODO: Remove this before mainnet
] }
tauri-plugin-cli = { git = "https://github.com/tari-project/tauri-plugins-workspace", rev = "09f29b0abe2cb1eb81365b65a3aa3f73325e4e17" }
tauri-plugin-os = { git = "https://github.com/tari-project/tauri-plugins-workspace", rev = "09f29b0abe2cb1eb81365b65a3aa3f73325e4e17" }
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/binaries_versions_esmeralda.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"mmproxy": "=1.9.1-pre.2",
"minotari_node": "=1.9.1-pre.2",
"wallet": "=1.9.1-pre.2",
"sha-p2pool": "=0.18.1",
"sha-p2pool": "=0.19.0",
"xtrgpuminer": "=0.2.10",
"tor": "=13.5.7"
}
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/binaries_versions_nextnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"mmproxy": "=1.9.1-rc.3",
"minotari_node": "=1.9.1-rc.3",
"wallet": "=1.9.1-rc.3",
"sha-p2pool": "=0.18.1",
"sha-p2pool": "=0.19.0",
"xtrgpuminer": "=0.2.10",
"tor": "=13.5.7"
}
Expand Down
25 changes: 13 additions & 12 deletions src-tauri/src/app_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,18 +566,19 @@ impl AppConfig {
Ok(())
}

pub async fn set_window_settings(
&mut self,
window_settings: WindowSettings,
) -> Result<(), anyhow::Error> {
self.window_settings = Some(window_settings);
self.update_config_file().await?;
Ok(())
}

pub fn window_settings(&self) -> &Option<WindowSettings> {
&self.window_settings
}
// Config temporarily unused
// pub async fn set_window_settings(
// &mut self,
// window_settings: WindowSettings,
// ) -> Result<(), anyhow::Error> {
// self.window_settings = Some(window_settings);
// self.update_config_file().await?;
// Ok(())
// }

// pub fn window_settings(&self) -> &Option<WindowSettings> {
// &self.window_settings
// }

pub async fn set_show_experimental_settings(
&mut self,
Expand Down
40 changes: 1 addition & 39 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use auto_launcher::AutoLauncher;
use gpu_miner_adapter::GpuMinerStatus;
use hardware::hardware_status_monitor::HardwareStatusMonitor;
use log::trace;
use log::{debug, error, info, warn};
use node_adapter::BaseNodeStatus;
use p2pool::models::Connections;
Expand All @@ -48,7 +47,7 @@ use tari_common::configuration::Network;
use tari_common_types::tari_address::TariAddress;
use tari_shutdown::Shutdown;
use tauri::async_runtime::{block_on, JoinHandle};
use tauri::{Emitter, Manager, PhysicalPosition, PhysicalSize, RunEvent, WindowEvent};
use tauri::{Emitter, Manager, RunEvent};
use tauri_plugin_sentry::{minidump, sentry};
use tokio::sync::{Mutex, RwLock};
use tokio::time;
Expand All @@ -65,7 +64,6 @@ use telemetry_manager::TelemetryManager;

use crate::cpu_miner::CpuMiner;

use crate::app_config::WindowSettings;
use crate::commands::{CpuMinerConnection, MinerMetrics};
#[allow(unused_imports)]
use crate::external_dependencies::ExternalDependencies;
Expand Down Expand Up @@ -782,10 +780,6 @@ fn main() {
}
};

let splash_window = app
.get_webview_window("splashscreen")
.expect("Main window not found");

// The start of needed restart operations. Break this out into a module if we need n+1
let tcp_tor_toggled_file = config_path.join("tcp_tor_toggled");
if tcp_tor_toggled_file.exists() {
Expand Down Expand Up @@ -827,15 +821,6 @@ fn main() {
app_conf.ludicrous_mode_cpu_options().clone();
cpu_conf.custom_mode_xmrig_options = app_conf.custom_mode_cpu_options().clone();

// Set splashscreen windows position and size here so it won't jump around
if let Some(w_settings) = app_conf.window_settings() {
let window_position = PhysicalPosition::new(w_settings.x, w_settings.y);
let window_size = PhysicalSize::new(w_settings.width, w_settings.height);

if let Err(e) = splash_window.set_position(window_position).and_then(|_| splash_window.set_size(window_size)) {
error!(target: LOG_TARGET, "Could not set splashscreen window position or size: {:?}", e);
}
}
Ok(())
});

Expand Down Expand Up @@ -974,29 +959,6 @@ fn main() {
RunEvent::MainEventsCleared => {
// no need to handle
}
RunEvent::WindowEvent { label, event, .. } => {
trace!(target: LOG_TARGET, "Window event: {:?} {:?}", label, event);
if let WindowEvent::CloseRequested { .. } = event {
if let Some(window) = app_handle.get_webview_window(&label) {
if let (Ok(window_position), Ok(window_size)) = (window.outer_position(), window.inner_size()) {
let window_settings = WindowSettings {
x: window_position.x,
y: window_position.y,
width: window_size.width,
height: window_size.height,
};
let mut app_config = block_on(app_state.config.write());
if let Err(e) = block_on(app_config.set_window_settings(window_settings.clone())) {
error!(target: LOG_TARGET, "Could not set window settings: {:?}", e);
}
} else {
error!(target: LOG_TARGET, "Could not get window position or size");
}
} else {
error!(target: LOG_TARGET, "Could not get main window");
}
}
}
_ => {
debug!(target: LOG_TARGET, "Unhandled event: {:?}", event);
}
Expand Down
6 changes: 4 additions & 2 deletions src-tauri/src/p2pool_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ impl ProcessAdapter for P2poolAdapter {
];
let pid_file_name = self.pid_file_name().to_string();

args.push("--squad".to_string());
args.push("default_2".to_string());
args.push("--squad-prefix".to_string());
args.push("default".to_string());
args.push("--num-squads".to_string());
args.push("2".to_string());
let mut envs = HashMap::new();
match Network::get_current_or_user_setting_or_default() {
Network::Esmeralda => {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.8.40",
"version": "0.8.41",
"productName": "Tari Universe (Alpha)",
"mainBinaryName": "Tari Universe (Alpha)",
"identifier": "com.tari.universe.alpha",
Expand Down

0 comments on commit 8bac2d0

Please sign in to comment.