News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Editor's right-click menu can open file's containing folder.

Started by codeman, July 24, 2010, 10:07:53 PM

Previous topic - Next topic

oBFusCATed

codeman: You can use this:


#if MACRO1
#elif MACRO2
#else
#endif


It will make the code more readable :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

codeman

Quote from: jens on July 26, 2010, 06:59:59 AM
I would prefer not to hardcode the open-commands, but making them configurable.
The configuration-defaults should be platform specific, so the user can change the default command to his/her needs.
It would be a little bit like "Terminal to launch  console apps", but for all platforms and not only for non-windows platforms.

Should not be too hard to implement.

Ok what about this: In ToolsManager::LoadTools(), we currently do:
void ToolsManager::LoadTools()
{
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("tools"));
    wxArrayString list = cfg->EnumerateSubPaths(_("/"));
    for (unsigned int i = 0; i < list.GetCount(); ++i)
    {
...


If the list of saved tools returns zero, then we could create a default tool to open the containing folder. For windows this would by default point to explorer, and for linux it would be xdg-open, but then you could change the tool to whatever you wanted. This tool would then be saved and loaded up as normal the next time round.

Only issue is how do we allow that tool to appear in the context menu? - that could be a new custom tool option.

What do you think?

MortenMacFly

Quote from: codeman on July 27, 2010, 12:01:26 AM
What do you think?
I think what Jens means is a configuration option like in Settings -> Environment -> General settings -> "Shell to run commands in" or "Terminal to launch console programs".

If there would be another option like "explorer to launch" which can be configured (with a checkbox to "use the file name", too for Linux) and the text box is pre-configured with the platform specific default explorer (as you did now) that would be fine and most flexible.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

ptDev

I like the idea of having the option to call the system's file browser from "Tools". It makes sense to me. In fact, under Windows I added explorer to my tools, and passed arguments to make it open the directory of the active project by default.

It would be nice if a special, separated, menu option to browse the project directory would be present under "Tools" in addition to the context menu of the project manager.

codeman

Quote from: ptDev on July 27, 2010, 10:08:21 AM
I like the idea of having the option to call the system's file browser from "Tools". It makes sense to me. In fact, under Windows I added explorer to my tools, and passed arguments to make it open the directory of the active project by default.

It would be nice if a special, separated, menu option to browse the project directory would be present under "Tools" in addition to the context menu of the project manager.

This is my current thinking too. The "Open containing folder" feature doesnt need its own dedicated setting field, as Morten suggested. All the functionality to do it is already available in the custom Tools menu. The correct way to do this would be to create default tools for the different platforms, and to allow cusomizing tools to be accessible from the context menu.

Maybe my code segment was not the correct way of creating pre-defined custom tools, but the idea is still sound.

MortenMacFly

Quote from: codeman on July 27, 2010, 09:43:16 PM
This is my current thinking too. The "Open containing folder" feature doesnt need its own dedicated setting field, as Morten suggested. All the functionality to do it is already available in the custom Tools menu. The correct way to do this would be to create default tools for the different platforms, and to allow cusomizing tools to be accessible from the context menu.
I disagree. Assume you have a project with sub-folders. You can browse to any folder from the project managment pane if you attach the option there. However, from the tools menu you don-t have macros available to tell you the path to browse to. All you can do is e.g. open an Explorer in the path of you project or alike. But not in any sub-path. Try yourself or proof me wrong.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mariocup

Hi,

I think we should integrate another option. Since the Filemanager and Powershell plugin will be integrated in Code::Blocks it would make sense to have also a context menu like: Open in Filemanager. This would work under windows and linux and it is more convenient to browse within the Filemanager.

What do you think about?

MortenMacFly

Quote from: mariocup on July 28, 2010, 07:51:23 AM
What do you think about?
True. However, you might really want to browse with the explorer if you want to use Explorer shell extensions like TortoiseSVN or alike (as an example on Windows).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Loaden

There are too many options in "General setting" panel.
Why not instead by wxAuiNotebook?

MortenMacFly

Quote from: Loaden on October 01, 2010, 08:41:35 AM
Why not instead by wxAuiNotebook?
Probably splitting into another category would make more sense.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]