Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented RenderAppchooserAction #335

Open
wants to merge 3 commits into
base: v5
Choose a base branch
from

Conversation

dalanicolai
Copy link
Contributor

@dalanicolai dalanicolai commented Jan 20, 2019

Link to related issue (if applicable)

Summary of the changes in this PR

This functionality is implemented in the (development version of the) Tracker/docfetcher/locate plugin. First search for a file, then choose 'Open with OTHER application'

I changed the .ui file so that the Gtk.box with id=body can hold three number of item. In this way the appchooserwidget can be added and removed from the body (without destroying the result_box), in a similar way as the item_widgets are added and destroyed in the result_box.

Then I more or less copied and adapted the RenderResultListAction file, to run the show_appchooser method from the new RenderAppchooserAction file.

Finally I added a Try-Exec to test for existence of the appchooser, otherwise the launcher will hang on its first start. If the appchooser exists than it is first removed before the result list is created/rendered.

Finally, the show_apchooser method first removes the item_widgets and subsequently creates and the appshooser widget, which takes a filepath as argument, and launches the file with the chosen application and hides again the UlauncherWindow.

Checklist (see more here)

  • Use dev as the base branch
  • Follow the Python Code Style Guides
  • Write unit tests for your changes when applicable.
  • If your changes alters the behavior or introduce new functionality, please update the documentation accordingly.
  • All tests are passing

Tested environment (distro, desktop environment and their versions)

@dalanicolai
Copy link
Contributor Author

Btw. let me know if and when you accept it, and I am happy to add this feature to the documentation...

@gornostal
Copy link
Member

Hi @dalanicolai

First of all, thank you for contributing to Ulauncher.
At this time we don't accept pull requests because there's an ongoing work on migrating to Python 3.
Once that is finished (don't know when that will happen), I'm going to review the improvement and decide if it's going to be merged.
You might want to keep using your local fork of Ulauncher for now.

I would appreciate if you could attach a screenshot of how that appchooser looks.

Thanks

@friday
Copy link
Member

friday commented Jan 22, 2019

@dalanicolai For someone who claims he's only a beginner programmer you sure are taking on some tough challenges 💪

@dalanicolai
Copy link
Contributor Author

dalanicolai commented Jan 23, 2019 via email

@friday
Copy link
Member

friday commented Jan 23, 2019

Haha thanks. Well maybe I am not fully beginner, but I consider myself
still as a beginner. I only coded a very simple application once in kivy. I
am trying to learn by understanding others people's code. So actually I do
not fully understand what I am doing and why it works.

Well, not fully understanding one's own code may not be a great thing or always appreciated among collaborators 😉 But I like the enthusiasm! It's a good way to learn.

I think you added the screenshots as email attachments though, which doesn't seem to be supported by github. You may have to go to the github thread and attach them. Since we talked on Gitter and I also had a look at the code and tested your extension I'm pretty sure it's the standard app chooser widget:

example-gtk appchooserwidget

I think the "App Chooser Dialog" may be better since it lets you choose any app. Not just the "recommended". And I'd avoid repurposing the Ulauncher window if it can be avoided.

Alternatively, try typing in ~/ to Ulauncher. This lists everything in your home path. You can press enter or alt+enter to open files and folders or copy paths. I think this could be used if:

  • It was possible to trigger this view with custom files. Maybe RenderFileListAction or ExtensionFileItem to be used with RenderResultListAction
  • Adding "Open with ..." to the alt+enter menu here (triggering the app chooser)

@dalanicolai
Copy link
Contributor Author

Hi! It is a while ago since I was here. I actually looked back at this pull request as someone did some nice work on the gnome-tracker extension. And had some question about the appchooser widget.

Anyway, I never noticed @friday comment about the failed screenshots. As I found that the transition to python 3 seems almost finished and I still think the possibility of an appchooser menu would be nice, I decided to comment on this old pull request.

Anyway, I agree with @friday that triggering the appchooser from an 'open with ...' entry in the alt+enter menu would be a nice way to implement it. Also I agree that the app chooser dialog would be a nicer choice than the default widget. he reason I chose this widget is that I could not find a way to implement the app chooser dialog without bugs (the python gtk documentation is rather minimal and the c documentation is still hard for me to understand).

Finally I will upload the working screenshot where additionaly I would like to mention that I have no strong opinion about if it is preferable to re purpose the Ulauncher window, or if the appchooser dialog should be shown in an external window.

Screenshot from 2019-01-23 13-32-46

@gornostal
Copy link
Member

Hi @dalanicolai
I'll get back to this feature once I finish with ones that are higher priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants