diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 9368eee..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -github: qarmin # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index c9b971c..0000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,239 +0,0 @@ -name: 🐧 Linux -on: - push: - pull_request: - schedule: - - cron: '0 0 * * 2' - -env: - CARGO_TERM_COLOR: always - -jobs: - linux-cli: - strategy: - matrix: - toolchain: [ stable ] - type: [ release ] - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - - uses: actions/cache@v2 - with: - path: | - target - key: linux-cli-${{github.ref}}-${{github.sha}} - restore-keys: | - linux-cli-${{github.ref}}-${{github.sha}} - - - name: Install basic libraries - run: sudo apt-get update; sudo apt install libgtk-3-dev libasound2-dev -y - - - name: Build CLI Debug - run: cargo build --bin czkawka_cli - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'debug'}} - - - name: Build CLI Release - run: cargo build --release --bin czkawka_cli - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'release'}} - - - name: Store Linux CLI - uses: actions/upload-artifact@v2 - with: - name: czkawka_cli-${{ runner.os }}-${{ matrix.toolchain }} - path: target/release/czkawka_cli - if: ${{ matrix.type == 'release' }} - - # Duplicate finder checks included and excluded directories - # Others are just check delete files number - - name: Linux Regression Test - run: | - wget https://github.com/qarmin/czkawka/releases/download/1.1.0/TestSuite.zip - unzip TestSuite.zip -d TestSuite - python3 misc/check_results.py TestSuite 15 8 - - - target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen -m 1024 - python3 misc/check_results.py TestSuite 7 8 - - rm -rf TestSuite - unzip TestSuite.zip -d TestSuite - - target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen -m 1024 - python3 misc/check_results.py TestSuite 7 8 - - rm -rf TestSuite - unzip TestSuite.zip -d TestSuite - - target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -x TEXT -D aeo -m 1024 - python3 misc/check_results.py TestSuite 14 8 - - rm -rf TestSuite - unzip TestSuite.zip -d TestSuite - - target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -e "$(pwd)/TestSuite/SubFolder" -D aeo -m 1024 - python3 misc/check_results.py TestSuite 13 8 - - rm -rf TestSuite - unzip TestSuite.zip -d TestSuite - - target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -m 1500 -D aeo - python3 misc/check_results.py TestSuite 8 8 - - rm -rf TestSuite - unzip TestSuite.zip -d TestSuite - - target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R -m 1024 - python3 misc/check_results.py TestSuite 15 8 - target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R -D aeo -m 1024 - python3 misc/check_results.py TestSuite 13 8 - - - target/release/czkawka_cli big -d "$(pwd)/TestSuite" - - rm -rf TestSuite - unzip TestSuite.zip -d TestSuite - - target/release/czkawka_cli empty-files -d "$(pwd)/TestSuite" - python3 misc/check_results.py TestSuite 15 8 - target/release/czkawka_cli empty-files -d "$(pwd)/TestSuite" -D - python3 misc/check_results.py TestSuite 13 8 - - rm -rf TestSuite - unzip TestSuite.zip -d TestSuite - - target/release/czkawka_cli empty-folders -d "$(pwd)/TestSuite" - python3 misc/check_results.py TestSuite 15 8 - target/release/czkawka_cli empty-folders -d "$(pwd)/TestSuite" -D - python3 misc/check_results.py TestSuite 15 2 - - rm -rf TestSuite - unzip TestSuite.zip -d TestSuite - - target/release/czkawka_cli temp -d "$(pwd)/TestSuite" - python3 misc/check_results.py TestSuite 15 8 - target/release/czkawka_cli temp -d "$(pwd)/TestSuite" -D - python3 misc/check_results.py TestSuite 14 8 - if: ${{ matrix.type == 'release' }} - - linux-gui: - strategy: - matrix: - toolchain: [ stable, 1.53.0 ] - type: [ release ] - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - - uses: actions/cache@v2 - with: - path: | - target - key: linux-gui-${{github.ref}}-${{github.sha}} - restore-keys: | - linux-gui-${{github.ref}}-${{github.sha}} - - - name: Install Gtk, Mingw, unzip, zip and wget - run: sudo apt-get update; sudo apt install libgtk-3-dev libasound2-dev -y - - - name: Build GUI Debug - run: cargo build --bin czkawka_gui - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'debug'}} - - - name: Build GUI Release - run: cargo build --release --bin czkawka_gui - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'release'}} - - - name: Store Linux GUI - uses: actions/upload-artifact@v2 - with: - name: czkawka_gui-${{ runner.os }}-${{ matrix.toolchain }} - path: target/release/czkawka_gui - if: ${{ matrix.type == 'release' }} - - - name: Minimal AppImage - run: | - pwd - rm -rf czkawka_gui - cp target/release/czkawka_gui . - strip czkawka_gui - wget https://github.com/AppImage/pkg2appimage/releases/download/continuous/pkg2appimage-1807-x86_64.AppImage - chmod +x pkg2appimage-1807-x86_64.AppImage - ./pkg2appimage-1807-x86_64.AppImage misc/czkawka-appimage-recipe.yml - mv out/Czkawka*.AppImage out/czkawka_gui-minimal.AppImage - - - name: Minimal Appimage Upload - uses: actions/upload-artifact@v2 - with: - name: czkawka_gui-${{ matrix.toolchain }}_minimal_AppImage - path: out/*.AppImage - - - linux-appimage-gui: - strategy: - matrix: - toolchain: [ stable ] - type: [ release ] - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - - uses: actions/cache@v2 - with: - path: | - target - key: linux-appimage-gui-${{github.ref}}-${{github.sha}} - restore-keys: | - linux-appimage-gui-${{github.ref}}-${{github.sha}} - - - name: Install Gtk, - run: sudo apt-get update; sudo apt install libgtk-3-dev libasound2-dev librsvg2-dev wget -y - - - name: Build GUI Release - run: cargo build --release --bin czkawka_gui - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" - - - name: Download appimage dependiences - run: | - wget -c "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" - wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" - chmod +x linuxdeploy-plugin-gtk.sh - chmod +x linuxdeploy-x86_64.AppImage - mkdir -p AppDir/usr/bin - cp target/release/czkawka_gui AppDir/usr/bin - ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin gtk --output appimage --icon-file data/icons/com.github.qarmin.czkawka.svg --desktop-file data/com.github.qarmin.czkawka.desktop - - - name: Store Linux Appimage GUI - uses: actions/upload-artifact@v2 - with: - name: czkawka_gui-appimage-${{ runner.os }}-${{ matrix.toolchain }} - path: Czkawka*.AppImage diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml deleted file mode 100644 index ab7d34a..0000000 --- a/.github/workflows/mac.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: 🍎 MacOS -on: - push: - pull_request: - schedule: - - cron: '0 0 * * 2' - -env: - CARGO_TERM_COLOR: always - -jobs: - macos-cli: - strategy: - matrix: - toolchain: [ stable ] - type: [ release ] - runs-on: macos-10.15 - steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - - uses: actions/cache@v2 - with: - path: | - target - key: mac-cli-${{github.ref}}-${{github.sha}} - restore-keys: | - mac-cli-${{github.ref}}-${{github.sha}} - - - name: Build CLI Debug - run: cargo build --bin czkawka_cli - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'debug'}} - - - name: Build CLI Release - run: cargo build --release --bin czkawka_cli - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'release'}} - - - name: Store MacOS CLI - uses: actions/upload-artifact@v2 - with: - name: czkawka_cli-${{ runner.os }}-${{ matrix.toolchain }} - path: target/release/czkawka_cli - if: ${{ matrix.type == 'release' }} - - macos-gui: - strategy: - matrix: - toolchain: [ stable ] - type: [ release ] - runs-on: macos-10.15 - steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - - name: Install Homebrew - run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - - - name: Override link[WORKAROUND] # Looks that this is a bug with current homebrew or Github CI - run: rm '/usr/local/bin/2to3' - - - name: Install GTK3 - run: brew install rust gtk+3 - - - name: Build GUI Debug - run: cargo build --bin czkawka_gui - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'debug'}} - - - name: Build GUI Release - run: cargo build --release --bin czkawka_gui - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'release'}} - - - name: Store MacOS GUI - uses: actions/upload-artifact@v2 - with: - name: czkawka_gui-${{ runner.os }}-${{ matrix.toolchain }} - path: target/release/czkawka_gui - if: ${{ matrix.type == 'release' }} diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml deleted file mode 100644 index ad5874f..0000000 --- a/.github/workflows/quality.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Quality -on: - push: - pull_request: - schedule: - - cron: '0 0 * * 2' - -env: - CARGO_TERM_COLOR: always - -jobs: - quality: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - 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 - run: sudo apt-get update; sudo apt install -y libgtk-3-dev libasound2-dev - - - name: Check the format - run: cargo fmt --all -- --check - - # type complexity must be ignored because we use huge templates for queries - - name: Run clippy - run: > - cargo clippy - --all-targets - --all-features - -- - -D warnings diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c2a9482..d53f0be 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -148,7 +148,7 @@ jobs: python misc/check_results.py TestSuite 14 8 if: ${{ matrix.type == 'release' }} - windows-gui: + windows-release-gui: strategy: matrix: toolchain: [ stable ] @@ -173,7 +173,7 @@ jobs: - name: Install Gtk, Mingw, unzip, zip and wget run: sudo apt-get update; sudo apt install mingw-w64 libgtk-3-dev unzip wget zip -y - - name: Build GUI Release Cross Compile + - name: Release normal(gui) run: | rustup target add x86_64-pc-windows-gnu @@ -181,74 +181,19 @@ jobs: echo "linker = \"x86_64-w64-mingw32-gcc\"" >> ~/.cargo/config echo "ar = \"x86_64-w64-mingw32-gcc-ar\"" >> ~/.cargo/config - GTK_LIBRARY="$(pwd)/gtk_library" - GTK_APP="$(pwd)/gtk_app" - GTK_THEME="$(pwd)/gtk_theme" - wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/mingw64.zip - unzip mingw64.zip -d $GTK_LIBRARY - GTK_LIBRARY="$GTK_LIBRARY/mingw64" - - wget https://github.com/nrhodes91/AdMin/archive/master.zip - unzip master.zip -d $GTK_THEME - - PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH="$GTK_LIBRARY/lib/pkgconfig" RUSTFLAGS="-L $GTK_LIBRARY/lib" cargo build --target=x86_64-pc-windows-gnu --bin czkawka_gui --release - - strip target/x86_64-pc-windows-gnu/release/czkawka_gui.exe - - mkdir $GTK_APP - cp target/x86_64-pc-windows-gnu/release/czkawka_gui.exe $GTK_APP - cp $GTK_LIBRARY/bin/*.dll $GTK_APP - mkdir -p $GTK_APP/share/glib-2.0/schemas - mkdir $GTK_APP/share/icons - cp $GTK_LIBRARY/share/glib-2.0/schemas/* $GTK_APP/share/glib-2.0/schemas - cp -r $GTK_LIBRARY/share/icons/* $GTK_APP/share/icons - mkdir $GTK_APP/lib - cp -r $GTK_LIBRARY/lib/gdk-pixbuf-2.0 $GTK_APP/lib - - mkdir -p $GTK_APP/share/themes - mkdir -p $GTK_APP/share/gtk-3.0 - echo "[Settings]" > $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-theme-name = admin-gtk3-dark-osx" >> $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-font-name = Segoe UI 10" >> $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-xft-rgba = rgb" >> $GTK_APP/share/gtk-3.0/settings.ini - cp $GTK_THEME/AdMin-master/admin-gtk3-dark-osx $GTK_APP/share/themes -r -L - - # This part is only unique for Czkawka - # This code allows to check which icons are used in Czkawka - # cd czkawka/ui - # rg icon-name - rm -rf $GTK_APP/share/icons/Adwaita/16x16 - rm -rf $GTK_APP/share/icons/Adwaita/22x22 - rm -rf $GTK_APP/share/icons/Adwaita/24x24 - rm -rf $GTK_APP/share/icons/Adwaita/256x256 - rm -rf $GTK_APP/share/icons/Adwaita/32x32 - rm -rf $GTK_APP/share/icons/Adwaita/48x48 - rm -rf $GTK_APP/share/icons/Adwaita/512x512 - rm -rf $GTK_APP/share/icons/Adwaita/64x64 - rm -rf $GTK_APP/share/icons/Adwaita/8x8 - rm -rf $GTK_APP/share/icons/Adwaita/96x96 - rm -rf $GTK_APP/share/icons/Adwaita/cursors - rm -rf $GTK_APP/share/icons/Adwaita/scalable - rm -rf $GTK_APP/share/icons/Adwaita/scalable-up-to-32 - rm -rf $GTK_APP/share/icons/hicolor - wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/czkawka_icons.zip - unzip czkawka_icons.zip -d $GTK_APP/share/icons/Adwaita - - zip -r gtk_app.zip $GTK_APP + PKG_CONFIG_ALLOW_CROSS=1 cargo build --target=x86_64-pc-windows-gnu --bin czkawka_gui --release env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'release'}} - name: Store Windows GUI CrossComplile uses: actions/upload-artifact@v2 with: - name: czkawka_gui-Windows-${{ matrix.toolchain }} - path: gtk_app.zip - if: ${{ matrix.type == 'release' }} + name: czkawka_gui-Windows-release-normal-${{ matrix.toolchain }} + path: target/release/czkawka_gui.exe - windows-gui-relase-console: + windows-debug-gui: strategy: matrix: toolchain: [ stable ] @@ -273,83 +218,73 @@ jobs: - name: Install Gtk, Mingw, unzip, zip and wget run: sudo apt-get update; sudo apt install mingw-w64 libgtk-3-dev unzip wget zip -y - - name: Build GUI Release Cross Compile + - name: Release debug(gui) run: | - sed -i 's/windows_subsystem = "windows"/windows_subsystem = "console"/' czkawka_gui/src/main.rs rustup target add x86_64-pc-windows-gnu echo "[target.x86_64-pc-windows-gnu]" > ~/.cargo/config echo "linker = \"x86_64-w64-mingw32-gcc\"" >> ~/.cargo/config echo "ar = \"x86_64-w64-mingw32-gcc-ar\"" >> ~/.cargo/config - GTK_LIBRARY="$(pwd)/gtk_library" - GTK_APP="$(pwd)/gtk_app" - GTK_THEME="$(pwd)/gtk_theme" - wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/mingw64.zip - unzip mingw64.zip -d $GTK_LIBRARY - GTK_LIBRARY="$GTK_LIBRARY/mingw64" - - wget https://github.com/nrhodes91/AdMin/archive/master.zip - unzip master.zip -d $GTK_THEME - - PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH="$GTK_LIBRARY/lib/pkgconfig" RUSTFLAGS="-L $GTK_LIBRARY/lib" cargo build --target=x86_64-pc-windows-gnu --bin czkawka_gui --release - - strip target/x86_64-pc-windows-gnu/release/czkawka_gui.exe - - mkdir $GTK_APP - cp target/x86_64-pc-windows-gnu/release/czkawka_gui.exe $GTK_APP - cp $GTK_LIBRARY/bin/*.dll $GTK_APP - mkdir -p $GTK_APP/share/glib-2.0/schemas - mkdir $GTK_APP/share/icons - cp $GTK_LIBRARY/share/glib-2.0/schemas/* $GTK_APP/share/glib-2.0/schemas - cp -r $GTK_LIBRARY/share/icons/* $GTK_APP/share/icons - mkdir $GTK_APP/lib - cp -r $GTK_LIBRARY/lib/gdk-pixbuf-2.0 $GTK_APP/lib - - mkdir -p $GTK_APP/share/themes - mkdir -p $GTK_APP/share/gtk-3.0 - echo "[Settings]" > $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-theme-name = admin-gtk3-dark-osx" >> $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-font-name = Segoe UI 10" >> $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-xft-rgba = rgb" >> $GTK_APP/share/gtk-3.0/settings.ini - cp $GTK_THEME/AdMin-master/admin-gtk3-dark-osx $GTK_APP/share/themes -r -L - - # This part is only unique for Czkawka - # This code allows to check which icons are used in Czkawka - # cd czkawka/ui - # rg icon-name - rm -rf $GTK_APP/share/icons/Adwaita/16x16 - rm -rf $GTK_APP/share/icons/Adwaita/22x22 - rm -rf $GTK_APP/share/icons/Adwaita/24x24 - rm -rf $GTK_APP/share/icons/Adwaita/256x256 - rm -rf $GTK_APP/share/icons/Adwaita/32x32 - rm -rf $GTK_APP/share/icons/Adwaita/48x48 - rm -rf $GTK_APP/share/icons/Adwaita/512x512 - rm -rf $GTK_APP/share/icons/Adwaita/64x64 - rm -rf $GTK_APP/share/icons/Adwaita/8x8 - rm -rf $GTK_APP/share/icons/Adwaita/96x96 - rm -rf $GTK_APP/share/icons/Adwaita/cursors - rm -rf $GTK_APP/share/icons/Adwaita/scalable - rm -rf $GTK_APP/share/icons/Adwaita/scalable-up-to-32 - rm -rf $GTK_APP/share/icons/hicolor - wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/czkawka_icons.zip - unzip czkawka_icons.zip -d $GTK_APP/share/icons/Adwaita - - zip -r gtk_app.zip $GTK_APP + PKG_CONFIG_ALLOW_CROSS=1 cargo build --target=x86_64-pc-windows-gnu --bin czkawka_gui env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'release'}} - name: Store Windows GUI CrossComplile + uses: actions/upload-artifact@v2 + with: + name: czkawka_gui-Windows-release-normal-${{ matrix.toolchain }} + path: target/debug/czkawka_gui.exe + + windows-release-console: + strategy: + matrix: + toolchain: [ stable ] + type: [ release ] + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true + + - uses: actions/cache@v2 + with: + path: | + target + key: windows-gui-${{github.ref}}-${{github.sha}} + restore-keys: | + windows-gui-${{github.ref}}-${{github.sha}} + + - name: Install Gtk, Mingw, unzip, zip and wget + run: sudo apt-get update; sudo apt install mingw-w64 libgtk-3-dev unzip wget zip -y + + - name: Release normal(gui) + run: | + sed -i 's/windows_subsystem = "windows"/windows_subsystem = "console"/' src/main.rs + rustup target add x86_64-pc-windows-gnu + + echo "[target.x86_64-pc-windows-gnu]" > ~/.cargo/config + echo "linker = \"x86_64-w64-mingw32-gcc\"" >> ~/.cargo/config + echo "ar = \"x86_64-w64-mingw32-gcc-ar\"" >> ~/.cargo/config + + + PKG_CONFIG_ALLOW_CROSS=1 cargo build --target=x86_64-pc-windows-gnu --bin czkawka_gui --release + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-C debuginfo=0 -D warnings" + + - name: F uses: actions/upload-artifact@v2 with: name: czkawka_gui-Windows-release-console-${{ matrix.toolchain }} - path: gtk_app.zip - if: ${{ matrix.type == 'release' }} + path: target/release/czkawka_gui.exe - windows-gui-windows: + windows-debug-console: strategy: matrix: toolchain: [ stable ] @@ -374,179 +309,23 @@ jobs: - name: Install Gtk, Mingw, unzip, zip and wget run: sudo apt-get update; sudo apt install mingw-w64 libgtk-3-dev unzip wget zip -y - - name: Build GUI Debug Cross Compile + - name: Release debug(gui) run: | + sed -i 's/windows_subsystem = "windows"/windows_subsystem = "console"/' src/main.rs rustup target add x86_64-pc-windows-gnu echo "[target.x86_64-pc-windows-gnu]" > ~/.cargo/config echo "linker = \"x86_64-w64-mingw32-gcc\"" >> ~/.cargo/config echo "ar = \"x86_64-w64-mingw32-gcc-ar\"" >> ~/.cargo/config - GTK_LIBRARY="$(pwd)/gtk_library" - GTK_APP="$(pwd)/gtk_app" - GTK_THEME="$(pwd)/gtk_theme" - wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/mingw64.zip - unzip mingw64.zip -d $GTK_LIBRARY - GTK_LIBRARY="$GTK_LIBRARY/mingw64" - - wget https://github.com/nrhodes91/AdMin/archive/master.zip - unzip master.zip -d $GTK_THEME - - PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH="$GTK_LIBRARY/lib/pkgconfig" RUSTFLAGS="-L $GTK_LIBRARY/lib" cargo build --target=x86_64-pc-windows-gnu --bin czkawka_gui - - strip target/x86_64-pc-windows-gnu/debug/czkawka_gui.exe - - mkdir $GTK_APP - cp target/x86_64-pc-windows-gnu/debug/czkawka_gui.exe $GTK_APP - cp $GTK_LIBRARY/bin/*.dll $GTK_APP - mkdir -p $GTK_APP/share/glib-2.0/schemas - mkdir $GTK_APP/share/icons - cp $GTK_LIBRARY/share/glib-2.0/schemas/* $GTK_APP/share/glib-2.0/schemas - cp -r $GTK_LIBRARY/share/icons/* $GTK_APP/share/icons - mkdir $GTK_APP/lib - cp -r $GTK_LIBRARY/lib/gdk-pixbuf-2.0 $GTK_APP/lib - - mkdir -p $GTK_APP/share/themes - mkdir -p $GTK_APP/share/gtk-3.0 - echo "[Settings]" > $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-theme-name = admin-gtk3-dark-osx" >> $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-font-name = Segoe UI 10" >> $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-xft-rgba = rgb" >> $GTK_APP/share/gtk-3.0/settings.ini - cp $GTK_THEME/AdMin-master/admin-gtk3-dark-osx $GTK_APP/share/themes -r -L - - # This part is only unique for Czkawka - # This code allows to check which icons are used in Czkawka - # cd czkawka/ui - # rg icon-name - rm -rf $GTK_APP/share/icons/Adwaita/16x16 - rm -rf $GTK_APP/share/icons/Adwaita/22x22 - rm -rf $GTK_APP/share/icons/Adwaita/24x24 - rm -rf $GTK_APP/share/icons/Adwaita/256x256 - rm -rf $GTK_APP/share/icons/Adwaita/32x32 - rm -rf $GTK_APP/share/icons/Adwaita/48x48 - rm -rf $GTK_APP/share/icons/Adwaita/512x512 - rm -rf $GTK_APP/share/icons/Adwaita/64x64 - rm -rf $GTK_APP/share/icons/Adwaita/8x8 - rm -rf $GTK_APP/share/icons/Adwaita/96x96 - rm -rf $GTK_APP/share/icons/Adwaita/cursors - rm -rf $GTK_APP/share/icons/Adwaita/scalable - rm -rf $GTK_APP/share/icons/Adwaita/scalable-up-to-32 - rm -rf $GTK_APP/share/icons/hicolor - wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/czkawka_icons.zip - unzip czkawka_icons.zip -d $GTK_APP/share/icons/Adwaita - - zip -r gtk_app.zip $GTK_APP + PKG_CONFIG_ALLOW_CROSS=1 cargo build --target=x86_64-pc-windows-gnu --bin czkawka_gui env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'release'}} - name: Store Windows GUI CrossComplile uses: actions/upload-artifact@v2 with: - name: czkawka_gui-Windows-windows-${{ matrix.toolchain }} - path: gtk_app.zip - if: ${{ matrix.type == 'release' }} - - - windows-gui-console: - strategy: - matrix: - toolchain: [ stable ] - type: [ release ] - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - - uses: actions/cache@v2 - with: - path: | - target - key: windows-gui-${{github.ref}}-${{github.sha}} - restore-keys: | - windows-gui-${{github.ref}}-${{github.sha}} - - - name: Install Gtk, Mingw, unzip, zip and wget - run: sudo apt-get update; sudo apt install mingw-w64 libgtk-3-dev unzip wget zip -y - - - name: Build GUI Debug Cross Compile - run: | - sed -i 's/windows_subsystem = "windows"/windows_subsystem = "console"/' czkawka_gui/src/main.rs - rustup target add x86_64-pc-windows-gnu - - echo "[target.x86_64-pc-windows-gnu]" > ~/.cargo/config - echo "linker = \"x86_64-w64-mingw32-gcc\"" >> ~/.cargo/config - echo "ar = \"x86_64-w64-mingw32-gcc-ar\"" >> ~/.cargo/config - - GTK_LIBRARY="$(pwd)/gtk_library" - GTK_APP="$(pwd)/gtk_app" - GTK_THEME="$(pwd)/gtk_theme" - - wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/mingw64.zip - unzip mingw64.zip -d $GTK_LIBRARY - GTK_LIBRARY="$GTK_LIBRARY/mingw64" - - wget https://github.com/nrhodes91/AdMin/archive/master.zip - unzip master.zip -d $GTK_THEME - - PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH="$GTK_LIBRARY/lib/pkgconfig" RUSTFLAGS="-L $GTK_LIBRARY/lib" cargo build --target=x86_64-pc-windows-gnu --bin czkawka_gui - - strip target/x86_64-pc-windows-gnu/debug/czkawka_gui.exe - - mkdir $GTK_APP - cp target/x86_64-pc-windows-gnu/debug/czkawka_gui.exe $GTK_APP - cp $GTK_LIBRARY/bin/*.dll $GTK_APP - mkdir -p $GTK_APP/share/glib-2.0/schemas - mkdir $GTK_APP/share/icons - cp $GTK_LIBRARY/share/glib-2.0/schemas/* $GTK_APP/share/glib-2.0/schemas - cp -r $GTK_LIBRARY/share/icons/* $GTK_APP/share/icons - mkdir $GTK_APP/lib - cp -r $GTK_LIBRARY/lib/gdk-pixbuf-2.0 $GTK_APP/lib - - mkdir -p $GTK_APP/share/themes - mkdir -p $GTK_APP/share/gtk-3.0 - echo "[Settings]" > $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-theme-name = admin-gtk3-dark-osx" >> $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-font-name = Segoe UI 10" >> $GTK_APP/share/gtk-3.0/settings.ini - echo "gtk-xft-rgba = rgb" >> $GTK_APP/share/gtk-3.0/settings.ini - cp $GTK_THEME/AdMin-master/admin-gtk3-dark-osx $GTK_APP/share/themes -r -L - - # This part is only unique for Czkawka - # This code allows to check which icons are used in Czkawka - # cd czkawka/ui - # rg icon-name - rm -rf $GTK_APP/share/icons/Adwaita/16x16 - rm -rf $GTK_APP/share/icons/Adwaita/22x22 - rm -rf $GTK_APP/share/icons/Adwaita/24x24 - rm -rf $GTK_APP/share/icons/Adwaita/256x256 - rm -rf $GTK_APP/share/icons/Adwaita/32x32 - rm -rf $GTK_APP/share/icons/Adwaita/48x48 - rm -rf $GTK_APP/share/icons/Adwaita/512x512 - rm -rf $GTK_APP/share/icons/Adwaita/64x64 - rm -rf $GTK_APP/share/icons/Adwaita/8x8 - rm -rf $GTK_APP/share/icons/Adwaita/96x96 - rm -rf $GTK_APP/share/icons/Adwaita/cursors - rm -rf $GTK_APP/share/icons/Adwaita/scalable - rm -rf $GTK_APP/share/icons/Adwaita/scalable-up-to-32 - rm -rf $GTK_APP/share/icons/hicolor - wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/czkawka_icons.zip - unzip czkawka_icons.zip -d $GTK_APP/share/icons/Adwaita - - zip -r gtk_app.zip $GTK_APP - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" - if: ${{ matrix.type == 'release'}} - - - name: Store Windows GUI CrossComplile - uses: actions/upload-artifact@v2 - with: - name: czkawka_gui-Windows-console-${{ matrix.toolchain }} - path: gtk_app.zip - if: ${{ matrix.type == 'release' }} + name: czkawka_gui-Windows-debug-console-${{ matrix.toolchain }} + path: target/debug/czkawka_gui.exe diff --git a/Cargo.lock b/Cargo.lock index 18dc22a..3594d45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,17 +57,6 @@ dependencies = [ "rust-embed", ] -[[package]] -name = "czkawka_gui" -version = "3.3.1" -dependencies = [ - "czkawka_core", - "i18n-embed", - "i18n-embed-fl", - "once_cell", - "rust-embed", -] - [[package]] name = "dashmap" version = "4.0.2" diff --git a/Cargo.toml b/Cargo.toml index 396001a..97716bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,17 @@ -[workspace] -members = [ - "czkawka_core", - "czkawka_gui", -] -[profile.release] -# Panic = "abort" will crash entire app when processing invalid image file. -# Since crash happens in external library, this is only way to handle this(I think). -panic = "unwind" +[package] +name = "czkawka_core" +version = "3.3.1" +authors = ["Rafał Mikrut "] +edition = "2018" +description = "Core of Czkawka app" +license = "MIT" +homepage = "https://github.com/qarmin/czkawka" +repository = "https://github.com/qarmin/czkawka" -# LTO setting is disabled by default, because release mode is usually needed to develop app and compilation with LTO would take a lot of time -#lto = "fat" \ No newline at end of file + +[dependencies] +# Language +i18n-embed = { version = "0.13", features = ["fluent-system", "desktop-requester"] } +i18n-embed-fl = "0.6" +rust-embed = "6.2.0" +once_cell = "1.8.0" \ No newline at end of file diff --git a/czkawka_core/Cargo.toml b/czkawka_core/Cargo.toml deleted file mode 100644 index 2c67ad3..0000000 --- a/czkawka_core/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "czkawka_core" -version = "3.3.1" -authors = ["Rafał Mikrut "] -edition = "2018" -description = "Core of Czkawka app" -license = "MIT" -homepage = "https://github.com/qarmin/czkawka" -repository = "https://github.com/qarmin/czkawka" - - -[dependencies] -# Language -i18n-embed = { version = "0.13", features = ["fluent-system", "desktop-requester"] } -i18n-embed-fl = "0.6.1" -rust-embed = "6.3.0" -once_cell = "1.9.0" diff --git a/czkawka_core/i18n.toml b/czkawka_core/i18n.toml deleted file mode 100644 index 111a110..0000000 --- a/czkawka_core/i18n.toml +++ /dev/null @@ -1,13 +0,0 @@ -# (Required) The language identifier of the language used in the -# source code for gettext system, and the primary fallback language -# (for which all strings must be present) when using the fluent -# system. -fallback_language = "en" - -# Use the fluent localization system. -[fluent] -# (Required) The path to the assets directory. -# The paths inside the assets directory should be structured like so: -# `assets_dir/{language}/{domain}.ftl` -assets_dir = "../i18n" - diff --git a/czkawka_core/src/lib.rs b/czkawka_core/src/lib.rs deleted file mode 100644 index 2bfa0b0..0000000 --- a/czkawka_core/src/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod localizer; - -pub const CZKAWKA_VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/czkawka_core/src/localizer.rs b/czkawka_core/src/localizer.rs deleted file mode 100644 index b3a22ce..0000000 --- a/czkawka_core/src/localizer.rs +++ /dev/null @@ -1,44 +0,0 @@ -use std::collections::HashMap; - -use i18n_embed::{ - fluent::{fluent_language_loader, FluentLanguageLoader}, - DefaultLocalizer, LanguageLoader, Localizer, -}; -use once_cell::sync::Lazy; -use rust_embed::RustEmbed; - -#[derive(RustEmbed)] -#[folder = "../i18n/"] -struct Localizations; - -pub static LANGUAGE_LOADER: Lazy = Lazy::new(|| { - let loader: FluentLanguageLoader = fluent_language_loader!(); - - loader.load_fallback_language(&Localizations).expect("Error while loading fallback language"); - - loader -}); - -#[macro_export] -macro_rules! fl { - ($message_id:literal) => {{ - i18n_embed_fl::fl!($crate::localizer::LANGUAGE_LOADER, $message_id) - }}; - - ($message_id:literal, $($args:expr),*) => {{ - i18n_embed_fl::fl!($crate::localizer::LANGUAGE_LOADER, $message_id, $($args), *) - }}; -} - -// Get the `Localizer` to be used for localizing this library. -pub fn localizer() -> Box { - Box::from(DefaultLocalizer::new(&*LANGUAGE_LOADER, &Localizations)) -} - -pub fn generate_translation_hashmap(vec: Vec<(&'static str, String)>) -> HashMap<&'static str, String> { - let mut hashmap: HashMap<&'static str, String> = Default::default(); - for (key, value) in vec { - hashmap.insert(key, value); - } - hashmap -} diff --git a/czkawka_gui/Cargo.toml b/czkawka_gui/Cargo.toml deleted file mode 100644 index 4328f7b..0000000 --- a/czkawka_gui/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "czkawka_gui" -version = "3.3.1" -authors = ["Rafał Mikrut "] -edition = "2018" -description = "GTK frontend of Czkawka" -license = "MIT" -homepage = "https://github.com/qarmin/czkawka" -repository = "https://github.com/qarmin/czkawka" - -[dependencies] -czkawka_core = { path = "../czkawka_core", version = "3.3.1"} - -# Language -i18n-embed = { version = "0.13", features = ["fluent-system", "desktop-requester"] } -i18n-embed-fl = "0.6.1" -rust-embed = "6.3.0" -once_cell = "1.9.0" - - diff --git a/czkawka_gui/i18n.toml b/czkawka_gui/i18n.toml deleted file mode 100644 index 111a110..0000000 --- a/czkawka_gui/i18n.toml +++ /dev/null @@ -1,13 +0,0 @@ -# (Required) The language identifier of the language used in the -# source code for gettext system, and the primary fallback language -# (for which all strings must be present) when using the fluent -# system. -fallback_language = "en" - -# Use the fluent localization system. -[fluent] -# (Required) The path to the assets directory. -# The paths inside the assets directory should be structured like so: -# `assets_dir/{language}/{domain}.ftl` -assets_dir = "../i18n" - diff --git a/czkawka_gui/ui/about_dialog.glade b/czkawka_gui/ui/about_dialog.glade deleted file mode 100644 index 33c8d3a..0000000 --- a/czkawka_gui/ui/about_dialog.glade +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - False - center - dialog - Czkawka - 3.3.1 - 2020 - 2021 Rafał Mikrut(qarmin) - -This program is free to use and will always be. - - Rafał Mikrut(qarmin) - system-search - mit-x11 - - - False - vertical - 2 - - - False - end - - - - - - - - - False - False - 0 - - - - - True - False - 3 - - - Repository - True - True - True - - - True - False - 0 - - - - - Instruction - True - True - True - - - True - False - 1 - - - - - Donation - True - True - True - - - True - False - 2 - - - - - Translation - True - True - True - - - True - False - 3 - - - - - False - True - 3 - - - - - - diff --git a/czkawka_gui/ui/main_window.glade b/czkawka_gui/ui/main_window.glade deleted file mode 100644 index df4a3e6..0000000 --- a/czkawka_gui/ui/main_window.glade +++ /dev/null @@ -1,1997 +0,0 @@ - - - - - - - - - - 100 - 1 - 10 - - - False - 1100 - 800 - - - True - False - vertical - - - True - True - vertical - - - True - True - - - True - False - 5 - 5 - 5 - - - True - False - 5 - vertical - 1 - - - True - True - True - - - True - False - center - 4 - - - True - False - list-add - - - False - True - 0 - - - - - True - False - Add - - - False - True - 1 - - - - - - - False - True - 0 - - - - - True - True - True - - - True - False - center - 4 - - - True - False - list-remove - - - False - True - 0 - - - - - True - False - Remove - - - False - True - 1 - - - - - - - False - True - 1 - - - - - True - True - True - - - True - False - center - 4 - - - True - False - insert-link - - - False - True - 0 - - - - - True - False - Manual Add - - - False - True - 1 - - - - - - - False - False - 2 - - - - - False - False - 0 - - - - - True - True - in - - - - - - True - True - 1 - - - - - Recursive - True - True - False - 5 - True - True - - - False - False - 2 - - - - - False - - - - - True - False - Included Directories - - - False - - - - - True - False - 5 - 5 - 6 - - - True - False - 5 - vertical - 1 - - - True - True - True - - - True - False - center - 4 - - - True - False - list-add - - - False - True - 0 - - - - - True - False - Add - - - False - True - 1 - - - - - - - False - True - 0 - - - - - True - True - True - - - True - False - center - 4 - - - True - False - list-remove - - - False - True - 0 - - - - - True - False - Remove - - - False - True - 1 - - - - - - - False - True - 1 - - - - - True - True - True - - - True - False - center - 4 - - - True - False - insert-link - - - False - True - 0 - - - - - True - False - Manual Add - - - False - True - 1 - - - - - - - False - False - 2 - - - - - False - True - 0 - - - - - True - True - in - - - - - - True - True - 1 - - - - - 1 - - - - - True - False - Excluded Directories - - - 1 - False - - - - - True - False - center - vertical - - - True - False - 5 - 5 - 5 - - - True - False - Excluded items - - - False - True - 0 - - - - - True - True - */.git,*/node_modules,*/lost+found - - - True - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - - - True - False - Allowed Extensions - - - False - True - 0 - - - - - True - True - - - True - True - 1 - - - - - False - True - 1 - - - - - True - False - 5 - 5 - 8 - - - True - False - File Size(bytes) - - - False - True - 0 - - - - - True - False - Min: - - - False - True - 1 - - - - - True - True - 15 - 8192 - False - number - - - True - True - 2 - - - - - True - False - Max: - - - False - True - 3 - - - - - True - True - 15 - 1099512000000 - False - number - - - True - True - 4 - - - - - False - True - 3 - - - - - 2 - - - - - True - False - Items Configuration - - - 2 - False - - - - - False - False - - - - - True - True - left - True - - - True - False - - - True - False - vertical - - - True - False - 5 - 5 - 2 - - - True - False - 3 - Check method - - - False - True - 0 - - - - - True - False - - - False - True - 1 - - - - - True - False - 5 - 2 - Hash type - - - False - True - 2 - - - - - True - False - - - False - True - 3 - - - - - False - True - 0 - - - - - True - True - 5 - in - - - - - - True - True - 3 - - - - - True - True - 0 - - - - - 100 - 80 - True - False - center - - - False - True - 1 - - - - - - - True - False - Duplicates files - - - False - - - - - True - True - in - - - - - - 1 - - - - - True - False - Empty Directories - - - 1 - False - - - - - True - False - vertical - - - True - False - 5 - 5 - 2 - 8 - - - True - False - Number of shown files - - - False - True - 0 - - - - - True - True - 15 - 50 - False - number - - - True - True - 1 - - - - - False - True - 0 - - - - - True - True - in - - - - - - True - True - 1 - - - - - 2 - - - - - True - False - Big Files - - - 2 - False - - - - - True - True - in - - - - - - 3 - - - - - True - False - Empty Files - - - 3 - False - - - - - True - True - in - - - - - - 4 - - - - - True - False - Temporary Files - - - 4 - False - - - - - True - False - - - True - False - vertical - - - True - False - 5 - 5 - 2 - - - True - False - 2 - Resize algorithm - - - False - True - 0 - - - - - True - False - - - False - True - 1 - - - - - True - False - 5 - 2 - Hash size: - - - False - True - 2 - - - - - True - False - - - False - True - 3 - - - - - True - False - 5 - 2 - Hash type: - - - False - True - 4 - - - - - True - False - - - False - True - 5 - - - - - False - True - 0 - - - - - True - False - 5 - 5 - 2 - - - True - False - Similarity - - - False - True - 0 - - - - - True - False - Very High - - - False - True - 1 - - - - - True - True - 100 - 1 - 0 - right - - - True - True - 2 - - - - - True - False - 5 - 5 - Minimal - - - False - True - 3 - - - - - Ignore same size - True - True - False - 7 - True - - - False - True - 4 - - - - - Fast compare - True - True - False - 7 - True - - - False - True - 5 - - - - - False - True - 4 - - - - - True - True - 5 - in - - - - - - True - True - 5 - - - - - True - True - 0 - - - - - 100 - 80 - True - False - center - - - False - True - 1 - - - - - 5 - - - - - True - False - Similar Images - - - 5 - False - - - - - True - False - vertical - - - True - False - 5 - 5 - 2 - - - True - False - Similarity - - - False - True - 0 - - - - - True - False - Very High - - - False - True - 1 - - - - - True - True - 100 - 0 - 0 - right - - - True - True - 2 - - - - - True - False - 5 - 5 - Minimal - - - False - True - 3 - - - - - Ignore same size - True - True - False - 7 - True - - - False - True - 4 - - - - - False - True - 4 - - - - - True - True - in - - - - - - True - True - 5 - - - - - 6 - - - - - True - False - Similar Videos - - - 6 - False - - - - - True - False - vertical - - - True - False - 5 - 5 - 8 - - - Title - True - True - False - True - True - - - False - True - 0 - - - - - Artist - True - True - False - True - True - - - False - True - 1 - - - - - Album Title - True - True - False - True - - - False - True - 2 - - - - - Album Artist - True - True - False - True - - - False - True - 3 - - - - - Year - True - True - False - True - - - False - True - 4 - - - - - False - True - 1 - - - - - True - False - 5 - 5 - 2 - - - Approximate Comparison - True - True - False - True - - - False - True - 0 - - - - - False - True - 2 - - - - - True - True - 5 - in - - - - - - True - True - 3 - - - - - 7 - - - - - True - False - Music Duplicates - - - 7 - False - - - - - True - True - in - - - - - - 8 - - - - - True - False - Invalid Symlinks - - - 8 - False - - - - - True - True - in - - - - - - 9 - - - - - True - False - Broken Files - - - 9 - False - - - - - True - False - - - - - True - True - 1 - - - - - True - False - 5 - 5 - 2 - 5 - - - True - False - 2 - - - True - True - True - - - True - False - center - 2 - - - True - False - edit-find - - - False - True - 0 - - - - - True - False - Search - - - False - True - 1 - - - - - - - False - True - 0 - - - - - False - True - 0 - - - - - True - True - True - - - True - False - center - format-justify-fill - - - - - False - True - end - 1 - - - - - True - True - True - - - True - False - center - utilities-system-monitor - - - - - False - True - end - 2 - - - - - True - False - 2 - - - True - True - False - True - - - True - False - center - 2 - - - True - False - edit-select-all - - - False - True - 0 - - - - - True - False - Select - - - False - True - 1 - - - - - - - False - True - 0 - - - - - True - True - True - - - True - False - center - 2 - - - True - False - list-remove - - - False - True - 0 - - - - - True - False - Delete - - - False - True - 1 - - - - - - - False - True - 2 - - - - - True - True - True - - - True - False - center - 2 - - - True - False - folder - - - False - True - 0 - - - - - True - False - Move - - - False - True - 1 - - - - - - - False - True - 3 - - - - - True - True - True - - - True - False - center - 2 - - - True - False - document-save - - - False - True - 0 - - - - - True - False - Save - - - False - True - 1 - - - - - - - False - True - 4 - - - - - True - True - True - - - True - False - center - 2 - - - True - False - network-transmit-receive - - - False - True - 0 - - - - - True - False - Symlink - - - False - True - 1 - - - - - - - False - True - 5 - - - - - True - True - True - - - True - False - center - 2 - - - True - False - text-x-generic-template - - - False - True - 0 - - - - - True - False - Hardlink - - - False - True - 1 - - - - - - - False - True - 6 - - - - - False - True - end - 3 - - - - - False - True - 3 - - - - - True - False - 5 - 5 - 5 - 5 - - - True - True - False - False - none - - - True - True - 0 - - - - - True - True - False - False - Czkawka 3.3.1 - 1 - none - False - - - False - True - end - 1 - - - - - False - True - 4 - - - - - True - True - queue - in - 100 - - - True - True - False - True - - - - - False - True - end - 5 - - - - - - - True - False - True - - - True - False - 5 - - - True - True - True - - - True - False - applications-engineering - - - - - False - True - 0 - - - - - True - True - True - - - True - False - dialog-information - - - - - False - True - 1 - - - - - end - - - - - - diff --git a/czkawka_gui/ui/popover_right_click.glade b/czkawka_gui/ui/popover_right_click.glade deleted file mode 100644 index ad6ec4c..0000000 --- a/czkawka_gui/ui/popover_right_click.glade +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - False - left - - - True - False - vertical - - - Open File - True - True - True - - - False - True - 0 - - - - - Open Folder - True - True - True - - - False - True - 1 - - - - - - diff --git a/czkawka_gui/ui/popover_select.glade b/czkawka_gui/ui/popover_select.glade deleted file mode 100644 index 482246e..0000000 --- a/czkawka_gui/ui/popover_select.glade +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - - - False - - - True - False - vertical - - - Select custom - True - True - True - - - False - True - 0 - - - - - Unselect custom - True - True - True - - - False - True - 1 - - - - - True - False - - - False - True - 2 - - - - - Select all except biggest - True - True - True - - - False - True - 3 - - - - - Select all except smallest - True - True - True - - - False - True - 4 - - - - - True - False - - - False - True - 5 - - - - - Select all except oldest - True - True - True - - - False - True - 6 - - - - - Select all except newest - True - True - True - - - False - True - 7 - - - - - Select one oldest - True - True - True - - - False - True - 8 - - - - - Select one newest - True - True - True - - - False - True - 9 - - - - - True - False - - - False - True - 10 - - - - - Reverse Selection - True - True - True - - - False - True - 11 - - - - - True - False - - - False - True - 12 - - - - - Select All - True - True - True - - - False - True - 13 - - - - - Unselect All - True - True - True - - - False - True - 14 - - - - - - diff --git a/czkawka_gui/ui/progress.glade b/czkawka_gui/ui/progress.glade deleted file mode 100644 index 6afe4b4..0000000 --- a/czkawka_gui/ui/progress.glade +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - - - False - dialog - center - - - False - vertical - 2 - - - False - end - - - - - - - - - False - False - 0 - - - - - True - False - 10 - 10 - 10 - 10 - vertical - 10 - - - - True - False - center - 2 - 2 - 2 - - - label_progress_all_stages - True - False - All stages: - - - 0 - 1 - - - - - True - False - True - 0.099999999776482579 - True - - - 1 - 1 - - - - - label_progress_current_stage - True - False - Current stage: - - - 0 - 0 - - - - - True - False - True - - - 1 - 0 - - - - - True - True - 0 - - - - - True - False - Stage 1/2 - - - False - True - 1 - - - - - True - True - True - end - 2 - - - True - False - - - True - False - dialog-cancel - - - False - True - 0 - - - - - True - False - Stop - - - True - True - 1 - - - - - - - False - False - end - 2 - - - - - False - True - 1 - - - - - - diff --git a/czkawka_gui/ui/settings.glade b/czkawka_gui/ui/settings.glade deleted file mode 100644 index 5f55f4e..0000000 --- a/czkawka_gui/ui/settings.glade +++ /dev/null @@ -1,681 +0,0 @@ - - - - - - - - - - False - Czkawka Options - True - dialog - - - False - vertical - 2 - - - False - end - - - - - - - - - False - False - 0 - - - - - True - False - vertical - - - True - False - vertical - - - True - False - - - False - False - 0 - - - - - False - True - 0 - - - - - True - True - left - - - True - False - vertical - - - True - False - vertical - - - True - False - - - True - False - 5 - 10 - Language - - - False - True - 0 - - - - - True - False - - - True - True - 1 - - - - - False - True - 0 - - - - - Load configuration at start - True - True - False - True - True - - - False - True - 1 - - - - - Save configuration at exit - True - True - False - True - True - - - False - True - 2 - - - - - Show confirm dialog when deleting any files - True - True - False - True - True - - - False - True - 3 - - - - - Show confirm dialog when hard/symlinks any files - True - True - False - True - True - - - False - True - 4 - - - - - Show confirm dialog when deleting all files in group - True - True - False - True - True - - - False - True - 5 - - - - - Show bottom text panel - True - True - False - True - True - - - False - False - 6 - - - - - Use cache - True - True - False - True - True - - - False - True - 7 - - - - - Move deleted files to trash - True - True - False - True - True - - - False - True - 8 - - - - - False - False - 0 - - - - - True - False - - - Open cache folder - True - True - True - - - False - True - 0 - - - - - Open settings folder - True - True - True - - - False - True - end - 1 - - - - - False - False - end - 1 - - - - - - - True - False - General - - - False - - - - - True - False - vertical - - - Hide hard links(only Linux and MacOS) - True - True - False - True - True - - - False - True - 0 - - - - - Show image preview - True - True - False - True - True - - - False - True - 1 - - - - - Delete outdated cache entries automatically - True - True - False - True - True - - - False - True - 2 - - - - - True - False - 4 - 4 - - - True - False - Minimal size of files in bytes saved to cache - - - True - True - 0 - - - - - True - True - 15 - 257144 - False - number - - - False - False - end - 1 - - - - - False - True - 3 - - - - - Use prehash cache - True - True - False - True - - - False - True - 4 - - - - - Remove outdated results from duplicates cache - True - True - True - - - False - False - end - 5 - - - - - True - False - 4 - 4 - - - True - False - Minimal size of files in bytes saved to prehash cache - - - True - True - 0 - - - - - True - True - 15 - 1 - False - number - - - False - False - end - 1 - - - - - False - True - 6 - - - - - 1 - - - - - True - False - Duplicate Finder - - - 1 - False - - - - - True - False - vertical - - - Show image preview - True - True - False - True - True - - - False - True - 0 - - - - - Delete outdated cache entries automatically - True - True - False - True - True - - - False - True - 1 - - - - - Remove outdated results from images cache - True - True - True - - - False - False - end - 2 - - - - - 2 - - - - - True - False - Similar Images - - - 2 - False - - - - - True - False - vertical - - - Remove outdated results from videos cache - True - True - True - - - False - False - end - 0 - - - - - Delete outdated cache entries automatically - True - True - False - True - - - False - True - 1 - - - - - 3 - - - - - True - False - Similar Videos - - - 3 - False - - - - - True - True - 1 - - - - - True - False - 3 - 3 - 3 - - - Load configuration - True - True - True - - - False - False - 0 - - - - - Reset configuration - True - True - True - - - True - False - 1 - - - - - Save configuration - True - True - True - - - False - False - end - 2 - - - - - False - True - 3 - 2 - - - - - True - True - 1 - - - - - - diff --git a/data/com.github.qarmin.czkawka.desktop b/data/com.github.qarmin.czkawka.desktop deleted file mode 100644 index c3b9997..0000000 --- a/data/com.github.qarmin.czkawka.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Application -Terminal=false -Exec=czkawka_gui -Name=Czkawka -Name[it]=Singhiozzo -Comment=Multi functional app to clean OS which allow to find duplicates, empty folders, similar files etc. -Comment[it]=Programma multifunzionale per pulire il sistema, che permette di trovare file duplicati, cartelle vuote, file simili, ecc... -Icon=com.github.qarmin.czkawka -Categories=System; -StartupWMClass=czkawka_gui -TryExec=czkawka_gui diff --git a/data/com.github.qarmin.czkawka.metainfo.xml b/data/com.github.qarmin.czkawka.metainfo.xml deleted file mode 100644 index bf513dc..0000000 --- a/data/com.github.qarmin.czkawka.metainfo.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - com.github.qarmin.czkawka - Czkawka - Multi functional app to find duplicates, empty folders, similar images, broken files etc. - CC0-1.0 - MIT - -

- Czkawka is simple, fast and easy to use app to remove unnecessary files from your computer. -

-
- com.github.qarmin.czkawka.desktop - - - https://user-images.githubusercontent.com/41945903/147875238-7f82fa27-c6dd-47e7-87ed-e253fb2cbc3e.png - https://user-images.githubusercontent.com/41945903/147875239-bcf9776c-885d-45ac-ba82-5a426d8e1647.png - https://user-images.githubusercontent.com/41945903/147875243-e654e683-37f7-46fa-8321-119a4c5775e7.png - - - - - - - Rafał Mikrut - https://github.com/qarmin/czkawka - https://github.com/qarmin/czkawka/issues - https://github.com/sponsors/qarmin - https://crowdin.com/project/czkawka -
diff --git a/data/icons/com.github.qarmin.czkawka-symbolic.svg b/data/icons/com.github.qarmin.czkawka-symbolic.svg deleted file mode 100644 index 1b8e410..0000000 --- a/data/icons/com.github.qarmin.czkawka-symbolic.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/icons/com.github.qarmin.czkawka.Devel.svg b/data/icons/com.github.qarmin.czkawka.Devel.svg deleted file mode 100644 index abdac45..0000000 --- a/data/icons/com.github.qarmin.czkawka.Devel.svg +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/icons/com.github.qarmin.czkawka.svg b/data/icons/com.github.qarmin.czkawka.svg deleted file mode 100644 index 89ac8f8..0000000 --- a/data/icons/com.github.qarmin.czkawka.svg +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/czkawka_gui/src/main.rs b/src/main.rs similarity index 52% rename from czkawka_gui/src/main.rs rename to src/main.rs index 6b9947e..6f7c72d 100644 --- a/czkawka_gui/src/main.rs +++ b/src/main.rs @@ -4,6 +4,15 @@ use i18n_embed::unic_langid::LanguageIdentifier; use i18n_embed::DesktopLanguageRequester; +use std::collections::HashMap; + +use i18n_embed::{ + fluent::{fluent_language_loader, FluentLanguageLoader}, + DefaultLocalizer, LanguageLoader, Localizer, +}; +use once_cell::sync::Lazy; +use rust_embed::RustEmbed; + fn main() { load_system_language(); // Check for default system language, must be loaded after initializing GUI and before loading settings from file connect_change_language(); @@ -14,7 +23,7 @@ pub fn connect_change_language() { fn change_language() { println!("Change language"); - let localizers = vec![("czkawka_gui", czkawka_core::localizer::localizer())]; + let localizers = vec![("czkawka_gui", localizer())]; let lang_identifier = vec![LanguageIdentifier::from_bytes("en".as_bytes()).unwrap()]; for (lib, localizer) in localizers { @@ -43,3 +52,39 @@ pub fn load_system_language() { } } } + +#[derive(RustEmbed)] +#[folder = "i18n/"] +struct Localizations; + +pub static LANGUAGE_LOADER: Lazy = Lazy::new(|| { + let loader: FluentLanguageLoader = fluent_language_loader!(); + + loader.load_fallback_language(&Localizations).expect("Error while loading fallback language"); + + loader +}); + +#[macro_export] +macro_rules! fl { + ($message_id:literal) => {{ + i18n_embed_fl::fl!($crate::localizer::LANGUAGE_LOADER, $message_id) + }}; + + ($message_id:literal, $($args:expr),*) => {{ + i18n_embed_fl::fl!($crate::localizer::LANGUAGE_LOADER, $message_id, $($args), *) + }}; +} + +// Get the `Localizer` to be used for localizing this library. +pub fn localizer() -> Box { + Box::from(DefaultLocalizer::new(&*LANGUAGE_LOADER, &Localizations)) +} + +pub fn generate_translation_hashmap(vec: Vec<(&'static str, String)>) -> HashMap<&'static str, String> { + let mut hashmap: HashMap<&'static str, String> = Default::default(); + for (key, value) in vec { + hashmap.insert(key, value); + } + hashmap +}