comparison cagou/core/platform_/base.py @ 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 71f51198478c
children c466678c57b2
comparison
equal deleted inserted replaced
407:364d2c8eb476 408:355326a3501c
14 # GNU Affero General Public License for more details. 14 # GNU Affero General Public License for more details.
15 15
16 # You should have received a copy of the GNU Affero General Public License 16 # You should have received a copy of the GNU Affero General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. 17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 18
19 import sys
19 import webbrowser 20 import webbrowser
20 from pathlib import Path 21 from pathlib import Path
22 import subprocess
21 from urllib.parse import urlparse 23 from urllib.parse import urlparse
22 from kivy.config import Config as KivyConfig 24 from kivy.config import Config as KivyConfig
25 from sat.core.i18n import _
23 from sat.core.log import getLogger 26 from sat.core.log import getLogger
24 from sat.tools.common import files_utils 27 from sat.tools.common import files_utils
25 from sat_frontends.quick_frontend.quick_widgets import QuickWidget 28 from sat_frontends.quick_frontend.quick_widgets import QuickWidget
26 from cagou import G 29 from cagou import G
27 30
67 def on_key_back_share(self, share_widget): 70 def on_key_back_share(self, share_widget):
68 """Back key is called while being on share widget""" 71 """Back key is called while being on share widget"""
69 share_widget.close() 72 share_widget.close()
70 return True 73 return True
71 74
75 def _on_new_window(self):
76 """Launch a new instance of Cagou to have an extra window"""
77 subprocess.Popen(sys.argv)
78
72 def on_extra_menu_init(self, extra_menu): 79 def on_extra_menu_init(self, extra_menu):
73 pass 80 extra_menu.addItem(_('new window'), self._on_new_window)
74 81
75 def updateParamsExtra(self, extra): 82 def updateParamsExtra(self, extra):
76 pass 83 pass
77 84
78 def check_plugin_permissions(self, plug_info, callback, errback): 85 def check_plugin_permissions(self, plug_info, callback, errback):