Mercurial > libervia-web
comparison src/browser/libervia_main.py @ 667:166f3b624816 frontends_multi_profiles
browser_side (blog): clean the MicroblogPanel:
- remove internal constants TOGGLE_EDITION_USE_ICON and NEW_MESSAGE_USE_BUTTON
- ignore the unibox and, as a consequence, remove the 'selected_entry' attribute
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 06 Mar 2015 14:29:37 +0100 |
parents | 6a8a1103ad10 |
children | a80c13249f5d |
comparison
equal
deleted
inserted
replaced
666:1bf645e73fe8 | 667:166f3b624816 |
---|---|
304 def domain_eb(value): | 304 def domain_eb(value): |
305 self._defaultDomain = "libervia.org" | 305 self._defaultDomain = "libervia.org" |
306 | 306 |
307 self.bridge.getNewAccountDomain(callback=domain_cb, errback=domain_eb) | 307 self.bridge.getNewAccountDomain(callback=domain_cb, errback=domain_eb) |
308 self.plug_profiles([C.PROF_KEY_NONE]) # XXX: None was used intitially, but pyjamas bug when using variable arguments and None is the only arg. | 308 self.plug_profiles([C.PROF_KEY_NONE]) # XXX: None was used intitially, but pyjamas bug when using variable arguments and None is the only arg. |
309 microblog_widget = self.displayWidget(blog.MicroblogPanel, ()) | |
310 self.setSelected(microblog_widget) | |
311 # self.discuss_panel.addWidget(panel.MicroblogPanel(self, [])) | 309 # self.discuss_panel.addWidget(panel.MicroblogPanel(self, [])) |
312 | 310 |
313 # # get cached params and refresh the display | 311 # # get cached params and refresh the display |
314 # def param_cb(cat, name, count): | 312 # def param_cb(cat, name, count): |
315 # count[0] += 1 | 313 # count[0] += 1 |
320 # for cat, name in C.CACHED_PARAMS: | 318 # for cat, name in C.CACHED_PARAMS: |
321 # self.bridge.call('asyncGetParamA', param_cb(cat, name, count), name, cat) | 319 # self.bridge.call('asyncGetParamA', param_cb(cat, name, count), name, cat) |
322 | 320 |
323 def profilePlugged(self, dummy): # FIXME: to be called as a "profilePlugged" listener? | 321 def profilePlugged(self, dummy): # FIXME: to be called as a "profilePlugged" listener? |
324 QuickApp.profilePlugged(self, dummy) | 322 QuickApp.profilePlugged(self, dummy) |
323 | |
324 microblog_widget = self.displayWidget(blog.MicroblogPanel, ()) | |
325 self.setSelected(microblog_widget) | |
326 | |
325 # we fill the panels already here | 327 # we fill the panels already here |
326 for wid in self.widgets.getWidgets(blog.MicroblogPanel): | 328 for wid in self.widgets.getWidgets(blog.MicroblogPanel): |
327 if wid.accept_all(): | 329 if wid.accept_all(): |
328 self.bridge.getMassiveLastMblogs('ALL', (), 10, profile=C.PROF_KEY_NONE, callback=wid.massiveInsert) | 330 self.bridge.getMassiveLastMblogs('ALL', (), 10, profile=C.PROF_KEY_NONE, callback=wid.massiveInsert) |
329 else: | 331 else: |
449 self.FillMicroblogPanel(wid) | 451 self.FillMicroblogPanel(wid) |
450 | 452 |
451 # FIXME | 453 # FIXME |
452 self.initialised = True # initialisation phase is finished here | 454 self.initialised = True # initialisation phase is finished here |
453 for event_data in self.init_cache: # so we have to send all the cached events | 455 for event_data in self.init_cache: # so we have to send all the cached events |
454 self._personalEventCb(*event_data) | 456 self.personalEventHandler(*event_data) |
455 del self.init_cache | 457 del self.init_cache |
456 | 458 |
457 def _getProfileJidCB(self, jid_s): | 459 def _getProfileJidCB(self, jid_s): |
458 # FIXME | 460 # FIXME |
459 raise Exception("should not be here !") | 461 raise Exception("should not be here !") |
480 # if hasattr(plugin, 'profileConnected'): | 482 # if hasattr(plugin, 'profileConnected'): |
481 # plugin.profileConnected() | 483 # plugin.profileConnected() |
482 | 484 |
483 ## Signals callbacks ## | 485 ## Signals callbacks ## |
484 | 486 |
485 def _personalEventCb(self, sender, event_type, data): | 487 def personalEventHandler(self, sender, event_type, data): |
488 # FIXME: move some code from here to QuickApp | |
486 if not self.initialised: | 489 if not self.initialised: |
487 self.init_cache.append((sender, event_type, data)) | 490 self.init_cache.append((sender, event_type, data)) |
488 return | 491 return |
489 sender = jid.JID(sender).bare | 492 sender = jid.JID(sender).bare |
490 if event_type == "MICROBLOG": | 493 if event_type == "MICROBLOG": |