module Hashbrown
Extended Modules
Defined in:
hashbrown.crmodules/functions/about_action.cr
modules/functions/current_lang.cr
modules/functions/file_set.cr
modules/functions/generate_hash.cr
modules/functions/hashinfo_action.cr
modules/functions/headbar_gen.cr
modules/functions/icon_name.cr
modules/functions/translate_ui.cr
modules/global_vars.cr
modules/views/main.cr
modules/views/tools/compare.cr
modules/views/tools/validate.cr
modules/views/welcomer.cr
Constant Summary
-
APP =
Adw::Application.new("dev.geopjr.Hashbrown", Gio::ApplicationFlags::None)
-
ARTICLE =
TRANSLATIONS[CURRENT_LANGUAGE]["https://en.wikipedia.org/wiki/Comparison_of_cryptographic_hash_functions"]
-
B_HL =
Gtk::Builder.new_from_string(HL, HL.bytesize.to_i64)
-
B_HR =
Gtk::Builder.new_from_string(HR, HR.bytesize.to_i64)
-
B_HS =
Gtk::Builder.new_from_string(HS, HS.bytesize.to_i64)
-
B_HT =
Gtk::Builder.new_from_string(HT, HT.bytesize.to_i64)
-
B_TL =
Gtk::Builder.new_from_string(TL, TL.bytesize.to_i64)
-
B_UI =
Gtk::Builder.new_from_string(UI, UI.bytesize.to_i64)
-
BOTTOM_TABS =
Adw::ViewSwitcherBar.cast(B_HT["switcher_bar"])
-
CLIPBOARD_HASH =
Hash(Gtk::Button, String).new
-
COPY_BUTTONS =
[Gtk::Button.cast(B_HS["copyBtn1"]), Gtk::Button.cast(B_HS["copyBtn2"]), Gtk::Button.cast(B_HS["copyBtn3"]), Gtk::Button.cast(B_HS["copyBtn4"])]
-
CURRENT_LANGUAGE =
Hashbrown.current_language
-
DEFAULT_FEEDBACK_ICON =
"dialog-password-symbolic"
-
HASH_LIST_TITLE =
TRANSLATIONS[CURRENT_LANGUAGE]["Hashes"]
-
HEADER_TITLE =
Adw::ViewSwitcherTitle.cast(B_HT["switcher_title"])
-
HL =
Hashbrown.translate({{ read_file("./src/modules/ui/header_left.ui") }})
-
HR =
Hashbrown.translate({{ read_file("./src/modules/ui/header_right.ui") }})
-
HS =
Hashbrown.translate({{ read_file("./src/modules/ui/hash_list.ui") }})
-
HT =
Hashbrown.translate({{ read_file("./src/modules/ui/switcher.ui") }})
-
MAIN_FILE_CHOOSER_NATIVE =
Gtk::FileChooserNative.cast(B_HL["mainFileChooserNative"])
-
MENU_BUTTON =
Gtk::MenuButton.cast(B_HR["menuBtn"])
-
OPEN_FILE_BUTTON =
Gtk::Button.cast(B_HL["openFileBtn"])
-
STACK =
Adw::ViewStack.cast(B_HT["stack"])
-
TEXT_FIELDS =
{"md5sum" => Gtk::Entry.cast(B_HS["textField1"]), "sha1sum" => Gtk::Entry.cast(B_HS["textField2"]), "sha256sum" => Gtk::Entry.cast(B_HS["textField3"]), "sha512sum" => Gtk::Entry.cast(B_HS["textField4"])}
-
THANKS =
{{ (run("../../extra/scripts/thank_translators")).stringify }}
-
TL =
Hashbrown.translate({{ read_file("./src/modules/ui/tools.ui") }})
-
TOOL_COMPARE_BUTTON =
Gtk::Button.cast(B_TL["compareBtn"])
-
TOOL_COMPARE_FILE_CHOOSER_NATIVE =
Gtk::FileChooserNative.cast(B_TL["compareFileChooserNative"])
-
TOOL_COMPARE_ROW =
Adw::ActionRow.cast(B_TL["tool2Row"])
-
TOOL_VALIDATE_BUTTON =
Gtk::Button.cast(B_TL["validateBtn"])
-
TOOL_VALIDATE_INPUT =
Gtk::Entry.cast(B_TL["hashInput"])
-
TOOL_VALIDATE_ROW =
Adw::ActionRow.cast(B_TL["tool1Row"])
-
TOOLS_TITLE =
TRANSLATIONS[CURRENT_LANGUAGE]["Tools"]
-
TRANSLATIONS =
Hash(String, Hash(String, String)).new
-
UI =
Hashbrown.translate({{ read_file("./src/modules/ui/welcomer.ui") }})
-
VERSION =
{{ (((read_file("./shard.yml")).split("version: "))[1].split("\n"))[0] }}
-
WELCOME_BUTTON =
Gtk::Button.cast(B_UI["welcomeBtn"])
-
WELCOMER_FILE_CHOOSER_NATIVE =
Gtk::FileChooserNative.cast(B_UI["welcomerFileChooserNative"])
-
WINDOW_BOX =
Gtk::Box.new(Gtk::Orientation::Vertical, 0)
Instance Method Summary
- #about_action(app : Adw::Application)
- #activate(app : Adw::Application)
- #current_language : String
- #generate_hashes(filename : String, textFields : Hash(String, Gtk::Entry), copyBtns : Array(Gtk::Button)) : Hash(Gtk::Button, String)
- #generate_headbar(left : Bool | Nil = false, original_header : Adw::HeaderBar | Nil = nil) : Adw::HeaderBar
- #hashinfo_action(app : Adw::Application)
- #icon(success : Bool | Nil = false)
- #reset(clear : Bool | Nil = false)
- #reset_feedback
- #run_cmd(cmd, args)
- #translate(ui : String, lang_code : String | Nil = CURRENT_LANGUAGE) : String
Instance Method Detail
def generate_hashes(filename : String, textFields : Hash(String, Gtk::Entry), copyBtns : Array(Gtk::Button)) : Hash(Gtk::Button, String)
#
def generate_headbar(left : Bool | Nil = false, original_header : Adw::HeaderBar | Nil = nil) : Adw::HeaderBar
#