Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTK 4 Port #466

Merged
merged 24 commits into from
May 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Kolejno
qarmin committed May 18, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 9cdec3901195b30070ce45314438e9826a3d79d3
4 changes: 2 additions & 2 deletions czkawka_gui/src/connect_things/connect_button_compare.rs
Original file line number Diff line number Diff line change
@@ -362,8 +362,8 @@ fn generate_cache_for_results(vector_with_path: Vec<(String, String, gtk4::TreeP
Some(pixbuf) => pixbuf,
};

big_img.set_pixbuf(Some(&pixbuf_big));
small_img.set_pixbuf(Some(&pixbuf_small));
big_img.set_from_pixbuf(Some(&pixbuf_big));
small_img.set_from_pixbuf(Some(&pixbuf_small));
break;
}
}
11 changes: 0 additions & 11 deletions czkawka_gui/src/connect_things/connect_button_search.rs
Original file line number Diff line number Diff line change
@@ -169,7 +169,6 @@ pub fn connect_button_search(

label_stage.show();
grid_progress_stages.show();
window_progress.resize(1, 1);

get_list_store(&tree_view_duplicate_finder).clear();

@@ -214,7 +213,6 @@ pub fn connect_button_search(
NotebookMainEnum::EmptyFiles => {
label_stage.show();
grid_progress_stages.hide();
window_progress.resize(1, 1);

get_list_store(&tree_view_empty_files_finder).clear();

@@ -235,7 +233,6 @@ pub fn connect_button_search(
NotebookMainEnum::EmptyDirectories => {
label_stage.show();
grid_progress_stages.hide();
window_progress.resize(1, 1);

get_list_store(&tree_view_empty_folder_finder).clear();

@@ -253,7 +250,6 @@ pub fn connect_button_search(
NotebookMainEnum::BigFiles => {
label_stage.show();
grid_progress_stages.hide();
window_progress.resize(1, 1);

get_list_store(&tree_view_big_files_finder).clear();

@@ -277,7 +273,6 @@ pub fn connect_button_search(
NotebookMainEnum::Temporary => {
label_stage.show();
grid_progress_stages.hide();
window_progress.resize(1, 1);

get_list_store(&tree_view_temporary_files_finder).clear();

@@ -299,7 +294,6 @@ pub fn connect_button_search(

label_stage.show();
grid_progress_stages.show();
window_progress.resize(1, 1);

get_list_store(&tree_view_similar_images_finder).clear();

@@ -349,7 +343,6 @@ pub fn connect_button_search(
NotebookMainEnum::SimilarVideos => {
label_stage.show();
grid_progress_stages.show();
window_progress.resize(1, 1);

get_list_store(&tree_view_similar_videos_finder).clear();

@@ -384,7 +377,6 @@ pub fn connect_button_search(
NotebookMainEnum::SameMusic => {
label_stage.show();
grid_progress_stages.show();
window_progress.resize(1, 1);

get_list_store(&tree_view_same_music_finder).clear();

@@ -444,7 +436,6 @@ pub fn connect_button_search(
NotebookMainEnum::Symlinks => {
label_stage.show();
grid_progress_stages.hide();
window_progress.resize(1, 1);

get_list_store(&tree_view_invalid_symlinks).clear();

@@ -465,7 +456,6 @@ pub fn connect_button_search(
NotebookMainEnum::BrokenFiles => {
label_stage.show();
grid_progress_stages.show();
window_progress.resize(1, 1);

get_list_store(&tree_view_broken_files).clear();

@@ -488,7 +478,6 @@ pub fn connect_button_search(
NotebookMainEnum::BadExtensions => {
label_stage.show();
grid_progress_stages.show();
window_progress.resize(1, 1);

get_list_store(&tree_view_bad_extensions).clear();

4 changes: 2 additions & 2 deletions czkawka_gui/src/gui_structs/gui_compare_images.rs
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ impl GuiCompareImages {
let builder = Builder::from_string(glade_src.as_str());

let window_compare: gtk4::Window = builder.object("window_compare").unwrap();
window_compare.set_title(&flg!("window_compare_images"));
window_compare.set_title(Some(&flg!("window_compare_images")));
window_compare.set_modal(true);
window_compare.set_transient_for(Some(window_main));

@@ -79,6 +79,6 @@ impl GuiCompareImages {
}
}
pub fn update_language(&self) {
self.window_compare.set_title(&flg!("window_compare_images"));
self.window_compare.set_title(Some(&flg!("window_compare_images")));
}
}
16 changes: 8 additions & 8 deletions czkawka_gui/src/gui_structs/gui_progress_dialog.rs
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ pub struct GuiProgressDialog {

pub button_stop_in_dialog: gtk4::Button,
pub evk_button_stop_in_dialog: gtk4::EventControllerKey,
// pub gc_button_stop_in_dialog: gtk4::GestureClick,
pub gc_button_stop_in_dialog: gtk4::GestureClick,
}

impl GuiProgressDialog {
@@ -28,7 +28,7 @@ impl GuiProgressDialog {
let builder = Builder::from_string(glade_src.as_str());

let window_progress: gtk4::Dialog = builder.object("window_progress").unwrap();
window_progress.set_title(&flg!("window_progress_title"));
window_progress.set_title(Some(&flg!("window_progress_title")));
window_progress.set_transient_for(Some(window_main));
window_progress.set_modal(true);

@@ -42,11 +42,10 @@ impl GuiProgressDialog {
let grid_progress_stages: gtk4::Grid = builder.object("grid_progress_stages").unwrap();

let button_stop_in_dialog: gtk4::Button = builder.object("button_stop_in_dialog").unwrap();
let evk_button_stop_in_dialog = EventControllerKey::new(&button_stop_in_dialog);
// let evk_button_stop_in_dialog = EventControllerKey::new();
// button_stop_in_dialog.add_controller(&evk_button_stop_in_dialog);
// let gc_button_stop_in_dialog = gtk4::GestureClick::new();
// button_stop_in_dialog.add_controller(&gc_button_stop_in_dialog);
let evk_button_stop_in_dialog = EventControllerKey::new();
button_stop_in_dialog.add_controller(&evk_button_stop_in_dialog);
let gc_button_stop_in_dialog = gtk4::GestureClick::new();
button_stop_in_dialog.add_controller(&gc_button_stop_in_dialog);

set_icon_of_button(&button_stop_in_dialog, CZK_ICON_STOP);

@@ -60,10 +59,11 @@ impl GuiProgressDialog {
grid_progress_stages,
button_stop_in_dialog,
evk_button_stop_in_dialog,
gc_button_stop_in_dialog,
}
}
pub fn update_language(&self) {
self.window_progress.set_title(&flg!("window_progress_title"));
self.window_progress.set_title(Some(&flg!("window_progress_title")));

get_custom_label_from_button_with_image(&self.button_stop_in_dialog.clone()).set_text(&flg!("progress_stop_button"));

9 changes: 4 additions & 5 deletions czkawka_gui/src/gui_structs/gui_settings.rs
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ use gtk4::prelude::*;
use gtk4::{Builder, Window};

use crate::flg;
use crate::help_functions::get_all_children;

#[derive(Clone)]
pub struct GuiSettings {
@@ -57,7 +58,7 @@ impl GuiSettings {
let builder = Builder::from_string(glade_src.as_str());

let window_settings: gtk4::Window = builder.object("window_settings").unwrap();
window_settings.set_title(&flg!("window_settings_title"));
window_settings.set_title(Some(&flg!("window_settings_title")));
window_settings.set_modal(true);
window_settings.set_transient_for(Some(window_main));

@@ -239,10 +240,8 @@ impl GuiSettings {
self.button_settings_open_settings_folder
.set_tooltip_text(Some(&flg!("settings_folder_settings_open_tooltip")));

let vec_children: Vec<gtk4::Widget> = self.notebook_settings.children();

// let vec_children: Vec<gtk4::Widget> = get_all_children(&self.notebook_settings);
// let vec_children: Vec<gtk4::Widget> = get_all_children(&vec_children[1]);
let vec_children: Vec<gtk4::Widget> = get_all_children(&self.notebook_settings);
let vec_children: Vec<gtk4::Widget> = get_all_children(&vec_children[1]);

// Change name of main notebook tabs
let names: [String; 4] = [
10 changes: 4 additions & 6 deletions czkawka_gui/src/gui_structs/gui_upper_notebook.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use gtk4::prelude::*;
use gtk4::{EventControllerKey, TreeView};

use crate::help_functions::{get_custom_label_from_button_with_image, set_icon_of_button};
use crate::help_functions::{get_all_children, get_custom_label_from_button_with_image, set_icon_of_button};
use crate::notebook_enums::NotebookUpperEnum;
use crate::{flg, CZK_ICON_ADD, CZK_ICON_DELETE, CZK_ICON_MANUAL_ADD};

@@ -108,7 +108,7 @@ impl GuiUpperNotebook {
}
}
pub fn update_language(&self) {
self.check_button_recursive.set_label(&flg!("upper_recursive_button"));
self.check_button_recursive.set_label(Some(&flg!("upper_recursive_button")));
self.check_button_recursive.set_tooltip_text(Some(&flg!("upper_recursive_button_tooltip")));

get_custom_label_from_button_with_image(&self.buttons_manual_add_included_directory.clone()).set_text(&flg!("upper_manual_add_included_button"));
@@ -153,10 +153,8 @@ impl GuiUpperNotebook {
self.entry_general_minimal_size.set_tooltip_text(Some(&flg!("main_label_size_bytes_tooltip")));
self.entry_general_maximal_size.set_tooltip_text(Some(&flg!("main_label_size_bytes_tooltip")));

let vec_children: Vec<gtk4::Widget> = self.notebook_upper.children();

// let vec_children: Vec<gtk4::Widget> = get_all_children(&self.notebook_upper);
// let vec_children: Vec<gtk4::Widget> = get_all_children(&vec_children[1]);
let vec_children: Vec<gtk4::Widget> = get_all_children(&self.notebook_upper);
let vec_children: Vec<gtk4::Widget> = get_all_children(&vec_children[1]);

// Change name of upper notebook tabs
for (upper_enum, fl_thing) in [
Loading