-
Notifications
You must be signed in to change notification settings - Fork 189
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
base: v5
Are you sure you want to change the base?
Conversation
Btw. let me know if and when you accept it, and I am happy to add this feature to the documentation... |
Hi @dalanicolai First of all, thank you for contributing to Ulauncher. I would appreciate if you could attach a screenshot of how that appchooser looks. Thanks |
@dalanicolai For someone who claims he's only a beginner programmer you sure are taking on some tough challenges 💪 |
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. But by just using
some logic and copying your code I managed to get it work (the "go to
implementation" functionality in some editors really help here). But it
took me a frustrating lot of time (especially because of lack of
understandable, for beginners, documentation about gtk). Anyway, it is just
some simple extra functionality but I guess it will be appreciated by some
other people writing plugins. I think this piece of code should work also
with python3 but I understand your considerations, no problem. I attached
two screenshots. The first shows the 'choose action' menu after some file
is selected, which contains the option to 'open with other application'.
When this option is selected the gtk appchooserwidget is shown as shown in
the second screenshot. Actually the appchooser functionality already works
with the gnome-tracker-extension, but it works by running an external
apchooserdialog from a python script. If I knew that I could 'chmod +x' it
from within my plugin I would not have spent time to integrate the widget
with ulauncher. But I did not know this until "friday' suggested this to me
on gitter. At that time I already integrated the widget into Ulauncher.
Anyway, I think the work was worth it. Thanks for Ulauncher and good luck
with the python3 integration.
Regards
[image: Screenshot from 2019-01-23 13-32-40.png]
[image: Screenshot from 2019-01-23 13-32-46.png]
,
Daniel
…On Tue, 22 Jan 2019 at 21:49, friday ***@***.***> wrote:
@dalanicolai <https://github.com/dalanicolai> For someone who claims he's
only a beginner programmer you sure are taking on some tough challenges 💪
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#335 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARk3X48jzVl-pXLoqg5MuLZJpULbPwkGks5vF3k8gaJpZM4aJaWt>
.
|
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: 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
|
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. |
Hi @dalanicolai |
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)
dev
as the base branchTested environment (distro, desktop environment and their versions)