~ubuntu-branches/ubuntu/oneiric/thunderbird/oneiric-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2011-09-06 00:19:41 UTC
  • mfrom: (1.6.13 upstream)
  • Revision ID: package-import@ubuntu.com-20110906001941-ie80kcviw3yfmfv1
Tags: 7.0~b2+build2+nobinonly-0ubuntu1
* New upstream release from the beta channel (THUNDERBIRD_7_0b2_BUILD2)
  - LP: #837557 and LP: #838322

* Update globalmenu-extension to 2.0
  - Only update a menu in realtime if it's parent is opening. For all other
    times, just invalidate the menu. Avoids spamming dbus everytime
    something changes in the menu
  - When removing a menuitem from its parent, check that the index is
    in-bounds. Should fix a frequent crash on startup, although it doesn't
    explain how it gets in to that state in the first place
  - Add the ability to turn on debugging without building Firefox with
    debugging on
* Add upstream patch to only add ENABLE_JIT=1 to CXXFLAGS if any of trace/
  method/yarr jit is enabled. Fixes a build failure on PPC
  - add debian/patches/only-add-ENABLE_JIT-to-CXXFLAGS-if-jit-is-enabled.patch
  - update debian/patches/series
* Add upstream patch to fix build failure with ENABLE_YARR_JIT=0
  - add debian/patches/build-fix-for-no-ENABLE_YARR_JIT.patch
  - update debian/patches/series
* Add upstream patch to work around a linker bug
  - add debian/patches/compile-pldhash-as-C++.patch
  - update debian/patches/series
* Don't pass an empty --mozilla-repo= argument to client.py when creating
  the source tarball without a local cache, as it totally breaks. This is
  why we've got rid of all this in nightly and aurora, so we can avoid
  such bandaids in the first place
  - update debian/mozclient/thunderbird.conf
* Messagingmenu fixes:
  - Use the libunity5 ABI (LP: #839154)
  - Don't use QueryInterface on objects where we can't guarantee they
    implement a particular interface (LP: #826447)
* Make sure that thunderbird-gnome-support actually depends on libunity5
  - update debian/rules
* Update eds extension to r84 from 0.3 branch
  - fixes a shutdown crash
* Use the latest eds libs for the contacts integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
#include "uGlobalMenuBar.h"
65
65
#include "uWidgetAtoms.h"
66
66
 
 
67
#include "uDebug.h"
 
68
 
67
69
#define MAX_LABEL_NCHARS 40
68
70
 
69
71
typedef nsresult (nsIDOMRect::*GetRectSideMethod)(nsIDOMCSSPrimitiveValue**);
227
229
        primitiveValue->GetPrimitiveType(&primitiveType);
228
230
        if (primitiveType == nsIDOMCSSPrimitiveValue::CSS_RECT) {
229
231
          primitiveValue->GetRectValue(getter_AddRefs(domRect));
230
 
        } else {
231
 
          NS_WARNING("-moz-image-region has wrong primitive type");
232
232
        }
233
233
      }
234
234
    }
457
457
// Synchronize the 'label' and 'accesskey' attributes on the DOM node
458
458
// with the 'label' property on the dbusmenu node
459
459
void
460
 
uGlobalMenuObject::SyncLabelFromContent(nsIContent *aContent)
 
460
uGlobalMenuObject::SyncLabelFromContent()
461
461
{
462
462
  // Gecko stores the label and access key in separate attributes
463
463
  // so we need to convert label="Foo"/accesskey="F" in to
464
464
  // label="_Foo" for dbusmenu
465
465
 
466
466
  nsAutoString label;
467
 
  if (!aContent || !aContent->GetAttr(kNameSpaceID_None, uWidgetAtoms::label,
468
 
                                      label)) {
469
 
    mContent->GetAttr(kNameSpaceID_None, uWidgetAtoms::label, label);
470
 
  }
 
467
  mContent->GetAttr(kNameSpaceID_None, uWidgetAtoms::label, label);
471
468
 
472
469
  nsAutoString accesskey;
473
470
  mContent->GetAttr(kNameSpaceID_None, uWidgetAtoms::accesskey, accesskey);
543
540
                                 clabel.get());
544
541
}
545
542
 
546
 
void
547
 
uGlobalMenuObject::SyncLabelFromContent()
548
 
{
549
 
  SyncLabelFromContent(nsnull);
550
 
}
551
 
 
552
543
// Synchronize the 'hidden' attribute on the DOM node with the
553
544
// 'visible' property on the dbusmenu node
554
545
void
555
546
uGlobalMenuObject::SyncVisibilityFromContent()
556
547
{
557
548
  mContentVisible = !IsHidden();
 
549
  PRBool realVis = (!mMenuBar || !ShouldShowOnlyForKb() ||
 
550
                    mMenuBar->OpenedByKeyboard()) ?
 
551
                    mContentVisible : PR_FALSE;
 
552
 
558
553
  dbusmenu_menuitem_property_set_bool(mDbusMenuItem,
559
554
                                      DBUSMENU_MENUITEM_PROP_VISIBLE,
560
 
                                      mContentVisible);
 
555
                                      realVis);
561
556
}
562
557
 
563
558
// Synchronize the 'disabled' attribute on the DOM node with the
564
559
// 'sensitivity' property on the dbusmenu node
565
560
void
566
 
uGlobalMenuObject::SyncSensitivityFromContent(nsIContent *aContent)
 
561
uGlobalMenuObject::SyncSensitivityFromContent()
567
562
{
568
 
  nsIContent *content;
569
 
  if (aContent) {
570
 
    content = aContent;
571
 
  } else {
572
 
    content = mContent;
573
 
  }
574
 
 
575
563
  dbusmenu_menuitem_property_set_bool(mDbusMenuItem,
576
564
                                      DBUSMENU_MENUITEM_PROP_ENABLED,
577
 
                                      !content->AttrValueIs(kNameSpaceID_None,
578
 
                                                            uWidgetAtoms::disabled,
579
 
                                                            uWidgetAtoms::_true,
580
 
                                                            eCaseMatters));
581
 
}
582
 
 
583
 
void
584
 
uGlobalMenuObject::SyncSensitivityFromContent()
585
 
{
586
 
  SyncSensitivityFromContent(nsnull);
 
565
                                      !mContent->AttrValueIs(kNameSpaceID_None,
 
566
                                                             uWidgetAtoms::disabled,
 
567
                                                             uWidgetAtoms::_true,
 
568
                                                             eCaseMatters));
587
569
}
588
570
 
589
571
// Synchronize the 'label' attribute on our content node with that from
642
624
    return;
643
625
  }
644
626
 
 
627
  PRBool tmp;
645
628
  classes->Contains(NS_LITERAL_STRING("show-only-for-keyboard"),
646
 
                    &mShowOnlyForKb);
 
629
                    &tmp);
 
630
  mShowOnlyForKb = !!tmp;
 
631
 
647
632
  classes->Contains(NS_LITERAL_STRING("menuitem-with-favicon"),
648
 
                    &mWithFavicon);
 
633
                    &tmp);
 
634
  mWithFavicon = !!tmp;
649
635
}
650
636
 
651
637
PRBool
658
644
}
659
645
 
660
646
void
661
 
uGlobalMenuObject::AboutToShowNotify()
 
647
uGlobalMenuObject::UpdateVisibility()
662
648
{
663
 
  NS_WARN_IF_FALSE(!mHalted, "Showing a menuitem that should have been destroyed already");
664
 
 
665
649
  if (!mMenuBar) {
666
650
    return;
667
651
  }
668
652
 
669
 
  PRBool newVis = (mShowOnlyForKb == PR_FALSE || mMenuBar->OpenedByKeyboard()) ?
 
653
  PRBool newVis = (!ShouldShowOnlyForKb() || mMenuBar->OpenedByKeyboard()) ?
670
654
                   mContentVisible : PR_FALSE;
671
655
 
672
656
  dbusmenu_menuitem_property_set_bool(mDbusMenuItem,