From d47949fdca0b8a7c218b7909625cf0cd15122b07 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Sat, 28 Jan 2023 18:52:24 +0100 Subject: [PATCH] show how many bytes are selected --- locales/de_DE/LC_MESSAGES/messages.mo | Bin 4529 -> 4623 bytes locales/de_DE/LC_MESSAGES/messages.po | 58 ++++++++++++++------------ locales/messages.pot | 54 +++++++++++++----------- src/ui/bigtext/bigtext.py | 9 ++++ 4 files changed, 69 insertions(+), 52 deletions(-) diff --git a/locales/de_DE/LC_MESSAGES/messages.mo b/locales/de_DE/LC_MESSAGES/messages.mo index 3e103b80f290fe5fae3bd36e3d3ff311af40b878..e45edb110c3d7b1c5118b589f2dd2c747dd8734c 100644 GIT binary patch delta 1475 zcmZ|NO-PhM9LMol-F02p-F&68h^N-DgUarPAseIybtx68pa_c84N?!128GB&9eO#) zR+~hHL>5IzL>Q>#L9ECQK^S&QDM$)BcrcMXWZxgowdL9Q%*-?M|If?wB9ba~=L)?2 zhF>H9&HQg=7}JiqJ_>%LS;p{~F^U45z-;_v{el`gk74|Ueq6Er88mWfXJZZ)Bd?5u z#Bog-l>i-4c~D*;W4um+QAQ0;zd+IFU!4vg{VY*sPT7^&&52l{ZCLQ`4YF|Bx?RoRNQ6M6=c$& zY63yd-=R`OhXzzpC_o*?J$#g?0GG(BZ{Y?i@iXL*%m``&6R3IbZ2yeypF^G8JZj#O zeZPvzmmT8#m7s{(3K+p%SdL2Af(qawk4aevPyvQeCpCgfFoinWY21qQs0I2-qWEFd zy!BXw5tj;!G1aJ#W*=_BdfV_$9$M*dgD&YrIoCVCsWz+%!>_QvK zqtF5z)O@#`iU!u$jwURj-HO_oi^MS3QHk%PKE6>@pmEemO`*npM{Q^kYfwSdu0?I6 z-g*i-G1r`Gf1I@4PzU=MU9Knsl>IY6FG=V(1bkZ1cgqp6Llpi)XCgI zoy03toJriKOPHpjfJ?}A8Bala#akJur>fuXbj)|alb`POMLZ4Z2fpJBTf0ncM_b>M z4rO(D8q*iEzWFNR(fH2cX8%B@)0ONqxxhmA`E!E`q?lZ}=-T#|z4&MxJ{0E0Vmlps4 delta 1405 zcmXZaOGs2v9LMo9IahPWF&#@wEhg+ik)e`-20dU_`3Pj%G!SToprF$zXq1fx8Azk( zt%No%T%#H8^5tsW4O#Xw;xk+xdIAj{Yp_EU!`P-=QCu zF_Zjeg@yt;Y=@@FK`kt>{Zdqd3RIxOn1e@98#{q(Fpdg*0TrhoweFhj-?04&R3#o@ zCi%@%8Vc~-KCo>2KW*Pnc{E>$O1ukG@E~%TFgKOB7PXQ&yx zgi7|12A6rlO(&Q~?R*Ip@H3vlKd3~VY@epNhaU5v^t8}Vr_5u_2Gqi8q84Bjm9PUTis?aZybrZ*(2kGT@iA1zCQ$2U?EEY$ z-#jY*QU>)`z>f^<#TC>?S4>m|2%{22tPQ9DF;s=lp%NrfB^}1icoVh3IaK@w)Vi0r z7C#`V%B9A0Yn1(hGK`ztCO*`wvChS8VG~ZE)9VS(gY*fNr)bmB$RKapof(WWI$5EB& zM#Z^=iZhG>MH\n" "Language-Team: LANGUAGE \n" @@ -60,7 +60,7 @@ msgstr "" msgid "Filter:" msgstr "" -#: src/plugins/filesbrowser/filesbrowserwidget.py:73 +#: src/plugins/filesbrowser/filesbrowserwidget.py:75 msgid "Open Directory" msgstr "" @@ -93,7 +93,7 @@ msgid "Log file viewer" msgstr "" #: src/plugins/krowlog/aboutdialog.py:63 -msgid "(c) 2022 Andreas Huber" +msgid "(c) 2022-2023 Andreas Huber" msgstr "" #: src/plugins/krowlog/aboutdialog.py:64 @@ -216,6 +216,10 @@ msgstr "" msgid "Save File" msgstr "" +#: src/ui/bigtext/bigtext.py:459 +msgid "selected {0} - {1:,.0f}:{2:,.0f}" +msgstr "" + #: src/ui/bigtext/newhighlightingdialog.py:20 msgid "Manage Highlighting" msgstr "" @@ -236,91 +240,91 @@ msgstr "" msgid "Down" msgstr "" -#: src/ui/bigtext/newhighlightingdialog.py:143 +#: src/ui/bigtext/newhighlightingdialog.py:151 msgid "Hit Background:" msgstr "" -#: src/ui/bigtext/newhighlightingdialog.py:145 +#: src/ui/bigtext/newhighlightingdialog.py:155 msgid "Hit Background" msgstr "" -#: src/ui/bigtext/newhighlightingdialog.py:150 +#: src/ui/bigtext/newhighlightingdialog.py:161 msgid "Ignore Case" msgstr "" -#: src/ui/bigtext/newhighlightingdialog.py:156 +#: src/ui/bigtext/newhighlightingdialog.py:168 msgid "Line Background:" msgstr "" -#: src/ui/bigtext/newhighlightingdialog.py:158 +#: src/ui/bigtext/newhighlightingdialog.py:172 msgid "Line Background" msgstr "" -#: src/ui/bigtext/newhighlightingdialog.py:163 +#: src/ui/bigtext/newhighlightingdialog.py:178 msgid "Regular Expression" msgstr "" -#: src/ui/colorbutton.py:20 +#: src/ui/colorbutton.py:19 msgid "Strawberry Cream" msgstr "" -#: src/ui/colorbutton.py:21 +#: src/ui/colorbutton.py:20 msgid "Pale Crimson" msgstr "" -#: src/ui/colorbutton.py:23 +#: src/ui/colorbutton.py:22 msgid "Broken Buttercup" msgstr "" -#: src/ui/colorbutton.py:24 +#: src/ui/colorbutton.py:23 msgid "Passion Fruit Sugar" msgstr "" -#: src/ui/colorbutton.py:26 +#: src/ui/colorbutton.py:25 msgid "Sunrise Yellow" msgstr "" -#: src/ui/colorbutton.py:27 +#: src/ui/colorbutton.py:26 msgid "Magical Mustard" msgstr "" -#: src/ui/colorbutton.py:29 +#: src/ui/colorbutton.py:28 msgid "Trendy Green" msgstr "" -#: src/ui/colorbutton.py:30 +#: src/ui/colorbutton.py:29 msgid "Garden Of Sweden" msgstr "" -#: src/ui/colorbutton.py:32 +#: src/ui/colorbutton.py:31 msgid "Light Sky Blue" msgstr "" -#: src/ui/colorbutton.py:33 +#: src/ui/colorbutton.py:32 msgid "True Blue" msgstr "" -#: src/ui/colorbutton.py:35 +#: src/ui/colorbutton.py:34 msgid "Fairy Topia" msgstr "" -#: src/ui/colorbutton.py:36 +#: src/ui/colorbutton.py:35 msgid "Magenta Bachiego" msgstr "" -#: src/ui/colorbutton.py:38 +#: src/ui/colorbutton.py:37 msgid "Breeze of Mist" msgstr "" -#: src/ui/colorbutton.py:39 +#: src/ui/colorbutton.py:38 msgid "Light Grey" msgstr "" -#: src/ui/colorbutton.py:40 +#: src/ui/colorbutton.py:39 msgid "Grey" msgstr "" -#: src/ui/colorbutton.py:46 +#: src/ui/colorbutton.py:45 msgid "transparent" msgstr "" diff --git a/src/ui/bigtext/bigtext.py b/src/ui/bigtext/bigtext.py index b85c736..e9b7b80 100644 --- a/src/ui/bigtext/bigtext.py +++ b/src/ui/bigtext/bigtext.py @@ -442,6 +442,9 @@ class InnerBigText(QWidget): def _update_highlight_selected_text(self): start_byte = min(self.selection_highlight.start_byte, self.selection_highlight.end_byte) end_byte = max(self.selection_highlight.start_byte, self.selection_highlight.end_byte) + + self._update_status_bar(start_byte, end_byte) + if abs(start_byte - end_byte) < 1024: query = self.model.read_range(start_byte, end_byte) if query.find("\n") < 0: @@ -450,6 +453,12 @@ class InnerBigText(QWidget): self.highlight_selected_text.set_query("") + def _update_status_bar(self, start_byte: int, end_byte: int): + bytes_human_readable = humanbytes(end_byte - start_byte) + PluginRegistry.execute("update_status_bar", + _("selected {0} - {1:,.0f}:{2:,.0f}").format(bytes_human_readable, start_byte, + end_byte - 1)) + def _file_changed(self): if self._follow_tail: self.scroll_to_byte(self.model.byte_count())