Author Topic: File Open Dialog Filter  (Read 4166 times)

Stevo

  • Guest
File Open Dialog Filter
« on: January 20, 2006, 05:17:23 am »
Hi,

While playing around with the Python Lexer, ive been wondering about the file open dialog.

Currently the file open dialog has a bunch of hard coded filters, and one called "All Known Files".

The Lexers specify the masks of files they recognise.  I was wondering if it made sense for the File Open dialog, instead of having a hard coded filter to auto generate its filter from known file types of the associated lexers?  It seems logical to me if C:B can syntax highlight a file, that it should be a known type.

I also think this should carry to the "Add Files" process, where a bunch of files are automatically selected for inclusion, i would think again if C::B knows about a file type, its not unreasonable for it to automatically select those file types when adding multiple files recursively.

Now its possible that the Lexer XML file might need more info in it for this to happen, and you would probably want to centralise the information so it could be used consistently in multiple places, but the question is, what is the general view of this?

Stevo

takeshimiya

  • Guest
Re: File Open Dialog Filter
« Reply #1 on: January 20, 2006, 05:22:23 am »
You're right, and in the same File Open Dialog, C::B should account the extensions provided by MIME plugins (ie. *.xrc for wxSmith, etc).

Now that we're talking about that, sometimes I want to open an XRC file, but I want to hand edit, but it's automatically open with wxSmith. Is there any way of make that selectable? Either from wxSmith side (by having an menu with a "View XRC code" which will show the straight xml), or from C::B side.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: File Open Dialog Filter
« Reply #2 on: January 20, 2006, 08:55:27 am »
Now that we're talking about that, sometimes I want to open an XRC file, but I want to hand edit, but it's automatically open with wxSmith. Is there any way of make that selectable? Either from wxSmith side (by having an menu with a "View XRC code" which will show the straight xml), or from C::B side.

Right-click the file in the project tree and select "Open with->Internal editor" :)
Be patient!
This bug will be fixed soon...

takeshimiya

  • Guest
Re: File Open Dialog Filter
« Reply #3 on: January 20, 2006, 11:00:29 am »
Thanks, I really missed that. :D

The first time the dialog "What do you want to do with this file" pops up, however, doesn't appears when wxSmith autoregistered a mime type.

I think (maybe) the first time you open a file (eg. XRC), there should be a question asking:
1) Open with wxSmith
2) View as xml (Open with the internal editor)
3) Open with wxAnotherPluginLikeSmithWhoLikesToFightForMIMEs
4) Open with an external app

That way, the user can decide what to do (imagine various plugins fighting for a mime :P).