comparison src/browser/libervia_main.py @ 659:8e7d4de56e75 frontends_multi_profiles

browser_side: allow to drop a widget in the "+" tab
author souliane <souliane@mailoo.org>
date Fri, 27 Feb 2015 16:05:28 +0100
parents 476d8d9973d3
children ebb602d8b3f2
comparison
equal deleted inserted replaced
658:476d8d9973d3 659:8e7d4de56e75
424 ui.show() 424 ui.show()
425 elif "public_blog" in data: 425 elif "public_blog" in data:
426 # TODO: use the bare instead of node when all blogs can be retrieved 426 # TODO: use the bare instead of node when all blogs can be retrieved
427 node = jid.JID(data['public_blog']).node 427 node = jid.JID(data['public_blog']).node
428 # FIXME: "/blog/{}" won't work with unicode nodes 428 # FIXME: "/blog/{}" won't work with unicode nodes
429 self.displayWidget(widget.WebWidget, "/blog/{}".format(node), show_url=False, new_tab="{}'s blog".format(unicode(node))) 429 self.displayWidget(widget.WebWidget, "/blog/{}".format(node), show_url=False, new_tab=_(u"{}'s blog").format(unicode(node)))
430 else: 430 else:
431 dialog.InfoDialog("Error", 431 dialog.InfoDialog("Error",
432 "Unmanaged action result", Width="400px").center() 432 "Unmanaged action result", Width="400px").center()
433 433
434 def _actionEb(self, err_data): 434 def _actionEb(self, err_data):
619 if new_tab: 619 if new_tab:
620 kwargs['on_new_widget'] = None 620 kwargs['on_new_widget'] = None
621 kwargs['on_existing_widget'] = C.WIDGET_RECREATE 621 kwargs['on_existing_widget'] = C.WIDGET_RECREATE
622 wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs) 622 wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs)
623 self.tab_panel.addWidgetsTab(new_tab) 623 self.tab_panel.addWidgetsTab(new_tab)
624 self.addWidget(wid) 624 self.addWidget(wid, tab_index=self.tab_panel.getWidgetCount() - 1)
625 return wid 625 return wid
626 626
627 kwargs['on_existing_widget'] = C.WIDGET_RAISE 627 kwargs['on_existing_widget'] = C.WIDGET_RAISE
628 try: 628 try:
629 wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs) 629 wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs)