Open new window for IPC args.
This commit is contained in:
parent
19be96b4a8
commit
191b1dd240
@ -230,16 +230,19 @@ class Application(QApplication):
|
|||||||
self._open_startpage()
|
self._open_startpage()
|
||||||
self._open_quickstart()
|
self._open_quickstart()
|
||||||
|
|
||||||
def process_args(self, args):
|
def process_args(self, args, ipc=False):
|
||||||
"""Process commandline args.
|
"""Process commandline args.
|
||||||
|
|
||||||
URLs to open have no prefix, commands to execute begin with a colon.
|
URLs to open have no prefix, commands to execute begin with a colon.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
args: A list of arguments to process.
|
args: A list of arguments to process.
|
||||||
|
ipc: Whether the arguments were transmitted over IPC.
|
||||||
"""
|
"""
|
||||||
# FIXME handle win_id with IPC
|
if ipc:
|
||||||
win_id = 0
|
win_id = mainwindow.MainWindow.spawn()
|
||||||
|
else:
|
||||||
|
win_id = 0
|
||||||
for cmd in args:
|
for cmd in args:
|
||||||
if cmd.startswith(':'):
|
if cmd.startswith(':'):
|
||||||
log.init.debug("Startup cmd {}".format(cmd))
|
log.init.debug("Startup cmd {}".format(cmd))
|
||||||
|
@ -145,7 +145,7 @@ class IPCServer(QObject):
|
|||||||
return
|
return
|
||||||
log.ipc.debug("Processing: {}".format(decoded))
|
log.ipc.debug("Processing: {}".format(decoded))
|
||||||
app = objreg.get('app')
|
app = objreg.get('app')
|
||||||
app.process_args(args)
|
app.process_args(args, ipc=True)
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def on_timeout(self):
|
def on_timeout(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user