# HG changeset patch # User Goffi # Date 1582102160 -3600 # Node ID 355326a3501ce63ee578f141611178c8c7c02bf3 # Parent 364d2c8eb4760cbdd0c7590201c08aa6d5d2adbb platform (base): added a menu item to create a new window diff -r 364d2c8eb476 -r 355326a3501c cagou/core/platform_/base.py --- a/cagou/core/platform_/base.py Wed Feb 19 09:49:19 2020 +0100 +++ b/cagou/core/platform_/base.py Wed Feb 19 09:49:20 2020 +0100 @@ -16,10 +16,13 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import sys import webbrowser from pathlib import Path +import subprocess from urllib.parse import urlparse from kivy.config import Config as KivyConfig +from sat.core.i18n import _ from sat.core.log import getLogger from sat.tools.common import files_utils from sat_frontends.quick_frontend.quick_widgets import QuickWidget @@ -69,8 +72,12 @@ share_widget.close() return True + def _on_new_window(self): + """Launch a new instance of Cagou to have an extra window""" + subprocess.Popen(sys.argv) + def on_extra_menu_init(self, extra_menu): - pass + extra_menu.addItem(_('new window'), self._on_new_window) def updateParamsExtra(self, extra): pass