Change progress dialog to progress window (#229)
This commit is contained in:
parent
b8049efe62
commit
2c2004b316
|
@ -148,155 +148,6 @@ This program is free to use and will always be.
|
||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkDialog" id="dialog_progress">
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="type_hint">dialog</property>
|
|
||||||
<child internal-child="vbox">
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_start">10</property>
|
|
||||||
<property name="margin_end">10</property>
|
|
||||||
<property name="margin_top">10</property>
|
|
||||||
<property name="margin_bottom">10</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<property name="spacing">10</property>
|
|
||||||
<child internal-child="action_area">
|
|
||||||
<object class="GtkButtonBox">
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="layout_style">end</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="button_stop_in_dialog">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkAlignment">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkImage">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="icon_name">dialog-cancel</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Stop</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkGrid" id="grid_progress_stages">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Current stage: </property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">All stages: </property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkProgressBar" id="progress_bar_current_stage">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="show_text">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkProgressBar" id="progress_bar_all_stages">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="hexpand">True</property>
|
|
||||||
<property name="pulse_step">0.09999999977648258</property>
|
|
||||||
<property name="show_text">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label_stage">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Stage 1/2</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child type="titlebar">
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<object class="GtkPopover" id="popover_right_click">
|
<object class="GtkPopover" id="popover_right_click">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="position">left</property>
|
<property name="position">left</property>
|
||||||
|
@ -2627,4 +2478,155 @@ This program is free to use and will always be.
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkWindow" id="window_progress">
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="title" translatable="yes">Czkawka Progress Window</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_start">10</property>
|
||||||
|
<property name="margin_end">10</property>
|
||||||
|
<property name="margin_top">10</property>
|
||||||
|
<property name="margin_bottom">10</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">10</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkGrid" id="grid_progress_stages">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">All stages: </property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkProgressBar" id="progress_bar_all_stages">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="pulse_step">0.09999999977648258</property>
|
||||||
|
<property name="show_text">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Current stage: </property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkProgressBar" id="progress_bar_current_stage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="show_text">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label_stage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Stage 1/2</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButtonBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="layout_style">end</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="button_stop_in_dialog">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkAlignment">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="icon_name">dialog-cancel</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Stop</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child type="titlebar">
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
|
@ -16,7 +16,7 @@ use czkawka_core::temporary::Temporary;
|
||||||
use czkawka_core::zeroed::ZeroedFiles;
|
use czkawka_core::zeroed::ZeroedFiles;
|
||||||
use glib::Sender;
|
use glib::Sender;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk::{ResponseType, WindowPosition};
|
use gtk::WindowPosition;
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -36,7 +36,6 @@ pub fn connect_button_search(
|
||||||
futures_sender_invalid_symlinks: futures::channel::mpsc::Sender<invalid_symlinks::ProgressData>,
|
futures_sender_invalid_symlinks: futures::channel::mpsc::Sender<invalid_symlinks::ProgressData>,
|
||||||
futures_sender_broken_files: futures::channel::mpsc::Sender<broken_files::ProgressData>,
|
futures_sender_broken_files: futures::channel::mpsc::Sender<broken_files::ProgressData>,
|
||||||
) {
|
) {
|
||||||
let stop_sender = gui_data.stop_sender.clone();
|
|
||||||
let entry_info = gui_data.entry_info.clone();
|
let entry_info = gui_data.entry_info.clone();
|
||||||
let notebook_main = gui_data.main_notebook.notebook_main.clone();
|
let notebook_main = gui_data.main_notebook.notebook_main.clone();
|
||||||
let tree_view_included_directories = gui_data.upper_notebook.tree_view_included_directories.clone();
|
let tree_view_included_directories = gui_data.upper_notebook.tree_view_included_directories.clone();
|
||||||
|
@ -79,11 +78,11 @@ pub fn connect_button_search(
|
||||||
let tree_view_invalid_symlinks = gui_data.main_notebook.tree_view_invalid_symlinks.clone();
|
let tree_view_invalid_symlinks = gui_data.main_notebook.tree_view_invalid_symlinks.clone();
|
||||||
let tree_view_broken_files = gui_data.main_notebook.tree_view_broken_files.clone();
|
let tree_view_broken_files = gui_data.main_notebook.tree_view_broken_files.clone();
|
||||||
let text_view_errors = gui_data.text_view_errors.clone();
|
let text_view_errors = gui_data.text_view_errors.clone();
|
||||||
let dialog_progress = gui_data.progress_dialog.dialog_progress.clone();
|
let window_progress = gui_data.progress_window.window_progress.clone();
|
||||||
let label_stage = gui_data.progress_dialog.label_stage.clone();
|
let label_stage = gui_data.progress_window.label_stage.clone();
|
||||||
let grid_progress_stages = gui_data.progress_dialog.grid_progress_stages.clone();
|
let grid_progress_stages = gui_data.progress_window.grid_progress_stages.clone();
|
||||||
let progress_bar_current_stage = gui_data.progress_dialog.progress_bar_current_stage.clone();
|
let progress_bar_current_stage = gui_data.progress_window.progress_bar_current_stage.clone();
|
||||||
let progress_bar_all_stages = gui_data.progress_dialog.progress_bar_all_stages.clone();
|
let progress_bar_all_stages = gui_data.progress_window.progress_bar_all_stages.clone();
|
||||||
let image_preview_similar_images = gui_data.main_notebook.image_preview_similar_images.clone();
|
let image_preview_similar_images = gui_data.main_notebook.image_preview_similar_images.clone();
|
||||||
|
|
||||||
buttons_search_clone.connect_clicked(move |_| {
|
buttons_search_clone.connect_clicked(move |_| {
|
||||||
|
@ -103,7 +102,7 @@ pub fn connect_button_search(
|
||||||
entry_info.set_text("Searching data, it may take a while, please wait...");
|
entry_info.set_text("Searching data, it may take a while, please wait...");
|
||||||
|
|
||||||
// Set dialog to center to current screen(it is impossible to center it to main window)
|
// Set dialog to center to current screen(it is impossible to center it to main window)
|
||||||
dialog_progress.set_position(WindowPosition::CenterAlways);
|
window_progress.set_position(WindowPosition::CenterAlways);
|
||||||
|
|
||||||
// Resets progress bars
|
// Resets progress bars
|
||||||
progress_bar_all_stages.set_fraction(0 as f64);
|
progress_bar_all_stages.set_fraction(0 as f64);
|
||||||
|
@ -118,7 +117,7 @@ pub fn connect_button_search(
|
||||||
NotebookMainEnum::Duplicate => {
|
NotebookMainEnum::Duplicate => {
|
||||||
label_stage.show();
|
label_stage.show();
|
||||||
grid_progress_stages.show_all();
|
grid_progress_stages.show_all();
|
||||||
dialog_progress.resize(1, 1);
|
window_progress.resize(1, 1);
|
||||||
|
|
||||||
get_list_store(&tree_view_duplicate_finder).clear();
|
get_list_store(&tree_view_duplicate_finder).clear();
|
||||||
|
|
||||||
|
@ -154,7 +153,7 @@ pub fn connect_button_search(
|
||||||
NotebookMainEnum::EmptyFiles => {
|
NotebookMainEnum::EmptyFiles => {
|
||||||
label_stage.show();
|
label_stage.show();
|
||||||
grid_progress_stages.hide();
|
grid_progress_stages.hide();
|
||||||
dialog_progress.resize(1, 1);
|
window_progress.resize(1, 1);
|
||||||
|
|
||||||
get_list_store(&tree_view_empty_files_finder).clear();
|
get_list_store(&tree_view_empty_files_finder).clear();
|
||||||
|
|
||||||
|
@ -175,7 +174,7 @@ pub fn connect_button_search(
|
||||||
NotebookMainEnum::EmptyDirectories => {
|
NotebookMainEnum::EmptyDirectories => {
|
||||||
label_stage.show();
|
label_stage.show();
|
||||||
grid_progress_stages.hide();
|
grid_progress_stages.hide();
|
||||||
dialog_progress.resize(1, 1);
|
window_progress.resize(1, 1);
|
||||||
|
|
||||||
get_list_store(&tree_view_empty_folder_finder).clear();
|
get_list_store(&tree_view_empty_folder_finder).clear();
|
||||||
|
|
||||||
|
@ -193,7 +192,7 @@ pub fn connect_button_search(
|
||||||
NotebookMainEnum::BigFiles => {
|
NotebookMainEnum::BigFiles => {
|
||||||
label_stage.show();
|
label_stage.show();
|
||||||
grid_progress_stages.hide();
|
grid_progress_stages.hide();
|
||||||
dialog_progress.resize(1, 1);
|
window_progress.resize(1, 1);
|
||||||
|
|
||||||
get_list_store(&tree_view_big_files_finder).clear();
|
get_list_store(&tree_view_big_files_finder).clear();
|
||||||
|
|
||||||
|
@ -216,7 +215,7 @@ pub fn connect_button_search(
|
||||||
NotebookMainEnum::Temporary => {
|
NotebookMainEnum::Temporary => {
|
||||||
label_stage.show();
|
label_stage.show();
|
||||||
grid_progress_stages.hide();
|
grid_progress_stages.hide();
|
||||||
dialog_progress.resize(1, 1);
|
window_progress.resize(1, 1);
|
||||||
|
|
||||||
get_list_store(&tree_view_temporary_files_finder).clear();
|
get_list_store(&tree_view_temporary_files_finder).clear();
|
||||||
|
|
||||||
|
@ -238,7 +237,7 @@ pub fn connect_button_search(
|
||||||
|
|
||||||
label_stage.show();
|
label_stage.show();
|
||||||
grid_progress_stages.show_all();
|
grid_progress_stages.show_all();
|
||||||
dialog_progress.resize(1, 1);
|
window_progress.resize(1, 1);
|
||||||
|
|
||||||
get_list_store(&tree_view_similar_images_finder).clear();
|
get_list_store(&tree_view_similar_images_finder).clear();
|
||||||
|
|
||||||
|
@ -279,7 +278,7 @@ pub fn connect_button_search(
|
||||||
NotebookMainEnum::Zeroed => {
|
NotebookMainEnum::Zeroed => {
|
||||||
label_stage.show();
|
label_stage.show();
|
||||||
grid_progress_stages.show_all();
|
grid_progress_stages.show_all();
|
||||||
dialog_progress.resize(1, 1);
|
window_progress.resize(1, 1);
|
||||||
|
|
||||||
get_list_store(&tree_view_zeroed_files_finder).clear();
|
get_list_store(&tree_view_zeroed_files_finder).clear();
|
||||||
|
|
||||||
|
@ -300,7 +299,7 @@ pub fn connect_button_search(
|
||||||
NotebookMainEnum::SameMusic => {
|
NotebookMainEnum::SameMusic => {
|
||||||
label_stage.show();
|
label_stage.show();
|
||||||
grid_progress_stages.show_all();
|
grid_progress_stages.show_all();
|
||||||
dialog_progress.resize(1, 1);
|
window_progress.resize(1, 1);
|
||||||
|
|
||||||
get_list_store(&tree_view_same_music_finder).clear();
|
get_list_store(&tree_view_same_music_finder).clear();
|
||||||
|
|
||||||
|
@ -349,7 +348,7 @@ pub fn connect_button_search(
|
||||||
NotebookMainEnum::Symlinks => {
|
NotebookMainEnum::Symlinks => {
|
||||||
label_stage.show();
|
label_stage.show();
|
||||||
grid_progress_stages.hide();
|
grid_progress_stages.hide();
|
||||||
dialog_progress.resize(1, 1);
|
window_progress.resize(1, 1);
|
||||||
|
|
||||||
get_list_store(&tree_view_invalid_symlinks).clear();
|
get_list_store(&tree_view_invalid_symlinks).clear();
|
||||||
|
|
||||||
|
@ -369,7 +368,7 @@ pub fn connect_button_search(
|
||||||
NotebookMainEnum::BrokenFiles => {
|
NotebookMainEnum::BrokenFiles => {
|
||||||
label_stage.show();
|
label_stage.show();
|
||||||
grid_progress_stages.show();
|
grid_progress_stages.show();
|
||||||
dialog_progress.resize(1, 1);
|
window_progress.resize(1, 1);
|
||||||
|
|
||||||
get_list_store(&tree_view_broken_files).clear();
|
get_list_store(&tree_view_broken_files).clear();
|
||||||
|
|
||||||
|
@ -390,14 +389,7 @@ pub fn connect_button_search(
|
||||||
|
|
||||||
// Show progress dialog
|
// Show progress dialog
|
||||||
if show_dialog.load(Ordering::Relaxed) {
|
if show_dialog.load(Ordering::Relaxed) {
|
||||||
dialog_progress.show();
|
window_progress.show();
|
||||||
|
|
||||||
let response = dialog_progress.run();
|
|
||||||
if response == ResponseType::DeleteEvent {
|
|
||||||
stop_sender.send(()).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
dialog_progress.hide();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ use crate::gui_data::GuiData;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
|
|
||||||
pub fn connect_button_stop(gui_data: &GuiData) {
|
pub fn connect_button_stop(gui_data: &GuiData) {
|
||||||
let button_stop_in_dialog = gui_data.progress_dialog.button_stop_in_dialog.clone();
|
let button_stop_in_dialog = gui_data.progress_window.button_stop_in_dialog.clone();
|
||||||
let stop_sender = gui_data.stop_sender.clone();
|
let stop_sender = gui_data.stop_sender.clone();
|
||||||
button_stop_in_dialog.connect_clicked(move |_| {
|
button_stop_in_dialog.connect_clicked(move |_| {
|
||||||
stop_sender.send(()).unwrap();
|
stop_sender.send(()).unwrap();
|
||||||
|
|
|
@ -38,12 +38,12 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
|
||||||
let tree_view_same_music_finder = gui_data.main_notebook.tree_view_same_music_finder.clone();
|
let tree_view_same_music_finder = gui_data.main_notebook.tree_view_same_music_finder.clone();
|
||||||
let shared_same_music_state = gui_data.shared_same_music_state.clone();
|
let shared_same_music_state = gui_data.shared_same_music_state.clone();
|
||||||
let buttons_names = gui_data.bottom_buttons.buttons_names.clone();
|
let buttons_names = gui_data.bottom_buttons.buttons_names.clone();
|
||||||
let dialog_progress = gui_data.progress_dialog.dialog_progress.clone();
|
let window_progress = gui_data.progress_window.window_progress.clone();
|
||||||
|
|
||||||
glib_stop_receiver.attach(None, move |msg| {
|
glib_stop_receiver.attach(None, move |msg| {
|
||||||
buttons_search.show();
|
buttons_search.show();
|
||||||
|
|
||||||
dialog_progress.hide();
|
window_progress.hide();
|
||||||
|
|
||||||
// Restore clickability to main notebook
|
// Restore clickability to main notebook
|
||||||
notebook_main.set_sensitive(true);
|
notebook_main.set_sensitive(true);
|
||||||
|
|
|
@ -23,10 +23,10 @@ pub fn connect_progress_window(
|
||||||
|
|
||||||
{
|
{
|
||||||
// Duplicate Files
|
// Duplicate Files
|
||||||
let label_stage = gui_data.progress_dialog.label_stage.clone();
|
let label_stage = gui_data.progress_window.label_stage.clone();
|
||||||
let progress_bar_current_stage = gui_data.progress_dialog.progress_bar_current_stage.clone();
|
let progress_bar_current_stage = gui_data.progress_window.progress_bar_current_stage.clone();
|
||||||
let progress_bar_all_stages = gui_data.progress_dialog.progress_bar_all_stages.clone();
|
let progress_bar_all_stages = gui_data.progress_window.progress_bar_all_stages.clone();
|
||||||
let grid_progress_stages = gui_data.progress_dialog.grid_progress_stages.clone();
|
let grid_progress_stages = gui_data.progress_window.grid_progress_stages.clone();
|
||||||
let future = async move {
|
let future = async move {
|
||||||
while let Some(item) = futures_receiver_duplicate_files.next().await {
|
while let Some(item) = futures_receiver_duplicate_files.next().await {
|
||||||
match item.checking_method {
|
match item.checking_method {
|
||||||
|
@ -91,7 +91,7 @@ pub fn connect_progress_window(
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Empty Files
|
// Empty Files
|
||||||
let label_stage = gui_data.progress_dialog.label_stage.clone();
|
let label_stage = gui_data.progress_window.label_stage.clone();
|
||||||
let future = async move {
|
let future = async move {
|
||||||
while let Some(item) = futures_receiver_empty_files.next().await {
|
while let Some(item) = futures_receiver_empty_files.next().await {
|
||||||
label_stage.set_text(format!("Scanned {} files", item.files_checked).as_str());
|
label_stage.set_text(format!("Scanned {} files", item.files_checked).as_str());
|
||||||
|
@ -101,7 +101,7 @@ pub fn connect_progress_window(
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Empty Folder
|
// Empty Folder
|
||||||
let label_stage = gui_data.progress_dialog.label_stage.clone();
|
let label_stage = gui_data.progress_window.label_stage.clone();
|
||||||
let future = async move {
|
let future = async move {
|
||||||
while let Some(item) = futures_receiver_empty_folder.next().await {
|
while let Some(item) = futures_receiver_empty_folder.next().await {
|
||||||
label_stage.set_text(format!("Scanned {} folders", item.folders_checked).as_str());
|
label_stage.set_text(format!("Scanned {} folders", item.folders_checked).as_str());
|
||||||
|
@ -111,7 +111,7 @@ pub fn connect_progress_window(
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Big Files
|
// Big Files
|
||||||
let label_stage = gui_data.progress_dialog.label_stage.clone();
|
let label_stage = gui_data.progress_window.label_stage.clone();
|
||||||
let future = async move {
|
let future = async move {
|
||||||
while let Some(item) = futures_receiver_big_files.next().await {
|
while let Some(item) = futures_receiver_big_files.next().await {
|
||||||
label_stage.set_text(format!("Scanned {} files", item.files_checked).as_str());
|
label_stage.set_text(format!("Scanned {} files", item.files_checked).as_str());
|
||||||
|
@ -121,9 +121,9 @@ pub fn connect_progress_window(
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Same Music
|
// Same Music
|
||||||
let label_stage = gui_data.progress_dialog.label_stage.clone();
|
let label_stage = gui_data.progress_window.label_stage.clone();
|
||||||
let progress_bar_current_stage = gui_data.progress_dialog.progress_bar_current_stage.clone();
|
let progress_bar_current_stage = gui_data.progress_window.progress_bar_current_stage.clone();
|
||||||
let progress_bar_all_stages = gui_data.progress_dialog.progress_bar_all_stages.clone();
|
let progress_bar_all_stages = gui_data.progress_window.progress_bar_all_stages.clone();
|
||||||
let future = async move {
|
let future = async move {
|
||||||
while let Some(item) = futures_receiver_same_music.next().await {
|
while let Some(item) = futures_receiver_same_music.next().await {
|
||||||
match item.current_stage {
|
match item.current_stage {
|
||||||
|
@ -162,9 +162,9 @@ pub fn connect_progress_window(
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Similar Images
|
// Similar Images
|
||||||
let label_stage = gui_data.progress_dialog.label_stage.clone();
|
let label_stage = gui_data.progress_window.label_stage.clone();
|
||||||
let progress_bar_current_stage = gui_data.progress_dialog.progress_bar_current_stage.clone();
|
let progress_bar_current_stage = gui_data.progress_window.progress_bar_current_stage.clone();
|
||||||
let progress_bar_all_stages = gui_data.progress_dialog.progress_bar_all_stages.clone();
|
let progress_bar_all_stages = gui_data.progress_window.progress_bar_all_stages.clone();
|
||||||
let future = async move {
|
let future = async move {
|
||||||
while let Some(item) = futures_receiver_similar_images.next().await {
|
while let Some(item) = futures_receiver_similar_images.next().await {
|
||||||
match item.current_stage {
|
match item.current_stage {
|
||||||
|
@ -193,7 +193,7 @@ pub fn connect_progress_window(
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Temporary
|
// Temporary
|
||||||
let label_stage = gui_data.progress_dialog.label_stage.clone();
|
let label_stage = gui_data.progress_window.label_stage.clone();
|
||||||
let future = async move {
|
let future = async move {
|
||||||
while let Some(item) = futures_receiver_temporary.next().await {
|
while let Some(item) = futures_receiver_temporary.next().await {
|
||||||
label_stage.set_text(format!("Scanned {} files", item.files_checked).as_str());
|
label_stage.set_text(format!("Scanned {} files", item.files_checked).as_str());
|
||||||
|
@ -203,9 +203,9 @@ pub fn connect_progress_window(
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Zeroed Files
|
// Zeroed Files
|
||||||
let label_stage = gui_data.progress_dialog.label_stage.clone();
|
let label_stage = gui_data.progress_window.label_stage.clone();
|
||||||
let progress_bar_current_stage = gui_data.progress_dialog.progress_bar_current_stage.clone();
|
let progress_bar_current_stage = gui_data.progress_window.progress_bar_current_stage.clone();
|
||||||
let progress_bar_all_stages = gui_data.progress_dialog.progress_bar_all_stages.clone();
|
let progress_bar_all_stages = gui_data.progress_window.progress_bar_all_stages.clone();
|
||||||
let future = async move {
|
let future = async move {
|
||||||
while let Some(item) = futures_receiver_zeroed.next().await {
|
while let Some(item) = futures_receiver_zeroed.next().await {
|
||||||
match item.current_stage {
|
match item.current_stage {
|
||||||
|
@ -234,7 +234,7 @@ pub fn connect_progress_window(
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Invalid Symlinks
|
// Invalid Symlinks
|
||||||
let label_stage = gui_data.progress_dialog.label_stage.clone();
|
let label_stage = gui_data.progress_window.label_stage.clone();
|
||||||
let future = async move {
|
let future = async move {
|
||||||
while let Some(item) = futures_receiver_invalid_symlinks.next().await {
|
while let Some(item) = futures_receiver_invalid_symlinks.next().await {
|
||||||
label_stage.set_text(format!("Scanned {} files", item.files_checked).as_str());
|
label_stage.set_text(format!("Scanned {} files", item.files_checked).as_str());
|
||||||
|
@ -244,9 +244,9 @@ pub fn connect_progress_window(
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Broken Files
|
// Broken Files
|
||||||
let label_stage = gui_data.progress_dialog.label_stage.clone();
|
let label_stage = gui_data.progress_window.label_stage.clone();
|
||||||
let progress_bar_current_stage = gui_data.progress_dialog.progress_bar_current_stage.clone();
|
let progress_bar_current_stage = gui_data.progress_window.progress_bar_current_stage.clone();
|
||||||
let progress_bar_all_stages = gui_data.progress_dialog.progress_bar_all_stages.clone();
|
let progress_bar_all_stages = gui_data.progress_window.progress_bar_all_stages.clone();
|
||||||
let future = async move {
|
let future = async move {
|
||||||
while let Some(item) = futures_receiver_broken_files.next().await {
|
while let Some(item) = futures_receiver_broken_files.next().await {
|
||||||
match item.current_stage {
|
match item.current_stage {
|
||||||
|
|
|
@ -38,7 +38,7 @@ pub struct GuiData {
|
||||||
pub upper_notebook: GUIUpperNotebook,
|
pub upper_notebook: GUIUpperNotebook,
|
||||||
pub popovers: GUIPopovers,
|
pub popovers: GUIPopovers,
|
||||||
pub bottom_buttons: GUIBottomButtons,
|
pub bottom_buttons: GUIBottomButtons,
|
||||||
pub progress_dialog: GUIProgressDialog,
|
pub progress_window: GUIProgressDialog,
|
||||||
pub about: GUIAbout,
|
pub about: GUIAbout,
|
||||||
pub options: GUIOptions,
|
pub options: GUIOptions,
|
||||||
pub header: GUIHeader,
|
pub header: GUIHeader,
|
||||||
|
@ -88,7 +88,7 @@ impl GuiData {
|
||||||
let upper_notebook = GUIUpperNotebook::create_from_builder(&builder);
|
let upper_notebook = GUIUpperNotebook::create_from_builder(&builder);
|
||||||
let popovers = GUIPopovers::create_from_builder(&builder);
|
let popovers = GUIPopovers::create_from_builder(&builder);
|
||||||
let bottom_buttons = GUIBottomButtons::create_from_builder(&builder);
|
let bottom_buttons = GUIBottomButtons::create_from_builder(&builder);
|
||||||
let progress_dialog = GUIProgressDialog::create_from_builder(&builder);
|
let progress_window = GUIProgressDialog::create_from_builder(&builder);
|
||||||
let options = GUIOptions::create_from_builder(&builder);
|
let options = GUIOptions::create_from_builder(&builder);
|
||||||
let about = GUIAbout::create_from_builder(&builder);
|
let about = GUIAbout::create_from_builder(&builder);
|
||||||
let header = GUIHeader::create_from_builder(&builder);
|
let header = GUIHeader::create_from_builder(&builder);
|
||||||
|
@ -156,7 +156,7 @@ impl GuiData {
|
||||||
upper_notebook,
|
upper_notebook,
|
||||||
popovers,
|
popovers,
|
||||||
bottom_buttons,
|
bottom_buttons,
|
||||||
progress_dialog,
|
progress_window,
|
||||||
about,
|
about,
|
||||||
options,
|
options,
|
||||||
header,
|
header,
|
||||||
|
|
|
@ -2,7 +2,7 @@ use gtk::prelude::*;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct GUIProgressDialog {
|
pub struct GUIProgressDialog {
|
||||||
pub dialog_progress: gtk::Dialog,
|
pub window_progress: gtk::Window,
|
||||||
|
|
||||||
pub progress_bar_current_stage: gtk::ProgressBar,
|
pub progress_bar_current_stage: gtk::ProgressBar,
|
||||||
pub progress_bar_all_stages: gtk::ProgressBar,
|
pub progress_bar_all_stages: gtk::ProgressBar,
|
||||||
|
@ -16,8 +16,7 @@ pub struct GUIProgressDialog {
|
||||||
|
|
||||||
impl GUIProgressDialog {
|
impl GUIProgressDialog {
|
||||||
pub fn create_from_builder(builder: >k::Builder) -> Self {
|
pub fn create_from_builder(builder: >k::Builder) -> Self {
|
||||||
let dialog_progress: gtk::Dialog = builder.get_object("dialog_progress").unwrap();
|
let window_progress: gtk::Window = builder.get_object("window_progress").unwrap();
|
||||||
dialog_progress.set_title("Czkawka");
|
|
||||||
|
|
||||||
let progress_bar_current_stage: gtk::ProgressBar = builder.get_object("progress_bar_current_stage").unwrap();
|
let progress_bar_current_stage: gtk::ProgressBar = builder.get_object("progress_bar_current_stage").unwrap();
|
||||||
let progress_bar_all_stages: gtk::ProgressBar = builder.get_object("progress_bar_all_stages").unwrap();
|
let progress_bar_all_stages: gtk::ProgressBar = builder.get_object("progress_bar_all_stages").unwrap();
|
||||||
|
@ -29,7 +28,7 @@ impl GUIProgressDialog {
|
||||||
let button_stop_in_dialog: gtk::Button = builder.get_object("button_stop_in_dialog").unwrap();
|
let button_stop_in_dialog: gtk::Button = builder.get_object("button_stop_in_dialog").unwrap();
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
dialog_progress,
|
window_progress,
|
||||||
progress_bar_current_stage,
|
progress_bar_current_stage,
|
||||||
progress_bar_all_stages,
|
progress_bar_all_stages,
|
||||||
label_stage,
|
label_stage,
|
||||||
|
|
|
@ -457,6 +457,19 @@ pub fn initialize_gui(gui_data: &mut GuiData) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//// Window progress
|
||||||
|
{
|
||||||
|
let window_progress = gui_data.progress_window.window_progress.clone();
|
||||||
|
let stop_sender = gui_data.stop_sender.clone();
|
||||||
|
|
||||||
|
window_progress.hide_on_delete();
|
||||||
|
|
||||||
|
window_progress.connect_delete_event(move |_e, _y| {
|
||||||
|
stop_sender.send(()).unwrap();
|
||||||
|
gtk::Inhibit(true)
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fn show_preview(tree_view: &TreeView, text_view_errors: &TextView, check_button_settings_show_preview_similar_images: &CheckButton, image_preview_similar_images: &Image) {
|
fn show_preview(tree_view: &TreeView, text_view_errors: &TextView, check_button_settings_show_preview_similar_images: &CheckButton, image_preview_similar_images: &Image) {
|
||||||
let (selected_rows, tree_model) = tree_view.get_selection().get_selected_rows();
|
let (selected_rows, tree_model) = tree_view.get_selection().get_selected_rows();
|
||||||
|
|
Loading…
Reference in a new issue