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

Change Github CI #973

Merged
merged 4 commits into from
May 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 3 additions & 13 deletions .github/workflows/linux_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,12 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true

- uses: actions/cache@v3
with:
path: |
target
key: linux-default-${{github.ref}}-${{github.sha}}
restore-keys: |
linux-default-${{github.ref}}-${{github.sha}}

- name: Install basic libraries
run: sudo apt-get update; sudo apt install libheif-dev -y

- name: Setup rust version
run: rustup default ${{ matrix.toolchain }}

- name: Build Release
run: cargo build --release --bin czkawka_cli
env:
Expand Down
40 changes: 9 additions & 31 deletions .github/workflows/linux_gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,12 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true

- uses: actions/cache@v3
with:
path: |
target
key: linux-default-${{github.ref}}-${{github.sha}}
restore-keys: |
linux-default-${{github.ref}}-${{github.sha}}

- name: Install basic libraries
run: sudo apt-get update; sudo apt install libgtk-4-dev libheif-dev -y

- name: Setup rust version
run: rustup default ${{ matrix.toolchain }}

- name: Build Release Heif
run: cargo build --release --features heif
env:
Expand Down Expand Up @@ -64,22 +54,12 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true

- uses: actions/cache@v3
with:
path: |
target
key: linux-appimage-gui-${{github.ref}}-${{github.sha}}
restore-keys: |
linux-appimage-gui-${{github.ref}}-${{github.sha}}

- name: Install Dependencies
run: sudo apt-get update; sudo apt install libgtk-4-dev libheif-dev librsvg2-dev wget fuse libfuse2 -y

- name: Setup rust version
run: rustup default ${{ matrix.toolchain }}

- name: Build Release
run: cargo build --release
env:
Expand Down Expand Up @@ -130,14 +110,12 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true

- name: Install Dependencies
run: sudo apt-get update; sudo apt install libgtk-4-dev libheif-dev librsvg2-dev wget fuse libfuse2 -y xvfb

- name: Setup rust version
run: rustup default ${{ matrix.toolchain }}

- name: Test
run: xvfb-run cargo test
env:
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true

- uses: actions/cache@v3
with:
path: |
target
key: mac-${{github.ref}}-${{github.sha}}
restore-keys: |
mac-${{github.ref}}-${{github.sha}}

- name: Install Homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Expand All @@ -40,6 +27,9 @@ jobs:
brew install rust gtk4 libheif || true
brew link --overwrite python@3.11

- name: Setup rust version
run: rustup default ${{ matrix.toolchain }}

- name: Build Release
run: cargo build --release
env:
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: |
target
key: quality-${{github.ref}}-${{github.sha}}
restore-keys: |
quality-cli-${{github.ref}}-${{github.sha}}

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
override: true

- name: Install Gtk 4
run: sudo apt-get update; sudo apt install -y libgtk-4-dev libheif-dev -y

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
if-no-files-found: error

# Provide option to log things to windows CLI
container_cli:
container_console_window:
runs-on: ubuntu-22.04
container:
image: ghcr.io/piegamesde/gtk4-cross:gtk-4.8
Expand Down
77 changes: 45 additions & 32 deletions czkawka_gui/src/create_tree_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ use crate::help_functions::*;
pub fn create_tree_view_included_directories(tree_view: &TreeView) {
let model = get_list_store(tree_view);

create_default_column(tree_view, ColumnsIncludedDirectory::Path as i32, None, None);
create_default_column(tree_view, ColumnsIncludedDirectory::Path as i32, Some(None), None);
create_default_selection_button_column(tree_view, ColumnsIncludedDirectory::ReferenceButton as i32, model, None);
}

pub fn create_tree_view_excluded_directories(tree_view: &TreeView) {
tree_view.set_headers_visible(false);
create_default_column(tree_view, ColumnsExcludedDirectory::Path as i32, None, None);
create_default_column(tree_view, ColumnsExcludedDirectory::Path as i32, Some(None), None);
}

pub fn create_tree_view_duplicates(tree_view: &TreeView) {
Expand All @@ -39,12 +39,12 @@ pub fn create_tree_view_empty_folders(tree_view: &TreeView) {

create_default_selection_button_column(tree_view, ColumnsEmptyFolders::SelectionButton as i32, model, None);

create_default_column(tree_view, ColumnsEmptyFolders::Name as i32, None, None);
create_default_column(tree_view, ColumnsEmptyFolders::Path as i32, None, None);
create_default_column(tree_view, ColumnsEmptyFolders::Name as i32, Some(None), None);
create_default_column(tree_view, ColumnsEmptyFolders::Path as i32, Some(None), None);
create_default_column(
tree_view,
ColumnsEmptyFolders::Modification as i32,
Some(ColumnsEmptyFolders::ModificationAsSecs as i32),
Some(Some(ColumnsEmptyFolders::ModificationAsSecs as i32)),
None,
);
}
Expand All @@ -56,10 +56,15 @@ pub fn create_tree_view_big_files(tree_view: &TreeView) {

create_default_selection_button_column(tree_view, ColumnsBigFiles::SelectionButton as i32, model, None);

create_default_column(tree_view, ColumnsBigFiles::Size as i32, None, None);
create_default_column(tree_view, ColumnsBigFiles::Name as i32, None, None);
create_default_column(tree_view, ColumnsBigFiles::Path as i32, None, None);
create_default_column(tree_view, ColumnsBigFiles::Modification as i32, Some(ColumnsBigFiles::ModificationAsSecs as i32), None);
create_default_column(tree_view, ColumnsBigFiles::Size as i32, Some(None), None);
create_default_column(tree_view, ColumnsBigFiles::Name as i32, Some(None), None);
create_default_column(tree_view, ColumnsBigFiles::Path as i32, Some(None), None);
create_default_column(
tree_view,
ColumnsBigFiles::Modification as i32,
Some(Some(ColumnsBigFiles::ModificationAsSecs as i32)),
None,
);
}

pub fn create_tree_view_temporary_files(tree_view: &TreeView) {
Expand All @@ -69,12 +74,12 @@ pub fn create_tree_view_temporary_files(tree_view: &TreeView) {

create_default_selection_button_column(tree_view, ColumnsTemporaryFiles::SelectionButton as i32, model, None);

create_default_column(tree_view, ColumnsTemporaryFiles::Name as i32, None, None);
create_default_column(tree_view, ColumnsTemporaryFiles::Path as i32, None, None);
create_default_column(tree_view, ColumnsTemporaryFiles::Name as i32, Some(None), None);
create_default_column(tree_view, ColumnsTemporaryFiles::Path as i32, Some(None), None);
create_default_column(
tree_view,
ColumnsTemporaryFiles::Modification as i32,
Some(ColumnsTemporaryFiles::ModificationAsSecs as i32),
Some(Some(ColumnsTemporaryFiles::ModificationAsSecs as i32)),
None,
);
}
Expand All @@ -86,9 +91,14 @@ pub fn create_tree_view_empty_files(tree_view: &TreeView) {

create_default_selection_button_column(tree_view, ColumnsEmptyFiles::SelectionButton as i32, model, None);

create_default_column(tree_view, ColumnsEmptyFiles::Name as i32, None, None);
create_default_column(tree_view, ColumnsEmptyFiles::Path as i32, None, None);
create_default_column(tree_view, ColumnsEmptyFiles::Modification as i32, Some(ColumnsEmptyFiles::ModificationAsSecs as i32), None);
create_default_column(tree_view, ColumnsEmptyFiles::Name as i32, Some(None), None);
create_default_column(tree_view, ColumnsEmptyFiles::Path as i32, Some(None), None);
create_default_column(
tree_view,
ColumnsEmptyFiles::Modification as i32,
Some(Some(ColumnsEmptyFiles::ModificationAsSecs as i32)),
None,
);
}

pub fn create_tree_view_similar_images(tree_view: &TreeView) {
Expand Down Expand Up @@ -151,14 +161,14 @@ pub fn create_tree_view_invalid_symlinks(tree_view: &TreeView) {

create_default_selection_button_column(tree_view, ColumnsInvalidSymlinks::SelectionButton as i32, model, None);

create_default_column(tree_view, ColumnsInvalidSymlinks::Name as i32, None, None);
create_default_column(tree_view, ColumnsInvalidSymlinks::Path as i32, None, None);
create_default_column(tree_view, ColumnsInvalidSymlinks::DestinationPath as i32, None, None);
create_default_column(tree_view, ColumnsInvalidSymlinks::TypeOfError as i32, None, None);
create_default_column(tree_view, ColumnsInvalidSymlinks::Name as i32, Some(None), None);
create_default_column(tree_view, ColumnsInvalidSymlinks::Path as i32, Some(None), None);
create_default_column(tree_view, ColumnsInvalidSymlinks::DestinationPath as i32, Some(None), None);
create_default_column(tree_view, ColumnsInvalidSymlinks::TypeOfError as i32, Some(None), None);
create_default_column(
tree_view,
ColumnsInvalidSymlinks::Modification as i32,
Some(ColumnsInvalidSymlinks::ModificationAsSecs as i32),
Some(Some(ColumnsInvalidSymlinks::ModificationAsSecs as i32)),
None,
);
}
Expand All @@ -170,13 +180,13 @@ pub fn create_tree_view_broken_files(tree_view: &TreeView) {

create_default_selection_button_column(tree_view, ColumnsBrokenFiles::SelectionButton as i32, model, None);

create_default_column(tree_view, ColumnsBrokenFiles::Name as i32, None, None);
create_default_column(tree_view, ColumnsBrokenFiles::Path as i32, None, None);
create_default_column(tree_view, ColumnsBrokenFiles::ErrorType as i32, None, None);
create_default_column(tree_view, ColumnsBrokenFiles::Name as i32, Some(None), None);
create_default_column(tree_view, ColumnsBrokenFiles::Path as i32, Some(None), None);
create_default_column(tree_view, ColumnsBrokenFiles::ErrorType as i32, Some(None), None);
create_default_column(
tree_view,
ColumnsBrokenFiles::Modification as i32,
Some(ColumnsBrokenFiles::ModificationAsSecs as i32),
Some(Some(ColumnsBrokenFiles::ModificationAsSecs as i32)),
None,
);
}
Expand All @@ -188,10 +198,10 @@ pub fn create_tree_view_bad_extensions(tree_view: &TreeView) {

create_default_selection_button_column(tree_view, ColumnsBadExtensions::SelectionButton as i32, model, None);

create_default_column(tree_view, ColumnsBadExtensions::Name as i32, None, None);
create_default_column(tree_view, ColumnsBadExtensions::Path as i32, None, None);
create_default_column(tree_view, ColumnsBadExtensions::CurrentExtension as i32, None, None);
create_default_column(tree_view, ColumnsBadExtensions::ValidExtensions as i32, None, None);
create_default_column(tree_view, ColumnsBadExtensions::Name as i32, Some(None), None);
create_default_column(tree_view, ColumnsBadExtensions::Path as i32, Some(None), None);
create_default_column(tree_view, ColumnsBadExtensions::CurrentExtension as i32, Some(None), None);
create_default_column(tree_view, ColumnsBadExtensions::ValidExtensions as i32, Some(None), None);
}

fn create_default_selection_button_column(
Expand Down Expand Up @@ -220,17 +230,20 @@ fn create_default_selection_button_column(
(renderer, column)
}

fn create_default_column(tree_view: &TreeView, column_id: i32, sort_column_id: Option<i32>, colors_columns_id: Option<(i32, i32)>) -> (CellRendererText, TreeViewColumn) {
#[allow(clippy::option_option)]
fn create_default_column(tree_view: &TreeView, column_id: i32, sort_column_id: Option<Option<i32>>, colors_columns_id: Option<(i32, i32)>) -> (CellRendererText, TreeViewColumn) {
let renderer = CellRendererText::new();
let column: TreeViewColumn = TreeViewColumn::new();
column.pack_start(&renderer, true);
column.set_resizable(true);
column.set_min_width(50);
column.add_attribute(&renderer, "text", column_id);
if let Some(sort_column_id) = sort_column_id {
column.set_sort_column_id(sort_column_id);
} else {
column.set_sort_column_id(column_id);
if let Some(sort_column_id) = sort_column_id {
column.set_sort_column_id(sort_column_id);
} else {
column.set_sort_column_id(column_id);
}
}
if let Some(colors_columns_id) = colors_columns_id {
column.add_attribute(&renderer, "background", colors_columns_id.0);
Expand Down