~ubuntu-branches/ubuntu/oneiric/thunderbird/oneiric-updates

« back to all changes in this revision

Viewing changes to debian/globalmenu/components/src/uGlobalMenu.cpp

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2011-09-15 00:30:12 UTC
  • Revision ID: package-import@ubuntu.com-20110915003012-upbtjw901m5kwm8a
Tags: 7.0~b2+build2+nobinonly1-0ubuntu2
* Update globalmenu-extension to 2.0.1
  - Fixes broken labels in the Edit menu
  - Fixes radio item siblings not always being correctly unchecked
* Update messagingmenu-extension to 0.8
  - Fix a bug in inbox-only mode where we displayed non-inbox folders when
    clearing inbox-indicators
  - Add support for libunity6 ABI
  - Provide a utility module for loading libraries and binding symbols
  - Hide the internal implementation details from other chrome code
  - Fix some small memory leaks
  - Only destroy the IndicateServer on shutdown rather than when toggling
    the pref to disable the indicator, as recreating it seems to result in
    weird crashes. When disabling the indicator, just hide it (which doesn't
    work in any case)
  - Hide the prefs if the required libraries aren't installed
  - Fallback gracefully if the required libraries aren't installed
  - Trap all exceptions during initialization. Throwing exceptions in to a
    document load handler is bad, as it can prevent the entire UI from loading
* Fix broken icon URI for the reply button in the message header (LP: #844606)
  - update debian/patches/theme-refresh-message-header-buttons.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
void
173
173
uGlobalMenu::AboutToOpen()
174
174
{
 
175
  TRACE_WITH_THIS_MENUOBJECT();
175
176
  // XXX: HACK, HACK, HACK ALERT!!
176
177
  //      We ignore the first AboutToOpen on top-level menus, because Unity
177
178
  //      stupidly sends this signal on all top-levels when the window opens.
182
183
  //      the menu is first opened, when sanity returns again
183
184
  //      YUCK!
184
185
  if (!mPrimed) {
 
186
    DEBUG_WITH_THIS_MENUOBJECT("Ignoring first AboutToOpen");
185
187
    mPrimed = PR_TRUE;
186
188
    return;
187
189
  }
188
190
 
189
 
  if (DoesNeedRebuild()) {
190
 
    Build();
191
 
  }
192
 
 
193
 
  // If there is no popup content, then there is nothing to do, and it's
194
 
  // unsafe to proceed anyway
195
 
  if (!mPopupContent) {
196
 
    return;
197
 
  }
198
 
 
199
191
  mOpening = PR_TRUE;
200
192
 
 
193
  if (DoesNeedRebuild()) {
 
194
    Build();
 
195
  }
 
196
 
 
197
  // If there is no popup content, then there is nothing to do, and it's
 
198
  // unsafe to proceed anyway
 
199
  if (!mPopupContent) {
 
200
    DEBUG_WITH_THIS_MENUOBJECT("Menu has no popup content");
 
201
    mOpening = PR_FALSE;
 
202
    return;
 
203
  }
 
204
 
201
205
  PRUint32 count = mMenuObjects.Length();
202
206
  for (PRUint32 i = 0; i < count; i++) {
203
207
    mMenuObjects[i]->AboutToShowNotify();
358
362
void
359
363
uGlobalMenu::SyncProperties()
360
364
{
 
365
  TRACE_WITH_THIS_MENUOBJECT();
 
366
 
361
367
  UpdateInfoFromContentClass();
362
368
  SyncLabelFromContent();
363
369
  SyncSensitivityFromContent();
469
475
nsresult
470
476
uGlobalMenu::Build()
471
477
{
 
478
  TRACE_WITH_THIS_MENUOBJECT();
 
479
 
472
480
  PRUint32 count = mMenuObjects.Length();
473
481
  for (PRUint32 i = 0; i < count; i++) {
474
482
    RemoveMenuObjectAt(0);
597
605
                    nsIContent *aContent,
598
606
                    uGlobalMenuBar *aMenuBar)
599
607
{
 
608
  TRACE_WITH_CONTENT(aContent);
 
609
 
600
610
  uGlobalMenu *menu = new uGlobalMenu();
601
611
  if (!menu) {
602
612
    return nsnull;
613
623
void
614
624
uGlobalMenu::AboutToShowNotify()
615
625
{
 
626
  TRACE_WITH_THIS_MENUOBJECT();
 
627
 
616
628
  if (IsDirty()) {
617
629
    SyncProperties();
618
630
  } else {
635
647
                                     nsIContent *aContent,
636
648
                                     nsIAtom *aAttribute)
637
649
{
 
650
  TRACE_WITH_THIS_MENUOBJECT();
638
651
  NS_ASSERTION(aContent == mContent || aContent == mPopupContent,
639
652
               "Received an event that wasn't meant for us!");
640
653
 
641
654
  if (IsDirty()) {
 
655
    DEBUG_WITH_THIS_MENUOBJECT("Previously marked as invalid");
642
656
    return;
643
657
  }
644
658
 
645
659
  if (mParent->GetType() == Menu &&
646
660
      !(static_cast<uGlobalMenu *>(mParent))->IsOpening()) {
 
661
    DEBUG_WITH_THIS_MENUOBJECT("Parent isn't opening. Marking invalid");
647
662
    Invalidate();
648
663
    return;
649
664
  }
675
690
                                   nsIContent *aChild,
676
691
                                   PRInt32 aIndexInContainer)
677
692
{
 
693
  TRACE_WITH_THIS_MENUOBJECT();
678
694
  NS_ASSERTION(aContainer == mContent || aContainer == mPopupContent,
679
695
               "Received an event that wasn't meant for us!");
680
696
 
681
697
  if (DoesNeedRebuild()) {
 
698
    DEBUG_WITH_THIS_MENUOBJECT("Previously marked as needing a rebuild");
682
699
    return;
683
700
  }
684
701
 
685
702
  if (!IsOpening()) {
 
703
    DEBUG_WITH_THIS_MENUOBJECT("Parent not opening - Marking as needing a rebuild");
686
704
    SetNeedsRebuild();
687
705
    return;
688
706
  }
704
722
                                    nsIContent *aChild,
705
723
                                    PRInt32 aIndexInContainer)
706
724
{
 
725
  TRACE_WITH_THIS_MENUOBJECT();
707
726
  NS_ASSERTION(aContainer == mContent || aContainer == mPopupContent,
708
727
               "Received an event that wasn't meant for us!");
709
728
 
710
729
  if (DoesNeedRebuild()) {
 
730
    DEBUG_WITH_THIS_MENUOBJECT("Previously marked as needing a rebuild");
711
731
    return;
712
732
  }
713
733
 
714
734
  if (!IsOpening()) {
 
735
    DEBUG_WITH_THIS_MENUOBJECT("Parent not opening - Marking as needing a rebuild");
715
736
    SetNeedsRebuild();
716
737
    return;
717
738
  }