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

fixs gtk+ port mainloop on dbus service #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/gnomeshellsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import subprocess

import dbus.service
from gi.repository import GLib
from zim.main import NotebookCommand
from zim.plugins import PluginClass
from zim.search import SearchSelection
Expand Down Expand Up @@ -95,19 +96,16 @@ def __init__(self, notebook=None, search_all=True):
self.search_all = search_all

def main(self):
import gtk

gtk.main()
GLib.MainLoop().run()

def quit(self):
Copy link
Author

@gutierri gutierri Jul 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This here (quit method) apparently is not used and is not part of dbus Object class.

import gtk

gtk.main_quit()
GLib.MainLoop().quit()

@dbus.service.method(dbus_interface=SEARCH_IFACE,
in_signature='as', out_signature='as',
async_callbacks=('reply_handler', 'error_handler'))
def GetInitialResultSet(self, terms, reply_handler, error_handler):
print('->', terms)
"""Handles the initial search."""
results = self._get_search_results(terms)
reply_handler(results)
Expand Down