Commit 618b0b87 authored by Philipp Hörist's avatar Philipp Hörist

Add --start-chat command

parent c5de08d4
......@@ -2755,19 +2755,10 @@ class SynchroniseSelectContactsDialog:
class StartChatDialog(Gtk.ApplicationWindow):
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)
self.set_name('StartChatDialog')
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)
else:
self.set_transient_for(active_window)
self.set_type_hint(Gdk.WindowTypeHint.DIALOG)
self.set_position(Gtk.WindowPosition.CENTER)
self.set_show_menubar(False)
self.set_title(_('Start new Conversation'))
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,
GLib.OptionArg.NONE,
_('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('command-line', self._handle_remote_options)
......@@ -307,6 +310,7 @@ class GajimApplication(Gtk.Application):
remote_commands = ['ipython',
'show-next-pending-event',
'start-chat',
]
for cmd in remote_commands:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment