#55 √ resolved
Adam Boduch

FileManager Service API

Reported by Adam Boduch | June 2nd, 2010 @ 02:05 PM

Hi,

I have a few suggestions to improve the FileManager service API, mainly for the benefit of plugins:

Make the show_status_window() function a FileManager method. This is a useful function and it would be nice to be able to access in through the service created by inject() rather than have to import it separately.

FileManager._open_dialog() is also useful for plugins. Maybe rename it to open_dialog() so it doesn't seem like it shouldn't be used by plugins? (unless there is some reason it shouldn't be used)

What exactly is the difference between new and new from template? That is, what is the effect of "self.filename = None"?

Thanks!

Adam

Comments and changes to this ticket

  • Arjan Molenaar

    Arjan Molenaar June 2nd, 2010 @ 07:16 PM

    Maybe we need some base class to put this stuff in?

    The difference between new and new_from_template() is that the last one basically opens a file, but empties the filename field, so if you save, you'll get the save as behaviour (like with new).

  • Adam Boduch

    Adam Boduch June 3rd, 2010 @ 12:15 PM

    That makes sense about the new_from_template().

    A base class would probably make sense for some of the more generic file operations. I guess my main question would be what is the preferred method for using Gaphor internals by plugins? Should everything be accessible through inject()ing services or is it OK to import things directly, a mix of both?

    I personally like the inject() approach as it is clearer what should/can be used by a plugin.

    Thoughts?

  • Arjan Molenaar

    Arjan Molenaar June 3rd, 2010 @ 08:05 PM

    Wherever possible services should be inject()'ed. If that's not possible then ther eis either a good case for not using injection, or Gaphor should be fixed in providing it as a service.

    A good example I think is the gui_manager. It keeps references to the main window and other windows that can be used in the application.

  • Adam Boduch

    Adam Boduch June 4th, 2010 @ 02:43 PM

    That makes sense. Thanks.

  • Arjan Molenaar

    Arjan Molenaar May 9th, 2011 @ 07:51 PM

    • → State changed from “new” to “resolved”

    I implemented your file manager changes.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket