Skip to content

Commit

Permalink
3.0.0 (#72)
Browse files Browse the repository at this point in the history
* A1

* Remove buggy behaviour on release builds

* Fixed buggy behaviour

* Disable soring, enable treeiter cache, fix selecting items in folder

* Debug Assert

* Changes

* 3.0.0
  • Loading branch information
qarmin authored May 24, 2023
1 parent 7ab7f33 commit 75c2ef7
Show file tree
Hide file tree
Showing 33 changed files with 182 additions and 270 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*#
TestSuite*
*.snap
DO_NOT_RENAME/
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Version 3.0.0 - 24.02.2023r
- Builtin icons - [#70](/~https://github.com/qarmin/szyszka/pull/70), [#71](/~https://github.com/qarmin/szyszka/pull/71)
- Multithreading search for files - [#70](/~https://github.com/qarmin/szyszka/pull/70)
- Adding items to rename via cli - [#70](/~https://github.com/qarmin/szyszka/pull/70)
- Regex Support - [#70](/~https://github.com/qarmin/szyszka/pull/70)
- Use native filechoosers - [18df7](/~https://github.com/qarmin/szyszka/commit/18df74a9b686b62985248b9a8726bd96cee4f29c)
- Updating number per folder $(K) - [#68](/~https://github.com/qarmin/szyszka/pull/68)
- Optional numbers in custom macros - [#69](/~https://github.com/qarmin/szyszka/pull/69)
- Gtk4 port - [#65](/~https://github.com/qarmin/szyszka/pull/65)
- Added multiple languages - [#63](/~https://github.com/qarmin/szyszka/pull/63)
- Sorting added results - [#57](/~https://github.com/qarmin/szyszka/pull/57)
- Fix windows custom rules - [0fe9](/~https://github.com/qarmin/szyszka/commit/0fe9753eceac56321a49b44c6ec390d30ba0a494)
- Selecting changed items - [#49](/~https://github.com/qarmin/szyszka/pull/49)
- Normalizing rule - [#47](/~https://github.com/qarmin/szyszka/pull/47)
- New custom rules parser - [#45](/~https://github.com/qarmin/szyszka/pull/45)
- Really big code cleanup - [#70](/~https://github.com/qarmin/szyszka/pull/70)
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "szyszka"
version = "2.0.0"
version = "3.0.0"
authors = ["Rafał Mikrut <mikrutrafal@protonmail.com>"]
edition = "2021"
description = "Fast, powerful and easy to use file renamer"
Expand All @@ -19,9 +19,7 @@ directories-next = "2.0.0"
rayon = "1.7.0"

# For checking path
# Looks that jwalk find different files than walkdir
jwalk = "0.8.1"
#walkdir = "2.3.3"

humansize = "2.1"
chrono = "0.4.24"
Expand All @@ -32,10 +30,10 @@ open = "4.1"
# For slugs
slugmin = "1.0"

regex = "1.8.1"
regex = "1.8"

serde = {version="1.0.163", features=["derive"]}
serde_json = "1.0.96"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

# Language
i18n-embed = { version = "0.13", features = ["fluent-system", "desktop-requester"] }
Expand All @@ -50,4 +48,4 @@ features = ["v4_6"]

# Optimize all dependencies except application/workspaces, even in debug builds
[profile.dev.package."*"]
opt-level = 3
opt-level = 3
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Szyszka is a simple but powerful and fast bulk file renamer.

![Szyszka](https://user-images.githubusercontent.com/41945903/126200297-e0552164-2970-449f-9e68-bd47d231e041.png)
![Szyszka](https://github.com/qarmin/szyszka/assets/41945903/c8da9bf2-2962-46cb-a9e3-0172e2bd6033)
## Features
- Great performance
- Available for Linux, Mac and Windows
Expand All @@ -29,7 +29,7 @@ sudo apt install libgtk-4-bin
You need to install GTK using brew
```shell
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install rust gtk+3
brew install gtk4 adwaita-icon-theme librsvg pkg-config
```

### Windows
Expand Down Expand Up @@ -69,7 +69,8 @@ I tried to use different apps, but they didn't suit my needs.

## Contribution
Contributions are very welcome - bug reports, pull requests, testing etc.
When creating or modifying existing rules, don't forget about updating/adding tests!
When creating or modifying existing rules, don't forget about updating/adding tests!
You can also add/improve translations in crowdin - https://crowdin.com/project/szyszka

## Name
Szyszka is Polish word which means Pinecone.
Expand Down
2 changes: 1 addition & 1 deletion data/com.github.qarmin.szyszka.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</screenshot>
</screenshots>
<releases>
<release version="2.0.0" date="2021-07-19"/>
<release version="3.0.0" date="2023-05-23"/>
</releases>
<content_rating type="oars-1.0"/>
<developer_name>Rafał Mikrut</developer_name>
Expand Down
1 change: 1 addition & 0 deletions i18n/ar/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = اللغة
settings_open_rules = فتح ملف إعدادات القواعد
settings_open_cache_custom_texts = فتح ملف ذاكرة التخزين المؤقت المخصص
settings_open_config_dir = فتح ذاكرة التخزين المؤقت
check_button_dark_theme = أيقونات داكنة
# Other in main window
bottom_rule_label_rules = القواعد
upper_files_folders_label = الملفات/المجلدات
Expand Down
1 change: 1 addition & 0 deletions i18n/cs/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = Jazyk
settings_open_rules = Otevřít soubor s nastavením pravidel
settings_open_cache_custom_texts = Otevřít vlastní soubor mezipaměti
settings_open_config_dir = Otevřít dir keše
check_button_dark_theme = Tmavé ikony
# Other in main window
bottom_rule_label_rules = Pravidla
upper_files_folders_label = Soubory/Složky
Expand Down
1 change: 1 addition & 0 deletions i18n/de/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = Sprache
settings_open_rules = Öffne Regel-Einstellungsdatei
settings_open_cache_custom_texts = Eigene Cache-Datei öffnen
settings_open_config_dir = Cache-Verzeichnis öffnen
check_button_dark_theme = Dunkle Symbole
# Other in main window
bottom_rule_label_rules = Regeln
upper_files_folders_label = Dateien/Ordner
Expand Down
2 changes: 1 addition & 1 deletion i18n/en/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ settings_language_label = Language
settings_open_rules = Open rules settings file
settings_open_cache_custom_texts = Open custom cache file
settings_open_config_dir = Open cache dir
check_button_dark_theme = Dark theme icons
check_button_dark_theme = Dark icons
# Other in main window
bottom_rule_label_rules = Rules
Expand Down
1 change: 1 addition & 0 deletions i18n/es/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = Idioma
settings_open_rules = Abrir archivo de configuración de reglas
settings_open_cache_custom_texts = Abrir archivo de caché personalizado
settings_open_config_dir = Abrir directorio de caché
check_button_dark_theme = Iconos oscuros
# Other in main window
bottom_rule_label_rules = Reglas
upper_files_folders_label = Archivos/Carpetas
Expand Down
1 change: 1 addition & 0 deletions i18n/fr/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = Langue
settings_open_rules = Ouvrir le fichier de paramètres des règles
settings_open_cache_custom_texts = Ouvrir un fichier de cache personnalisé
settings_open_config_dir = Ouvrir le répertoire de cache
check_button_dark_theme = Icônes sombres
# Other in main window
bottom_rule_label_rules = Règles
upper_files_folders_label = Fichiers/Dossiers
Expand Down
1 change: 1 addition & 0 deletions i18n/it/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = Lingua
settings_open_rules = Apri file impostazioni regole
settings_open_cache_custom_texts = Apri file cache personalizzato
settings_open_config_dir = Apri cache dir
check_button_dark_theme = Icone scure
# Other in main window
bottom_rule_label_rules = Regole
upper_files_folders_label = File/Cartelle
Expand Down
1 change: 1 addition & 0 deletions i18n/ja/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = 言語
settings_open_rules = ルール設定ファイルを開く
settings_open_cache_custom_texts = カスタム キャッシュ ファイルを開く
settings_open_config_dir = キャッシュディレクトリを開く
check_button_dark_theme = ダークアイコン
# Other in main window
bottom_rule_label_rules = ルール
upper_files_folders_label = ファイル/フォルダ
Expand Down
2 changes: 1 addition & 1 deletion i18n/pl/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ settings_language_label = Język
settings_open_rules = Otwórz plik ustawień reguł
settings_open_cache_custom_texts = Otwórz plik ustawień niestandardowych reguł
settings_open_config_dir = Otwórz katalog konfiguracyjny
check_button_dark_theme = Ciemny styl ikon
check_button_dark_theme = Ciemne ikony
# Other in main window
bottom_rule_label_rules = Reguły
upper_files_folders_label = Pliki/Foldery
Expand Down
1 change: 1 addition & 0 deletions i18n/pt/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = IDIOMA
settings_open_rules = Abrir arquivo de configurações das regras
settings_open_cache_custom_texts = Abrir arquivo de cache personalizado
settings_open_config_dir = Abrir cache dir
check_button_dark_theme = Ícones escuros
# Other in main window
bottom_rule_label_rules = Regras
upper_files_folders_label = Arquivos/Pastas
Expand Down
1 change: 1 addition & 0 deletions i18n/ru/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = Язык
settings_open_rules = Открыть файл настроек правил
settings_open_cache_custom_texts = Открыть файл кэша
settings_open_config_dir = Открыть каталог кэша
check_button_dark_theme = Темные иконки
# Other in main window
bottom_rule_label_rules = Правила
upper_files_folders_label = Файлы/Папки
Expand Down
1 change: 1 addition & 0 deletions i18n/sv/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = Språk
settings_open_rules = Öppna regelinställningar fil
settings_open_cache_custom_texts = Öppna anpassad cachefil
settings_open_config_dir = Öppna cache dir
check_button_dark_theme = Mörka ikoner
# Other in main window
bottom_rule_label_rules = Regler
upper_files_folders_label = Filer/Mappar
Expand Down
1 change: 1 addition & 0 deletions i18n/uk/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = Мова:
settings_open_rules = Відкрити файл налаштувань правил
settings_open_cache_custom_texts = Відкрити користувацький файл кешу
settings_open_config_dir = Відкрити кеш dir
check_button_dark_theme = Темні іконки
# Other in main window
bottom_rule_label_rules = Правила
upper_files_folders_label = Файли/Теки
Expand Down
1 change: 1 addition & 0 deletions i18n/zh/szyszka.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ settings_language_label = 语言
settings_open_rules = 打开规则设置文件
settings_open_cache_custom_texts = 打开自定义缓存文件
settings_open_config_dir = 打开缓存目录
check_button_dark_theme = 暗色图标
# Other in main window
bottom_rule_label_rules = 规则
upper_files_folders_label = 文件/文件夹
Expand Down
2 changes: 1 addition & 1 deletion misc/cargo/PublishSzyszka.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
NUMBER="2.0.0"
NUMBER="3.0.0"
SZYSZKA_PATH="/home/rafal"

cd "$SZYSZKA_PATH"
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: szyszka # you probably want to 'snapcraft register <name>'
base: core22 # the base snap is the execution environment for this snap
version: '2.0.0' # just for humans, typically '1.2+git' or '1.3.2'
version: '3.0.0' # just for humans, typically '1.2+git' or '1.3.2'
summary: Szyszka - fast file renamer written in Rust # 79 char long summary
description: |
Szyszka is very fast file renamer written in Rust.
Expand Down
1 change: 1 addition & 0 deletions src/add_files_folders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::fs;
use std::path::PathBuf;
use std::time::UNIX_EPOCH;

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ItemStruct {
pub full_name: String,
pub name: String,
Expand Down
20 changes: 15 additions & 5 deletions src/cli_arguments.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::add_files_folders::{add_files_to_check, add_folders_to_check};
use crate::fls;
use crate::gui_data_things::gui_data::GuiData;
use crate::help_function::get_list_store_from_tree_view;
use crate::localizer::generate_translation_hashmap;
use std::path::{Path, PathBuf};
use std::process;

Expand Down Expand Up @@ -59,21 +61,23 @@ pub fn parse_cli_arguments(gui_data: &GuiData, arguments: &[String]) {
} else if i == "-f" {
current_mode = SearchMode::Recursive;
} else {
let path = Path::new(i);
let Ok(path) = Path::new(i).canonicalize() else {
continue
};
if path.is_dir() {
match current_mode {
SearchMode::Normal => {
folders_to_add.push(path.to_path_buf());
folders_to_add.push(path.clone());
}
SearchMode::RecursiveSkipFolders => {
folders_to_add_recursive_skip_folders.push(path.to_path_buf());
folders_to_add_recursive_skip_folders.push(path.clone());
}
SearchMode::Recursive => {
folders_to_add_recursive.push(path.to_path_buf());
folders_to_add_recursive.push(path.clone());
}
}
} else if path.is_file() {
files_to_add.push(path.to_path_buf());
files_to_add.push(path.clone());
} else {
eprintln!("Error: {i} is not valid file or folder");
}
Expand All @@ -89,4 +93,10 @@ pub fn parse_cli_arguments(gui_data: &GuiData, arguments: &[String]) {
add_folders_to_check(folders_to_add, &list_store, &mut result_entries, false, false);
add_folders_to_check(folders_to_add_recursive, &list_store, &mut result_entries, true, false);
add_folders_to_check(folders_to_add_recursive_skip_folders, &list_store, &mut result_entries, true, true);

let label_files_folders = gui_data.upper_buttons.label_files_folders.clone();
label_files_folders.set_text(&fls!(
"upper_files_folders_label_up_to_date",
generate_translation_hashmap(vec![("files_number", result_entries.files.len().to_string())])
));
}
3 changes: 2 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ pub const DARK_THEME_FILE_NAME: &str = "dark_theme.txt";

const BASIC_CUSTOM_COMMANDS: &str = r#"FILE_$(N).$(EXT)
FILE_$(K).$(EXT)
$(PARENT)_$(K).$(EXT)
$(PARENT) $(N).$(EXT)
$(PARENT) $(K).$(EXT)
"#;

const BASIC_RULE_CONTENT: &str = r#"[]"#;
Expand Down
20 changes: 12 additions & 8 deletions src/create_tree_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,25 @@ pub fn create_tree_view_rules(tree_view: &TreeView) {
}

#[allow(clippy::option_option)]
fn create_default_column(tree_view: &TreeView, column_id: i32, sort_column_id: Option<Option<i32>>, name: &str) -> (CellRendererText, TreeViewColumn) {
fn create_default_column(tree_view: &TreeView, column_id: i32, _sort_column_id: Option<Option<i32>>, name: &str) -> (CellRendererText, TreeViewColumn) {
let renderer = CellRendererText::new();
let column: TreeViewColumn = TreeViewColumn::new();
column.pack_start(&renderer, true);
column.set_title(name);
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 {
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);
}
}

// TODO sorting is disabled, because broke list_store swaps, which is needed to move items in list
// Consider to add manual sorting feature

// if let Some(sort_column_id) = sort_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);
// }
// }
tree_view.append_column(&column);
(renderer, column)
}
Loading

0 comments on commit 75c2ef7

Please sign in to comment.