<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<div>Hi again Sylvain,<br></div><div dir="auto">I don't fully get what you need, my only advice is to avoid glade, IMO it sucks so bad that I prefer to hand edit ui files. Maybe you already know, but worth mentioning is Gtk Inspector[1], it is super helpful to understand how the UI is structured and it allows live editing of widgets attributes.<br></div><div dir="auto"><br></div><div dir="auto">1 - <a href="https://wiki.gnome.org/action/show/Projects/GTK/Inspector">https://wiki.gnome.org/action/show/Projects/GTK/Inspector</a><br></div><div><br></div><div>Cheers,<br></div><div>Andre Miranda<br></div><div><br></div><div>Oct 1, 2021, 03:28 by sylvain@opensource-expert.com:<br></div><blockquote class="tutanota_quote" style="border-left: 1px solid #93A3B8; padding-left: 10px; margin-left: 5px;"><div class=""><div>Hi Andre,<br></div><div> <br></div><div> Thanks for your reply.<br></div><div> <br></div><div> I'm not at all skilled for GUI yet.<br></div><div> <br></div><div> As I was mostly hacking the history.c I met max-menu-items soon
enough, and it was my bound to keep the behavior of rotating item
it the history. So I reused this limit to set the size of my
indexes too. Remember that I don't save item to disk (which is
still available of course) so I disable it via the visual
settings GUI.<br></div><div> <br></div><div> <br></div><blockquote type="cite">max-texts-in-history that I think is about
the number of items not bytes.<br></blockquote><div>Yes max-texts-in-history is in fact the total length of items the
history in memory (items size in bytes doesn't matter), where the
list was truncated in _clipman_history_add_item().<br></div><div> This was including image too, image are counted as part to the
max-texts-in-history.<br></div><div> <br></div><div> I figured this one correctly, and I refactored all that code with
my new data structure (double linked list + indexes).<br></div><div> With my new understanding of history save, I realize now, that the
truncate was to handle resizing (in memory). I did it differently
because of the indexes.<br></div><div> That's why I want to play with the history size value:
max-texts-in-history<br></div><div> <br></div><div> Now that I'm testing to enlarge and shrink my new implementation
of the history in memory, it confuses me because the visual
settings in clipman 1.6 history tab, is all linked to the
"Remember history" switch. Which is not what the code do with most
of the values in the history tab:<br></div><div> <br></div><div> - Reorder history items<br></div><div> - Reverse history order<br></div><div> - Ignore mouses selection<br></div><div> - Size of the history:<br></div><div> <br></div><div> Are all used at runtime with or without saving the history to the
disk, at least in history.c.<br></div><div> <br></div><div> So may be my question becomes:<br></div><div> <br></div><div> How do I break the GUI link of the "Remember history" switch and
the greyed of gtk items on the history tab?<br></div><div> I would like to extract "Size of the history:" from the greyed
behavior.<br></div><div> <br></div><div> I saw that settings-dialog.ui was edited by glade, so I installed
glade + ui related stuff, I opened the .ui file and find the
history tab.<br></div><div> I need to learn glade I think before, because I'm unable to insert
an new gtkblock to just hold "Size of the history:" outside of the
actual bloc.<br></div><div> <br></div><div> <img alt="" src="cid:part1.FD3FEBE0.769B178D@opensource-expert.com" class="" width="425" height="257" border="1"><br></div><div> <br></div><div> In the mean time in order to test my code on resize I will add an
new dbus method for that, because I handle that part pretty well
now. It wont skill up my GUI knowledge but would be faster to put
in place for me. 😉<br></div><div> <br></div><div> I will also deep into the on disk history saving code to figure
out how its behavior depend of such settings.<br></div><div> <br></div><div> Regards,<br></div><div> Sylvain.<br></div><div> <br></div><div> On 01/10/2021 00:11, <a href="mailto:andre@andreldm.com" class="" rel="noopener noreferrer" target="_blank">andre@andreldm.com</a> wrote:<br></div></div><blockquote type="cite"><div>Hi Sylvain,<br></div><div dir="auto">As the original author doesn't hang around
anymore, I think Simon is the current maintainer, in any case
the source code is the best reference.<br></div><div><br></div><div dir="auto">I think your understanding of max-menu-items is
correct, just to be sure, only max-texts-in-history that I think
is about the number of items not bytes. Also notice in
_clipman_history_add_item that it is used to truncated the
in-memory list of all items, including images. With regards to
writing to disk, yes the items history is persisted/loaded if
"save-on-quit" is enabled.<br></div><div dir="auto"><br></div><div dir="auto">Well, I don't know how this impacts your
implementation, but I hope this helps.<br></div><div dir="auto"><br></div><div>Cheers,<br></div><div>Andre Miranda<br></div><div><br></div><div>Sep 29, 2021, 03:33 by <a href="mailto:sylvain@opensource-expert.com" class="" rel="noopener noreferrer" target="_blank">sylvain@opensource-expert.com</a>:<br></div><blockquote style="border-left: 1px solid #93A3B8; padding-left: 10px; margin-left: 5px;" class="tutanota_quote"><div>Hi,<br></div><div><br></div><div>I'm trying to figure out the purpose of max-menu-items vs
the max-texts-in-history?<br></div><div><br></div><div>I'm modifying the code of clipman to handle Secure Item,
this fork <a target="_blank" rel="noopener noreferrer" href="https://gitlab.xfce.org/Sylvain/xfce4-clipman-plugin">https://gitlab.xfce.org/Sylvain/xfce4-clipman-plugin</a><br></div><div>I'm planing to submit a merge request for future version
of clipman, as my use of the PoC is satisfying.<br></div><div><br></div><div>So during my journey in the code, it brings me to
extensively modifying the way items are stored in memory,
still not altering the existing behavior.<br></div><div>I disabled saving history to disk which is obviously not
compatible with secret non-disclosure.<br></div><div><br></div><div>So the memory data structure in my fork has been changed
to a GList double linked list + I'm crafting a circular
Indexes array to handle my <br></div><div>newly introduced index / ID on the stored item. So they
can be delete any item from history with an external cli by
index: ./clipman_cli.sh del 12<br></div><div><br></div><div>The goal here was to avoid secret disclosure.<br></div><div><br></div><div>I decided to keep indexes in a circular buffer of the same
size of the history (max-texts-in-history).<br></div><div>The indexes are kept to low ID values because I use them
in the preview of Secure Item: "🔐 SECURE %2d *********",
item->id<br></div><div>My history size in memory is generally of 40 or 50 items,
and I generally handle at most 4 or 5 Secure Item in the
history at the same time.<br></div><div>Some Secure Item are ephemeral so are going out quite
quickly. Keeping ID low also helps human to figure out which
secret is the one hidden in the history.<br></div><div> <br></div><div>I'm actually finalizing my circular buffer code and
handling history size change enlarge / shrink the history.<br></div><div><br></div><div>But I'm discovering the distinct behavior or those two max
values: max-texts-in-history / max-menu-items<br></div><div><br></div><div>To what I understand:<br></div><div><br></div><ul><li>max-menu-items is a visual limitation in the popup menu<br></li><li>max-texts-in-history is the actual history size in memory
(may be also on disk, I didn't explore this part, as it was
not involved in my changes)<br></li></ul><div><br></div><div>in clipman 1.6 the max-texts-in-history is set with this
visual interface:<br></div><div><br></div><div><img src="cid:part2.D480F5A9.FC497D1B@opensource-expert.com" class="tutanota-placeholder" alt=""><br></div><div><br></div><div>Which is greyed as I disabled it in my use case.<br></div><div><br></div><div>So what is exactly the purpose of max-texts-in-history? <br></div><div>Should I use this value for my in memory history size or
should I use a different size matching max-menu-items?<br></div><div><br></div><div>Regards,<br></div><div>Sylvain.<br></div></blockquote></blockquote><pre cols="72" class="">--
Sylvain Viart - GNU/Linux Sysadmin/Developer/DevOps - France<br></pre></blockquote><div dir="auto"><br></div> </body>
</html>