Open new window for IPC args.

This commit is contained in:
Florian Bruhin 2014-10-13 23:14:24 +02:00
parent 19be96b4a8
commit 191b1dd240
2 changed files with 7 additions and 4 deletions

View File

@ -230,16 +230,19 @@ class Application(QApplication):
self._open_startpage()
self._open_quickstart()
def process_args(self, args):
def process_args(self, args, ipc=False):
"""Process commandline args.
URLs to open have no prefix, commands to execute begin with a colon.
Args:
args: A list of arguments to process.
ipc: Whether the arguments were transmitted over IPC.
"""
# FIXME handle win_id with IPC
win_id = 0
if ipc:
win_id = mainwindow.MainWindow.spawn()
else:
win_id = 0
for cmd in args:
if cmd.startswith(':'):
log.init.debug("Startup cmd {}".format(cmd))

View File

@ -145,7 +145,7 @@ class IPCServer(QObject):
return
log.ipc.debug("Processing: {}".format(decoded))
app = objreg.get('app')
app.process_args(args)
app.process_args(args, ipc=True)
@pyqtSlot()
def on_timeout(self):