Add --start-chat command
This commit is contained in:
parent
c5de08d45f
commit
618b0b87c2
|
@ -2755,19 +2755,10 @@ class SynchroniseSelectContactsDialog:
|
||||||
|
|
||||||
class StartChatDialog(Gtk.ApplicationWindow):
|
class StartChatDialog(Gtk.ApplicationWindow):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# Must be before ApplicationWindow.__init__
|
|
||||||
# or we get our own window
|
|
||||||
active_window = app.app.get_active_window()
|
|
||||||
|
|
||||||
Gtk.ApplicationWindow.__init__(self)
|
Gtk.ApplicationWindow.__init__(self)
|
||||||
self.set_name('StartChatDialog')
|
self.set_name('StartChatDialog')
|
||||||
self.set_application(app.app)
|
self.set_application(app.app)
|
||||||
mode = app.config.get('one_message_window') != 'always_with_roster'
|
|
||||||
if active_window == app.interface.roster.window and mode:
|
|
||||||
self.set_position(Gtk.WindowPosition.CENTER)
|
self.set_position(Gtk.WindowPosition.CENTER)
|
||||||
else:
|
|
||||||
self.set_transient_for(active_window)
|
|
||||||
self.set_type_hint(Gdk.WindowTypeHint.DIALOG)
|
|
||||||
self.set_show_menubar(False)
|
self.set_show_menubar(False)
|
||||||
self.set_title(_('Start new Conversation'))
|
self.set_title(_('Start new Conversation'))
|
||||||
self.set_default_size(-1, 400)
|
self.set_default_size(-1, 400)
|
||||||
|
|
|
@ -103,6 +103,9 @@ class GajimApplication(Gtk.Application):
|
||||||
self.add_main_option('show-next-pending-event', 0, GLib.OptionFlags.NONE,
|
self.add_main_option('show-next-pending-event', 0, GLib.OptionFlags.NONE,
|
||||||
GLib.OptionArg.NONE,
|
GLib.OptionArg.NONE,
|
||||||
_('Pops up a window with the next pending event'))
|
_('Pops up a window with the next pending event'))
|
||||||
|
self.add_main_option('start-chat', 0, GLib.OptionFlags.NONE,
|
||||||
|
GLib.OptionArg.NONE,
|
||||||
|
_('Start a new chat'))
|
||||||
|
|
||||||
self.connect('handle-local-options', self._handle_local_options)
|
self.connect('handle-local-options', self._handle_local_options)
|
||||||
self.connect('command-line', self._handle_remote_options)
|
self.connect('command-line', self._handle_remote_options)
|
||||||
|
@ -307,6 +310,7 @@ class GajimApplication(Gtk.Application):
|
||||||
|
|
||||||
remote_commands = ['ipython',
|
remote_commands = ['ipython',
|
||||||
'show-next-pending-event',
|
'show-next-pending-event',
|
||||||
|
'start-chat',
|
||||||
]
|
]
|
||||||
|
|
||||||
for cmd in remote_commands:
|
for cmd in remote_commands:
|
||||||
|
|
Loading…
Reference in New Issue