Add --start-chat command

This commit is contained in:
Philipp Hörist 2018-02-19 21:18:04 +01:00
parent c5de08d45f
commit 618b0b87c2
2 changed files with 5 additions and 10 deletions

View File

@ -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)

View File

@ -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: