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
2 changes: 2 additions & 0 deletions data/ui/application.ui
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
<property name="maximum-size">400</property>
<child>
<object class="GtkProgressBar" id="progressbar">
<!-- translators: Text on top of the progressbar when waiting for a different window to finish first -->
<property name="text" translatable="yes">Pending</property>
<property name="show-text">1</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
Expand Down
7 changes: 5 additions & 2 deletions src/collision/functions/checksum.cr
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ module Collision

def generate(filename : String, progressbar : Gtk::ProgressBar? = nil, &block : Hash(Symbol, String) ->)
hash_amount = Collision::HASH_FUNCTIONS.size
progressbar.fraction = 0.0
progressbar.text = sprintf(Gettext.gettext("%d of %d hashes calculated"), {0, hash_amount})

unless progressbar.nil?
progressbar.fraction = 0.0
progressbar.text = sprintf(Gettext.gettext("%d of %d hashes calculated"), {0, hash_amount})
end

atomic = Atomic.new(0)
step = 1/hash_amount
Expand Down
1 change: 1 addition & 0 deletions src/collision/window.cr
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ module Collision
end

def loading
@progressbar.text = Gettext.gettext("Pending")
@progressbar.fraction = 0.0
@mainStack.visible_child_name = "spinner"
@headerbarStack.visible_child_name = "empty"
Expand Down