Philipp Hörist pushed to branch master at gajim / gajim

Commits:
b26ba9aa by Philipp Hörist at 2018-02-13T19:25:01+01:00
Port show-next-pending-event from gajim-remote

Delete some already ported methods

- - - - -


4 changed files:

- gajim/app_actions.py
- gajim/gajim.py
- gajim/gajim_remote.py
- gajim/remote_control.py


Changes:

=====================================
gajim/app_actions.py
=====================================
--- a/gajim/app_actions.py
+++ b/gajim/app_actions.py
@@ -286,3 +286,13 @@ class AppActions():
             win.present()
         else:
            app.interface.create_ipython_window()
+
+    def show_next_pending_event(self, action, param):
+        """
+        Show the window(s) with next pending event in tabbed/group chats
+        """
+        if app.events.get_nb_events():
+            account, jid, event = app.events.get_first_systray_event()
+            if not event:
+                return
+            app.interface.handle_event(account, jid, event.type_)


=====================================
gajim/gajim.py
=====================================
--- a/gajim/gajim.py
+++ b/gajim/gajim.py
@@ -96,7 +96,10 @@ class GajimApplication(Gtk.Application):
                              _('Show all warnings'))
         self.add_main_option('ipython', ord('i'), GLib.OptionFlags.NONE,
                              GLib.OptionArg.NONE,
-                             _('open ipython shell'))
+                             _('Open IPython shell'))
+        self.add_main_option('show-next-pending-event', 0, 
GLib.OptionFlags.NONE,
+                             GLib.OptionArg.NONE,
+                             _('Pops up a window with the next pending event'))
 
         self.connect('handle-local-options', self._handle_local_options)
         self.connect('command-line', self._handle_remote_options)
@@ -291,9 +294,14 @@ class GajimApplication(Gtk.Application):
         # Parse all options that should be executed on a remote instance
         options = command_line.get_options_dict()
 
-        if options.contains('ipython'):
-            self.activate_action('ipython')
-            return 0
+        remote_commands = ['ipython',
+                           'show-next-pending-event',
+                          ]
+
+        for cmd in remote_commands:
+            if options.contains(cmd):
+                self.activate_action(cmd)
+                return 0
 
         uri = self._parse_uris(command_line)
         if uri is not None:
@@ -415,6 +423,7 @@ class GajimApplication(Gtk.Application):
             ('about', action.on_about),
             ('faq', action.on_faq),
             ('ipython', action.toggle_ipython),
+            ('show-next-pending-event', action.show_next_pending_event),
         ]
 
         act = Gio.SimpleAction.new('add-contact', GLib.VariantType.new('s'))


=====================================
gajim/gajim_remote.py
=====================================
--- a/gajim/gajim_remote.py
+++ b/gajim/gajim_remote.py
@@ -85,14 +85,6 @@ class GajimRemote:
                                         _('show help on command'), False)
                                 ]
                         ],
-                'toggle_roster_appearance': [
-                                _('Shows or hides the roster window'),
-                                []
-                        ],
-                'show_next_pending_event': [
-                                _('Pops up a window with the next pending 
event'),
-                                []
-                        ],
                 'list_contacts': [
                                 _('Lists all contacts in roster, one for each 
line'),
                                 [
@@ -257,10 +249,6 @@ class GajimRemote:
                                 _('Check if Gajim is running'),
                                 []
                         ],
-                'toggle_ipython': [
-                                _('Shows or hides the ipython window'),
-                                []
-                        ],
 
                 }
 


=====================================
gajim/remote_control.py
=====================================
--- a/gajim/remote_control.py
+++ b/gajim/remote_control.py
@@ -646,50 +646,6 @@ class SignalObject(dbus.service.Object):
                         result.append(item)
         return result
 
-    @dbus.service.method(INTERFACE, in_signature='', out_signature='')
-    def toggle_roster_appearance(self):
-        """
-        Show/hide the roster window
-        """
-        win = app.interface.roster.window
-        if win.get_property('visible'):
-            GLib.idle_add(win.hide)
-        else:
-            win.present()
-            # preserve the 'steal focus preservation'
-            if self._is_first():
-                win.window.present()
-            else:
-                win.window.present_with_time(int(time()))
-
-    @dbus.service.method(INTERFACE, in_signature='', out_signature='')
-    def show_roster(self):
-        """
-        Show the roster window
-        """
-        win = app.interface.roster.window
-        win.present()
-        # preserve the 'steal focus preservation'
-        if self._is_first():
-            win.window.present()
-        else:
-            win.window.present_with_time(int(time()))
-
-    @dbus.service.method(INTERFACE, in_signature='', out_signature='')
-    def toggle_ipython(self):
-        """
-        Show/hide the ipython window
-        """
-        win = app.ipython_window
-        if win:
-            if win.window.is_visible():
-                GLib.idle_add(win.hide)
-            else:
-                win.show_all()
-                win.present()
-        else:
-            app.interface.create_ipython_window()
-
     @dbus.service.method(INTERFACE, in_signature='', out_signature='a{ss}')
     def prefs_list(self):
         prefs_dict = DBUS_DICT_SS()



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/b26ba9aa67136a93e03d9bbcb20bb937bcfcee88

---
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/b26ba9aa67136a93e03d9bbcb20bb937bcfcee88
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to