Mercurial > libervia-desktop-kivy
changeset 408:355326a3501c
platform (base): added a menu item to create a new window
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 19 Feb 2020 09:49:20 +0100 |
parents | 364d2c8eb476 |
children | 2caea63ae2ab |
files | cagou/core/platform_/base.py |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 <http://www.gnu.org/licenses/>. +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