build: common warnings
This commit is contained in:
parent
c469fec4e0
commit
2aa22030eb
11 changed files with 16 additions and 26 deletions
|
@ -13,7 +13,6 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use egui::{Margin, RichText, ScrollArea, Stroke};
|
use egui::{Margin, RichText, ScrollArea, Stroke};
|
||||||
use grin_servers::common::types::Error;
|
|
||||||
|
|
||||||
use crate::AppConfig;
|
use crate::AppConfig;
|
||||||
use crate::gui::Colors;
|
use crate::gui::Colors;
|
||||||
|
@ -193,7 +192,7 @@ impl NetworkContent {
|
||||||
ui: &mut egui::Ui,
|
ui: &mut egui::Ui,
|
||||||
frame: &mut eframe::Frame,
|
frame: &mut eframe::Frame,
|
||||||
show_connections: bool,
|
show_connections: bool,
|
||||||
cb: &dyn PlatformCallbacks) {
|
_: &dyn PlatformCallbacks) {
|
||||||
// Setup values for title panel.
|
// Setup values for title panel.
|
||||||
let title_text = self.node_tab_content.get_type().title().to_uppercase();
|
let title_text = self.node_tab_content.get_type().title().to_uppercase();
|
||||||
let subtitle_text = Node::get_sync_status_text();
|
let subtitle_text = Node::get_sync_status_text();
|
||||||
|
|
|
@ -13,11 +13,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use egui::{RichText, Rounding, ScrollArea};
|
use egui::{RichText, Rounding, ScrollArea};
|
||||||
use grin_servers::common::types::Error;
|
|
||||||
use grin_servers::PeerStats;
|
use grin_servers::PeerStats;
|
||||||
|
|
||||||
use crate::gui::Colors;
|
use crate::gui::Colors;
|
||||||
use crate::gui::icons::{ARROWS_COUNTER_CLOCKWISE, AT, CUBE, DEVICES, FLOW_ARROW, HANDSHAKE, PACKAGE, PLUGS_CONNECTED, SHARE_NETWORK};
|
use crate::gui::icons::{AT, CUBE, DEVICES, FLOW_ARROW, HANDSHAKE, PACKAGE, PLUGS_CONNECTED, SHARE_NETWORK};
|
||||||
use crate::gui::platform::PlatformCallbacks;
|
use crate::gui::platform::PlatformCallbacks;
|
||||||
use crate::gui::views::{NetworkContent, Root, View};
|
use crate::gui::views::{NetworkContent, Root, View};
|
||||||
use crate::gui::views::network::types::{NetworkTab, NetworkTabType};
|
use crate::gui::views::network::types::{NetworkTab, NetworkTabType};
|
||||||
|
|
|
@ -40,7 +40,7 @@ impl TitlePanel {
|
||||||
};
|
};
|
||||||
(Id::from(text.clone()), false)
|
(Id::from(text.clone()), false)
|
||||||
},
|
},
|
||||||
TitleType::Dual(first, second) => {
|
TitleType::Dual(first, _) => {
|
||||||
let first_text = match first {
|
let first_text = match first {
|
||||||
TitleContentType::Title(text) => text,
|
TitleContentType::Title(text) => text,
|
||||||
TitleContentType::WithSubTitle(text, _, _) => text
|
TitleContentType::WithSubTitle(text, _, _) => text
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use std::ops::Add;
|
|
||||||
use std::sync::atomic::{AtomicI32, Ordering};
|
use std::sync::atomic::{AtomicI32, Ordering};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
|
@ -558,7 +557,6 @@ impl View {
|
||||||
pub fn radio_value<T: PartialEq>(ui: &mut egui::Ui, current: &mut T, value: T, text: String) {
|
pub fn radio_value<T: PartialEq>(ui: &mut egui::Ui, current: &mut T, value: T, text: String) {
|
||||||
let mut response = ui.radio(*current == value, text)
|
let mut response = ui.radio(*current == value, text)
|
||||||
.on_hover_cursor(CursorIcon::PointingHand);
|
.on_hover_cursor(CursorIcon::PointingHand);
|
||||||
;
|
|
||||||
if Self::touched(ui, response.clone()) && *current != value {
|
if Self::touched(ui, response.clone()) && *current != value {
|
||||||
*current = value;
|
*current = value;
|
||||||
response.mark_changed();
|
response.mark_changed();
|
||||||
|
@ -650,7 +648,7 @@ pub extern "C" fn Java_mw_gri_android_MainActivity_onInput(
|
||||||
_class: jni::objects::JObject,
|
_class: jni::objects::JObject,
|
||||||
char: jni::sys::jstring
|
char: jni::sys::jstring
|
||||||
) {
|
) {
|
||||||
use jni::objects::{JString};
|
use jni::objects::JString;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let j_obj = JString::from_raw(char);
|
let j_obj = JString::from_raw(char);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use egui::{Align, Id, Layout, Margin, RichText, Rounding, ScrollArea, Widget};
|
use egui::{Align, Id, Layout, Margin, RichText, Rounding, ScrollArea};
|
||||||
|
|
||||||
use crate::AppConfig;
|
use crate::AppConfig;
|
||||||
use crate::gui::Colors;
|
use crate::gui::Colors;
|
||||||
|
@ -272,7 +272,7 @@ impl WalletsContent {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Draw title panel.
|
// Draw title panel.
|
||||||
TitlePanel::ui(title_content, |ui, frame| {
|
TitlePanel::ui(title_content, |ui, _| {
|
||||||
if show_wallet && !dual_panel {
|
if show_wallet && !dual_panel {
|
||||||
View::title_button(ui, ARROW_LEFT, || {
|
View::title_button(ui, ARROW_LEFT, || {
|
||||||
self.wallets.select(None);
|
self.wallets.select(None);
|
||||||
|
@ -296,7 +296,7 @@ impl WalletsContent {
|
||||||
Root::toggle_network_panel();
|
Root::toggle_network_panel();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}, |ui, frame| {
|
}, |ui, _| {
|
||||||
View::title_button(ui, GEAR, || {
|
View::title_button(ui, GEAR, || {
|
||||||
// Show settings modal.
|
// Show settings modal.
|
||||||
Modal::new(Root::SETTINGS_MODAL)
|
Modal::new(Root::SETTINGS_MODAL)
|
||||||
|
|
|
@ -12,13 +12,12 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use egui::{Id, Margin, RichText, ScrollArea, TextStyle, vec2, Widget};
|
use egui::{Id, Margin, RichText, ScrollArea, vec2};
|
||||||
use egui_extras::{RetainedImage, Size, StripBuilder};
|
|
||||||
use grin_util::ZeroingString;
|
use grin_util::ZeroingString;
|
||||||
|
|
||||||
use crate::built_info;
|
use crate::built_info;
|
||||||
use crate::gui::Colors;
|
use crate::gui::Colors;
|
||||||
use crate::gui::icons::{CHECK, CLIPBOARD_TEXT, COPY, EYE, EYE_SLASH, FOLDER_PLUS, SCAN, SHARE_FAT};
|
use crate::gui::icons::{CHECK, CLIPBOARD_TEXT, COPY, FOLDER_PLUS, SCAN, SHARE_FAT};
|
||||||
use crate::gui::platform::PlatformCallbacks;
|
use crate::gui::platform::PlatformCallbacks;
|
||||||
use crate::gui::views::{Modal, Root, View};
|
use crate::gui::views::{Modal, Root, View};
|
||||||
use crate::gui::views::types::{ModalPosition, TextEditOptions};
|
use crate::gui::views::types::{ModalPosition, TextEditOptions};
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use egui::{Id, RichText, Widget};
|
use egui::{Id, RichText};
|
||||||
|
|
||||||
use crate::gui::Colors;
|
use crate::gui::Colors;
|
||||||
use crate::gui::icons::{CLOCK_COUNTDOWN, PASSWORD, PENCIL};
|
use crate::gui::icons::{CLOCK_COUNTDOWN, PASSWORD, PENCIL};
|
||||||
|
@ -201,7 +201,7 @@ impl CommonSetup {
|
||||||
});
|
});
|
||||||
columns[1].vertical_centered_justified(|ui| {
|
columns[1].vertical_centered_justified(|ui| {
|
||||||
// Save button callback.
|
// Save button callback.
|
||||||
let mut on_save = || {
|
let on_save = || {
|
||||||
if !self.name_edit.is_empty() {
|
if !self.name_edit.is_empty() {
|
||||||
wallet.change_name(self.name_edit.clone());
|
wallet.change_name(self.name_edit.clone());
|
||||||
cb.hide_keyboard();
|
cb.hide_keyboard();
|
||||||
|
@ -358,7 +358,7 @@ impl CommonSetup {
|
||||||
});
|
});
|
||||||
columns[1].vertical_centered_justified(|ui| {
|
columns[1].vertical_centered_justified(|ui| {
|
||||||
// Save button callback.
|
// Save button callback.
|
||||||
let mut on_save = || {
|
let on_save = || {
|
||||||
if let Ok(min_conf) = self.min_confirmations_edit.parse::<u64>() {
|
if let Ok(min_conf) = self.min_confirmations_edit.parse::<u64>() {
|
||||||
wallet.update_min_confirmations(min_conf);
|
wallet.update_min_confirmations(min_conf);
|
||||||
cb.hide_keyboard();
|
cb.hide_keyboard();
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use egui::{Align, Id, Layout, RichText, Rounding, Widget};
|
use egui::{Align, Id, Layout, RichText, Rounding};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use crate::gui::Colors;
|
use crate::gui::Colors;
|
||||||
|
@ -412,7 +412,7 @@ impl ConnectionSetup {
|
||||||
ui: &mut egui::Ui,
|
ui: &mut egui::Ui,
|
||||||
wallet: &Wallet,
|
wallet: &Wallet,
|
||||||
modal: &Modal,
|
modal: &Modal,
|
||||||
cb: &dyn PlatformCallbacks) {
|
_: &dyn PlatformCallbacks) {
|
||||||
ui.add_space(8.0);
|
ui.add_space(8.0);
|
||||||
ui.vertical_centered(|ui| {
|
ui.vertical_centered(|ui| {
|
||||||
ui.label(RichText::new(t!("wallets.change_server_confirmation"))
|
ui.label(RichText::new(t!("wallets.change_server_confirmation"))
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use egui::{Id, RichText, Widget};
|
use egui::{Id, RichText};
|
||||||
use grin_chain::SyncStatus;
|
use grin_chain::SyncStatus;
|
||||||
use grin_util::ZeroingString;
|
use grin_util::ZeroingString;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use egui::{Align, Id, Layout, Margin, RichText, ScrollArea, Widget};
|
use egui::{Align, Id, Layout, Margin, RichText, ScrollArea};
|
||||||
use grin_chain::SyncStatus;
|
use grin_chain::SyncStatus;
|
||||||
use grin_core::core::amount_to_hr_string;
|
use grin_core::core::amount_to_hr_string;
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,6 @@ impl Tor {
|
||||||
runtime
|
runtime
|
||||||
.spawn(async move {
|
.spawn(async move {
|
||||||
loop {
|
loop {
|
||||||
println!("start loop");
|
|
||||||
// Create client.
|
// Create client.
|
||||||
let (client, _) = Self::build_client(client_runtime.clone()).await;
|
let (client, _) = Self::build_client(client_runtime.clone()).await;
|
||||||
|
|
||||||
|
@ -234,19 +233,16 @@ impl Tor {
|
||||||
let tor_connector = ArtiHttpConnector::new(client, tls_connector);
|
let tor_connector = ArtiHttpConnector::new(client, tls_connector);
|
||||||
let http = hyper::Client::builder().build::<_, Body>(tor_connector);
|
let http = hyper::Client::builder().build::<_, Body>(tor_connector);
|
||||||
|
|
||||||
println!("start get {}", url);
|
|
||||||
match http.get(Uri::from_str(url.as_str()).unwrap()).await {
|
match http.get(Uri::from_str(url.as_str()).unwrap()).await {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
// Remove service from starting.
|
// Remove service from starting.
|
||||||
let mut w_services = TOR_SERVER_STATE.starting_services.write().unwrap();
|
let mut w_services = TOR_SERVER_STATE.starting_services.write().unwrap();
|
||||||
w_services.remove(&service_id);
|
w_services.remove(&service_id);
|
||||||
println!("OK");
|
|
||||||
},
|
},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
// Put service to starting.
|
// Put service to starting.
|
||||||
let mut w_services = TOR_SERVER_STATE.starting_services.write().unwrap();
|
let mut w_services = TOR_SERVER_STATE.starting_services.write().unwrap();
|
||||||
w_services.insert(service_id.clone());
|
w_services.insert(service_id.clone());
|
||||||
println!("err: {}", e);
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if !Self::is_service_running(&service_id) &&
|
if !Self::is_service_running(&service_id) &&
|
||||||
|
@ -305,7 +301,6 @@ impl Tor {
|
||||||
w_services.remove(&id);
|
w_services.remove(&id);
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("service err: {}", e);
|
|
||||||
// Remove service from running.
|
// Remove service from running.
|
||||||
let mut w_services =
|
let mut w_services =
|
||||||
TOR_SERVER_STATE.running_services.write().unwrap();
|
TOR_SERVER_STATE.running_services.write().unwrap();
|
||||||
|
|
Loading…
Reference in a new issue