Show MRU files into menuItems defined by fileStackMax.

49 views
Skip to first unread message

Jérôme LAFORGE

unread,
Sep 22, 2011, 7:40:33 AM9/22/11
to scite-i...@googlegroups.com
Hello,
For me, it's annoying when you change the value of fileStackMax, the menu doesn't take care about this value.
I think that that's helpful when you change this value, that the menuItem adjusts automatically to this value.

I propose you this patch, that should add this feature unfortunately for GTK only :

In the case case, you accept it. I plan to add property to defined this value by configuration (e.g. mruFileSize or another name of your choice).
(If you think that's worth, I can propose you only one patch included property directly)

Jérôme LAFORGE

--
"The box said 'Requires Windows 95, NT, or better,' so I installed Linux."

Jérôme LAFORGE

unread,
Sep 22, 2011, 8:33:01 AM9/22/11
to scite-interest
Please find this new patch that fixes browse index and some typo.
http://pastebin.com/EzawmGQx

Neil Hodgson

unread,
Sep 23, 2011, 9:47:22 PM9/23/11
to scite-i...@googlegroups.com
Jérôme LAFORGE:

> For me, it's annoying when you change the value of fileStackMax, the menu doesn't take care about this value.
> I think that that's helpful when you change this value, that the menuItem adjusts automatically to this value.
> I propose you this patch, that should add this feature unfortunately for GTK only

That code looks too complex and difficult to maintain for what
seems to me to be a minor benefit. The amount of explicit memory
management is particularly unwieldy and may be possible to avoid using
containers from the C++ standard library.

> In the case case, you accept it. I plan to add property to defined this value by configuration (e.g. mruFileSize or another name of your choice).
> (If you think that's worth, I can propose you only one patch included property directly)

I don't really see an extra long MRU menu being useful. Maybe
others want this.

Neil

Jérôme LAFORGE

unread,
Sep 26, 2011, 5:28:15 AM9/26/11
to scite-interest
>    That code looks too complex and difficult to maintain for what
> seems to me to be a minor benefit. The amount of explicit memory
> management is particularly unwieldy and may be possible to avoid using
> containers from the C++ standard library.

Originally, I didn't want modify the design of the code. That's reason
why I implemented this code with explicit memory managment.
So, I changed it, and as you told me I replaced all this code with
containers from the C++ standard library (deque) and I removed all
explicit memory managment.
I hope that this new patch is acceptable for you in term of complexity

>    I don't really see an extra long MRU menu being useful. Maybe
> others want this.

This patch lets users defined the mru size (shorter or longer) via
mru.file.list.size.

Please find the new patch :
http://pastebin.com/jiDnQ9cT

Jérôme

Neil Hodgson

unread,
Oct 1, 2011, 4:10:21 AM10/1/11
to scite-i...@googlegroups.com
Jérôme LAFORGE:

> Originally, I didn't want modify the design of the code. That's reason
> why I implemented this code with explicit memory managment.
> So, I changed it, and as you told me I replaced all this code with
> containers from the C++ standard library (deque) and I removed all
> explicit memory managment.
> I hope that this new patch is acceptable for you in term of complexity

Instead of being simpler, the patch has grown from 164 to 414
lines. I won't be applying it in its current form.

Neil

Jérôme LAFORGE

unread,
Oct 7, 2011, 9:44:18 AM10/7/11
to scite-interest
>    Instead of being simpler, the patch has grown from 164 to 414
> lines. I won't be applying it in its current form.
Sorry for my delayed response. In my previous patch, I added the
managment of the size of mru file.
I remove it into this patch. This patch manages only the mru dynamic
menu without explicit memory.
http://pastebin.com/gX6qCZv7
The patch is now only 237 lines (with majority is due to use of
iterator)

Jérôme

Neil Hodgson

unread,
Oct 9, 2011, 9:19:30 PM10/9/11
to scite-i...@googlegroups.com
Jérôme LAFORGE:

> The patch is now only 237 lines (with majority is due to use of
> iterator)

My suggestion about using standard containers was an attempt to
simplify the original code. If it doesn't help simplify then a
different approach should be used. This feature should not require a
lot of code. If it does then I won't be merging it.

Neil

Jérôme LAFORGE

unread,
Oct 15, 2011, 10:12:21 AM10/15/11
to scite-interest
> If it doesn't help simplify then a
> different approach should be used.

Ok, I'll try to propose a patch that simplifies this part of this
code.
Jérôme

Jérôme LAFORGE

unread,
Oct 16, 2011, 4:55:48 PM10/16/11
to scite-interest
Please find this new patch, where I try to simplify the code :
http://pastebin.com/9MYvnau4

Jérôme

Jérôme LAFORGE

unread,
Oct 20, 2011, 5:11:34 AM10/20/11
to scite-interest
In the case where my previous patch is suitable for you, I propose you
this patch where the user can define the number of mru files and
whether the user wants use submenu for hiding the very long mru files
list. For now, it's just a mock up.
pastebin.com/CvBmY4DV

Jérôme

Jérôme LAFORGE

unread,
Oct 20, 2011, 5:18:05 AM10/20/11
to scite-interest
Sorry, for my previous message. I send the correct url :
http://pastebin.com/CvBmY4DV

Neil Hodgson

unread,
Oct 25, 2011, 2:04:17 AM10/25/11
to scite-i...@googlegroups.com
Jérôme LAFORGE:

> Please find this new patch, where I try to simplify the code :
> http://pastebin.com/9MYvnau4

I see many warnings like:
SciTEGTK.cxx: In member function ‘void SciTEGTK::CreateMenu()’:
SciTEGTK.cxx:3326:36: warning: passing NULL to non-pointer argument 1
of ‘SString::SString(int)’

Neil

Frank Wunderlich

unread,
Oct 27, 2011, 11:40:25 AM10/27/11
to scite-i...@googlegroups.com
J�r�me LAFORGE, 20.10.2011 11:11:

> In the case where my previous patch is suitable for you, I propose you
> this patch where the user can define the number of mru files and
> whether the user wants use submenu for hiding the very long mru files
> list. For now, it's just a mock up.
> pastebin.com/CvBmY4DV
>
> J�r�me
thank you for your work...is it working on gtk+ (linux) also? please
make with submenu...mru-lists direct in file-menu are to
big...especially on small displays (netbooks).

do you use dynamic creation of menus/submenus? maybe its useful to
enahnce the tools-menu like in scite-ru also for gtk+

regards Frank

Jérôme LAFORGE

unread,
Nov 1, 2011, 12:58:41 PM11/1/11
to scite-interest
Neil :
>    I see many warnings like:> SciTEGTK.cxx: In member function ‘void SciTEGTK::CreateMenu()’:> SciTEGTK.cxx:3326:36: warning: passing NULL to non-pointer argument 1> of ‘SString::SString(int)’

I have no warnings. I use gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5).
Do you use some particular environment for having this kind of
warning?

Please find this new patch where replace NULL by empty string ("")
for accelerator and also replace 0 by empty string for item_type.
http://pastebin.com/MAa5dbMD
I hope this patch fix all warning, since my gcc doesn't produce the
warning,

Frank :
> is it working on gtk+ (linux) also?

this patch is only for GTK+ (Linux and compatible operating systems)

> do you use dynamic creation of menus/submenus? maybe its useful to
> enahnce the tools-menu like in scite-ru also for gtk+

Sorry, I don't use scite-ru. I let someone else to integrate this
patch into scite-ru, if useful.

Jérôme

Frank

unread,
Nov 1, 2011, 1:04:21 PM11/1/11
to scite-interest
scite-ru has a patch for dynamic/extended mru-list and also for
dynamic tools-menu.
it will be great if your functions can also be used to build the tools-
menu with submenus.

On 1 Nov., 17:58, Jérôme LAFORGE <jerome.lafo...@gmail.com> wrote:
> Neil :
>
> >    I see many warnings like:> SciTEGTK.cxx: In member function ‘void SciTEGTK::CreateMenu()’:> SciTEGTK.cxx:3326:36: warning: passing NULL to non-pointer argument 1> of ‘SString::SString(int)’
>
> I have no warnings. I use gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5).
> Do you use some particular environment for having this kind of
> warning?
>
> Please find this new patch where replace NULL by empty string ("")
> for accelerator and also replace 0 by empty string for item_type.http://pastebin.com/MAa5dbMD
Reply all
Reply to author
Forward
0 new messages