Skip to content
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
11 changes: 11 additions & 0 deletions data/dev.geopjr.Collision.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@
<color type="primary" scheme_preference="dark">#26a269</color>
</branding>
<releases>
<release version="3.13.0" date="2026-01-19">
<description translate="no">
<ul>
<li>Added a beautiful drop overlay when drag and dropping files</li>
<li>Fixed issues with the checksum text input</li>
<li>Title will be hidden now when unused</li>
<li>Files pending to be hashed will now reflect that in the progress bar</li>
<li>Collision will now gracefully handle closing windows that have pending operations</li>
</ul>
</description>
</release>
<release version="3.12.1" date="2026-01-14">
<description translate="no">
<ul>
Expand Down
4 changes: 2 additions & 2 deletions data/screenshots/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions data/screenshots/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions data/screenshots/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions data/screenshots/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions data/ui/application.ui
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
</child>
<child type="top">
<object class="AdwHeaderBar" id="header_bar">
<property name="show-title">0</property>
<child type="start">
<object class="GtkButton" id="openFileBtn">
<property name="visible">False</property>
Expand All @@ -81,10 +82,9 @@
</object>
</child>
<property name="title-widget">
<object class="AdwViewSwitcher" id="headerbarViewSwitcher">
<object class="AdwViewSwitcher">
<property name="policy">wide</property>
<property name="stack">resultsStack</property>
<property name="visible">0</property>
</object>
</property>
<child type="end">
Expand Down
10 changes: 10 additions & 0 deletions po/dev.geopjr.Collision.pot
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,13 @@ msgstr ""
#: src/collision/functions/feedback.cr:204
msgid "They Don't Match"
msgstr ""

#. Text on top of the progressbar when waiting for a different window to finish first
#: src/window.cr:164 data/ui/application.ui:152
msgid "Pending"
msgstr ""

#. translators: overlay shown when dragging files above it
#: data/ui/application.ui:48
msgid "Drop to hash"
msgstr ""
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: collision
version: 3.12.1
version: 3.13.0

authors:
- GeopJr <evan@geopjr.dev>
Expand Down
2 changes: 1 addition & 1 deletion spec/hash_generator_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe Collision::Checksum do
path = Path["./spec/test.txt"].expand(home: true)
hashes = Hash(Symbol, String).new
channel = Channel(Hash(String, String)).new
mt_context = Fiber::ExecutionContext::Parallel.new("worker-threads", 8)
mt_context = {{ Fiber::ExecutionContext.has_constant?(:Parallel) ? Fiber::ExecutionContext::Parallel : Fiber::ExecutionContext::MultiThreaded }}.new("worker-threads", 8)

Collision::CLIPBOARD_HASH.keys.each do |x|
hashes[x] = ""
Expand Down
13 changes: 11 additions & 2 deletions src/collision/functions/checksum.cr
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@ module Collision
end

class Checksum
@mt_context : Fiber::ExecutionContext::Parallel = Fiber::ExecutionContext::Parallel.new("worker-threads", 8)
@s_context = Fiber::ExecutionContext::Concurrent.new("channel-receiver")
{% if Fiber::ExecutionContext.has_constant?(:Parallel) %}
@mt_context : Fiber::ExecutionContext::Parallel = Fiber::ExecutionContext::Parallel.new("worker-threads", 8)
{% else %}
@mt_context : Fiber::ExecutionContext::MultiThreaded = Fiber::ExecutionContext::MultiThreaded.new("worker-threads", 8)
{% end %}

{% if Fiber::ExecutionContext.has_constant?(:Concurrent) %}
@s_context = Fiber::ExecutionContext::Concurrent.new("channel-receiver")
{% else %}
@s_context = Fiber::ExecutionContext::SingleThreaded.new("channel-receiver")
{% end %}

def calculate(type : Symbol, filename : String) : String
hash =
Expand Down
13 changes: 7 additions & 6 deletions src/collision/window.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Collision
"welcomeBtn",
"mainStack",
"fileInfo",
"headerbarViewSwitcher",
"header_bar",
"openFileBtn",
"compareBtn",
"verifyOverlayLabel",
Expand All @@ -31,7 +31,7 @@ module Collision
HOST_PATH_ATTR = "xattr::document-portal.host-path"

@hash_rows = Hash(Symbol, Widgets::HashRow).new
@headerbarViewSwitcher : Adw::ViewSwitcher
@header_bar : Adw::HeaderBar
@welcomeBtn : Gtk::Button
@compareBtn : Gtk::Button
@compareBtnImage : Gtk::Image
Expand Down Expand Up @@ -88,7 +88,7 @@ module Collision
end

@mainStack.visible_child_name = "results"
@headerbarViewSwitcher.visible = true
@header_bar.show_title = true
@openFileBtn.visible = true
@switcher_bar.visible = true
flow_queue
Expand Down Expand Up @@ -164,7 +164,7 @@ module Collision
@progressbar.text = Gettext.gettext("Pending")
@progressbar.fraction = 0.0
@mainStack.visible_child_name = "spinner"
@headerbarViewSwitcher.visible = false
@header_bar.show_title = false
@openFileBtn.visible = false
@switcher_bar.visible = false
reset_feedback
Expand Down Expand Up @@ -227,7 +227,8 @@ module Collision

@compareBtnLabel.label = file_path.basename.to_s
@compareBtnLabel.tooltip_text = file_path.basename.to_s
(Fiber::ExecutionContext::Concurrent.new("compare-tool")).spawn do

({{ Fiber::ExecutionContext.has_constant?(:Concurrent) ? Fiber::ExecutionContext::Concurrent : Fiber::ExecutionContext::SingleThreaded }}.new("compare-tool")).spawn do
compareFileSHA256 = Collision::Checksum.new.calculate(:sha256, file.path.to_s)
result = @hash_results[:sha256] == compareFileSHA256
result = Collision::FileUtils.compare_content(file_path, @hash_results.values) if !result && File.size(file_path) < MAX_COMPARE_READ_SIZE
Expand Down Expand Up @@ -293,7 +294,7 @@ module Collision
@verifyFeedback = Gtk::Image.cast(template_child("verifyFeedback"))

@mainStack = Gtk::Stack.cast(template_child("mainStack"))
@headerbarViewSwitcher = Adw::ViewSwitcher.cast(template_child("headerbarViewSwitcher"))
@header_bar = Adw::HeaderBar.cast(template_child("header_bar"))
@switcher_bar = Adw::ViewSwitcherBar.cast(template_child("switcher_bar"))
@mainDnd = Gtk::DropTarget.cast(template_child("mainDnd"))
@compareDnd = Gtk::DropTarget.cast(template_child("compareDnd"))
Expand Down