Skip to content

Commit

Permalink
It works 2
Browse files Browse the repository at this point in the history
  • Loading branch information
qarmin committed Nov 30, 2021
1 parent abd275a commit 812d06e
Show file tree
Hide file tree
Showing 32 changed files with 71 additions and 73 deletions.
4 changes: 2 additions & 2 deletions czkawka_gui/src/compute_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::rc::Rc;
use chrono::NaiveDateTime;
use glib::Receiver;
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use humansize::{file_size_opts as options, FileSize};

use czkawka_core::duplicate::CheckingMethod;
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_about_buttons.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;



use crate::gui_data::GuiData;

Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_button_delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::fs;
use std::fs::Metadata;

use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{Align, CheckButton, Dialog, ResponseType, TextView};

use crate::gui_data::GuiData;
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_button_hardlink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::fs;
use std::path::PathBuf;

use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{TextView, TreeIter, TreePath};

use czkawka_core::duplicate::make_hard_link;
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_button_move.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::path::{Path, PathBuf};

use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{ResponseType, TreePath};

use crate::gui_data::GuiData;
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_button_save.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::collections::HashMap;
use std::rc::Rc;

use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{Button, Entry};

use czkawka_core::common_traits::SaveResults;
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_button_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::thread;

use glib::Sender;
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use img_hash::{FilterType, HashAlg};

use czkawka_core::big_file::BigFile;
Expand Down
6 changes: 3 additions & 3 deletions czkawka_gui/src/connect_button_select.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::collections::HashMap;

use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;



use crate::gui_data::GuiData;
use crate::gui_popovers::GuiPopovers;
Expand Down Expand Up @@ -30,7 +30,7 @@ pub fn connect_button_select(gui_data: &GuiData) {
let notebook_main = gui_data.main_notebook.notebook_main.clone();
let buttons_select_clone = gui_data.bottom_buttons.buttons_select.clone();
let popover_select = gui_data.popovers.popover_select.clone();
let buttons_select = gui_data.bottom_buttons.buttons_select.clone();
let _buttons_select = gui_data.bottom_buttons.buttons_select.clone();

buttons_select_clone.connect_clicked(move |_| {
show_required_popovers(&popovers, &to_notebook_main_enum(notebook_main.current_page().unwrap()), &hashmap);
Expand Down
8 changes: 4 additions & 4 deletions czkawka_gui/src/connect_button_stop.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;




use crate::gui_data::GuiData;

pub fn connect_button_stop(gui_data: &GuiData) {
pub fn connect_button_stop(_gui_data: &GuiData) {
// let button_stop_in_dialog = gui_data.progress_window.button_stop_in_dialog.clone();
// let stop_sender = gui_data.stop_sender.clone();
// button_stop_in_dialog.connect_key_release_event(move |_, e| {
Expand Down
2 changes: 1 addition & 1 deletion czkawka_gui/src/connect_header_buttons.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use gtk4::prelude::*;
use gtk4::prelude::*;

use gtk4::Inhibit;

use crate::gui_data::GuiData;
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_hide_text_view_errors.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;



use crate::gui_data::GuiData;

Expand Down
8 changes: 3 additions & 5 deletions czkawka_gui/src/connect_notebook_tabs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;

use crate::gui_data::GuiData;
use crate::help_functions::*;
Expand All @@ -11,8 +9,8 @@ pub fn connect_notebook_tabs(gui_data: &GuiData) {
let buttons_array = gui_data.bottom_buttons.buttons_array.clone();
let notebook_main_clone = gui_data.main_notebook.notebook_main.clone();
let buttons_names = gui_data.bottom_buttons.buttons_names.clone();
let shared_upper_notebooks = gui_data.shared_upper_notebooks.clone();
let notebook_upper = gui_data.upper_notebook.notebook_upper.clone();
let _shared_upper_notebooks = gui_data.shared_upper_notebooks.clone();
let _notebook_upper = gui_data.upper_notebook.notebook_upper.clone();

notebook_main_clone.connect_switch_page(move |_, _, number| {
let current_tab_in_main_notebook = to_notebook_main_enum(number);
Expand All @@ -22,7 +20,7 @@ pub fn connect_notebook_tabs(gui_data: &GuiData) {

// Upper notebook
{
for (index, upper_tab) in get_all_upper_tabs().iter().enumerate() {
for (_index, _upper_tab) in get_all_upper_tabs().iter().enumerate() {
// if *shared_upper_notebooks.borrow_mut().get_mut(&current_tab_in_main_notebook).unwrap().get_mut(upper_tab).unwrap() {
// notebook_upper.children().get(index).unwrap().show(); // TODO find alternative for children
// } else {
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_popovers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{ResponseType, TreeIter, Window};

use czkawka_core::common::Common;
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_progress_window.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use futures::StreamExt;
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;



use czkawka_core::{big_file, broken_files, duplicate, empty_files, empty_folder, invalid_symlinks, same_music, similar_images, similar_videos, temporary};

Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_selection_of_directories.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{ResponseType, TreeView, Window};
use std::path::PathBuf;

Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use czkawka_core::common_messages::Messages;
use czkawka_core::duplicate::HashType;
use directories_next::ProjectDirs;
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{LabelBuilder, ResponseType};
use image::imageops::FilterType;
use img_hash::HashAlg;
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_similar_image_size_change.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;



use czkawka_core::similar_images::SIMILAR_VALUES;

Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/create_tree_view.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::TreeViewColumn;

use crate::help_functions::*;
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/gui_about.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use gtk4::prelude::*;
use gtk4::prelude::*;

use gtk4::Builder;
use gtk4::Inhibit;


#[derive(Clone)]
pub struct GuiAbout {
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/gui_bottom_buttons.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use gtk4::prelude::*;
use gtk4::prelude::*;

use gtk4::Button;
use gtk4::Inhibit;


#[derive(Clone)]
pub struct GuiBottomButtons {
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/gui_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use std::rc::Rc;

use crossbeam_channel::unbounded;
use gtk4::prelude::*;
use gtk4::prelude::*;

use gtk4::Builder;
use gtk4::Inhibit;


use czkawka_core::big_file::BigFile;
use czkawka_core::broken_files::BrokenFiles;
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/gui_header.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;



#[derive(Clone)]
pub struct GuiHeader {
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/gui_main_notebook.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{EventControllerKey, TreeView};

use crate::notebook_enums::NUMBER_OF_NOTEBOOK_MAIN_TABS;
Expand Down
2 changes: 1 addition & 1 deletion czkawka_gui/src/gui_popovers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::Builder;
use gtk4::Inhibit;


#[derive(Clone)]
pub struct GuiPopovers {
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/gui_progress_dialog.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{Builder, Window};

#[derive(Clone)]
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/gui_settings.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{Builder, Window};

#[derive(Clone)]
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/gui_upper_notepad.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{EventControllerKey, TreeView};

#[derive(Clone)]
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/help_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::collections::HashMap;
use std::path::{Path, PathBuf};

use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{ListStore, TextView};

use czkawka_core::big_file::BigFile;
Expand Down
14 changes: 7 additions & 7 deletions czkawka_gui/src/initialize_gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::path::Path;

use directories_next::ProjectDirs;
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{CheckButton, EventControllerKey, Image, SelectionMode, TextView, TreeView};
use image::imageops::FilterType;
use image::GenericImageView;
Expand Down Expand Up @@ -54,7 +54,7 @@ pub fn initialize_gui(gui_data: &mut GuiData) {
let scrolled_window_invalid_symlinks = gui_data.main_notebook.scrolled_window_invalid_symlinks.clone();
let scrolled_window_broken_files = gui_data.main_notebook.scrolled_window_broken_files.clone();

let text_view_errors = gui_data.text_view_errors.clone();
let _text_view_errors = gui_data.text_view_errors.clone();

let scale_similarity_similar_images = gui_data.main_notebook.scale_similarity_similar_images.clone();
let scale_similarity_similar_videos = gui_data.main_notebook.scale_similarity_similar_videos.clone();
Expand Down Expand Up @@ -109,8 +109,8 @@ pub fn initialize_gui(gui_data: &mut GuiData) {
{
// Other connects

let check_button_settings_show_preview_duplicates = gui_data.settings.check_button_settings_show_preview_duplicates.clone();
let image_preview_duplicates = gui_data.main_notebook.image_preview_duplicates.clone();
let _check_button_settings_show_preview_duplicates = gui_data.settings.check_button_settings_show_preview_duplicates.clone();
let _image_preview_duplicates = gui_data.main_notebook.image_preview_duplicates.clone();

// tree_view.connect_button_press_event(opening_double_click_function);
// tree_view.connect_button_release_event(move |tree_view, _event| {
Expand Down Expand Up @@ -255,10 +255,10 @@ pub fn initialize_gui(gui_data: &mut GuiData) {
}
{
// Other connects
let check_button_settings_show_preview_similar_images = gui_data.settings.check_button_settings_show_preview_similar_images.clone();
let _check_button_settings_show_preview_similar_images = gui_data.settings.check_button_settings_show_preview_similar_images.clone();

// tree_view.connect_button_press_event(opening_double_click_function);
let text_view_errors = gui_data.text_view_errors.clone();
let _text_view_errors = gui_data.text_view_errors.clone();
// tree_view.connect_button_release_event(move |tree_view, _event| {
// let nb_object = &NOTEBOOKS_INFOS[NotebookMainEnum::SimilarImages as usize];
// show_preview(
Expand Down
2 changes: 1 addition & 1 deletion czkawka_gui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![allow(clippy::too_many_arguments)]

use gtk4::prelude::*;
use gtk4::prelude::*;

use gtk4::Inhibit;

use czkawka_core::*;
Expand Down
6 changes: 3 additions & 3 deletions czkawka_gui/src/opening_selecting_records.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use crate::help_functions::*;
use gdk::ModifierType;
use gtk4::prelude::*;
use gtk4::prelude::*;

use gtk4::{gdk, Inhibit};

// TODO add option to open files and folders from context menu activated by pressing ONCE with right mouse button

pub fn opening_enter_function_ported2(event_controller: &gtk4::EventControllerKey, key: gdk4::keys::Key, _modifier_type: ModifierType) {}
pub fn opening_enter_function_ported2(_event_controller: &gtk4::EventControllerKey, _key: gdk4::keys::Key, _modifier_type: ModifierType) {}

pub fn opening_enter_function_ported(event_controller: &gtk4::EventControllerKey, key: gdk4::keys::Key, key_code: u32, _modifier_type: ModifierType) -> gtk4::Inhibit {
pub fn opening_enter_function_ported(event_controller: &gtk4::EventControllerKey, _key: gdk4::keys::Key, key_code: u32, _modifier_type: ModifierType) -> gtk4::Inhibit {
let tree_view = event_controller.widget().unwrap().downcast::<gtk4::TreeView>().unwrap();
#[cfg(debug_assertions)]
{
Expand Down
4 changes: 2 additions & 2 deletions czkawka_gui/src/saving_loading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use std::{env, fs};

use directories_next::ProjectDirs;
use gtk4::prelude::*;
use gtk4::prelude::*;
use gtk4::Inhibit;


use gtk4::{ScrolledWindow, TextView};

use crate::gui_settings::GuiSettings;
Expand Down

0 comments on commit 812d06e

Please sign in to comment.