Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » [PROPOSAL] Configurable web search menu for TheIDE
[PROPOSAL] Configurable web search menu for TheIDE [message #55394] Fri, 06 November 2020 11:34 Go to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hi,

I've been using TheIDE with this configurable web search menu for some time and I find it very useful, so I thought it might be a good idea to propose it for the trunk.

A direct search on web sites sometimes yield better results than using a generic search engine such as google. E.g. just search for "private" on Google and CppReference and see the results. Smile

What I propose is:
* Adding an optional sub-menu to TheIDE's context menu. This menu will become visible only if a search provider is set.
* Adding a simple search provider setup tab in the setting menu.

- This proposal does not change Google and Upp website search entries, and leave them intact (as default, hard-coded options).

Screenshots:

https://i.imgur.com/Mazz8oG.png

https://i.imgur.com/yqABDpX.png


What do you think?


Best regards,
Oblivion






[Updated on: Fri, 06 November 2020 11:38]

Report message to a moderator

Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55396 is a reply to message #55394] Fri, 06 November 2020 15:14 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Seems to be a good idea to me.
Even a better one if it's already developped Wink
Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55397 is a reply to message #55396] Fri, 06 November 2020 16:06 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Didier,

Quote:
Seems to be a good idea to me.
Even a better one if it's already developped


It is already developed, yes. Smile To be honest, it is a simple string map manager, nothing more.
Easy to maintain.

Of course, the setup dialog may need a bit polishing.

If Mirek greenlight's this, I will send in the patches for review and modification.

Best regards,
Oblivion


[Updated on: Fri, 06 November 2020 16:07]

Report message to a moderator

Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55398 is a reply to message #55397] Sat, 07 November 2020 05:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
We might want to have means to define "default" search engine for Alt+G....
Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55400 is a reply to message #55398] Sat, 07 November 2020 09:23 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Quote:
We might want to have means to define "default" search engine for Alt+G....


OK, I'll add that to the mechanism.

Still I think we shouldn'T add Google and Upp-website on the configurable list. They should be hard-coded.

And how should we handle configuration?

Currently I use binary serialization, but it is far from ideal.
For trunk, I suggest we use a separate file ("ide.websearch" or "ide.search") with JSON or other format

Best regards,
Oblivion


[Updated on: Sat, 07 November 2020 09:25]

Report message to a moderator

Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55423 is a reply to message #55398] Mon, 09 November 2020 21:36 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Mirek,

Please find attached the patch to be reviewed for the proposed online search engines support.

This patch:

+ Adds a search providers manager tab to settings dialog.
+ Adds the ability to set a default search provider.
+ Adds the ability to sort the search providers menu.
+ Uses a separate, JSON formatted config file ("ide.search") to store the search configuration.


If you think it needs improvements, let me know.

Best regards,
Oblivion


[Updated on: Mon, 09 November 2020 21:36]

Report message to a moderator

Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55426 is a reply to message #55398] Tue, 10 November 2020 11:08 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Mirek,

I improved and polished the patch.

Now the search providers menu will be hidden if the search providers list has a single entry that is set as the defeault provider.

Best regards,
Oblivion



[Updated on: Tue, 10 November 2020 11:17]

Report message to a moderator

Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55427 is a reply to message #55400] Tue, 10 November 2020 11:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Oblivion wrote on Sat, 07 November 2020 09:23
Quote:
We might want to have means to define "default" search engine for Alt+G....


Still I think we shouldn'T add Google and Upp-website on the configurable list. They should be hard-coded.



Actually, if U++ ever started to be used more widely, nice possible source of funding there... Smile

Mirek
Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55445 is a reply to message #55427] Wed, 11 November 2020 10:15 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Quote:
Actually, if U++ ever started to be used more widely, nice possible source of funding there...


Fingers crossed. Smile

Anyway, the above patch adds the ability to set ALT + G and default search provider.
In time if Upp gains more audience, we can simply ship a selected set of default entries too (Json file compiled-in as a binary resource, maybe). For now, the hard-coded default is Google but it can be changed by users, using the web search manager or simply by editing the ide.search file.

The real benefit of this configurable search engine is that it allows users to do something like this:

index.php?t=getfile&id=6278&private=0

Smile

Best regards,
Oblivion


[Updated on: Wed, 11 November 2020 10:17]

Report message to a moderator

Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55446 is a reply to message #55445] Wed, 11 November 2020 14:41 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

I would personally simplify editor menu. Too many options there is not good option and might be misleading. So I opt for moving "Search on Google" and "Search on the official site.." to "Search on menu" (This entry shouldn't have .., because it doesn't spawn any external dialog or redirect to browser):
Search on ->
   Google..
   Official site..
   Separator /* Not hard coded engines */
   CppReference..
   DuckDuckGo..
   ...

Thanks to that editor menu will not be overload with options.

Also "ide.search" nice idea for external modification, however we should use regular TheIDE serialization procedures (binary) and bump settings version. We should keep all TheIDE options in standardize way. If we want to keep it in external file that is easy to modify by the user then let's do it for all options. Partial solution will always increase fragmentation.

I like the idea of supporting more sources. With the solution that we will have the option to specify default engine only we will lose that ability. Also, sites like CppReference is extremely useful for the learning purpose (C++ and standard library).

If we will gain popularity - sure we could try selling default option here. Maybe we should ask DuckDuckGo if they want to buy it Smile

Klugier


U++ - one framework to rule them all.

[Updated on: Wed, 11 November 2020 16:12]

Report message to a moderator

Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55447 is a reply to message #55446] Wed, 11 November 2020 16:22 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Klugier,

Quote:
would personally simplify editor menu. Too many options there is not good option and might be misleading. So I opt for moving "Search on Google" and "Search on the official site.." to "Search on menu"


OK.


Quote:
however we should use regular TheIDE serialization procedures (binary) and bump settings version


I was hesitant to add a Serialize method (not to disrupt TheIDE's config settings), but this sounds OK to me. Still, I'd prefer an external file in human-readble form (Json seems very good to me. besides it can allow us to easily change/add new stuff if need be).

I'll upload a patch with the changes you've asked, later tonight.

It is up to Mirek to decide.

p.s: Speaking of consistency, I think TheIDE's toolbar should have an Icon for "Settings" menu entry.

Best regards,
Oblivion


[Updated on: Wed, 11 November 2020 16:25]

Report message to a moderator

Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55454 is a reply to message #55447] Thu, 12 November 2020 20:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Oblivion wrote on Wed, 11 November 2020 16:22
Hello Klugier,

Quote:
would personally simplify editor menu. Too many options there is not good option and might be misleading. So I opt for moving "Search on Google" and "Search on the official site.." to "Search on menu"


OK.


Quote:
however we should use regular TheIDE serialization procedures (binary) and bump settings version


I was hesitant to add a Serialize method (not to disrupt TheIDE's config settings), but this sounds OK to me. Still, I'd prefer an external file in human-readble form (Json seems very good to me. besides it can allow us to easily change/add new stuff if need be).


Agreed. JSON is a bit off (we mostly have key=value pairs), but it is ok.

Quote:

p.s: Speaking of consistency, I think TheIDE's toolbar should have an Icon for "Settings" menu entry.


Do not quite agree - if it is settings, it should not be needed that often.

Mirek
Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55455 is a reply to message #55447] Thu, 12 November 2020 20:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Oblivion wrote on Wed, 11 November 2020 16:22

I'll upload a patch with the changes you've asked, later tonight.


Ops, I have just patched... I will take it from here.

Mirek
Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55456 is a reply to message #55455] Thu, 12 November 2020 20:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I am sorry but the code feels a bit overengineered. There will be simplifications Smile

That said, do the phrase placeholder need to be so complicated? Would not simple '@' be enough?

More importantly, we need a default list.

Mirek
Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55457 is a reply to message #55456] Thu, 12 November 2020 21:02 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Quote:
do the phrase placeholder need to be so complicated? Would not simple '@' be enough?


Sure, @ would do just fine.
I was following KDE/Konqueror's style there. Gnome web uses "%s", for example.

Quote:

I am sorry but the code feels a bit overengineered. There will be simplifications


By all means, go on. Smile

Quote:
More importantly, we need a default list.


Yes, I was going to propose that too, but apparently I am a bit late.

Still I think, at least Google, Upp, CppReference, StackOverflow [+Github] could be in the list.
Thanks.


Best regards,
Oblivion


[Updated on: Thu, 12 November 2020 21:04]

Report message to a moderator

Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55471 is a reply to message #55457] Sat, 14 November 2020 13:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks for comments even if the issue is not yet finished.

WRT ReadIcon... Well, I have found the ReadIcon code lacking, but that was before the commit, so should have been fixed there. BTW, the issue with cppreference is that they do not return correct .ico format, they return regular .png instead with .ico extension Smile And ReadIcon crashed on png. But it does not anymore when I am testing. Can you check this one?

GUI_APP_MAIN
{
	String icon = HttpRequest("https://en.cppreference.com/favicon.ico").Execute();
	for(const Image& m : ReadIcon(icon))
		DDUMP(m.GetSize());
}


If you have the actual ReadIcon version and it is still crashing/freezing, can you send me a backtrace?

As for the default list, StackOverflow has captcha, not sure we want that...

Mirek
Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55472 is a reply to message #55471] Sat, 14 November 2020 13:58 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Mirek,


Quote:
ReadIcon crashed on png. But it does not anymore when I am testing. Can you check this one?


I've just synced my copy of trunk and recompiled TheIDE (on Linux, in both DEBUG and RELEASE modes). The issue seems to be resolved. The search manager downloaded and displayed the icons correctly. Thanks!


By the way, some more observations on the new code:

1. It does not discard empty entries in json file (while reading). Empty entries can show up in both menu and in the search manager. The original patch prevented this. A cosmetics issue really, but looks ugly when it happens.

2. Default Google search is not available when the list has at least one entry. (The original patch prevented this too by allowing the user to unset the default engine) The only way to reset the default search engine to Google is by deleting the entire list.

3. ArrayCtrl has ScrollBar visible. Shouldn't it be AutoHideScrollbar() ?

4. ArrayCtrl has visible vertical and horizontal grids, which seems unnecessary as it uses even/odd line coloring already.

As for the StackOverflow issue,

I have now checked and yes, you are right. We should find anothe provider.

I'd recommend Microsoft Docs (for at least Windows builds)



Thank you for your efforts.

Best regards,
Oblivion


[Updated on: Sat, 14 November 2020 14:05]

Report message to a moderator

Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55476 is a reply to message #55394] Sat, 14 November 2020 14:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I am finished for now. Please check.
Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55477 is a reply to message #55472] Sat, 14 November 2020 14:51 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Oblivion wrote on Sat, 14 November 2020 13:58
Hello Mirek,


Quote:
ReadIcon crashed on png. But it does not anymore when I am testing. Can you check this one?


I've just synced my copy of trunk and recompiled TheIDE (on Linux, in both DEBUG and RELEASE modes). The issue seems to be resolved. The search manager downloaded and displayed the icons correctly. Thanks!


By the way, some more observations on the new code:

1. It does not discard empty entries in json file (while reading). Empty entries can show up in both menu and in the search manager. The
original patch prevented this. A cosmetics issue really, but looks ugly when it happens.


I guess the only way how this can happen is if user manually edits .json. Is it worth fixing?

Quote:

2. Default Google search is not available when the list has at least one entry. (The original patch prevented this too by allowing the user to unset the default engine) The only way to reset the default search engine to Google is by deleting the entire list.


Or set first entry as google... I now expect to that "in code" default search only be active if the list is missing.

Quote:

4. ArrayCtrl has visible vertical and horizontal grids, which seems unnecessary as it uses even/odd line coloring already.


I do not like that when list has columns.

Quote:

Thank you for your efforts.


Ah that was your initiative! Good job, this is a nice feature!

Mirek
Re: [PROPOSAL] Configurable web search menu for TheIDE [message #55478 is a reply to message #55477] Sat, 14 November 2020 15:27 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Everything is up and working well here.

Quote:
I guess the only way how this can happen is if user manually edits .json. Is it worth fixing?


From a personal POV, I don't really care. I do not edit a config file manually unless I necessarily have to. But I know and work with a plenty of *NIX users who almost "live" in those files and who consider using a GUI for it a heresy. Smile

From a QA perspective, it'll give a better impression on a production-level code.

Still, it is not really a must. You decide.

Quote:
I do not like that when list has columns.


OK, I've noted down this too (for possible future patches). Smile


Again, thank you and have a nice weekend (or what's left of it).

Best regards,
Oblivion


[Updated on: Sat, 14 November 2020 15:33]

Report message to a moderator

Previous Topic: Displaying screenshots in Readme (UppHub)
Next Topic: Import external library - Include files depending on OS
Goto Forum:
  


Current Time: Thu Mar 28 14:12:21 CET 2024

Total time taken to generate the page: 0.01580 seconds