зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to tracemonkey.
This commit is contained in:
Коммит
f79b5552e0
|
@ -4,7 +4,7 @@
|
|||
~$
|
||||
\.pyc$
|
||||
(^|/)TAGS$
|
||||
\.DS_Store$
|
||||
(^|/)\.DS_Store$
|
||||
|
||||
# User files that may appear at the root
|
||||
^\.mozconfig$
|
||||
|
|
21
Makefile.in
21
Makefile.in
|
@ -124,25 +124,6 @@ ifdef MOZILLA_OFFICIAL
|
|||
rebase -b 60000000 -R . -G rebase.lst
|
||||
rm rebase.lst
|
||||
endif
|
||||
|
||||
splitsymbols:
|
||||
ifdef MOZILLA_OFFICIAL
|
||||
ifdef MOZ_DEBUG_SYMBOLS
|
||||
echo finding pdb files
|
||||
mkdir -p $(DIST)/$(BUILDID)
|
||||
-cp `/bin/find . -path "./dist" -prune -o -name "*.dll" | sed "s/\.dll$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
|
||||
-cp `/bin/find . -path "./dist" -prune -o -name "*.exe" | sed "s/\.exe$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
|
||||
-cp `/bin/find . -path "./dist" -prune -o -name "*.EXE" | sed "s/\.EXE$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
|
||||
endif # MOZ_DEBUG_SYMBOLS
|
||||
ifdef MOZ_PROFILE
|
||||
echo splitting symbols out of binaries
|
||||
/bin/find $(DIST) -name "*.dll" -exec splitsym {} \;
|
||||
/bin/find $(DIST) -name "*.exe" -exec splitsym {} \;
|
||||
/bin/find $(DIST) -name "*.EXE" -exec splitsym {} \;
|
||||
mkdir -p $(DIST)/$(BUILDID)
|
||||
/bin/find $(DIST) -name "*.dbg" -exec mv {} $(DIST)/$(BUILDID) \;
|
||||
endif # MOZ_PROFILE
|
||||
endif # MOZILLA_OFFICIAL
|
||||
endif # WINNT
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
|
@ -218,7 +199,7 @@ ifdef MOZILLA_OFFICIAL
|
|||
cd $(DIST)/bin; ./shlibsign.exe -v -i freebl3.dll
|
||||
endif # MOZILLA_OFFICIAL
|
||||
|
||||
deliver: splitsymbols rebase signnss
|
||||
deliver: rebase signnss
|
||||
|
||||
endif # WINNT
|
||||
|
||||
|
|
|
@ -44,7 +44,14 @@ function testActions(aArray, aIndex)
|
|||
|
||||
gEventHandler.initialize(accOrElmOrID, elm, events);
|
||||
|
||||
acc.doAction(0);
|
||||
try {
|
||||
acc.doAction(0);
|
||||
}
|
||||
catch (e){
|
||||
ok(false, "doAction(0) failed with: " + e.name);
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
window.setTimeout(
|
||||
function()
|
||||
|
@ -63,7 +70,7 @@ var gEventHandler =
|
|||
{
|
||||
initialize: function(aID, aElm, aExpectedEvents)
|
||||
{
|
||||
this.ID = aID,
|
||||
this.ID = aID;
|
||||
this.element = aElm;
|
||||
this.mExpectedEvents = aExpectedEvents;
|
||||
this.mFiredEvents = 0;
|
||||
|
|
|
@ -70,6 +70,7 @@ build/wince/tools/Makefile
|
|||
build/wince/shunt/Makefile
|
||||
build/wince/shunt/include/windows.h
|
||||
build/wince/shunt/include/ymath.h
|
||||
build/wince/shunt/include/stdlib.h
|
||||
build/wince/shunt/include/sys/Makefile
|
||||
"
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
abs_srcdir = $(shell cd $(srcdir) && pwd)
|
||||
abs_srcdir = $(call core_abspath,$(srcdir))
|
||||
|
||||
CHROME_DEPS += $(abs_srcdir)/content/overrides/app-license.html
|
||||
|
||||
|
@ -55,10 +55,8 @@ endif
|
|||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
PRE_RELEASE_SUFFIX = $(shell cat $(srcdir)/../config/version.txt | \
|
||||
sed -e '/pre/s/.*//g' -e '/[ab][0-9]/!s/.*//g' \
|
||||
-e 's/\(.*[0-9]\)a\([0-9]\+\)/ \1 Alpha \2/g' \
|
||||
-e 's/\(.*[0-9]\)b\([0-9]\+\)/ \1 Beta \2/g')
|
||||
PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/config/printprereleasesuffix.py \
|
||||
$(shell cat $(srcdir)/../config/version.txt))
|
||||
|
||||
DEFINES += \
|
||||
-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
|
||||
|
|
|
@ -235,7 +235,7 @@
|
|||
<menuitem id="menu_bookmarksSidebar"
|
||||
key="viewBookmarksSidebarKb"
|
||||
observes="viewBookmarksSidebar"
|
||||
accesskey="&bookmarksSidebarCmd.accesskey;"/>
|
||||
accesskey="&bookmarksButton.accesskey;"/>
|
||||
<menuitem id="menu_historySidebar"
|
||||
key="key_gotoHistory"
|
||||
observes="viewHistorySidebar"
|
||||
|
|
|
@ -174,6 +174,13 @@ var StarUI = {
|
|||
|
||||
this._blockCommands(); // un-done in the popuphiding handler
|
||||
|
||||
// Move the header (star, title, possibly a button) into the grid,
|
||||
// so that it aligns nicely with the other items (bug 484022).
|
||||
var rows = this._element("editBookmarkPanelGrid").lastChild;
|
||||
var header = this._element("editBookmarkPanelHeader");
|
||||
rows.insertBefore(header, rows.firstChild);
|
||||
header.hidden = false;
|
||||
|
||||
var bundle = this._element("bundle_browser");
|
||||
|
||||
// Set panel title:
|
||||
|
@ -1022,6 +1029,9 @@ var PlacesStarButton = {
|
|||
this.updateState();
|
||||
},
|
||||
|
||||
onBeforeItemRemoved: function PSB_onBeforeItemRemoved(aItemId) {
|
||||
},
|
||||
|
||||
onItemRemoved: function PSB_onItemRemoved(aItemId, aFolder, aIndex) {
|
||||
if (!this._batching)
|
||||
this.updateState();
|
||||
|
|
|
@ -281,13 +281,15 @@
|
|||
# Accel+Shift+A-F are reserved on GTK2
|
||||
#ifndef MOZ_WIDGET_GTK2
|
||||
<key id="bookmarkAllTabsKb" key="&bookmarkThisPageCmd.commandkey;" command="Browser:BookmarkAllTabs" modifiers="accel,shift"/>
|
||||
<key id="manBookmarkKb" key="&bookmarksSidebarCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
|
||||
<key id="manBookmarkKb" key="&bookmarksCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
|
||||
#else
|
||||
<key id="manBookmarkKb" key="&bookmarksGtkCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
|
||||
#endif
|
||||
<key id="viewBookmarksSidebarKb" key="&bookmarksSidebarCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
|
||||
<key id="viewBookmarksSidebarKb" key="&bookmarksCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
|
||||
#ifdef XP_WIN
|
||||
# Cmd+I is conventially mapped to Info on MacOS X, thus it should not be
|
||||
# overridden for other purposes there.
|
||||
<key id="viewBookmarksSidebarWinKb" key="&bookmarksSidebarWinCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
|
||||
<key id="viewBookmarksSidebarWinKb" key="&bookmarksWinCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
|
||||
#endif
|
||||
|
||||
# don't use |command="Browser:Stop"|, ESC is being used to freeze animated gifs,
|
||||
|
|
|
@ -56,6 +56,11 @@ toolbar[printpreview="true"] {
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
#editBMPanel_tagsSelector {
|
||||
/* override default listbox width from xul.css */
|
||||
width: auto;
|
||||
}
|
||||
|
||||
menuitem.spell-suggestion {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
|
@ -5935,7 +5935,8 @@ missingPluginInstaller.prototype.newDisabledPlugin = function(aEvent){
|
|||
}
|
||||
|
||||
missingPluginInstaller.prototype.refreshBrowser = function(aEvent) {
|
||||
var browser = aEvent.target;
|
||||
// browser elements are anonymous so we can't just use target.
|
||||
var browser = aEvent.originalTarget;
|
||||
var notificationBox = gBrowser.getNotificationBox(browser);
|
||||
var notification = notificationBox.getNotificationWithValue("missing-plugins");
|
||||
|
||||
|
|
|
@ -124,11 +124,13 @@
|
|||
hidden="true"
|
||||
onpopupshown="StarUI.panelShown(event);"
|
||||
aria-labelledby="editBookmarkPanelTitle">
|
||||
<hbox flex="1" align="top">
|
||||
<image id="editBookmarkPanelStarIcon"/>
|
||||
<vbox flex="1">
|
||||
<label id="editBookmarkPanelTitle" flex="1"/>
|
||||
<description id="editBookmarkPanelDescription" flex="1"/>
|
||||
<row id="editBookmarkPanelHeader" align="center" hidden="true">
|
||||
<vbox align="center">
|
||||
<image id="editBookmarkPanelStarIcon"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<label id="editBookmarkPanelTitle"/>
|
||||
<description id="editBookmarkPanelDescription"/>
|
||||
<hbox>
|
||||
<button id="editBookmarkPanelUndoRemoveButton"
|
||||
hidden="true"
|
||||
|
@ -144,10 +146,9 @@
|
|||
accesskey="&editBookmark.edit.accessKey;"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</row>
|
||||
<vbox id="editBookmarkPanelContent" flex="1" hidden="true"/>
|
||||
<hbox flex="1" id="editBookmarkPanelBottomButtons">
|
||||
<spacer flex="1"/>
|
||||
<hbox id="editBookmarkPanelBottomButtons" pack="end">
|
||||
#ifndef XP_UNIX
|
||||
<button id="editBookmarkPanelDoneButton"
|
||||
label="&editBookmark.done.label;"
|
||||
|
|
|
@ -292,7 +292,7 @@
|
|||
<image id="thepreviewimage"/>
|
||||
</hbox>
|
||||
<hbox id="brokenimagecontainer" pack="center" collapsed="true">
|
||||
<image id="brokenimage" src="resource:///res/broken-image.gif"/>
|
||||
<image id="brokenimage" src="resource:///res/broken-image.png"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
dlgbuttons="accept,cancel"
|
||||
title="&sanitizeDialog2.title;"
|
||||
style="width: &window.width;;"
|
||||
style="width: &dialog.width;;"
|
||||
ondialogaccept="gSanitizePromptDialog.sanitize();">
|
||||
|
||||
<prefpane id="SanitizeDialogPane" onpaneload="gSanitizePromptDialog.init();">
|
||||
|
@ -78,7 +78,7 @@
|
|||
}
|
||||
|
||||
var bundleBrowser = document.getElementById("bundleBrowser");
|
||||
document.documentElement.getButton("accept").label = bundleBrowser.getString("sanitizeButton2");
|
||||
document.documentElement.getButton("accept").label = bundleBrowser.getString("sanitizeButtonOK");
|
||||
},
|
||||
|
||||
checkPrefs : function ()
|
||||
|
@ -199,36 +199,36 @@
|
|||
<groupbox orient="vertical">
|
||||
<caption label="&historySection.label;"/>
|
||||
<hbox id="SanitizeDurationBox" align="center">
|
||||
<label value="&clearDuration.label;" control="sanitizeDurationChoice"
|
||||
accesskey="&clearDuration.accesskey;" id="sanitizeDurationLabel"/>
|
||||
<label value="&clearTimeDuration.label;" control="sanitizeDurationChoice"
|
||||
accesskey="&clearTimeDuration.accesskey;" id="sanitizeDurationLabel"/>
|
||||
<menulist id="sanitizeDurationChoice"
|
||||
preference="privacy.sanitize.timeSpan">
|
||||
<menupopup>
|
||||
<menuitem label="&clearDuration.lastHour;" value="1"/>
|
||||
<menuitem label="&clearDuration.last2Hours;" value="2"/>
|
||||
<menuitem label="&clearDuration.last4Hours;" value="3"/>
|
||||
<menuitem label="&clearDuration.today;" value="4"/>
|
||||
<menuitem label="&clearTimeDuration.lastHour;" value="1"/>
|
||||
<menuitem label="&clearTimeDuration.last2Hours;" value="2"/>
|
||||
<menuitem label="&clearTimeDuration.last4Hours;" value="3"/>
|
||||
<menuitem label="&clearTimeDuration.today;" value="4"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&clearDuration.everything;" value="0"/>
|
||||
<menuitem label="&clearTimeDuration.everything;" value="0"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<label value="&clearDuration.suffix;" flex="1"/>
|
||||
<label value="&clearTimeDuration.suffix;" flex="1"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<vbox style="width: &column.width;">
|
||||
<checkbox id="history-checkbox"
|
||||
label="&itemVisitedPages.label;"
|
||||
accesskey="&itemVisitedPages.accesskey;"
|
||||
label="&itemBrowsingHistory.label;"
|
||||
accesskey="&itemBrowsingHistory.accesskey;"
|
||||
preference="privacy.cpd.history"
|
||||
oncommand="gSanitizePromptDialog.updateDownloadHistory();"
|
||||
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
||||
<checkbox id="downloads-checkbox"
|
||||
label="&itemDownloadList.label;"
|
||||
accesskey="&itemDownloadList.accesskey;"
|
||||
label="&itemDownloadHistory.label;"
|
||||
accesskey="&itemDownloadHistory.accesskey;"
|
||||
preference="privacy.cpd.downloads"
|
||||
onsyncfrompreference="return gSanitizePromptDialog.onReadDownloads();"/>
|
||||
<checkbox label="&itemFormSearchEntries.label;"
|
||||
accesskey="&itemFormSearchEntries.accesskey;"
|
||||
<checkbox label="&itemFormSearchHistory.label;"
|
||||
accesskey="&itemFormSearchHistory.accesskey;"
|
||||
preference="privacy.cpd.formdata"
|
||||
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
||||
</vbox>
|
||||
|
@ -241,8 +241,8 @@
|
|||
accesskey="&itemActiveLogins.accesskey;"
|
||||
preference="privacy.cpd.sessions"
|
||||
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
||||
<checkbox label="&itemWebCache.label;"
|
||||
accesskey="&itemWebCache.accesskey;"
|
||||
<checkbox label="&itemCache.label;"
|
||||
accesskey="&itemCache.accesskey;"
|
||||
preference="privacy.cpd.cache"
|
||||
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
||||
</vbox>
|
||||
|
@ -255,8 +255,8 @@
|
|||
accesskey="&itemPasswords.accesskey;"
|
||||
preference="privacy.cpd.passwords"
|
||||
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
||||
<checkbox label="&itemSiteSettings.label;"
|
||||
accesskey="&itemSiteSettings.accesskey;"
|
||||
<checkbox label="&itemSitePreferences.label;"
|
||||
accesskey="&itemSitePreferences.accesskey;"
|
||||
preference="privacy.cpd.siteSettings"
|
||||
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
||||
</vbox>
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
- Simon Bünzli <zeniko@gmail.com>
|
||||
- Michael Ventnor <ventnor.bugzilla@yahoo.com.au>
|
||||
- Mark Pilgrim <pilgrim@gmail.com>
|
||||
- Dão Gottwald <dao@mozilla.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
|
@ -1482,7 +1483,7 @@
|
|||
<method name="removeCurrentTab">
|
||||
<body>
|
||||
<![CDATA[
|
||||
return this.removeTab(this.mCurrentTab);
|
||||
this.removeTab(this.mCurrentTab);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -1501,6 +1502,10 @@
|
|||
</body>
|
||||
</method>
|
||||
|
||||
<field name="_removingTabs">
|
||||
[]
|
||||
</field>
|
||||
|
||||
<method name="removeTab">
|
||||
<parameter name="aTab"/>
|
||||
<body>
|
||||
|
@ -1510,6 +1515,12 @@
|
|||
</body>
|
||||
</method>
|
||||
|
||||
<!-- Tab close requests are ignored if the window is closing anyway,
|
||||
e.g. when holding Ctrl+W. -->
|
||||
<field name="_windowIsClosing">
|
||||
false
|
||||
</field>
|
||||
|
||||
<!-- Returns everything that _endRemoveTab needs in an array. -->
|
||||
<method name="_beginRemoveTab">
|
||||
<parameter name="aTab"/>
|
||||
|
@ -1517,42 +1528,37 @@
|
|||
<parameter name="aCloseWindowWithLastTab"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this._removingTabs.indexOf(aTab) > -1 || this._windowIsClosing)
|
||||
return null;
|
||||
|
||||
var browser = this.getBrowserForTab(aTab);
|
||||
|
||||
if (aFireBeforeUnload) {
|
||||
let ds = this.getBrowserForTab(aTab).docShell;
|
||||
let ds = browser.docShell;
|
||||
if (ds.contentViewer && !ds.contentViewer.permitUnload())
|
||||
return null;
|
||||
}
|
||||
|
||||
var closeWindow = false;
|
||||
var l = this.mTabs.length;
|
||||
var l = this.mTabs.length - this._removingTabs.length;
|
||||
var newTab;
|
||||
if (l == 1) {
|
||||
closeWindow = aCloseWindowWithLastTab != null ?
|
||||
aCloseWindowWithLastTab :
|
||||
this.mPrefs.getBoolPref("browser.tabs.closeWindowWithLastTab");
|
||||
|
||||
// BrowserOpenTab focuses the location bar. Use it only if that's
|
||||
// really wanted.
|
||||
if (closeWindow)
|
||||
this.addTab("about:blank");
|
||||
else
|
||||
BrowserOpenTab();
|
||||
newTab = this.addTab("about:blank");
|
||||
newTab.collapsed = true;
|
||||
l++;
|
||||
}
|
||||
if (l == 2) {
|
||||
var autohide = this.mPrefs.getBoolPref("browser.tabs.autoHide");
|
||||
var tabStripHide = !window.toolbar.visible;
|
||||
let autohide = this.mPrefs.getBoolPref("browser.tabs.autoHide");
|
||||
let tabStripHide = !window.toolbar.visible;
|
||||
if (autohide || tabStripHide)
|
||||
this.setStripVisibilityTo(false);
|
||||
}
|
||||
|
||||
if (!closeWindow) {
|
||||
// see notes in addTab
|
||||
let _delayedUpdate = function (aTabContainer) {
|
||||
aTabContainer.adjustTabstrip();
|
||||
aTabContainer.mTabstrip._updateScrollButtonsDisabledState();
|
||||
};
|
||||
setTimeout(_delayedUpdate, 0, this.mTabContainer);
|
||||
}
|
||||
this._removingTabs.push(aTab);
|
||||
|
||||
// We're committed to closing the tab now.
|
||||
// Dispatch a notification.
|
||||
|
@ -1562,31 +1568,25 @@
|
|||
evt.initEvent("TabClose", true, false);
|
||||
aTab.dispatchEvent(evt);
|
||||
|
||||
var index = aTab._tPos;
|
||||
|
||||
// Remove the tab's filter and progress listener.
|
||||
const filter = this.mTabFilters[index];
|
||||
var oldBrowser = this.getBrowserForTab(aTab);
|
||||
oldBrowser.webProgress.removeProgressListener(filter);
|
||||
filter.removeProgressListener(this.mTabListeners[index]);
|
||||
this.mTabFilters.splice(index, 1);
|
||||
this.mTabListeners.splice(index, 1);
|
||||
const filter = this.mTabFilters[aTab._tPos];
|
||||
browser.webProgress.removeProgressListener(filter);
|
||||
filter.removeProgressListener(this.mTabListeners[aTab._tPos]);
|
||||
|
||||
// Remove our title change and blocking listeners
|
||||
oldBrowser.removeEventListener("DOMTitleChanged", this.onTitleChanged, true);
|
||||
browser.removeEventListener("DOMTitleChanged", this.onTitleChanged, true);
|
||||
|
||||
// We are no longer the primary content area.
|
||||
oldBrowser.setAttribute("type", "content-targetable");
|
||||
browser.setAttribute("type", "content-targetable");
|
||||
|
||||
// Remove this tab as the owner of any other tabs, since it's going away.
|
||||
for (let i = 0; i < l; ++i) {
|
||||
let tab = this.mTabs[i];
|
||||
Array.forEach(this.mTabs, function (tab) {
|
||||
if ("owner" in tab && tab.owner == aTab)
|
||||
// |tab| is a child of the tab we're removing, make it an orphan
|
||||
tab.owner = null;
|
||||
}
|
||||
});
|
||||
|
||||
return [aTab, closeWindow];
|
||||
return [aTab, closeWindow, newTab];
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -1597,18 +1597,42 @@
|
|||
<![CDATA[
|
||||
if (!args)
|
||||
return;
|
||||
var [aTab, aCloseWindow] = args;
|
||||
var [aTab, aCloseWindow, aNewTab] = args;
|
||||
|
||||
// update the UI early for responsiveness
|
||||
aTab.collapsed = true;
|
||||
this.tabContainer._fillTrailingGap();
|
||||
this._blurTab(aTab);
|
||||
|
||||
this._removingTabs.splice(this._removingTabs.indexOf(aTab), 1);
|
||||
|
||||
if (aCloseWindow) {
|
||||
this._windowIsClosing = true;
|
||||
while (this._removingTabs.length)
|
||||
this._endRemoveTab([this._removingTabs[0], false]);
|
||||
} else if (!this._windowIsClosing) {
|
||||
// see notes in addTab
|
||||
function _delayedUpdate(aTabContainer) {
|
||||
aTabContainer.adjustTabstrip();
|
||||
aTabContainer.mTabstrip._updateScrollButtonsDisabledState();
|
||||
};
|
||||
setTimeout(_delayedUpdate, 0, this.tabContainer);
|
||||
|
||||
if (aNewTab) {
|
||||
aNewTab.collapsed = false;
|
||||
if (gURLBar)
|
||||
gURLBar.focus();
|
||||
}
|
||||
}
|
||||
|
||||
// We're going to remove the tab and the browser now.
|
||||
// Clean up mTabFilters and mTabListeners now rather than in
|
||||
// _beginRemoveTab, so that their size is always in sync with the
|
||||
// number of tabs and browsers (the xbl destructor depends on this).
|
||||
this.mTabFilters.splice(aTab._tPos, 1);
|
||||
this.mTabListeners.splice(aTab._tPos, 1);
|
||||
|
||||
var browser = this.getBrowserForTab(aTab);
|
||||
var length = this.mTabs.length;
|
||||
|
||||
// Get the index of the tab we're removing before unselecting it
|
||||
var currentIndex = this.mTabContainer.selectedIndex;
|
||||
var index = aTab._tPos;
|
||||
|
||||
// clean up the before/afterselected attributes before removing the
|
||||
// tab. But make sure this happens after we grab currentIndex.
|
||||
aTab._selected = false;
|
||||
|
||||
// Because of the way XBL works (fields just set JS
|
||||
// properties on the element) and the code we have in place
|
||||
|
@ -1625,53 +1649,72 @@
|
|||
if (browser == this.mCurrentBrowser)
|
||||
this.mCurrentBrowser = null;
|
||||
|
||||
// Remove the tab
|
||||
this.mTabContainer.removeChild(aTab);
|
||||
// Update our length
|
||||
--length;
|
||||
// invalidate cache, because mTabContainer is about to change
|
||||
// Invalidate browsers cache, as the tab is removed from the
|
||||
// tab container.
|
||||
this._browsers = null;
|
||||
this.mPanelContainer.removeChild(browser.parentNode);
|
||||
|
||||
this.tabContainer._fillTrailingGap();
|
||||
// Remove the tab ...
|
||||
this.tabContainer.removeChild(aTab);
|
||||
|
||||
// Find the tab to select
|
||||
var newIndex = -1;
|
||||
if (currentIndex > index)
|
||||
newIndex = currentIndex-1;
|
||||
else if (currentIndex < index)
|
||||
newIndex = currentIndex;
|
||||
else {
|
||||
if ("owner" in aTab && aTab.owner &&
|
||||
this.mPrefs.getBoolPref("browser.tabs.selectOwnerOnClose")) {
|
||||
for (let i = 0; i < length; ++i) {
|
||||
if (this.mTabs[i] == aTab.owner) {
|
||||
newIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newIndex == -1)
|
||||
newIndex = (index == length) ? index - 1 : index;
|
||||
}
|
||||
|
||||
// Select the new tab
|
||||
this.selectedTab = this.mTabs[newIndex];
|
||||
|
||||
for (let i = aTab._tPos; i < length; i++)
|
||||
// ... and fix up the _tPos properties immediately.
|
||||
for (let i = aTab._tPos; i < this.mTabs.length; i++)
|
||||
this.mTabs[i]._tPos = i;
|
||||
|
||||
this.mTabBox.selectedPanel = this.getBrowserForTab(this.mCurrentTab).parentNode;
|
||||
this.mCurrentTab._selected = true;
|
||||
// update first-tab/last-tab/beforeselected/afterselected attributes
|
||||
this.selectedTab._selected = true;
|
||||
|
||||
this.updateCurrentBrowser();
|
||||
// This will unload the document. An unload handler could remove
|
||||
// dependant tabs, so it's important that the tabbrowser is now in
|
||||
// a consistent state (tab removed, tab positions updated, etc.).
|
||||
// Also, it's important that another tab has been selected before
|
||||
// the panel is removed; otherwise, a random sibling panel can flash.
|
||||
this.mPanelContainer.removeChild(browser.parentNode);
|
||||
|
||||
// see comment above destroy above
|
||||
// As the panel is removed, the removal of a dependent document can
|
||||
// cause the whole window to close. So at this point, it's possible
|
||||
// that the binding is destructed.
|
||||
if (this.mTabBox)
|
||||
this.mTabBox.selectedPanel = this.getBrowserForTab(this.mCurrentTab).parentNode;
|
||||
|
||||
// see comment about destroy above
|
||||
browser.focusedWindow = null;
|
||||
browser.focusedElement = null;
|
||||
|
||||
if (aCloseWindow)
|
||||
closeWindow(true);
|
||||
this._windowIsClosing = closeWindow(true);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="_blurTab">
|
||||
<parameter name="aTab"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this.mCurrentTab != aTab)
|
||||
return;
|
||||
|
||||
if (aTab.owner &&
|
||||
this._removingTabs.indexOf(aTab.owner) == -1 &&
|
||||
this.mPrefs.getBoolPref("browser.tabs.selectOwnerOnClose")) {
|
||||
this.selectedTab = aTab.owner;
|
||||
return;
|
||||
}
|
||||
|
||||
var tab = aTab;
|
||||
|
||||
do {
|
||||
tab = tab.nextSibling;
|
||||
} while (tab && this._removingTabs.indexOf(tab) != -1);
|
||||
|
||||
if (!tab) {
|
||||
tab = aTab;
|
||||
|
||||
do {
|
||||
tab = tab.previousSibling;
|
||||
} while (tab && this._removingTabs.indexOf(tab) != -1);
|
||||
}
|
||||
|
||||
this.selectedTab = tab;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -1919,10 +1962,10 @@
|
|||
var uri = this.getBrowserForTab(aEvent.target).currentURI;
|
||||
var spec = uri ? uri.spec : "about:blank";
|
||||
|
||||
// We must not set text/x-moz-url data, otherwise trying to deatch
|
||||
// the tab by dropping it on the desktop would result in an
|
||||
// "internet shortcut"
|
||||
dt.mozSetDataAt("text/plain", spec, 0);
|
||||
// We must not set text/x-moz-url or text/plain data here,
|
||||
// otherwise trying to deatch the tab by dropping it on the desktop
|
||||
// may result in an "internet shortcut"
|
||||
dt.mozSetDataAt("text/x-moz-text-internal", spec, 0);
|
||||
|
||||
// Set the cursor to an arrow during tab drags.
|
||||
dt.mozCursor = "default";
|
||||
|
|
|
@ -68,12 +68,16 @@ _BROWSER_FILES = browser_sanitize-timespans.js \
|
|||
browser_bug409481.js \
|
||||
browser_bug413915.js \
|
||||
browser_bug420160.js \
|
||||
browser_bug432599.js \
|
||||
browser_bug424101.js \
|
||||
browser_bug427559.js \
|
||||
browser_bug432599.js \
|
||||
browser_bug441778.js \
|
||||
browser_bug455852.js \
|
||||
browser_bug462673.js \
|
||||
browser_discovery.js \
|
||||
discovery.html \
|
||||
moz.png \
|
||||
test_bug462673.html \
|
||||
browser_getshortcutoruri.js \
|
||||
browser_page_style_menu.js \
|
||||
page_style_sample.html \
|
||||
|
@ -99,6 +103,7 @@ _BROWSER_FILES = browser_sanitize-timespans.js \
|
|||
browser_sanitize-passwordDisabledHosts.js \
|
||||
browser_bug479408.js \
|
||||
browser_bug479408_sample.html \
|
||||
browser_scope.js \
|
||||
$(NULL)
|
||||
|
||||
ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
/* Make sure that the context menu appears on form elements */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let newTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = newTab;
|
||||
let newBrowser = gBrowser.getBrowserForTab(newTab);
|
||||
|
||||
newBrowser.addEventListener("load", function() {
|
||||
newBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
let doc = newBrowser.contentWindow.document;
|
||||
let testInput = function(type, expected) {
|
||||
let element = doc.createElement("input");
|
||||
element.setAttribute("type", type);
|
||||
doc.body.appendChild(element);
|
||||
document.popupNode = element;
|
||||
|
||||
let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
|
||||
let contextMenu = new nsContextMenu(contentAreaContextMenu, gBrowser);
|
||||
|
||||
is(contextMenu.shouldDisplay, expected, "context menu behavior for <input type=" + type + "> is wrong");
|
||||
};
|
||||
let testElement = function(tag, expected) {
|
||||
let element = doc.createElement(tag);
|
||||
doc.body.appendChild(element);
|
||||
document.popupNode = element;
|
||||
|
||||
let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
|
||||
let contextMenu = new nsContextMenu(contentAreaContextMenu, gBrowser);
|
||||
|
||||
is(contextMenu.shouldDisplay, expected, "context menu behavior for <" + tag + "> is wrong");
|
||||
};
|
||||
|
||||
testInput("text", true);
|
||||
testInput("password", true);
|
||||
testInput("image", true);
|
||||
testInput("button", false);
|
||||
testInput("submit", false);
|
||||
testInput("reset", false);
|
||||
testInput("checkbox", false);
|
||||
testInput("radio", false);
|
||||
testElement("button", false);
|
||||
testElement("select", false);
|
||||
testElement("option", false);
|
||||
testElement("optgroup", false);
|
||||
|
||||
// cleanup
|
||||
document.popupNode = null;
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}, true);
|
||||
newBrowser.loadURI("data:text/html,test");
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
function test() {
|
||||
is(gBrowser.mTabs.length, 1, "one tab is open");
|
||||
|
||||
content.focus();
|
||||
isnot(document.activeElement, gURLBar.inputField, "location bar is not focused");
|
||||
|
||||
var tab = gBrowser.selectedTab;
|
||||
gPrefService.setBoolPref("browser.tabs.closeWindowWithLastTab", false);
|
||||
EventUtils.synthesizeKey("w", { accelKey: true });
|
||||
is(tab.parentNode, null, "ctrl+w removes the tab");
|
||||
is(gBrowser.mTabs.length, 1, "a new tab has been opened");
|
||||
is(document.activeElement, gURLBar.inputField, "location bar is focused for the new tab");
|
||||
|
||||
if (gPrefService.prefHasUserValue("browser.tabs.closeWindowWithLastTab"))
|
||||
gPrefService.clearUserPref("browser.tabs.closeWindowWithLastTab");
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
var runs = [
|
||||
function (win, tabbrowser, tab) {
|
||||
is(tabbrowser.browsers.length, 2, "test_bug462673.html has opened a second tab");
|
||||
is(tabbrowser.selectedTab, tab.nextSibling, "dependent tab is selected");
|
||||
tabbrowser.removeTab(tab);
|
||||
ok(win.closed, "Window is closed");
|
||||
},
|
||||
function (win, tabbrowser, tab) {
|
||||
var newTab = tabbrowser.addTab();
|
||||
var newBrowser = newTab.linkedBrowser;
|
||||
tabbrowser.removeTab(tab);
|
||||
ok(!win.closed, "Window stays open");
|
||||
if (!win.closed) {
|
||||
is(tabbrowser.tabContainer.childElementCount, 1, "Window has one tab");
|
||||
is(tabbrowser.browsers.length, 1, "Window has one browser");
|
||||
is(tabbrowser.selectedTab, newTab, "Remaining tab is selected");
|
||||
is(tabbrowser.selectedBrowser, newBrowser, "Browser for remaining tab is selected");
|
||||
is(tabbrowser.mTabBox.selectedPanel, newBrowser.parentNode, "Panel for remaining tab is selected");
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
runOneTest();
|
||||
}
|
||||
|
||||
function runOneTest() {
|
||||
var win = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
|
||||
|
||||
win.addEventListener("load", function () {
|
||||
win.removeEventListener("load", arguments.callee, false);
|
||||
|
||||
var tab = win.gBrowser.tabContainer.firstChild;
|
||||
var browser = tab.linkedBrowser;
|
||||
|
||||
browser.addEventListener("load", function () {
|
||||
browser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
executeSoon(function () {
|
||||
runs.shift()(win, win.gBrowser, tab);
|
||||
win.close();
|
||||
if (runs.length)
|
||||
runOneTest();
|
||||
else
|
||||
finish();
|
||||
});
|
||||
}, true);
|
||||
|
||||
browser.contentWindow.location =
|
||||
"chrome://mochikit/content/browser/browser/base/content/test/test_bug462673.html";
|
||||
}, false);
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<html>
|
||||
<head>
|
||||
<script>
|
||||
var w;
|
||||
function openIt() {
|
||||
w = window.open("", "window2");
|
||||
}
|
||||
function closeIt() {
|
||||
if (w) {
|
||||
w.close();
|
||||
w = null;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="openIt();" onunload="closeIt();">
|
||||
</body>
|
||||
</html>
|
|
@ -75,14 +75,8 @@ upload::
|
|||
ifdef ENABLE_TESTS
|
||||
# Implemented in testing/testsuite-targets.mk
|
||||
|
||||
ifdef TEST_PATH
|
||||
BROWSER_TEST_PATH = --test-path=$(TEST_PATH)
|
||||
else
|
||||
BROWSER_TEST_PATH =
|
||||
endif
|
||||
|
||||
mochitest-browser-chrome:
|
||||
$(RUN_MOCHITEST) --browser-chrome $(BROWSER_TEST_PATH)
|
||||
$(RUN_MOCHITEST) --browser-chrome
|
||||
$(CHECK_TEST_ERROR)
|
||||
|
||||
mochitest:: mochitest-browser-chrome
|
||||
|
|
|
@ -396,36 +396,36 @@ nsDogbertProfileMigrator::GetSourceHomePageURL(nsACString& aResult)
|
|||
static
|
||||
nsDogbertProfileMigrator::PrefTransform gTransforms[] = {
|
||||
// Simple Copy Prefs
|
||||
{ "browser.anchor_color", 0, F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "browser.visited_color", 0, F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "browser.startup.homepage", 0, F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "security.enable_java", 0, F(GetBool), F(SetBool), PR_FALSE, -1 },
|
||||
{ "network.cookie.cookieBehavior", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
|
||||
{ "network.cookie.warnAboutCookies",0, F(GetBool), F(SetBool), PR_FALSE, -1 },
|
||||
{ "javascript.enabled", 0, F(GetBool), F(SetBool), PR_FALSE, -1 },
|
||||
{ "network.proxy.type", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
|
||||
{ "network.proxy.no_proxies_on", 0, F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "network.proxy.autoconfig_url", 0, F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "network.proxy.ftp", 0, F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "network.proxy.ftp_port", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
|
||||
{ "network.proxy.gopher", 0, F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "network.proxy.gopher_port", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
|
||||
{ "network.proxy.http", 0, F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "network.proxy.http_port", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
|
||||
{ "network.proxy.ssl", 0, F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "network.proxy.ssl_port", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
|
||||
{ "browser.anchor_color", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "browser.visited_color", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "browser.startup.homepage", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "security.enable_java", 0, F(GetBool), F(SetBool), PR_FALSE, { -1 } },
|
||||
{ "network.cookie.cookieBehavior", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
|
||||
{ "network.cookie.warnAboutCookies",0, F(GetBool), F(SetBool), PR_FALSE, { -1 } },
|
||||
{ "javascript.enabled", 0, F(GetBool), F(SetBool), PR_FALSE, { -1 } },
|
||||
{ "network.proxy.type", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
|
||||
{ "network.proxy.no_proxies_on", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "network.proxy.autoconfig_url", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "network.proxy.ftp", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "network.proxy.ftp_port", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
|
||||
{ "network.proxy.gopher", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "network.proxy.gopher_port", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
|
||||
{ "network.proxy.http", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "network.proxy.http_port", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
|
||||
{ "network.proxy.ssl", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "network.proxy.ssl_port", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
|
||||
|
||||
// Prefs with Different Names
|
||||
{ "network.hosts.socks_server", "network.proxy.socks", F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "network.hosts.socks_serverport", "network.proxy.socks_port", F(GetInt), F(SetInt), PR_FALSE, -1 },
|
||||
{ "browser.background_color", "browser.display.background_color", F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "browser.foreground_color", "browser.display.foreground_color", F(GetString), F(SetString), PR_FALSE, -1 },
|
||||
{ "browser.wfe.use_windows_colors", "browser.display.use_system_colors", F(GetBool), F(SetBool), PR_FALSE, -1 },
|
||||
{ "browser.use_document_colors", "browser.display.use_document_colors",F(GetBool), F(SetBool), PR_FALSE, -1 },
|
||||
{ "browser.use_document.fonts", "browser.display.use_document_fonts", F(GetInt), F(SetInt), PR_FALSE, -1 },
|
||||
{ "browser.link_expiration", "browser.history_expire_days", F(GetInt), F(SetInt), PR_FALSE, -1 },
|
||||
{ "browser.startup.page", "browser.startup.homepage", F(GetHomepage), F(SetWStringFromASCII), PR_FALSE, -1 },
|
||||
{ "general.always_load_images", "permissions.default.image", F(GetImagePref),F(SetInt), PR_FALSE, -1 },
|
||||
{ "network.hosts.socks_server", "network.proxy.socks", F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "network.hosts.socks_serverport", "network.proxy.socks_port", F(GetInt), F(SetInt), PR_FALSE, { -1 } },
|
||||
{ "browser.background_color", "browser.display.background_color", F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "browser.foreground_color", "browser.display.foreground_color", F(GetString), F(SetString), PR_FALSE, { -1 } },
|
||||
{ "browser.wfe.use_windows_colors", "browser.display.use_system_colors", F(GetBool), F(SetBool), PR_FALSE, { -1 } },
|
||||
{ "browser.use_document_colors", "browser.display.use_document_colors",F(GetBool), F(SetBool), PR_FALSE, { -1 } },
|
||||
{ "browser.use_document.fonts", "browser.display.use_document_fonts", F(GetInt), F(SetInt), PR_FALSE, { -1 } },
|
||||
{ "browser.link_expiration", "browser.history_expire_days", F(GetInt), F(SetInt), PR_FALSE, { -1 } },
|
||||
{ "browser.startup.page", "browser.startup.homepage", F(GetHomepage), F(SetWStringFromASCII), PR_FALSE, { -1 } },
|
||||
{ "general.always_load_images", "permissions.default.image", F(GetImagePref),F(SetInt), PR_FALSE, { -1 } },
|
||||
};
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsIProperties.h"
|
||||
#include <InternetConfig.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
#define MACIE_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("Favorites.html")
|
||||
#define MACIE_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING("Explorer")
|
||||
|
|
|
@ -132,7 +132,7 @@ nsNetscapeProfileMigratorBase::GetProfileDataFromRegistry(nsILocalFile* aRegistr
|
|||
// "migrated" is "yes" for all valid Seamonkey profiles. It is only "no"
|
||||
// for 4.x profiles.
|
||||
char migratedStr[3];
|
||||
errCode = NR_RegGetEntryString(reg, profileKey, "migrated",
|
||||
errCode = NR_RegGetEntryString(reg, profileKey, (char *)"migrated",
|
||||
migratedStr, sizeof(migratedStr));
|
||||
if ((errCode != REGERR_OK && errCode != REGERR_BUFTOOSMALL) ||
|
||||
strcmp(migratedStr, "no") == 0)
|
||||
|
@ -142,13 +142,13 @@ nsNetscapeProfileMigratorBase::GetProfileDataFromRegistry(nsILocalFile* aRegistr
|
|||
REGINFO regInfo;
|
||||
regInfo.size = sizeof(REGINFO);
|
||||
|
||||
if (NR_RegGetEntryInfo(reg, profileKey, "directory", ®Info))
|
||||
if (NR_RegGetEntryInfo(reg, profileKey, (char *)"directory", ®Info))
|
||||
continue;
|
||||
|
||||
nsCAutoString dirStr;
|
||||
dirStr.SetLength(regInfo.entryLength);
|
||||
|
||||
errCode = NR_RegGetEntryString(reg, profileKey, "directory",
|
||||
errCode = NR_RegGetEntryString(reg, profileKey, (char *)"directory",
|
||||
dirStr.BeginWriting(), regInfo.entryLength);
|
||||
// Remove trailing \0
|
||||
dirStr.SetLength(regInfo.entryLength-1);
|
||||
|
|
|
@ -56,8 +56,8 @@ public:
|
|||
typedef nsresult(*prefConverter)(void*, nsIPrefBranch*);
|
||||
|
||||
struct PrefTransform {
|
||||
char* sourcePrefName;
|
||||
char* targetPrefName;
|
||||
const char* sourcePrefName;
|
||||
const char* targetPrefName;
|
||||
prefConverter prefGetterFunc;
|
||||
prefConverter prefSetterFunc;
|
||||
PRBool prefHasValue;
|
||||
|
|
|
@ -314,26 +314,26 @@ nsOperaProfileMigrator::GetSourceHomePageURL(nsACString& aResult)
|
|||
|
||||
static
|
||||
nsOperaProfileMigrator::PrefTransform gTransforms[] = {
|
||||
{ "User Prefs", "Download Directory", _OPM(STRING), "browser.download.dir", _OPM(SetFile), PR_FALSE, -1 },
|
||||
{ nsnull, "Enable Cookies", _OPM(INT), "network.cookie.cookieBehavior", _OPM(SetCookieBehavior), PR_FALSE, -1 },
|
||||
{ nsnull, "Accept Cookies Session Only", _OPM(BOOL), "network.cookie.lifetimePolicy", _OPM(SetCookieLifetime), PR_FALSE, -1 },
|
||||
{ nsnull, "Allow script to resize window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, -1 },
|
||||
{ nsnull, "Allow script to move window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, -1 },
|
||||
{ nsnull, "Allow script to raise window", _OPM(BOOL), "dom.disable_window_flip", _OPM(SetBool), PR_FALSE, -1 },
|
||||
{ nsnull, "Allow script to change status", _OPM(BOOL), "dom.disable_window_status_change", _OPM(SetBool), PR_FALSE, -1 },
|
||||
{ nsnull, "Ignore Unrequested Popups", _OPM(BOOL), "dom.disable_open_during_load", _OPM(SetBool), PR_FALSE, -1 },
|
||||
{ nsnull, "Load Figures", _OPM(BOOL), "permissions.default.image", _OPM(SetImageBehavior), PR_FALSE, -1 },
|
||||
{ "User Prefs", "Download Directory", _OPM(STRING), "browser.download.dir", _OPM(SetFile), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Enable Cookies", _OPM(INT), "network.cookie.cookieBehavior", _OPM(SetCookieBehavior), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Accept Cookies Session Only", _OPM(BOOL), "network.cookie.lifetimePolicy", _OPM(SetCookieLifetime), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Allow script to resize window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Allow script to move window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Allow script to raise window", _OPM(BOOL), "dom.disable_window_flip", _OPM(SetBool), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Allow script to change status", _OPM(BOOL), "dom.disable_window_status_change", _OPM(SetBool), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Ignore Unrequested Popups", _OPM(BOOL), "dom.disable_open_during_load", _OPM(SetBool), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Load Figures", _OPM(BOOL), "permissions.default.image", _OPM(SetImageBehavior), PR_FALSE, { -1 } },
|
||||
|
||||
{ "Visited link", nsnull, _OPM(COLOR), "browser.visited_color", _OPM(SetString), PR_FALSE, -1 },
|
||||
{ "Link", nsnull, _OPM(COLOR), "browser.anchor_color", _OPM(SetString), PR_FALSE, -1 },
|
||||
{ nsnull, "Underline", _OPM(BOOL), "browser.underline_anchors", _OPM(SetBool), PR_FALSE, -1 },
|
||||
{ nsnull, "Expiry", _OPM(INT), "browser.history_expire_days", _OPM(SetInt), PR_FALSE, -1 },
|
||||
{ "Visited link", nsnull, _OPM(COLOR), "browser.visited_color", _OPM(SetString), PR_FALSE, { -1 } },
|
||||
{ "Link", nsnull, _OPM(COLOR), "browser.anchor_color", _OPM(SetString), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Underline", _OPM(BOOL), "browser.underline_anchors", _OPM(SetBool), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Expiry", _OPM(INT), "browser.history_expire_days", _OPM(SetInt), PR_FALSE, { -1 } },
|
||||
|
||||
{ "Security Prefs", "Enable SSL v2", _OPM(BOOL), "security.enable_ssl2", _OPM(SetBool), PR_FALSE, -1 },
|
||||
{ nsnull, "Enable SSL v3", _OPM(BOOL), "security.enable_ssl3", _OPM(SetBool), PR_FALSE, -1 },
|
||||
{ nsnull, "Enable TLS v1.0", _OPM(BOOL), "security.enable_tls", _OPM(SetBool), PR_FALSE, -1 },
|
||||
{ "Security Prefs", "Enable SSL v2", _OPM(BOOL), "security.enable_ssl2", _OPM(SetBool), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Enable SSL v3", _OPM(BOOL), "security.enable_ssl3", _OPM(SetBool), PR_FALSE, { -1 } },
|
||||
{ nsnull, "Enable TLS v1.0", _OPM(BOOL), "security.enable_tls", _OPM(SetBool), PR_FALSE, { -1 } },
|
||||
|
||||
{ "Extensions", "Scripting", _OPM(BOOL), "javascript.enabled", _OPM(SetBool), PR_FALSE, -1 }
|
||||
{ "Extensions", "Scripting", _OPM(BOOL), "javascript.enabled", _OPM(SetBool), PR_FALSE, { -1 } }
|
||||
};
|
||||
|
||||
nsresult
|
||||
|
@ -420,7 +420,7 @@ nsOperaProfileMigrator::CopyPreferences(PRBool aReplace)
|
|||
PrefTransform* transform;
|
||||
PrefTransform* end = gTransforms + sizeof(gTransforms)/sizeof(PrefTransform);
|
||||
|
||||
char* lastSectionName = nsnull;
|
||||
const char* lastSectionName = nsnull;
|
||||
for (transform = gTransforms; transform < end; ++transform) {
|
||||
if (transform->sectionName)
|
||||
lastSectionName = transform->sectionName;
|
||||
|
@ -882,8 +882,9 @@ nsOperaCookieMigrator::AddCookieOverride(nsIPermissionManager* aManager)
|
|||
uri->SetHost(domain);
|
||||
|
||||
rv = aManager->Add(uri, "cookie",
|
||||
(mCurrHandlingInfo == 1 || mCurrHandlingInfo == 3) ? nsIPermissionManager::ALLOW_ACTION :
|
||||
nsIPermissionManager::DENY_ACTION);
|
||||
(mCurrHandlingInfo == 1 || mCurrHandlingInfo == 3)
|
||||
? (PRUint32) nsIPermissionManager::ALLOW_ACTION
|
||||
: (PRUint32) nsIPermissionManager::DENY_ACTION);
|
||||
|
||||
mCurrHandlingInfo = 0;
|
||||
|
||||
|
@ -1167,7 +1168,7 @@ nsOperaProfileMigrator::CopySmartKeywords(nsINavBookmarksService* aBMS,
|
|||
PRInt32 index = 0;
|
||||
do {
|
||||
index = name.FindChar('&', index);
|
||||
if (index >= length - 2)
|
||||
if ((PRUint32)index >= length - 2)
|
||||
break;
|
||||
|
||||
// Assume "&&" is an escaped ampersand in the search query title.
|
||||
|
@ -1179,7 +1180,7 @@ nsOperaProfileMigrator::CopySmartKeywords(nsINavBookmarksService* aBMS,
|
|||
|
||||
name.Cut(index, 1);
|
||||
}
|
||||
while (index < length);
|
||||
while ((PRUint32)index < length);
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
NS_NewURI(getter_AddRefs(uri), url.get());
|
||||
|
|
|
@ -74,10 +74,10 @@ public:
|
|||
typedef nsresult(*prefConverter)(void*, nsIPrefBranch*);
|
||||
|
||||
struct PrefTransform {
|
||||
char* sectionName;
|
||||
char* keyName;
|
||||
const char* sectionName;
|
||||
const char* keyName;
|
||||
PrefType type;
|
||||
char* targetPrefName;
|
||||
const char* targetPrefName;
|
||||
prefConverter prefSetterFunc;
|
||||
PRBool prefHasValue;
|
||||
union {
|
||||
|
|
|
@ -808,6 +808,12 @@ BrowserGlue.prototype = {
|
|||
},
|
||||
|
||||
ensurePlacesDefaultQueriesInitialized: function() {
|
||||
// This is actual version of the smart bookmarks, must be increased every
|
||||
// time smart bookmarks change.
|
||||
// When adding a new smart bookmark below, its newInVersion property must
|
||||
// be set to the version it has been added in, we will compare its value
|
||||
// to users' smartBookmarksVersion and add new smart bookmarks without
|
||||
// recreating old deleted ones.
|
||||
const SMART_BOOKMARKS_VERSION = 2;
|
||||
const SMART_BOOKMARKS_ANNO = "Places/SmartBookmark";
|
||||
const SMART_BOOKMARKS_PREF = "browser.places.smartBookmarksVersion";
|
||||
|
@ -820,7 +826,7 @@ BrowserGlue.prototype = {
|
|||
var smartBookmarksCurrentVersion = 0;
|
||||
try {
|
||||
smartBookmarksCurrentVersion = this._prefs.getIntPref(SMART_BOOKMARKS_PREF);
|
||||
} catch(ex) {}
|
||||
} catch(ex) { /* no version set, new profile */ }
|
||||
|
||||
// bail out if we don't have to create or update Smart Bookmarks
|
||||
if (smartBookmarksCurrentVersion == -1 ||
|
||||
|
@ -858,7 +864,8 @@ BrowserGlue.prototype = {
|
|||
Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_DESCENDING +
|
||||
"&maxResults=" + MAX_RESULTS),
|
||||
parent: bmsvc.toolbarFolder,
|
||||
position: bookmarksToolbarIndex++};
|
||||
position: bookmarksToolbarIndex++,
|
||||
newInVersion: 1 };
|
||||
smartBookmarks.push(smart);
|
||||
|
||||
// RECENTLY BOOKMARKED
|
||||
|
@ -876,7 +883,8 @@ BrowserGlue.prototype = {
|
|||
"&maxResults=" + MAX_RESULTS +
|
||||
"&excludeQueries=1"),
|
||||
parent: bmsvc.bookmarksMenuFolder,
|
||||
position: bookmarksMenuIndex++};
|
||||
position: bookmarksMenuIndex++,
|
||||
newInVersion: 1 };
|
||||
smartBookmarks.push(smart);
|
||||
|
||||
// RECENT TAGS
|
||||
|
@ -890,15 +898,19 @@ BrowserGlue.prototype = {
|
|||
Ci.nsINavHistoryQueryOptions.SORT_BY_LASTMODIFIED_DESCENDING +
|
||||
"&maxResults=" + MAX_RESULTS),
|
||||
parent: bmsvc.bookmarksMenuFolder,
|
||||
position: bookmarksMenuIndex++};
|
||||
position: bookmarksMenuIndex++,
|
||||
newInVersion: 1 };
|
||||
smartBookmarks.push(smart);
|
||||
|
||||
var smartBookmarkItemIds = annosvc.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO, {});
|
||||
// set current itemId, parent and position if Smart Bookmark exists
|
||||
// Set current itemId, parent and position if Smart Bookmark exists,
|
||||
// we will use these informations to create the new version at the same
|
||||
// position.
|
||||
for each(var itemId in smartBookmarkItemIds) {
|
||||
var queryId = annosvc.getItemAnnotation(itemId, SMART_BOOKMARKS_ANNO);
|
||||
for (var i = 0; i < smartBookmarks.length; i++){
|
||||
if (smartBookmarks[i].queryId == queryId) {
|
||||
smartBookmarks[i].found = true;
|
||||
smartBookmarks[i].itemId = itemId;
|
||||
smartBookmarks[i].parent = bmsvc.getFolderIdForItem(itemId);
|
||||
smartBookmarks[i].position = bmsvc.getItemIndex(itemId);
|
||||
|
@ -916,6 +928,14 @@ BrowserGlue.prototype = {
|
|||
|
||||
// create smart bookmarks
|
||||
for each(var smartBookmark in smartBookmarks) {
|
||||
// We update or create only changed or new smart bookmarks.
|
||||
// Also we respect user choices, so we won't try to create a smart
|
||||
// bookmark if it has been removed.
|
||||
if (smartBookmarksCurrentVersion > 0 &&
|
||||
smartBookmark.newInVersion <= smartBookmarksCurrentVersion &&
|
||||
!smartBookmark.found)
|
||||
continue;
|
||||
|
||||
smartBookmark.itemId = bmsvc.insertBookmark(smartBookmark.parent,
|
||||
smartBookmark.uri,
|
||||
smartBookmark.position,
|
||||
|
@ -927,7 +947,8 @@ BrowserGlue.prototype = {
|
|||
|
||||
// If we are creating all Smart Bookmarks from ground up, add a
|
||||
// separator below them in the bookmarks menu.
|
||||
if (smartBookmarkItemIds.length == 0)
|
||||
if (smartBookmarksCurrentVersion == 0 &&
|
||||
smartBookmarkItemIds.length == 0)
|
||||
bmsvc.insertSeparator(bmsvc.bookmarksMenuFolder, bookmarksMenuIndex);
|
||||
}
|
||||
};
|
||||
|
@ -1039,17 +1060,17 @@ GeolocationPrompt.prototype = {
|
|||
var browserBundle = bundleService.createBundle("chrome://browser/locale/browser.properties");
|
||||
|
||||
var buttons = [{
|
||||
label: browserBundle.GetStringFromName("geolocation.exactLocation"),
|
||||
accessKey: browserBundle.GetStringFromName("geolocation.exactLocationKey"),
|
||||
label: browserBundle.GetStringFromName("geolocation.tellThem"),
|
||||
accessKey: browserBundle.GetStringFromName("geolocation.tellThemKey"),
|
||||
callback: function() request.allow() ,
|
||||
},
|
||||
{
|
||||
label: browserBundle.GetStringFromName("geolocation.nothingLocation"),
|
||||
accessKey: browserBundle.GetStringFromName("geolocation.nothingLocationKey"),
|
||||
label: browserBundle.GetStringFromName("geolocation.dontTellThem"),
|
||||
accessKey: browserBundle.GetStringFromName("geolocation.dontTellThemKey"),
|
||||
callback: function() request.cancel() ,
|
||||
}];
|
||||
|
||||
var message = browserBundle.formatStringFromName("geolocation.requestMessage",
|
||||
var message = browserBundle.formatStringFromName("geolocation.siteWantsToKnow",
|
||||
[request.requestingURI.spec], 1);
|
||||
notificationBox.appendNotification(message,
|
||||
"geolocation",
|
||||
|
|
|
@ -136,7 +136,7 @@ PlacesController.prototype = {
|
|||
case "cmd_copy":
|
||||
return this._view.hasSelection;
|
||||
case "cmd_paste":
|
||||
return this._canInsert() && this._isClipboardDataPasteable();
|
||||
return this._canInsert(true) && this._isClipboardDataPasteable();
|
||||
case "cmd_selectAll":
|
||||
if (this._view.selType != "single") {
|
||||
var result = this._view.getResult();
|
||||
|
@ -331,9 +331,9 @@ PlacesController.prototype = {
|
|||
/**
|
||||
* Determines whether or not nodes can be inserted relative to the selection.
|
||||
*/
|
||||
_canInsert: function PC__canInsert() {
|
||||
_canInsert: function PC__canInsert(isPaste) {
|
||||
var ip = this._view.insertionPoint;
|
||||
return ip != null && ip.isTag != true;
|
||||
return ip != null && (isPaste || ip.isTag != true);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -596,7 +596,9 @@ PlacesController.prototype = {
|
|||
for (var i = 0; i < aPopup.childNodes.length; ++i) {
|
||||
var item = aPopup.childNodes[i];
|
||||
if (item.localName != "menuseparator") {
|
||||
item.hidden = (item.getAttribute("hideifnoinsertionpoint") == "true" && noIp) ||
|
||||
// We allow pasting into tag containers, so special case that.
|
||||
item.hidden = (item.getAttribute("hideifnoinsertionpoint") == "true" &&
|
||||
noIp && !(ip && ip.isTag && item.id == "placesContext_paste")) ||
|
||||
!this._shouldShowMenuItem(item, metadata);
|
||||
|
||||
if (!item.hidden) {
|
||||
|
@ -973,26 +975,13 @@ PlacesController.prototype = {
|
|||
}
|
||||
}
|
||||
else if (PlacesUtils.nodeIsDay(node)) {
|
||||
// this is the oldest date
|
||||
// for the last node endDate is end of epoch
|
||||
var beginDate = 0;
|
||||
// this is the newest date
|
||||
// day nodes have time property set to the last day in the interval
|
||||
var endDate = node.time;
|
||||
|
||||
var nodeIdx = 0;
|
||||
var cc = root.childCount;
|
||||
|
||||
// Find index of current day node
|
||||
while (nodeIdx < cc && root.getChild(nodeIdx) != node)
|
||||
++nodeIdx;
|
||||
|
||||
// We have an older day
|
||||
if (nodeIdx+1 < cc)
|
||||
beginDate = root.getChild(nodeIdx+1).time;
|
||||
|
||||
// we want to exclude beginDate from the removal
|
||||
bhist.removePagesByTimeframe(beginDate+1, endDate);
|
||||
var query = node.getQueries({})[0];
|
||||
var beginTime = query.beginTime;
|
||||
var endTime = query.endTime;
|
||||
NS_ASSERT(query && beginTime && endTime,
|
||||
"A valid date container query should exist!");
|
||||
// We want to exclude beginTime from the removal
|
||||
bhist.removePagesByTimeframe(beginTime+1, endTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1222,13 +1211,21 @@ PlacesController.prototype = {
|
|||
var transactions = [];
|
||||
var index = ip.index;
|
||||
for (var i = 0; i < items.length; ++i) {
|
||||
// adjusted to make sure that items are given the correct index -
|
||||
// transactions insert differently if index == -1
|
||||
if (ip.index > -1)
|
||||
index = ip.index + i;
|
||||
transactions.push(PlacesUIUtils.makeTransaction(items[i], type.value,
|
||||
ip.itemId, index,
|
||||
true));
|
||||
var txn;
|
||||
if (ip.isTag) {
|
||||
var uri = PlacesUtils._uri(items[i].uri);
|
||||
txn = PlacesUIUtils.ptm.tagURI(uri, [ip.itemId]);
|
||||
}
|
||||
else {
|
||||
// adjusted to make sure that items are given the correct index
|
||||
// transactions insert differently if index == -1
|
||||
// transaction will enqueue the item.
|
||||
if (ip.index > -1)
|
||||
index = ip.index + i;
|
||||
txn = PlacesUIUtils.makeTransaction(items[i], type.value,
|
||||
ip.itemId, index, true);
|
||||
}
|
||||
transactions.push(txn);
|
||||
}
|
||||
return transactions;
|
||||
}
|
||||
|
|
|
@ -1157,6 +1157,7 @@ var gEditItemOverlay = {
|
|||
|
||||
onBeginUpdateBatch: function() { },
|
||||
onEndUpdateBatch: function() { },
|
||||
onBeforeItemRemoved: function() { },
|
||||
onItemRemoved: function() { },
|
||||
onItemVisited: function() { },
|
||||
};
|
||||
|
|
|
@ -771,13 +771,13 @@ var PlacesOrganizer = {
|
|||
if (infoBox.getAttribute("minimal") == "true") {
|
||||
infoBox.removeAttribute("minimal");
|
||||
infoBoxExpanderLabel.value = infoBoxExpanderLabel.getAttribute("lesslabel");
|
||||
infoBoxExpanderLabel.setAttribute("accesskey", infoBoxExpanderLabel.getAttribute("lessaccesskey"));
|
||||
infoBoxExpanderLabel.accessKey = infoBoxExpanderLabel.getAttribute("lessaccesskey");
|
||||
infoBoxExpander.className = "expander-up";
|
||||
}
|
||||
else {
|
||||
infoBox.setAttribute("minimal", "true");
|
||||
infoBoxExpanderLabel.value = infoBoxExpanderLabel.getAttribute("morelabel");
|
||||
infoBoxExpanderLabel.setAttribute("accesskey", infoBoxExpanderLabel.getAttribute("moreaccesskey"));
|
||||
infoBoxExpanderLabel.accessKey = infoBoxExpanderLabel.getAttribute("moreaccesskey");
|
||||
infoBoxExpander.className = "expander-down";
|
||||
}
|
||||
},
|
||||
|
|
|
@ -46,11 +46,13 @@ include $(topsrcdir)/config/rules.mk
|
|||
_BROWSER_TEST_FILES = \
|
||||
browser_425884.js \
|
||||
browser_423515.js \
|
||||
browser_410196_paste_into_tags.js \
|
||||
browser_457473_no_copy_guid.js \
|
||||
browser_sort_in_library.js \
|
||||
browser_library_open_leak.js \
|
||||
browser_library_panel_leak.js \
|
||||
browser_library_search.js \
|
||||
browser_history_sidebar_search.js \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_BROWSER_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,218 @@
|
|||
/* vim:set ts=2 sw=2 sts=2 et: */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Places test code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* David Dahl <ddahl@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// Get history services
|
||||
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
var gh = hs.QueryInterface(Ci.nsIGlobalHistory2);
|
||||
var bh = hs.QueryInterface(Ci.nsIBrowserHistory);
|
||||
var ts = Cc["@mozilla.org/browser/tagging-service;1"].
|
||||
getService(Components.interfaces.nsITaggingService);
|
||||
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
|
||||
getService(Ci.nsINavBookmarksService);
|
||||
|
||||
function add_visit(aURI, aReferrer) {
|
||||
var visitId = hs.addVisit(aURI,
|
||||
Date.now() * 1000,
|
||||
aReferrer,
|
||||
hs.TRANSITION_TYPED, // user typed in URL bar
|
||||
false, // not redirect
|
||||
0);
|
||||
return visitId;
|
||||
}
|
||||
|
||||
function add_bookmark(aURI) {
|
||||
var bId = bs.insertBookmark(bs.unfiledBookmarksFolder, aURI,
|
||||
bs.DEFAULT_INDEX, "bookmark/" + aURI.spec);
|
||||
return bId;
|
||||
}
|
||||
|
||||
const TEST_URL = "http://example.com/";
|
||||
const MOZURISPEC = "http://mozilla.com/";
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
var win = window.openDialog("chrome://browser/content/places/places.xul",
|
||||
"",
|
||||
"chrome,toolbar=yes,dialog=no,resizable");
|
||||
|
||||
win.addEventListener("load", function onload() {
|
||||
win.removeEventListener("load", onload, false);
|
||||
executeSoon(function () {
|
||||
var PU = win.PlacesUtils;
|
||||
var PO = win.PlacesOrganizer;
|
||||
var PUIU = win.PlacesUIUtils;
|
||||
|
||||
// individual tests for each step of tagging a history item
|
||||
var tests = {
|
||||
|
||||
sanity: function(){
|
||||
// sanity check
|
||||
ok(PU, "PlacesUtils in scope");
|
||||
ok(PUIU, "PlacesUIUtils in scope");
|
||||
ok(PO, "Places organizer in scope");
|
||||
},
|
||||
|
||||
makeHistVisit: function() {
|
||||
// need to add a history object
|
||||
var testURI1 = PU._uri(MOZURISPEC);
|
||||
isnot(testURI1, null, "testURI is not null");
|
||||
visitId = add_visit(testURI1);
|
||||
ok(visitId > 0, "A visit was added to the history");
|
||||
ok(gh.isVisited(testURI1), MOZURISPEC + " is a visited url.");
|
||||
},
|
||||
|
||||
makeTag: function() {
|
||||
// create an initial tag to work with
|
||||
var bmId = add_bookmark(PlacesUtils._uri(TEST_URL));
|
||||
ok(bmId > 0, "A bookmark was added");
|
||||
ts.tagURI(PlacesUtils._uri(TEST_URL), ["foo"]);
|
||||
var tags = ts.getTagsForURI(PU._uri(TEST_URL), {});
|
||||
is(tags[0], 'foo', "tag is foo");
|
||||
},
|
||||
|
||||
focusTag: function (paste){
|
||||
// focus the new tag
|
||||
PO.selectLeftPaneQuery("Tags");
|
||||
var tags = PO._places.selectedNode;
|
||||
tags.containerOpen = true;
|
||||
var fooTag = tags.getChild(0);
|
||||
this.tagNode = fooTag;
|
||||
PO._places.selectNode(fooTag);
|
||||
is(this.tagNode.title, 'foo', "tagNode title is foo");
|
||||
var ip = PO._places.insertionPoint;
|
||||
ok(ip.isTag, "IP is a tag");
|
||||
if (paste) {
|
||||
ok(true, "About to paste");
|
||||
PO._places.controller.paste();
|
||||
}
|
||||
},
|
||||
|
||||
histNode: null,
|
||||
|
||||
copyHistNode: function (){
|
||||
// focus the history object
|
||||
PO.selectLeftPaneQuery("History");
|
||||
this.histNode = PO._content.view.nodeForTreeIndex(0);
|
||||
PO._content.selectNode(this.histNode);
|
||||
is(this.histNode.uri, MOZURISPEC,
|
||||
"historyNode exists: " + this.histNode.uri);
|
||||
// copy the history node
|
||||
PO._content.controller.copy();
|
||||
},
|
||||
|
||||
waitForPaste: function (){
|
||||
try {
|
||||
var xferable = Cc["@mozilla.org/widget/transferable;1"].
|
||||
createInstance(Ci.nsITransferable);
|
||||
xferable.addDataFlavor(PU.TYPE_X_MOZ_PLACE);
|
||||
PUIU.clipboard.getData(xferable, Ci.nsIClipboard.kGlobalClipboard);
|
||||
var data = { }, type = { };
|
||||
xferable.getAnyTransferData(type, data, { });
|
||||
// Data is in the clipboard
|
||||
continue_test();
|
||||
} catch (ex) {
|
||||
// check again after 100ms.
|
||||
setTimeout(tests.waitForPaste, 100);
|
||||
}
|
||||
},
|
||||
|
||||
pasteToTag: function (){
|
||||
// paste history node into tag
|
||||
this.focusTag(true);
|
||||
},
|
||||
|
||||
historyNode: function (){
|
||||
// re-focus the history again
|
||||
PO.selectLeftPaneQuery("History");
|
||||
var histNode = PO._content.view.nodeForTreeIndex(0);
|
||||
ok(histNode, "histNode exists: " + histNode.title);
|
||||
// check to see if the history node is tagged!
|
||||
var tags = PU.tagging.getTagsForURI(PU._uri(MOZURISPEC), {});
|
||||
ok(tags.length == 1, "history node is tagged: " + tags.length);
|
||||
// check if a bookmark was created
|
||||
var isBookmarked = PU.bookmarks.isBookmarked(PU._uri(MOZURISPEC));
|
||||
is(isBookmarked, true, MOZURISPEC + " is bookmarked");
|
||||
var bookmarkIds = PU.bookmarks.getBookmarkIdsForURI(
|
||||
PU._uri(histNode.uri), {});
|
||||
ok(bookmarkIds.length > 0, "bookmark exists for the tagged history item: " + bookmarkIds);
|
||||
},
|
||||
|
||||
checkForBookmarkInUI: function(){
|
||||
// is the bookmark visible in the UI?
|
||||
// get the Unsorted Bookmarks node
|
||||
PO.selectLeftPaneQuery("UnfiledBookmarks");
|
||||
// now we can see what is in the _content tree
|
||||
var unsortedNode = PO._content.view.nodeForTreeIndex(1);
|
||||
ok(unsortedNode, "unsortedNode is not null: " + unsortedNode.uri);
|
||||
is(unsortedNode.uri, MOZURISPEC, "node uri's are the same");
|
||||
},
|
||||
|
||||
tagNode: null,
|
||||
|
||||
cleanUp: function(){
|
||||
ts.untagURI(PU._uri(MOZURISPEC), ["foo"]);
|
||||
ts.untagURI(PU._uri(TEST_URL), ["foo"]);
|
||||
hs.removeAllPages();
|
||||
var tags = ts.getTagsForURI(PU._uri(TEST_URL), {});
|
||||
is(tags.length, 0, "tags are gone");
|
||||
bs.removeFolderChildren(bs.unfiledBookmarksFolder);
|
||||
}
|
||||
};
|
||||
|
||||
tests.sanity();
|
||||
tests.makeHistVisit();
|
||||
tests.makeTag();
|
||||
tests.focusTag();
|
||||
tests.copyHistNode();
|
||||
tests.waitForPaste();
|
||||
|
||||
function continue_test() {
|
||||
tests.pasteToTag();
|
||||
tests.historyNode();
|
||||
tests.checkForBookmarkInUI();
|
||||
|
||||
// remove new places data we created
|
||||
tests.cleanUp();
|
||||
|
||||
win.close();
|
||||
finish();
|
||||
}
|
||||
|
||||
});
|
||||
},false);
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Marco Bonardo <mak77@bonardo.net>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/**
|
||||
* Bug 392497 - search in history sidebar loses sort
|
||||
*/
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
|
||||
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
var bh = hs.QueryInterface(Ci.nsIBrowserHistory);
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
function uri(spec) {
|
||||
return ios.newURI(spec, null, null);
|
||||
}
|
||||
|
||||
var sidebar = document.getElementById("sidebar");
|
||||
|
||||
function add_visit(aURI, aDate) {
|
||||
var visitId = hs.addVisit(aURI,
|
||||
aDate,
|
||||
null, // no referrer
|
||||
hs.TRANSITION_TYPED, // user typed in URL bar
|
||||
false, // not redirect
|
||||
0);
|
||||
return visitId;
|
||||
}
|
||||
|
||||
// Visited pages listed by descending visit date.
|
||||
var pages = [
|
||||
"http://sidebar.mozilla.org/a",
|
||||
"http://sidebar.mozilla.org/b",
|
||||
"http://sidebar.mozilla.org/c",
|
||||
"http://www.mozilla.org/d",
|
||||
];
|
||||
// Number of pages that will be filtered out by the search.
|
||||
const FILTERED_COUNT = 1;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
// Cleanup.
|
||||
bh.removeAllPages();
|
||||
|
||||
// Add some visited page.
|
||||
var time = Date.now();
|
||||
for (var i = 0; i < pages.length; i++) {
|
||||
add_visit(uri(pages[i]), (time - i) * 1000);
|
||||
}
|
||||
|
||||
sidebar.addEventListener("load", function() {
|
||||
sidebar.removeEventListener("load", arguments.callee, true);
|
||||
executeSoon(function() {
|
||||
// Set "by last visited" in the sidebar (sort by visit date descendind).
|
||||
sidebar.contentDocument.getElementById("bylastvisited").doCommand();
|
||||
check_sidebar_tree_order(pages.length);
|
||||
var searchBox = sidebar.contentDocument.getElementById("search-box");
|
||||
ok(searchBox, "search box is in context");
|
||||
searchBox.value = "sidebar.mozilla";
|
||||
searchBox.doCommand();
|
||||
check_sidebar_tree_order(pages.length - FILTERED_COUNT);
|
||||
searchBox.value = "";
|
||||
searchBox.doCommand();
|
||||
check_sidebar_tree_order(pages.length);
|
||||
|
||||
// Cleanup.
|
||||
toggleSidebar("viewHistorySidebar", false);
|
||||
bh.removeAllPages();
|
||||
|
||||
finish();
|
||||
});
|
||||
}, true);
|
||||
toggleSidebar("viewHistorySidebar", true);
|
||||
}
|
||||
|
||||
function check_sidebar_tree_order(aExpectedRows) {
|
||||
var tree = sidebar.contentDocument.getElementById("historyTree");
|
||||
var treeView = tree.view;
|
||||
var rc = treeView.rowCount;
|
||||
is(rc, aExpectedRows, "All expected tree rows are present");
|
||||
var columns = tree.columns;
|
||||
is(columns.count, 1, "There should be only 1 column in the sidebar");
|
||||
for (var r = 0; r < rc; r++) {
|
||||
var node = treeView.nodeForTreeIndex(r);
|
||||
is(node.uri, pages[r], "Node is in correct position based on its visit date");
|
||||
}
|
||||
}
|
|
@ -167,12 +167,15 @@ function check_no_bookmarks() {
|
|||
root.containerOpen = false;
|
||||
}
|
||||
|
||||
let gTestDir = do_get_file("browser/components/places/tests/unit/");
|
||||
let gTestDir = do_get_cwd();
|
||||
const FILENAME_BOOKMARKS_HTML = "bookmarks.html";
|
||||
let backup_date = new Date().toLocaleFormat("%Y-%m-%d");
|
||||
const FILENAME_BOOKMARKS_JSON = "bookmarks-" + backup_date + ".json";
|
||||
// Number of smart bookmarks we have on the toolbar
|
||||
|
||||
// Smart bookmarks constants
|
||||
const SMART_BOOKMARKS_VERSION = 2;
|
||||
const SMART_BOOKMARKS_ON_TOOLBAR = 1;
|
||||
const SMART_BOOKMARKS_ON_MENU = 2;
|
||||
|
||||
/**
|
||||
* Creates a bookmarks.html file in the profile folder from a given source file.
|
||||
|
|
|
@ -70,8 +70,8 @@ function run_test() {
|
|||
setIntPref("browser.places.smartBookmarksVersion", -1);
|
||||
|
||||
// file pointer to legacy bookmarks file
|
||||
//var bookmarksFileOld = do_get_file("browser/components/places/tests/unit/bookmarks.large.html");
|
||||
var bookmarksFileOld = do_get_file("browser/components/places/tests/unit/bookmarks.preplaces.html");
|
||||
//var bookmarksFileOld = do_get_file("bookmarks.large.html");
|
||||
var bookmarksFileOld = do_get_file("bookmarks.preplaces.html");
|
||||
// file pointer to a new places-exported json file
|
||||
var jsonFile = dirSvc.get("ProfD", Ci.nsILocalFile);
|
||||
jsonFile.append("bookmarks.exported.json");
|
||||
|
|
|
@ -71,7 +71,7 @@ function run_test() {
|
|||
ps.setIntPref("browser.places.smartBookmarksVersion", -1);
|
||||
|
||||
// import bookmarks from corrupt file
|
||||
var corruptBookmarksFile = do_get_file("browser/components/places/tests/unit/bookmarks.corrupt.html");
|
||||
var corruptBookmarksFile = do_get_file("bookmarks.corrupt.html");
|
||||
try {
|
||||
ies.importHTMLFromFile(corruptBookmarksFile, true);
|
||||
} catch(ex) { do_throw("couldn't import corrupt bookmarks file: " + ex); }
|
||||
|
|
|
@ -102,7 +102,7 @@ function run_test() {
|
|||
setIntPref("browser.places.smartBookmarksVersion", -1);
|
||||
|
||||
// file pointer to legacy bookmarks file
|
||||
var bookmarksFileOld = do_get_file("browser/components/places/tests/unit/bookmarks.preplaces.html");
|
||||
var bookmarksFileOld = do_get_file("bookmarks.preplaces.html");
|
||||
// file pointer to a new places-exported bookmarks file
|
||||
var bookmarksFileNew = dirSvc.get("ProfD", Ci.nsILocalFile);
|
||||
bookmarksFileNew.append("bookmarks.exported.html");
|
||||
|
|
|
@ -0,0 +1,223 @@
|
|||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et: */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Places Unit Test code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Marco Bonardo <mak77@bonardo.net>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/**
|
||||
* Tests that nsBrowserGlue is correctly interpreting the preferences settable
|
||||
* by the user or by other components.
|
||||
*/
|
||||
|
||||
// Initialize browserGlue.
|
||||
var bg = Cc["@mozilla.org/browser/browserglue;1"].
|
||||
getService(Ci.nsIBrowserGlue);
|
||||
|
||||
// Initialize Places.
|
||||
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
|
||||
getService(Ci.nsINavBookmarksService);
|
||||
|
||||
// Get other services.
|
||||
var ps = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
var os = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
var as = Cc["@mozilla.org/browser/annotation-service;1"].
|
||||
getService(Ci.nsIAnnotationService);
|
||||
|
||||
const PREF_SMART_BOOKMARKS_VERSION = "browser.places.smartBookmarksVersion";
|
||||
const SMART_BOOKMARKS_ANNO = "Places/SmartBookmark";
|
||||
|
||||
const TOPIC_PLACES_INIT_COMPLETE = "places-init-complete";
|
||||
|
||||
var tests = [];
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
tests.push({
|
||||
description: "All smart bookmarks are created if smart bookmarks version is 0.",
|
||||
exec: function() {
|
||||
// Sanity check: we should not have any bookmark on the toolbar.
|
||||
do_check_eq(bs.getIdForItemAt(bs.toolbarFolder, 0), -1);
|
||||
// Sanity check: we should not have any bookmark on the menu.
|
||||
do_check_eq(bs.getIdForItemAt(bs.bookmarksMenuFolder, 0), -1);
|
||||
|
||||
// Set preferences.
|
||||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 0);
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Count items on toolbar.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR);
|
||||
// Count items on menu (+1 for the separator).
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + 1);
|
||||
|
||||
// Check version has been updated.
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION), SMART_BOOKMARKS_VERSION);
|
||||
|
||||
next_test();
|
||||
}
|
||||
});
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
tests.push({
|
||||
description: "An existing smart bookmark is replaced when version changes.",
|
||||
exec: function() {
|
||||
// Sanity check: we have a smart bookmark on the toolbar.
|
||||
var itemId = bs.getIdForItemAt(bs.toolbarFolder, 0);
|
||||
do_check_neq(itemId, -1);
|
||||
do_check_true(as.itemHasAnnotation(itemId, SMART_BOOKMARKS_ANNO));
|
||||
|
||||
// Change its title.
|
||||
bs.setItemTitle(itemId, "new title");
|
||||
do_check_eq(bs.getItemTitle(itemId), "new title");
|
||||
|
||||
// Set preferences.
|
||||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 1);
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Count items on toolbar.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR);
|
||||
// Count items on menu (+1 for the separator).
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + 1);
|
||||
|
||||
// check smart bookmark has been replaced, itemId has changed.
|
||||
itemId = bs.getIdForItemAt(bs.toolbarFolder, 0);
|
||||
do_check_neq(itemId, -1);
|
||||
do_check_neq(bs.getItemTitle(itemId), "new title");
|
||||
do_check_true(as.itemHasAnnotation(itemId, SMART_BOOKMARKS_ANNO));
|
||||
|
||||
// Check version has been updated.
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION), SMART_BOOKMARKS_VERSION);
|
||||
|
||||
next_test();
|
||||
}
|
||||
});
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
tests.push({
|
||||
description: "An explicitly removed smart bookmark should not be recreated.",
|
||||
exec: function() {
|
||||
// Set preferences.
|
||||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 1);
|
||||
// Remove toolbar's smart bookmarks
|
||||
bs.removeFolderChildren(bs.toolbarFolder);
|
||||
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Count items on toolbar, we should not have recreated the smart bookmark.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder), 0);
|
||||
// Count items on menu (+1 for the separator).
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + 1);
|
||||
|
||||
// Check version has been updated.
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION), SMART_BOOKMARKS_VERSION);
|
||||
|
||||
next_test();
|
||||
}
|
||||
});
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
tests.push({
|
||||
description: "Even if a smart bookmark has been removed recreate it if version is 0.",
|
||||
exec: function() {
|
||||
// Set preferences.
|
||||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 0);
|
||||
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Count items on toolbar, we should not have recreated the smart bookmark.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR);
|
||||
// Count items on menu (+1 for the separator).
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + 1);
|
||||
|
||||
// Check version has been updated.
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION), SMART_BOOKMARKS_VERSION);
|
||||
|
||||
finish_test();
|
||||
}
|
||||
});
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function countFolderChildren(aFolderItemId) {
|
||||
var query = hs.getNewQuery();
|
||||
query.setFolders([aFolderItemId], 1);
|
||||
var options = hs.getNewQueryOptions();
|
||||
var rootNode = hs.executeQuery(query, options).root;
|
||||
rootNode.containerOpen = true;
|
||||
var cc = rootNode.childCount;
|
||||
rootNode.containerOpen = false;
|
||||
return cc;
|
||||
}
|
||||
|
||||
function finish_test() {
|
||||
// Clean up database from all bookmarks.
|
||||
remove_all_bookmarks();
|
||||
// Simulate application closing to remove the idle observer and avoid leaks.
|
||||
os.notifyObservers(null, "quit-application-granted", null);
|
||||
do_test_finished();
|
||||
}
|
||||
|
||||
var testIndex = 0;
|
||||
function next_test() {
|
||||
// Simulate application closing to remove the idle observer and avoid leaks.
|
||||
os.notifyObservers(null, "quit-application-granted", null);
|
||||
|
||||
// nsBrowserGlue stops observing topics after first notification,
|
||||
// so we add back the observer to test additional runs.
|
||||
os.addObserver(bg, TOPIC_PLACES_INIT_COMPLETE, false);
|
||||
|
||||
// Execute next test.
|
||||
var test = tests.shift();
|
||||
dump("\nTEST " + (++testIndex) + ": " + test.description);
|
||||
test.exec();
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
// Clean up database from all bookmarks.
|
||||
remove_all_bookmarks();
|
||||
|
||||
// Kick-off tests.
|
||||
do_test_pending();
|
||||
next_test();
|
||||
}
|
|
@ -95,6 +95,8 @@ var observer = {
|
|||
this._itemAddedParent = folder;
|
||||
this._itemAddedIndex = index;
|
||||
},
|
||||
onBeforeItemRemoved: function(id) {
|
||||
},
|
||||
onItemRemoved: function(id, folder, index) {
|
||||
this._itemRemovedId = id;
|
||||
this._itemRemovedFolder = folder;
|
||||
|
|
|
@ -111,7 +111,17 @@ const PREF_AUDIO_FEED_SELECTED_READER = "browser.audioFeeds.handler.default";
|
|||
// identifying the "use plugin" action, so we use this constant instead.
|
||||
const kActionUsePlugin = 5;
|
||||
|
||||
/*
|
||||
#ifdef MOZ_WIDGET_GTK2
|
||||
*/
|
||||
const ICON_URL_APP = "moz-icon://dummy.exe?size=16";
|
||||
/*
|
||||
#else
|
||||
*/
|
||||
const ICON_URL_APP = "chrome://browser/skin/preferences/application.png";
|
||||
/*
|
||||
#endif
|
||||
*/
|
||||
|
||||
// For CSS. Can be one of "ask", "save", "plugin" or "feed". If absent, the icon URL
|
||||
// was set by us to a custom handler icon and CSS should not try to override it.
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
#endif
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
#ifdef USE_WIN_TITLE_STYLE
|
||||
style="&prefWinMinSize.styleWin;">
|
||||
style="&prefWinMinSize.styleWin2;">
|
||||
#else
|
||||
#ifdef XP_MACOSX
|
||||
style="&prefWinMinSize.styleMac;">
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
dlgbuttons="accept,cancel,help"
|
||||
ondialoghelp="openPrefsHelp()"
|
||||
title="&sanitizePrefs.title;">
|
||||
title="&sanitizePrefs2.title;">
|
||||
|
||||
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
|
||||
|
||||
|
@ -76,14 +76,14 @@
|
|||
<groupbox orient="horizontal">
|
||||
<caption label="&historySection.label;"/>
|
||||
<vbox style="width: &column.width;">
|
||||
<checkbox label="&itemVisitedPages.label;"
|
||||
accesskey="&itemVisitedPages.accesskey;"
|
||||
<checkbox label="&itemBrowsingHistory.label;"
|
||||
accesskey="&itemBrowsingHistory.accesskey;"
|
||||
preference="privacy.item.history"/>
|
||||
<checkbox label="&itemDownloadList.label;"
|
||||
accesskey="&itemDownloadList.accesskey;"
|
||||
<checkbox label="&itemDownloadHistory.label;"
|
||||
accesskey="&itemDownloadHistory.accesskey;"
|
||||
preference="privacy.item.downloads"/>
|
||||
<checkbox label="&itemFormSearchEntries.label;"
|
||||
accesskey="&itemFormSearchEntries.accesskey;"
|
||||
<checkbox label="&itemFormSearchHistory.label;"
|
||||
accesskey="&itemFormSearchHistory.accesskey;"
|
||||
preference="privacy.item.formdata"/>
|
||||
</vbox>
|
||||
<vbox style="width: &column.width;">
|
||||
|
@ -93,8 +93,8 @@
|
|||
<checkbox label="&itemActiveLogins.label;"
|
||||
accesskey="&itemActiveLogins.accesskey;"
|
||||
preference="privacy.item.sessions"/>
|
||||
<checkbox label="&itemWebCache.label;"
|
||||
accesskey="&itemWebCache.accesskey;"
|
||||
<checkbox label="&itemCache.label;"
|
||||
accesskey="&itemCache.accesskey;"
|
||||
preference="privacy.item.cache"/>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
@ -104,8 +104,8 @@
|
|||
<checkbox label="&itemPasswords.label;"
|
||||
accesskey="&itemPasswords.accesskey;"
|
||||
preference="privacy.item.passwords"/>
|
||||
<checkbox label="&itemSiteSettings.label;"
|
||||
accesskey="&itemSiteSettings.accesskey;"
|
||||
<checkbox label="&itemSitePreferences.label;"
|
||||
accesskey="&itemSitePreferences.accesskey;"
|
||||
preference="privacy.item.siteSettings"/>
|
||||
</vbox>
|
||||
<vbox style="width: &column.width;">
|
||||
|
|
|
@ -106,6 +106,14 @@
|
|||
for (let i = 0; i < elements.length; ++ i)
|
||||
elements[i].parentNode.removeChild(elements[i]);
|
||||
|
||||
// Set up the help link
|
||||
let moreInfoURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
|
||||
getService(Ci.nsIURLFormatter).
|
||||
formatURLPref("app.support.baseURL");
|
||||
let moreInfoLink = document.getElementById("moreInfoLink");
|
||||
if (moreInfoLink)
|
||||
moreInfoLink.setAttribute("href", moreInfoURL + "private-browsing");
|
||||
|
||||
// Focus the location bar
|
||||
if (mainWindow.gURLBar)
|
||||
mainWindow.focusElement(mainWindow.gURLBar);
|
||||
|
@ -153,6 +161,16 @@
|
|||
<p id="footerText" class="showPrivate">&privatebrowsingpage.howToStop;</p>
|
||||
<p id="footerTextNormal" class="showNormal">&privatebrowsingpage.howToStart;</p>
|
||||
</div>
|
||||
|
||||
<!-- More Info -->
|
||||
<div id="moreInfo" class="showPrivate">
|
||||
<p id="moreInfoText">
|
||||
&privatebrowsingpage.moreInfo;
|
||||
</p>
|
||||
<p id="moreInfoLinkContainer">
|
||||
<a id="moreInfoLink" target="_blank">&privatebrowsingpage.learnMore;</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ function do_test()
|
|||
// the active downloads array.
|
||||
|
||||
// Copy the empty downloads database to our profile directory
|
||||
let downloads = do_get_file("toolkit/components/downloads/test/downloads.empty.sqlite");
|
||||
let downloads = do_get_file("downloads.empty.sqlite");
|
||||
downloads.copyTo(dirSvc.get("ProfD", Ci.nsIFile), "downloads.sqlite");
|
||||
|
||||
// Open the database
|
||||
|
|
|
@ -39,6 +39,6 @@
|
|||
|
||||
function run_test() {
|
||||
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
|
||||
do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_autostart.js");
|
||||
load("do_test_privatebrowsing_autostart.js");
|
||||
do_test();
|
||||
}
|
||||
|
|
|
@ -40,6 +40,6 @@
|
|||
|
||||
function run_test() {
|
||||
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
|
||||
do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_exit.js");
|
||||
load("do_test_privatebrowsing_exit.js");
|
||||
do_test();
|
||||
}
|
||||
|
|
|
@ -39,6 +39,6 @@
|
|||
|
||||
function run_test() {
|
||||
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1";
|
||||
do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_autostart.js");
|
||||
load("do_test_privatebrowsing_autostart.js");
|
||||
do_test();
|
||||
}
|
||||
|
|
|
@ -40,6 +40,6 @@
|
|||
|
||||
function run_test() {
|
||||
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1";
|
||||
do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_exit.js");
|
||||
load("do_test_privatebrowsing_exit.js");
|
||||
do_test();
|
||||
}
|
||||
|
|
|
@ -44,6 +44,6 @@
|
|||
|
||||
function run_test() {
|
||||
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1";
|
||||
do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain.js");
|
||||
load("do_test_removeDataFromDomain.js");
|
||||
do_test();
|
||||
}
|
||||
|
|
|
@ -44,6 +44,6 @@
|
|||
|
||||
function run_test() {
|
||||
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
|
||||
do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain_activeDownloads.js");
|
||||
load("do_test_removeDataFromDomain_activeDownloads.js");
|
||||
do_test();
|
||||
}
|
||||
|
|
|
@ -44,6 +44,6 @@
|
|||
|
||||
function run_test() {
|
||||
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
|
||||
do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain.js");
|
||||
load("do_test_removeDataFromDomain.js");
|
||||
do_test();
|
||||
}
|
||||
|
|
|
@ -44,6 +44,6 @@
|
|||
|
||||
function run_test() {
|
||||
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
|
||||
do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain_activeDownloads.js");
|
||||
load("do_test_removeDataFromDomain_activeDownloads.js");
|
||||
do_test();
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<title>&restorepage.tabtitle;</title>
|
||||
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all"/>
|
||||
<link rel="stylesheet" href="chrome://browser/skin/aboutSessionRestore.css" type="text/css" media="all"/>
|
||||
<link rel="icon" type="image/png" href="chrome://global/skin/icons/question-16.png"/>
|
||||
<link rel="icon" type="image/png" href="chrome://global/skin/icons/warning-16.png"/>
|
||||
|
||||
<script type="application/javascript" src="chrome://browser/content/aboutSessionRestore.js"/>
|
||||
</head>
|
||||
|
@ -64,7 +64,7 @@
|
|||
|
||||
<!-- Error Title -->
|
||||
<div id="errorTitle">
|
||||
<h1 id="errorTitleText">&restorepage.pagetitle;</h1>
|
||||
<h1 id="errorTitleText">&restorepage.errorTitle;</h1>
|
||||
</div>
|
||||
|
||||
<!-- LONG CONTENT (the section most likely to require scrolling) -->
|
||||
|
@ -72,20 +72,21 @@
|
|||
|
||||
<!-- Short Description -->
|
||||
<div id="errorShortDesc">
|
||||
<p id="errorShortDescText">&restorepage.issueDesc;</p>
|
||||
<p id="errorShortDescText">&restorepage.problemDesc;</p>
|
||||
</div>
|
||||
|
||||
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
|
||||
<div id="errorLongDesc">
|
||||
<p>&restorepage.remedies;</p>
|
||||
<p>&restorepage.tryThis;</p>
|
||||
<ul>
|
||||
<li>&restorepage.dueToChrome;</li>
|
||||
<li>&restorepage.dueToContent;</li>
|
||||
<li>&restorepage.restoreSome;</li>
|
||||
<li>&restorepage.startNew;</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Short Description -->
|
||||
<div id="errorTrailerDesc">
|
||||
<p> </p>
|
||||
<tree xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
id="tabList" flex="1" seltype="single" hidecolumnpicker="true"
|
||||
onclick="onListClick(event);" onkeydown="onListKeyDown(event);"
|
||||
|
@ -106,11 +107,11 @@
|
|||
<button id="errorCancel" label="&restorepage.cancelButton;"
|
||||
accesskey="&restorepage.cancel.access;"
|
||||
oncommand="startNewSession();"/>
|
||||
<button id="errorTryAgain" label="&restorepage.restoreButton;"
|
||||
<button id="errorTryAgain" label="&restorepage.tryagainButton;"
|
||||
accesskey="&restorepage.restore.access;"
|
||||
oncommand="restoreSession();"/>
|
||||
#else
|
||||
<button id="errorTryAgain" label="&restorepage.restoreButton;"
|
||||
<button id="errorTryAgain" label="&restorepage.tryagainButton;"
|
||||
accesskey="&restorepage.restore.access;"
|
||||
oncommand="restoreSession();"/>
|
||||
<button id="errorCancel" label="&restorepage.cancelButton;"
|
||||
|
|
|
@ -408,6 +408,9 @@ Bookmark.prototype = {
|
|||
// bookmark object doesn't exist at this point
|
||||
},
|
||||
|
||||
onBeforeItemRemoved : function bm_obir(aId) {
|
||||
},
|
||||
|
||||
onItemRemoved : function bm_oir(aId, aFolder, aIndex) {
|
||||
if (this._id == aId)
|
||||
this._events.dispatch("remove", aId);
|
||||
|
@ -564,6 +567,9 @@ BookmarkFolder.prototype = {
|
|||
this._events.dispatch("addchild", aId);
|
||||
},
|
||||
|
||||
onBeforeItemRemoved : function bmf_oir(aId) {
|
||||
},
|
||||
|
||||
onItemRemoved : function bmf_oir(aId, aFolder, aIndex) {
|
||||
// handle root folder events
|
||||
if (!this._parent || this._id == aId)
|
||||
|
|
|
@ -609,6 +609,8 @@ init.d/README
|
|||
redo-prebinding.sh
|
||||
res/viewer.properties
|
||||
res/bloatcycle.html
|
||||
res/broken-image.gif
|
||||
res/loading-image.gif
|
||||
components/browsersearch.xpt
|
||||
components/nsResetPref.js
|
||||
plugins/Default Plugin.plugin/Contents/Info.plist
|
||||
|
|
|
@ -327,8 +327,8 @@ bin/res/grabber.gif
|
|||
bin/res/viewsource.css
|
||||
bin/res/mathml.css
|
||||
bin/res/arrow.gif
|
||||
bin/res/loading-image.gif
|
||||
bin/res/broken-image.gif
|
||||
bin/res/loading-image.png
|
||||
bin/res/broken-image.png
|
||||
bin/res/fonts/*
|
||||
bin/res/dtd/*
|
||||
bin/res/html/*
|
||||
|
|
|
@ -49,12 +49,9 @@ include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
|
|||
|
||||
CONFIG_DIR = instgen
|
||||
SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/firefox/7zSD.sfx
|
||||
APP_VERSION = $(shell cat $(srcdir)/../../config/version.txt)
|
||||
APP_VERSION := $(shell cat $(srcdir)/../../config/version.txt)
|
||||
DEFINES += -DAPP_VERSION=$(APP_VERSION)
|
||||
PRE_RELEASE_SUFFIX = $(shell echo $(APP_VERSION) | \
|
||||
sed -e '/pre/s/.*//g' -e '/[ab][0-9]/!s/.*//g' \
|
||||
-e 's/\(.*[0-9]\)a\([0-9]\+\)/ \1 Alpha \2/g' \
|
||||
-e 's/\(.*[0-9]\)b\([0-9]\+\)/ \1 Beta \2/g')
|
||||
PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/config/printprereleasesuffix.py $(APP_VERSION))
|
||||
DEFINES += -DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)"
|
||||
|
||||
PP_LOCALIZED_FILES = \
|
||||
|
@ -116,9 +113,9 @@ uninstaller::
|
|||
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
|
||||
$(EXIT_ON_ERROR) \
|
||||
for i in $(PP_LOCALIZED_FILES); do \
|
||||
$(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $(srcdir)/$$i > $(CONFIG_DIR)/$$i; \
|
||||
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(srcdir)/$$i > $(CONFIG_DIR)/$$i; \
|
||||
done
|
||||
$(PERL) $(topsrcdir)/config/preprocessor.pl -Fsubstitution $(DEFINES) $(ACDEFINES) \
|
||||
$(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \
|
||||
$(srcdir)/nsis/defines.nsi.in | iconv -f UTF-8 -t UTF-16LE | \
|
||||
cat $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/utf16-le-bom.bin - > \
|
||||
$(CONFIG_DIR)/defines.nsi
|
||||
|
@ -142,13 +139,13 @@ $(CONFIG_DIR)/setup.exe::
|
|||
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
|
||||
$(EXIT_ON_ERROR) \
|
||||
for i in $(PP_LOCALIZED_FILES); do \
|
||||
$(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $(srcdir)/$$i > $(CONFIG_DIR)/$$i; \
|
||||
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(srcdir)/$$i > $(CONFIG_DIR)/$$i; \
|
||||
done
|
||||
ifeq ($(CONFIG_DIR),instgen)
|
||||
$(PERL) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/make-installremoves.pl \
|
||||
../removed-files > $(CONFIG_DIR)/removed-files.log
|
||||
endif
|
||||
$(PERL) $(topsrcdir)/config/preprocessor.pl -Fsubstitution $(DEFINES) $(ACDEFINES) \
|
||||
$(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \
|
||||
$(srcdir)/nsis/defines.nsi.in | iconv -f UTF-8 -t UTF-16LE | \
|
||||
cat $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/utf16-le-bom.bin - > \
|
||||
$(CONFIG_DIR)/defines.nsi
|
||||
|
|
|
@ -58,6 +58,9 @@ Var InstallType
|
|||
Var AddStartMenuSC
|
||||
Var AddQuickLaunchSC
|
||||
Var AddDesktopSC
|
||||
Var PageName
|
||||
|
||||
!define AbortSurveyURL "http://www.kampyle.com/feedback_form/ff-feedback-form.php?site_code=8166124&form_id=12116&url="
|
||||
|
||||
; Other included files may depend upon these includes!
|
||||
; The following includes are provided by NSIS.
|
||||
|
@ -72,6 +75,7 @@ Var AddDesktopSC
|
|||
!insertmacro GetParameters
|
||||
!insertmacro GetSize
|
||||
!insertmacro StrFilter
|
||||
!insertmacro WordFind
|
||||
!insertmacro WordReplace
|
||||
|
||||
; The following includes are custom.
|
||||
|
@ -129,7 +133,8 @@ ShowInstDetails nevershow
|
|||
################################################################################
|
||||
# Modern User Interface - MUI
|
||||
|
||||
!define MUI_ABORTWARNING
|
||||
!define MOZ_MUI_CUSTOM_ABORT
|
||||
!define MUI_CUSTOMFUNCTION_ABORT "CustomAbort"
|
||||
!define MUI_ICON setup.ico
|
||||
!define MUI_UNICON setup.ico
|
||||
!define MUI_WELCOMEPAGE_TITLE_3LINES
|
||||
|
@ -477,6 +482,79 @@ Section "-InstallEndCleanup"
|
|||
${EndIf}
|
||||
SectionEnd
|
||||
|
||||
################################################################################
|
||||
# Install Abort Survey Functions
|
||||
|
||||
Function CustomAbort
|
||||
${If} "${AB_CD}" == "en-US"
|
||||
${AndIf} "$PageName" != ""
|
||||
${AndIf} ${FileExists} "$EXEDIR\nonlocalized\distribution\distribution.ini"
|
||||
ReadINIStr $0 "$EXEDIR\nonlocalized\distribution\distribution.ini" "Global" "about"
|
||||
ClearErrors
|
||||
${WordFind} "$0" "Funnelcake" "E#" $1
|
||||
${Unless} ${Errors}
|
||||
; Yes = fill out the survey and exit, No = don't fill out survey and exit,
|
||||
; Cancel = don't exit.
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION \
|
||||
"Would you like to tell us why you are canceling this installation?" \
|
||||
IDYes +1 IDNO CustomAbort_finish
|
||||
${If} "$PageName" == "Welcome"
|
||||
GetFunctionAddress $0 AbortSurveyWelcome
|
||||
${ElseIf} "$PageName" == "Options"
|
||||
GetFunctionAddress $0 AbortSurveyOptions
|
||||
${ElseIf} "$PageName" == "Directory"
|
||||
GetFunctionAddress $0 AbortSurveyDirectory
|
||||
${ElseIf} "$PageName" == "Shortcuts"
|
||||
GetFunctionAddress $0 AbortSurveyShortcuts
|
||||
${ElseIf} "$PageName" == "StartMenu"
|
||||
GetFunctionAddress $0 AbortSurveyStartMenu
|
||||
${ElseIf} "$PageName" == "Summary"
|
||||
GetFunctionAddress $0 AbortSurveySummary
|
||||
${EndIf}
|
||||
ClearErrors
|
||||
${GetParameters} $1
|
||||
${GetOptions} "$1" "/UAC:" $2
|
||||
${If} ${Errors}
|
||||
Call $0
|
||||
${Else}
|
||||
UAC::ExecCodeSegment $0
|
||||
${EndIf}
|
||||
|
||||
CustomAbort_finish:
|
||||
Return
|
||||
${EndUnless}
|
||||
${EndIf}
|
||||
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(MOZ_MUI_TEXT_ABORTWARNING)" \
|
||||
IDYES +1 IDNO +2
|
||||
Return
|
||||
Abort
|
||||
FunctionEnd
|
||||
|
||||
Function AbortSurveyWelcome
|
||||
ExecShell "open" "${AbortSurveyURL}step1"
|
||||
FunctionEnd
|
||||
|
||||
Function AbortSurveyOptions
|
||||
ExecShell "open" "${AbortSurveyURL}step2"
|
||||
FunctionEnd
|
||||
|
||||
Function AbortSurveyDirectory
|
||||
ExecShell "open" "${AbortSurveyURL}step3"
|
||||
FunctionEnd
|
||||
|
||||
Function AbortSurveyShortcuts
|
||||
ExecShell "open" "${AbortSurveyURL}step4"
|
||||
FunctionEnd
|
||||
|
||||
Function AbortSurveyStartMenu
|
||||
ExecShell "open" "${AbortSurveyURL}step5"
|
||||
FunctionEnd
|
||||
|
||||
Function AbortSurveySummary
|
||||
ExecShell "open" "${AbortSurveyURL}step6"
|
||||
FunctionEnd
|
||||
|
||||
################################################################################
|
||||
# Helper Functions
|
||||
|
||||
|
@ -484,14 +562,14 @@ Function CheckExistingInstall
|
|||
; If there is a pending file copy from a previous uninstall don't allow
|
||||
; installing until after the system has rebooted.
|
||||
IfFileExists "$INSTDIR\${FileMainEXE}.moz-upgrade" +1 +4
|
||||
MessageBox MB_YESNO "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +2
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +2
|
||||
Reboot
|
||||
Quit
|
||||
|
||||
; If there is a pending file deletion from a previous uninstall don't allow
|
||||
; installing until after the system has rebooted.
|
||||
IfFileExists "$INSTDIR\${FileMainEXE}.moz-delete" +1 +4
|
||||
MessageBox MB_YESNO "$(WARN_RESTART_REQUIRED_UNINSTALL)" IDNO +2
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UNINSTALL)" IDNO +2
|
||||
Reboot
|
||||
Quit
|
||||
|
||||
|
@ -564,6 +642,7 @@ BrandingText " "
|
|||
# Page pre, show, and leave functions
|
||||
|
||||
Function preWelcome
|
||||
StrCpy $PageName "Welcome"
|
||||
${If} ${FileExists} "$EXEDIR\localized\distribution\modern-wizard.bmp"
|
||||
Delete "$PLUGINSDIR\modern-wizard.bmp"
|
||||
CopyFiles /SILENT "$EXEDIR\localized\distribution\modern-wizard.bmp" "$PLUGINSDIR\modern-wizard.bmp"
|
||||
|
@ -571,6 +650,7 @@ Function preWelcome
|
|||
FunctionEnd
|
||||
|
||||
Function preOptions
|
||||
StrCpy $PageName "Options"
|
||||
${If} ${FileExists} "$EXEDIR\localized\distribution\modern-header.bmp"
|
||||
${AndIf} $hHeaderBitmap == ""
|
||||
Delete "$PLUGINSDIR\modern-header.bmp"
|
||||
|
@ -613,6 +693,7 @@ Function leaveOptions
|
|||
FunctionEnd
|
||||
|
||||
Function preDirectory
|
||||
StrCpy $PageName "Directory"
|
||||
${PreDirectoryCommon}
|
||||
FunctionEnd
|
||||
|
||||
|
@ -621,6 +702,7 @@ Function leaveDirectory
|
|||
FunctionEnd
|
||||
|
||||
Function preShortcuts
|
||||
StrCpy $PageName "Shortcuts"
|
||||
${CheckCustomCommon}
|
||||
!insertmacro MUI_HEADER_TEXT "$(SHORTCUTS_PAGE_TITLE)" "$(SHORTCUTS_PAGE_SUBTITLE)"
|
||||
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "shortcuts.ini"
|
||||
|
@ -637,6 +719,7 @@ Function leaveShortcuts
|
|||
FunctionEnd
|
||||
|
||||
Function preStartMenu
|
||||
StrCpy $PageName "StartMenu"
|
||||
; With the Unicode installer the path to the application's Start Menu
|
||||
; directory relative to the Start Menu's Programs directory is written to the
|
||||
; shortcuts log ini file and is used to set the default Start Menu directory.
|
||||
|
@ -676,6 +759,7 @@ Function leaveStartMenu
|
|||
FunctionEnd
|
||||
|
||||
Function preSummary
|
||||
StrCpy $PageName "Summary"
|
||||
; Setup the summary.ini file for the Custom Summary Page
|
||||
WriteINIStr "$PLUGINSDIR\summary.ini" "Settings" NumFields "3"
|
||||
|
||||
|
@ -764,6 +848,7 @@ FunctionEnd
|
|||
; When we add an optional action to the finish page the cancel button is
|
||||
; enabled. This disables it and leaves the finish button as the only choice.
|
||||
Function preFinish
|
||||
StrCpy $PageName ""
|
||||
${EndInstallLog} "${BrandFullName}"
|
||||
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "settings" "cancelenabled" "0"
|
||||
FunctionEnd
|
||||
|
@ -772,6 +857,7 @@ FunctionEnd
|
|||
# Initialization Functions
|
||||
|
||||
Function .onInit
|
||||
StrCpy $PageName ""
|
||||
StrCpy $LANGUAGE 0
|
||||
${SetBrandNameVars} "$EXEDIR\localized\distribution\setup.ini"
|
||||
|
||||
|
|
|
@ -323,8 +323,8 @@ bin\res\grabber.gif
|
|||
bin\res\viewsource.css
|
||||
bin\res\mathml.css
|
||||
bin\res\arrow.gif
|
||||
bin\res\loading-image.gif
|
||||
bin\res\broken-image.gif
|
||||
bin\res\loading-image.png
|
||||
bin\res\broken-image.png
|
||||
bin\res\fonts\*
|
||||
bin\res\dtd\*
|
||||
bin\res\html\*
|
||||
|
|
|
@ -65,7 +65,7 @@ endif
|
|||
|
||||
|
||||
run_for_effects := $(shell if ! test -d $(DIST); then $(NSINSTALL) -D $(DIST); fi; if ! test -d $(DIST)/branding; then $(NSINSTALL) -D $(DIST)/branding; fi)
|
||||
_ABS_DIST := $(shell cd $(DIST) && pwd)
|
||||
_ABS_DIST := $(call core_abspath,$(DIST))
|
||||
|
||||
ifdef MOZ_BRANDING_DIRECTORY
|
||||
SUBMAKEFILES += \
|
||||
|
@ -81,8 +81,7 @@ AB = $(firstword $(subst -, ,$(AB_CD)))
|
|||
|
||||
APP_VERSION := $(shell cat $(srcdir)/../config/version.txt)
|
||||
|
||||
PWD := $(shell pwd)
|
||||
core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
|
||||
PWD := $(CURDIR)
|
||||
|
||||
# These are defaulted to be compatible with the files the wget-en-US target
|
||||
# pulls. You may override them if you provide your own files. You _must_
|
||||
|
|
|
@ -17,6 +17,12 @@ browser.contentHandlers.types.2.uri=http://fusion.google.com/add?feedurl=%s
|
|||
# Keyword URL (for location bar searches)
|
||||
keyword.URL=http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=
|
||||
|
||||
# URL for site-specific search engines
|
||||
# TRANSLATION NOTE: {moz:domain} and {searchTerms} are placeholders for the site
|
||||
# to be searched and the user's search query. Place them in the appropriate location
|
||||
# for your locale's URL but do not translate them.
|
||||
browser.search.siteSearchURL=http://www.google.com/search?hl=en&q=site%3A{moz:domain}+{searchTerms}
|
||||
|
||||
# increment this number when anything gets changed in the list below. This will
|
||||
# cause Firefox to re-read these prefs and inject any new handlers into the
|
||||
# profile database. Note that "new" is defined as "has a different URL"; this
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
<!ENTITY restorepage.tabtitle "Restore Session">
|
||||
<!ENTITY restorepage.pagetitle "Would you like to restore your session?">
|
||||
<!-- LOCALIZATION NOTE: If "closed unexpectedly" sounds too awkward in the translation,
|
||||
you may translate "crash" instead (even though it's IT-speak) -->
|
||||
<!ENTITY restorepage.issueDesc "Your previous &brandShortName; session closed unexpectedly. We sincerely apologize for the inconvenience. You can restore the tabs and windows from your previous session, or start a new session if they are no longer needed.">
|
||||
<!ENTITY restorepage.remedies "If &brandShortName; closes repeatedly:">
|
||||
<!ENTITY restorepage.dueToChrome "Try disabling any recently added extensions in the Add-ons Manager.">
|
||||
<!ENTITY restorepage.dueToContent "Try restoring your session without any Web pages you suspect might be causing the problem:">
|
||||
|
||||
<!ENTITY restorepage.restoreButton "Restore Previous Session">
|
||||
<!-- LOCALIZATION NOTE: The title is intended to be apologetic and disarming, expressing dismay
|
||||
and regret that we are unable to restore the session for the user -->
|
||||
<!ENTITY restorepage.errorTitle "Well, this is embarrassing.">
|
||||
<!ENTITY restorepage.problemDesc "&brandShortName; is having trouble recovering your windows and tabs. This is usually caused by a recently opened web page.">
|
||||
<!ENTITY restorepage.tryThis "You can try:">
|
||||
<!ENTITY restorepage.restoreSome "Removing one or more tabs that you think may be causing the problem">
|
||||
<!ENTITY restorepage.startNew "Starting an entirely new browsing session">
|
||||
|
||||
<!ENTITY restorepage.tryagainButton "Restore">
|
||||
<!ENTITY restorepage.restore.access "R">
|
||||
<!ENTITY restorepage.cancelButton "Start New Session">
|
||||
<!ENTITY restorepage.cancel.access "S">
|
||||
|
|
|
@ -100,9 +100,13 @@
|
|||
|
||||
<!ENTITY bookmarksButton.label "Bookmarks">
|
||||
<!ENTITY bookmarksButton.tooltip "Display your bookmarks">
|
||||
<!ENTITY bookmarksSidebarCmd.accesskey "B">
|
||||
<!ENTITY bookmarksSidebarCmd.commandkey "b">
|
||||
<!ENTITY bookmarksSidebarWinCmd.commandkey "i">
|
||||
<!ENTITY bookmarksButton.accesskey "B">
|
||||
<!ENTITY bookmarksCmd.commandkey "b">
|
||||
<!-- LOCALIZATION NOTE (bookmarksSidebarGtkCmd.commandkey): This command
|
||||
- key should not contain the letters A-F, since these are reserved
|
||||
- shortcut keys on Linux. -->
|
||||
<!ENTITY bookmarksGtkCmd.commandkey "o">
|
||||
<!ENTITY bookmarksWinCmd.commandkey "i">
|
||||
|
||||
<!ENTITY historyButton.label "History">
|
||||
<!ENTITY historyButton.tooltip "Display pages you've viewed recently">
|
||||
|
@ -185,6 +189,8 @@
|
|||
<!ENTITY historyMenu.label "History">
|
||||
<!ENTITY historyMenu.accesskey "s">
|
||||
<!ENTITY historyUndoMenu.label "Recently Closed Tabs">
|
||||
<!-- LOCALIZATION NOTE (historyUndoWindowMenu): see bug 394759 -->
|
||||
<!ENTITY historyUndoWindowMenu.label "Recently Closed Windows">
|
||||
|
||||
<!ENTITY historyHomeCmd.label "Home">
|
||||
<!ENTITY showAllHistoryCmd2.label "Show All History">
|
||||
|
@ -192,6 +198,10 @@
|
|||
|
||||
<!ENTITY openCmd.commandkey "l">
|
||||
<!ENTITY urlbar.emptyText "Search Bookmarks and History">
|
||||
<!ENTITY urlbar.bookmarkhistory.emptyText "Search Bookmarks and History">
|
||||
<!ENTITY urlbar.bookmark.emptyText "Search Bookmarks">
|
||||
<!ENTITY urlbar.history.emptyText "Search History">
|
||||
<!ENTITY urlbar.none.emptyText "Type a Web address">
|
||||
<!ENTITY urlbar.accesskey "d">
|
||||
|
||||
<!--
|
||||
|
|
|
@ -61,7 +61,22 @@ blockedpluginsMessage.searchButton.accesskey=U
|
|||
|
||||
# Sanitize
|
||||
sanitizeWithPromptLabel2=Clear Recent History…
|
||||
sanitizeButton2=Clear Private Data
|
||||
# LOCALIZATION NOTE (sanitizeDialog2.everything.title): When "Time range to
|
||||
# clear" is set to "Everything", the Clear Recent History dialog's title is
|
||||
# changed to this. See UI mockup and comment 11 at bug 480169 -->
|
||||
sanitizeDialog2.everything.title=Clear All History
|
||||
sanitizeButtonOK=Clear Now
|
||||
# LOCALIZATION NOTE (sanitizeEverythingWarning): Warning that appears when "Time
|
||||
# range to clear" is set to "Everything" in Clear Recent History dialog. UI
|
||||
# mockup at bug 480169. This value is a semi-colon list of plural forms. #1 is
|
||||
# replaced with the number of history visits. %S is replaced with the date of
|
||||
# the oldest visit.
|
||||
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
|
||||
sanitizeEverythingWarning=All history will be cleared. Your history includes one page visit since %S.;All history will be cleared. Your history includes #1 page visits since %S.
|
||||
# LOCALIZATION NOTE (sanitizeEverythingNoVisitsWarning): Used in same context
|
||||
# as sanitizeEverythingWarning except this is shown instead when there are no
|
||||
# visits in the user's history.
|
||||
sanitizeEverythingNoVisitsWarning=All history will be cleared.
|
||||
|
||||
# Check for Updates
|
||||
updatesItem_default=Check for Updates…
|
||||
|
@ -79,6 +94,15 @@ feedShowFeedNew=Subscribe to '%S'…
|
|||
# History menu
|
||||
menuOpenAllInTabs.label=Open All in Tabs
|
||||
menuOpenAllInTabs.accesskey=o
|
||||
# LOCALIZATION NOTE (menuRestoreAllWindows, menuUndoCloseWindowLabel, menuUndoCloseWindowSingleTabLabel):
|
||||
# see bug 394759
|
||||
menuRestoreAllWindows.label=Restore All Windows
|
||||
menuRestoreAllWindows.accesskey=R
|
||||
# LOCALIZATION NOTE (menuUndoCloseWindowLabel): Semi-colon list of plural forms.
|
||||
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
|
||||
# #1 Window Title, #2 Number of tabs
|
||||
menuUndoCloseWindowLabel=#1 (and #2 other tab);#1 (and #2 other tabs)
|
||||
menuUndoCloseWindowSingleTabLabel=#1
|
||||
|
||||
# Unified Back-/Forward Popup
|
||||
tabHistory.current=Stay on this page
|
||||
|
@ -140,16 +164,11 @@ editBookmarkPanel.editBookmarkTitle=Edit This Bookmark
|
|||
editBookmark.removeBookmarks.label=Remove Bookmark;Remove Bookmarks (#1)
|
||||
|
||||
# Geolocation UI
|
||||
# LOCALIZATION NOTE (exactLocation, neighborhoodLocation): These do not have to be
|
||||
# exact value, instead approximations would be fine.
|
||||
# examples: Neighborhood (within 2 km)
|
||||
# Exact Location (within 3 m)
|
||||
#
|
||||
geolocation.exactLocation=Exact Location (within 10 feet)
|
||||
geolocation.exactLocationKey=E
|
||||
geolocation.nothingLocation=Nothing
|
||||
geolocation.nothingLocationKey=o
|
||||
geolocation.requestMessage=%S wants to know where you are. Tell them:
|
||||
geolocation.tellThem=Tell them
|
||||
geolocation.tellThemKey=e
|
||||
geolocation.dontTellThem=Don't tell them
|
||||
geolocation.dontTellThemKey=o
|
||||
geolocation.siteWantsToKnow=%S wants to know your location.
|
||||
|
||||
# Phishing/Malware Notification Bar.
|
||||
# LOCALIZATION NOTE (notAForgery, notAnAttack)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<!ENTITY prefWindow.titleGNOME "&brandShortName; Preferences">
|
||||
<!-- When making changes to prefWindow.styleWin test both Windows Classic and
|
||||
Luna since widget heights are different based on the OS theme -->
|
||||
<!ENTITY prefWinMinSize.styleWin "width: 42em; min-height: 39em;">
|
||||
<!ENTITY prefWinMinSize.styleWin2 "width: 42em; min-height: 37.5em;">
|
||||
<!ENTITY prefWinMinSize.styleMac "width: 47em; min-height: 40em;">
|
||||
<!ENTITY prefWinMinSize.styleGNOME "width: 45.5em; min-height: 40.5em;">
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<!ENTITY history.label "History">
|
||||
|
||||
<!ENTITY locationBar.label "Location Bar">
|
||||
|
||||
<!ENTITY locbar.pre.label "When using the location bar, suggest:">
|
||||
<!ENTITY locbar.pre.accessKey "l">
|
||||
<!ENTITY locbar.post.label "">
|
||||
|
@ -54,3 +56,54 @@
|
|||
|
||||
<!ENTITY clearDataSettings.label "Settings…">
|
||||
<!ENTITY clearDataSettings.accesskey "t">
|
||||
|
||||
<!ENTITY historyHeader.pre.label "&brandShortName; will:">
|
||||
<!ENTITY historyHeader.pre.accesskey "F">
|
||||
<!ENTITY historyHeader.remember.label "Remember history">
|
||||
<!ENTITY historyHeader.dontremember.label "Never remember history">
|
||||
<!ENTITY historyHeader.custom.label "Use custom settings for history">
|
||||
<!ENTITY historyHeader.post.label "">
|
||||
|
||||
<!ENTITY rememberDescription.label "&brandShortName; will remember your browsing, download, form and search history, and keep cookies from Web sites you visit.">
|
||||
|
||||
<!-- LOCALIZATION NOTE (rememberActions.pre.label): include a trailing space as needed -->
|
||||
<!-- LOCALIZATION NOTE (rememberActions.middle.label): include a starting and trailing space as needed -->
|
||||
<!-- LOCALIZATION NOTE (rememberActions.post.label): include a starting space as needed -->
|
||||
<!ENTITY rememberActions.pre.label "You may want to ">
|
||||
<!ENTITY rememberActions.clearHistory.label "clear your recent history">
|
||||
<!ENTITY rememberActions.middle.label ", or ">
|
||||
<!ENTITY rememberActions.removeCookies.label "remove individual cookies">
|
||||
<!ENTITY rememberActions.post.label ".">
|
||||
|
||||
<!ENTITY dontrememberDescription.label "&brandShortName; will use the same settings as private browsing, and will not remember any history as you browse the Web.">
|
||||
|
||||
<!-- LOCALIZATION NOTE (dontrememberActions.pre.label): include a trailing space as needed -->
|
||||
<!-- LOCALIZATION NOTE (dontrememberActions.post.label): include a starting space as needed -->
|
||||
<!ENTITY dontrememberActions.pre.label "You may also want to ">
|
||||
<!ENTITY dontrememberActions.clearHistory.label "clear all current history">
|
||||
<!ENTITY dontrememberActions.post.label ".">
|
||||
|
||||
<!ENTITY privateBrowsingAutoStart.label "Automatically start &brandShortName; in a private browsing session">
|
||||
<!ENTITY privateBrowsingAutoStart.accesskey "A">
|
||||
|
||||
<!-- LOCALIZATION NOTE:
|
||||
The entities rememberHistory.pre.label and rememberHistory.post.label appear on a single
|
||||
line in preferences as follows:
|
||||
|
||||
&rememberHistory.pre.label [ textbox for number of days ] &rememberHistory.post.label;
|
||||
-->
|
||||
<!ENTITY rememberHistory.pre.label "Remember my browsing history for at least">
|
||||
<!ENTITY rememberHistory.pre.accesskey "h">
|
||||
<!ENTITY rememberHistory.post.label "days">
|
||||
|
||||
<!ENTITY rememberDownload.label "Remember download history">
|
||||
<!ENTITY rememberDownload.accesskey "d">
|
||||
|
||||
<!ENTITY rememberSearchForm.label "Remember search and form history">
|
||||
<!ENTITY rememberSearchForm.accesskey "f">
|
||||
|
||||
<!ENTITY clearOnClose.label "Clear history when &brandShortName; closes">
|
||||
<!ENTITY clearOnClose.accesskey "w">
|
||||
|
||||
<!ENTITY clearOnCloseSettings.label "Settings…">
|
||||
<!ENTITY clearOnCloseSettings.accesskey "t">
|
||||
|
|
|
@ -1,43 +1,62 @@
|
|||
<!ENTITY sanitizePrefs.title "Clear Private Data">
|
||||
<!ENTITY sanitizePrefs2.title "Settings for Clearing History">
|
||||
<!ENTITY sanitizeDialog2.title "Clear Recent History">
|
||||
|
||||
<!ENTITY sanitizeItems.label "Clear the following items now:">
|
||||
<!ENTITY clearDataSettings2.label "When I quit &brandShortName;, it should automatically clear all:">
|
||||
|
||||
<!-- XXX rearrange entities to match physical layout when l10n isn't an issue -->
|
||||
|
||||
<!ENTITY clearDuration.label "Remove ">
|
||||
<!ENTITY clearDuration.accesskey "R">
|
||||
<!ENTITY clearDuration.lastHour "the last hour">
|
||||
<!ENTITY clearDuration.last2Hours "the last 2 hours">
|
||||
<!ENTITY clearDuration.last4Hours "the last 4 hours">
|
||||
<!ENTITY clearDuration.today "my history for today">
|
||||
<!ENTITY clearDuration.everything "my entire history">
|
||||
<!-- Localization note (clearDuration.suffix) - trailing entity for languages
|
||||
<!-- LOCALIZATION NOTE (clearTimeDuration.*): "Time range to clear" dropdown.
|
||||
See UI mockup at bug 480169 -->
|
||||
<!ENTITY clearTimeDuration.label "Time range to clear: ">
|
||||
<!ENTITY clearTimeDuration.accesskey "T">
|
||||
<!ENTITY clearTimeDuration.lastHour "Last Hour">
|
||||
<!ENTITY clearTimeDuration.last2Hours "Last Two Hours">
|
||||
<!ENTITY clearTimeDuration.last4Hours "Last Four Hours">
|
||||
<!ENTITY clearTimeDuration.today "Today">
|
||||
<!ENTITY clearTimeDuration.everything "Everything">
|
||||
<!-- Localization note (clearTimeDuration.suffix) - trailing entity for languages
|
||||
that require it. -->
|
||||
<!ENTITY clearDuration.suffix "">
|
||||
<!ENTITY clearTimeDuration.suffix "">
|
||||
<!ENTITY clearTimeDuration.dateColumn "Visit Date">
|
||||
<!ENTITY clearTimeDuration.nameColumn "Name">
|
||||
|
||||
<!-- LOCALIZATION NOTE (detailsProgressiveDisclosure.*): Labels and accesskeys
|
||||
of the "Details" progressive disclosure button. See UI mockup at bug
|
||||
480169 -->
|
||||
<!ENTITY detailsProgressiveDisclosure.label "Details">
|
||||
<!ENTITY detailsProgressiveDisclosure.accesskey "e">
|
||||
|
||||
<!ENTITY historySection.label "History">
|
||||
<!ENTITY dataSection.label "Data">
|
||||
|
||||
<!ENTITY itemVisitedPages.label "Visited Pages">
|
||||
<!ENTITY itemVisitedPages.accesskey "V">
|
||||
<!ENTITY itemFormSearchEntries.label "Form & Search Entries">
|
||||
<!ENTITY itemFormSearchEntries.accesskey "F">
|
||||
<!ENTITY itemPasswords.label "Saved Passwords">
|
||||
<!ENTITY itemPasswords.accesskey "P">
|
||||
<!ENTITY itemCookies.label "Cookies">
|
||||
<!ENTITY itemCookies.accesskey "C">
|
||||
<!ENTITY itemWebCache.label "Web Cache">
|
||||
<!ENTITY itemWebCache.accesskey "W">
|
||||
<!ENTITY itemOfflineApps.label "Offline Website Data">
|
||||
<!ENTITY itemOfflineApps.accesskey "O">
|
||||
<!ENTITY itemDownloadList.label "Download List">
|
||||
<!ENTITY itemDownloadList.accesskey "D">
|
||||
<!ENTITY itemActiveLogins.label "Active Logins">
|
||||
<!ENTITY itemActiveLogins.accesskey "L">
|
||||
<!ENTITY itemSiteSettings.label "Site-specific Settings">
|
||||
<!ENTITY itemSiteSettings.accesskey "S">
|
||||
<!-- LOCALIZATION NOTE (item*): itemHistoryAndDownloads.* and
|
||||
itemBrowsingHistory.* will never be used at the same time, so they can
|
||||
have the same accesskey. -->
|
||||
<!ENTITY itemHistoryAndDownloads.label "Browsing and Download History">
|
||||
<!ENTITY itemHistoryAndDownloads.accesskey "B">
|
||||
<!ENTITY itemBrowsingHistory.label "Browsing History">
|
||||
<!ENTITY itemBrowsingHistory.accesskey "B">
|
||||
<!ENTITY itemFormSearchHistory.label "Form & Search History">
|
||||
<!ENTITY itemFormSearchHistory.accesskey "F">
|
||||
<!ENTITY itemPasswords.label "Saved Passwords">
|
||||
<!ENTITY itemPasswords.accesskey "P">
|
||||
<!ENTITY itemCookies.label "Cookies">
|
||||
<!ENTITY itemCookies.accesskey "C">
|
||||
<!ENTITY itemCache.label "Cache">
|
||||
<!ENTITY itemCache.accesskey "A">
|
||||
<!ENTITY itemOfflineApps.label "Offline Website Data">
|
||||
<!ENTITY itemOfflineApps.accesskey "O">
|
||||
<!ENTITY itemDownloadHistory.label "Download History">
|
||||
<!ENTITY itemDownloadHistory.accesskey "D">
|
||||
<!ENTITY itemActiveLogins.label "Active Logins">
|
||||
<!ENTITY itemActiveLogins.accesskey "L">
|
||||
<!ENTITY itemSitePreferences.label "Site Preferences">
|
||||
<!ENTITY itemSitePreferences.accesskey "S">
|
||||
|
||||
<!ENTITY window.width "30em">
|
||||
<!-- LOCALIZATION NOTE (sanitizeEverythingUndoWarning): Second warning paragraph
|
||||
that appears when "Time range to clear" is set to "Everything". See UI
|
||||
mockup at bug 480169 -->
|
||||
<!ENTITY sanitizeEverythingUndoWarning "This action cannot be undone.">
|
||||
|
||||
<!ENTITY dialog.width "32em">
|
||||
<!ENTITY column.width "14em">
|
||||
|
|
|
@ -59,3 +59,21 @@ body.normal > #errorPageContainer {
|
|||
#footerDesc > p {
|
||||
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
|
||||
}
|
||||
|
||||
#moreInfo {
|
||||
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
|
||||
-moz-padding-start: 25px;
|
||||
background: url("moz-icon://stock/gtk-dialog-info?size=menu") no-repeat top left;
|
||||
}
|
||||
|
||||
body[dir="rtl"] #moreInfo {
|
||||
background-position: top right;
|
||||
}
|
||||
|
||||
#moreInfoText {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#moreInfoLinkContainer {
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
%endif
|
||||
|
||||
#errorPageContainer {
|
||||
background-image: url("moz-icon://stock/gtk-dialog-question?size=dialog");
|
||||
background-image: url("moz-icon://stock/gtk-dialog-warning?size=dialog");
|
||||
}
|
||||
|
||||
#tabList {
|
||||
|
|
|
@ -222,7 +222,7 @@ menuitem:not([type]) {
|
|||
}
|
||||
|
||||
#placesContext_open\:newwindow,
|
||||
menuitem[command="cmd_newNavigator"],
|
||||
#menu_newNavigator,
|
||||
#context-openlink,
|
||||
#context-openframe {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
|
||||
|
@ -231,14 +231,14 @@ menuitem[command="cmd_newNavigator"],
|
|||
|
||||
#placesContext_open\:newtab,
|
||||
#placesContext_openContainer\:tabs,
|
||||
menuitem[command="cmd_newNavigatorTab"],
|
||||
#menu_newNavigatorTab,
|
||||
#context-openlinkintab,
|
||||
#context-openframeintab {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
|
||||
-moz-image-region: rect(0px 64px 16px 48px);
|
||||
}
|
||||
|
||||
menuitem[command="Browser:OpenFile"] {
|
||||
#menu_openFile {
|
||||
list-style-image: url("moz-icon://stock/gtk-open?size=menu");
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ menuitem[command="Browser:OpenFile"] {
|
|||
list-style-image: url("moz-icon://stock/gtk-media-pause?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="Browser:SavePage"],
|
||||
#menu_savePage,
|
||||
#context-savelink,
|
||||
#context-saveimage,
|
||||
#context-savevideo,
|
||||
|
@ -264,11 +264,11 @@ menuitem[command="Browser:SavePage"],
|
|||
list-style-image: url("moz-icon://stock/gtk-save-as?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_printPreview"] {
|
||||
#menu_printPreview {
|
||||
list-style-image: url("moz-icon://stock/gtk-print-preview?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_print"],
|
||||
#menu_print,
|
||||
#context-printframe {
|
||||
list-style-image: url("moz-icon://stock/gtk-print?size=menu");
|
||||
}
|
||||
|
@ -277,35 +277,38 @@ menuitem[command="cmd_print"],
|
|||
list-style-image: url("moz-icon://stock/gtk-quit?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_undo"],
|
||||
#menu_undo,
|
||||
#context-undo {
|
||||
list-style-image: url("moz-icon://stock/gtk-undo?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_undo"][disabled],
|
||||
#menu_undo[disabled],
|
||||
#context-undo[disabled] {
|
||||
list-style-image: url("moz-icon://stock/gtk-undo?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_redo"] {
|
||||
#menu_redo {
|
||||
list-style-image: url("moz-icon://stock/gtk-redo?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_redo"][disabled] {
|
||||
#menu_redo[disabled] {
|
||||
list-style-image: url("moz-icon://stock/gtk-redo?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_cut"],
|
||||
#menu_cut,
|
||||
#placesContext_cut,
|
||||
#context-cut {
|
||||
list-style-image: url("moz-icon://stock/gtk-cut?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_cut"][disabled],
|
||||
#menu_cut[disabled],
|
||||
#placesContext_cut[disabled],
|
||||
#context-cut[disabled] {
|
||||
list-style-image: url("moz-icon://stock/gtk-cut?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_copy"],
|
||||
#menu_copy,
|
||||
#placesContext_copy,
|
||||
#context-copy,
|
||||
#context-copyimage,
|
||||
#context-copyvideourl,
|
||||
|
@ -315,32 +318,40 @@ menuitem[command="cmd_copy"],
|
|||
list-style-image: url("moz-icon://stock/gtk-copy?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_copy"][disabled],
|
||||
#menu_copy[disabled],
|
||||
#placesContext_copy[disabled],
|
||||
#context-copy[disabled] {
|
||||
list-style-image: url("moz-icon://stock/gtk-copy?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_paste"],
|
||||
#menu_paste,
|
||||
#placesContext_paste,
|
||||
#context-paste {
|
||||
list-style-image: url("moz-icon://stock/gtk-paste?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_paste"][disabled],
|
||||
#menu_paste[disabled],
|
||||
#placesContext_paste[disabled],
|
||||
#context-paste[disabled] {
|
||||
list-style-image: url("moz-icon://stock/gtk-paste?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_delete"],
|
||||
#menu_delete,
|
||||
#placesContext_delete,
|
||||
#placesContext_delete_history,
|
||||
#context-delete {
|
||||
list-style-image: url("moz-icon://stock/gtk-delete?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_delete"][disabled],
|
||||
#menu_delete[disabled],
|
||||
#placesContext_delete[disabled],
|
||||
#placesContext_delete_history[disabled],
|
||||
#context-delete[disabled] {
|
||||
list-style-image: url("moz-icon://stock/gtk-delete?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_selectAll"] {
|
||||
#menu_selectAll,
|
||||
#context-selectall {
|
||||
list-style-image: url("moz-icon://stock/gtk-select-all?size=menu");
|
||||
}
|
||||
|
||||
|
@ -356,77 +367,77 @@ menuitem[command="cmd_selectAll"] {
|
|||
list-style-image: url("moz-icon://stock/gtk-preferences?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="Browser:Stop"],
|
||||
#menu_stop,
|
||||
#context-stop {
|
||||
list-style-image: url("moz-icon://stock/gtk-stop?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="Browser:Stop"][disabled],
|
||||
#menu_stop[disabled],
|
||||
#context-stop[disabled] {
|
||||
list-style-image: url("moz-icon://stock/gtk-stop?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
#menu_reload,
|
||||
#placesContext_reload,
|
||||
#placesContext_reloadMicrosummary,
|
||||
menuitem[command="Browser:ReloadOrDuplicate"],
|
||||
#context-reload,
|
||||
#context-reloadframe {
|
||||
list-style-image: url("moz-icon://stock/gtk-refresh?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="Browser:ReloadOrDuplicate"][disabled],
|
||||
#menu_reload[disabled],
|
||||
#context-reload[disabled] {
|
||||
list-style-image: url("moz-icon://stock/gtk-refresh?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_fullZoomEnlarge"] {
|
||||
#menu_zoomEnlarge {
|
||||
list-style-image: url("moz-icon://stock/gtk-zoom-in?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_fullZoomReduce"] {
|
||||
#menu_zoomReduce {
|
||||
list-style-image: url("moz-icon://stock/gtk-zoom-out?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="cmd_fullZoomReset"] {
|
||||
#menu_zoomReset {
|
||||
list-style-image: url("moz-icon://stock/gtk-zoom-100?size=menu");
|
||||
}
|
||||
|
||||
menuitem[key="goBackKb"],
|
||||
#historyMenuBack,
|
||||
#context-back {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=menu");
|
||||
}
|
||||
|
||||
menuitem[key="goBackKb"][disabled],
|
||||
#historyMenuBack[disabled],
|
||||
#context-back[disabled] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
menuitem[key="goBackKb"][chromedir="rtl"],
|
||||
#historyMenuBack[chromedir="rtl"],
|
||||
#context-back[chromedir="rtl"] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu");
|
||||
}
|
||||
|
||||
menuitem[key="goBackKb"][disabled][chromedir="rtl"],
|
||||
#historyMenuBack[disabled][chromedir="rtl"],
|
||||
#context-back[disabled][chromedir="rtl"] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
menuitem[key="goForwardKb"],
|
||||
#historyMenuForward,
|
||||
#context-forward {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu");
|
||||
}
|
||||
|
||||
menuitem[key="goForwardKb"][disabled],
|
||||
#historyMenuForward[disabled],
|
||||
#context-forward[disabled] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
menuitem[key="goForwardKb"][chromedir="rtl"],
|
||||
#historyMenuForward[chromedir="rtl"],
|
||||
#context-forward[chromedir="rtl"] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu");
|
||||
}
|
||||
|
||||
menuitem[key="goForwardKb"][disabled][chromedir="rtl"],
|
||||
#historyMenuForward[disabled][chromedir="rtl"],
|
||||
#context-forward[disabled][chromedir="rtl"] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu&state=disabled");
|
||||
}
|
||||
|
@ -435,12 +446,12 @@ menuitem[key="goForwardKb"][disabled][chromedir="rtl"],
|
|||
list-style-image: url("moz-icon://stock/gtk-home?size=menu");
|
||||
}
|
||||
|
||||
menuitem[command="Browser:ShowAllHistory"] {
|
||||
#menu_showAllHistory {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
|
||||
-moz-image-region: rect(0px 32px 16px 16px);
|
||||
}
|
||||
|
||||
menuitem[command="Browser:ShowAllBookmarks"] {
|
||||
#bookmarksShowAll {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
|
||||
-moz-image-region: rect(0px 48px 16px 32px);
|
||||
}
|
||||
|
@ -454,7 +465,7 @@ menuitem[command="Browser:ShowAllBookmarks"] {
|
|||
-moz-image-region: rect(0px 16px 16px 0px);
|
||||
}
|
||||
|
||||
menuitem[command="View:PageInfo"],
|
||||
#menu_pageInfo,
|
||||
#context-viewinfo,
|
||||
#context-viewframeinfo {
|
||||
list-style-image: url("moz-icon://stock/gtk-info?size=menu");
|
||||
|
@ -469,7 +480,7 @@ menuitem[command="View:PageInfo"],
|
|||
list-style-image: url("moz-icon://stock/gtk-clear?size=menu");
|
||||
}
|
||||
|
||||
menuitem[key="key_openHelp"] {
|
||||
#menu_openHelp {
|
||||
list-style-image: url("moz-icon://stock/gtk-help?size=menu");
|
||||
}
|
||||
|
||||
|
@ -1091,6 +1102,11 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] {
|
|||
font-size: 130%;
|
||||
}
|
||||
|
||||
#editBookmarkPanelHeader,
|
||||
#editBookmarkPanelContent {
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
|
||||
/* Implements editBookmarkPanel resizing on folderTree un-collapse. */
|
||||
#editBMPanel_folderTree {
|
||||
min-width: 27em;
|
||||
|
@ -1299,9 +1315,13 @@ tabpanels {
|
|||
opacity: 0.0;
|
||||
}
|
||||
|
||||
.tabs-alltabs-button {
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
.tabs-alltabs-button > .toolbarbutton-icon {
|
||||
list-style-image: url("chrome://browser/skin/tabbrowser/alltabs.png");
|
||||
margin: 2px 0 2px;
|
||||
margin: 2px 0 1px;
|
||||
}
|
||||
|
||||
/* Sidebar */
|
||||
|
|
|
@ -57,7 +57,6 @@ classic.jar:
|
|||
skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png)
|
||||
skin/classic/browser/places/wrench.png (places/wrench.png)
|
||||
skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png)
|
||||
skin/classic/browser/preferences/application.png (preferences/application.png)
|
||||
skin/classic/browser/preferences/mail.png (preferences/mail.png)
|
||||
skin/classic/browser/preferences/Options.png (preferences/Options.png)
|
||||
* skin/classic/browser/preferences/preferences.css (preferences/preferences.css)
|
||||
|
|
|
@ -84,7 +84,6 @@
|
|||
}
|
||||
|
||||
.small, .small[disabled="true"] {
|
||||
font-size: x-small;
|
||||
min-width: 0px;
|
||||
padding: 0px 4px 0px 4px;
|
||||
margin: 0px;
|
||||
|
|
Двоичные данные
browser/themes/gnomestripe/browser/places/starPage.png
Двоичные данные
browser/themes/gnomestripe/browser/places/starPage.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 575 B После Ширина: | Высота: | Размер: 723 B |
Двоичные данные
browser/themes/gnomestripe/browser/preferences/application.png
Двоичные данные
browser/themes/gnomestripe/browser/preferences/application.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 547 B |
|
@ -59,3 +59,21 @@ body.normal > #errorPageContainer {
|
|||
#footerDesc > p {
|
||||
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
|
||||
}
|
||||
|
||||
#moreInfo {
|
||||
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
|
||||
-moz-padding-start: 25px;
|
||||
background: url("chrome://global/skin/icons/information-16.png") no-repeat top left;
|
||||
}
|
||||
|
||||
body[dir="rtl"] #moreInfo {
|
||||
background-position: top right;
|
||||
}
|
||||
|
||||
#moreInfoText {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#moreInfoLinkContainer {
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
%endif
|
||||
|
||||
#errorPageContainer {
|
||||
background-image: url("chrome://global/skin/icons/question-64.png");
|
||||
background-image: url("chrome://global/skin/icons/warning-64.png");
|
||||
}
|
||||
|
||||
#tabList {
|
||||
|
|
|
@ -1039,7 +1039,6 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
#editBookmarkPanelTitle {
|
||||
font-size: 130%;
|
||||
font-weight: bold;
|
||||
margin: 2px 12px 0px 9px;
|
||||
}
|
||||
|
||||
#editBookmarkPanel > hbox,
|
||||
|
@ -1049,8 +1048,8 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
|
||||
/**** HUD style buttons ****/
|
||||
|
||||
#editBookmarkPanel > hbox > vbox > hbox > button,
|
||||
#editBookmarkPanel > #editBookmarkPanelBottomButtons > button {
|
||||
#editBookmarkPanelHeader > vbox > hbox > button,
|
||||
#editBookmarkPanelBottomButtons > button {
|
||||
-moz-appearance: none;
|
||||
background: url("chrome://browser/skin/hud-style-button-middle-background.png") repeat-x #464646 center center;
|
||||
border-width: 3px;
|
||||
|
@ -1067,27 +1066,32 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
color: #ffffff;
|
||||
}
|
||||
|
||||
#editBookmarkPanel > hbox > vbox > hbox > button:hover:active,
|
||||
#editBookmarkPanel > #editBookmarkPanelBottomButtons > button:hover:active {
|
||||
#editBookmarkPanelHeader > vbox > hbox > button:hover:active,
|
||||
#editBookmarkPanelBottomButtons > button:hover:active {
|
||||
background-color: #86888B;
|
||||
}
|
||||
|
||||
#editBookmarkPanel > hbox > vbox > hbox > button:focus,
|
||||
#editBookmarkPanel > #editBookmarkPanelBottomButtons > button:focus {
|
||||
#editBookmarkPanelHeader > vbox > hbox > button:focus,
|
||||
#editBookmarkPanelBottomButtons > button:focus {
|
||||
outline: 2px solid -moz-mac-focusring;
|
||||
outline-offset: -2px;
|
||||
-moz-outline-radius: 100%;
|
||||
}
|
||||
|
||||
#editBookmarkPanel > #editBookmarkPanelBottomButtons > button[default="true"] {
|
||||
#editBookmarkPanelBottomButtons > button[default="true"] {
|
||||
background-color: #666;
|
||||
}
|
||||
|
||||
#editBookmarkPanel > #editBookmarkPanelContent {
|
||||
margin-top: 6px;
|
||||
#editBookmarkPanelHeader {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_newFolderBox {
|
||||
/* The following elements come from editBookmarkOverlay.xul. Styling that's
|
||||
specific to the editBookmarkPanel should be in browser.css. Styling that
|
||||
should be shared by all editBookmarkOverlay.xul consumers should be in
|
||||
editBookmarkOverlay.css. */
|
||||
|
||||
#editBMPanel_newFolderBox {
|
||||
background-image: url("chrome://browser/skin/hud-style-new-folder-bar-background.png");
|
||||
background-repeat: repeat-x;
|
||||
border: 0;
|
||||
|
@ -1102,7 +1106,7 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
height: 20px;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_newFolderButton {
|
||||
#editBMPanel_newFolderButton {
|
||||
-moz-appearance: none;
|
||||
background-color: transparent !important;
|
||||
border: 0;
|
||||
|
@ -1119,21 +1123,21 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
list-style-image: url("chrome://browser/skin/hud-style-new-folder-plus-sign.png") !important;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_newFolderButton:hover:active {
|
||||
#editBMPanel_newFolderButton:hover:active {
|
||||
background-color: #86888B;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_newFolderButton:focus {
|
||||
#editBMPanel_newFolderButton:focus {
|
||||
outline: 2px solid -moz-mac-focusring;
|
||||
outline-offset: -2px;
|
||||
-moz-outline-radius: 1px;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_newFolderButton .button-text {
|
||||
#editBMPanel_newFolderButton .button-text {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_folderMenuList {
|
||||
#editBMPanel_folderMenuList {
|
||||
-moz-appearance: none;
|
||||
background: url("chrome://browser/skin/hud-style-button-middle-background.png") repeat-x #464646 center center;
|
||||
border: 3px solid;
|
||||
|
@ -1148,18 +1152,18 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_folderMenuList:focus {
|
||||
#editBMPanel_folderMenuList:focus {
|
||||
outline: 2px solid -moz-mac-focusring;
|
||||
outline-offset: -2px;
|
||||
-moz-outline-radius: 5px;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_folderMenuList[open="true"],
|
||||
#editBookmarkPanel #editBMPanel_folderMenuList:hover:active {
|
||||
#editBMPanel_folderMenuList[open="true"],
|
||||
#editBMPanel_folderMenuList:hover:active {
|
||||
background-image: url("chrome://browser/skin/hud-style-button-middle-background-active.png");
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_folderMenuList > .menulist-dropmarker {
|
||||
#editBMPanel_folderMenuList > .menulist-dropmarker {
|
||||
-moz-appearance: none;
|
||||
display: -moz-box;
|
||||
background-color: transparent;
|
||||
|
@ -1168,13 +1172,13 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_folderMenuList > .menulist-dropmarker > .dropmarker-icon {
|
||||
#editBMPanel_folderMenuList > .menulist-dropmarker > .dropmarker-icon {
|
||||
list-style-image: url("chrome://browser/skin/hud-style-dropmarker-double-arrows.png");
|
||||
}
|
||||
|
||||
/**** folder tree ****/
|
||||
|
||||
#editBookmarkPanel #editBMPanel_folderTree {
|
||||
#editBMPanel_folderTree {
|
||||
background-color: #333333;
|
||||
border-top: 2px solid !important;
|
||||
border-right: 0 !important;
|
||||
|
@ -1186,7 +1190,7 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
min-width: 27em;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_folderTree:focus {
|
||||
#editBMPanel_folderTree:focus {
|
||||
outline: 2px solid -moz-mac-focusring;
|
||||
outline-offset: -1px;
|
||||
-moz-outline-radius: 1px;
|
||||
|
@ -1215,7 +1219,7 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
-moz-image-region: rect(0px, 40px, 10px, 30px);
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_tagsSelector {
|
||||
#editBMPanel_tagsSelector {
|
||||
-moz-appearance: none;
|
||||
background-color: #333333;
|
||||
border-top: 2px solid !important;
|
||||
|
@ -1227,13 +1231,13 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_tagsSelector:focus {
|
||||
#editBMPanel_tagsSelector:focus {
|
||||
outline: 2px solid -moz-mac-focusring;
|
||||
outline-offset: -2px;
|
||||
-moz-outline-radius: 1px;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_tagsSelector .listcell-check {
|
||||
#editBMPanel_tagsSelector .listcell-check {
|
||||
-moz-appearance: none !important;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
|
@ -1242,7 +1246,7 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
min-width: 14px;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_tagsSelector .listcell-check[checked="true"] {
|
||||
#editBMPanel_tagsSelector .listcell-check[checked="true"] {
|
||||
list-style-image: url("chrome://browser/skin/hud-style-check-box-checked.png");
|
||||
}
|
||||
|
||||
|
@ -1265,7 +1269,7 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
background-color: #b3b3b3 !important;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_tagsSelector > listitem[selected="true"] {
|
||||
#editBMPanel_tagsSelector > listitem[selected="true"] {
|
||||
color: #222222;
|
||||
background-color: #b3b3b3;
|
||||
}
|
||||
|
@ -1321,20 +1325,20 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
|
||||
/**** name picker ****/
|
||||
|
||||
#editBookmarkPanel #editBMPanel_namePicker[droppable="false"] {
|
||||
#editBMPanel_namePicker[droppable="false"] {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_namePicker[droppable="false"] > .menulist-dropmarker {
|
||||
#editBMPanel_namePicker[droppable="false"] > .menulist-dropmarker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_tagsField[focused="true"] {
|
||||
#editBMPanel_tagsField[focused="true"] {
|
||||
background-color: #eeeeee;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_namePicker[droppable="false"] > .menulist-editable-box {
|
||||
#editBMPanel_namePicker[droppable="false"] > .menulist-editable-box {
|
||||
-moz-appearance: none !important;
|
||||
cursor: text;
|
||||
margin: 2px 4px;
|
||||
|
@ -1349,11 +1353,11 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
color: #ffffff;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_tagsField[empty="true"] {
|
||||
#editBMPanel_tagsField[empty="true"] {
|
||||
color: #bbbbbb;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_namePicker[droppable="false"][focused="true"] > .menulist-editable-box {
|
||||
#editBMPanel_namePicker[droppable="false"][focused="true"] > .menulist-editable-box {
|
||||
outline: 2px solid -moz-mac-focusring;
|
||||
outline-offset: -1px;
|
||||
-moz-outline-radius: 1px;
|
||||
|
@ -1361,11 +1365,11 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
color: #000000;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_namePicker[droppable="false"][disabled="true"] > .menulist-editable-box {
|
||||
#editBMPanel_namePicker[droppable="false"][disabled="true"] > .menulist-editable-box {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_namePicker[droppable="false"] > .menulist-editable-box > html|*.menulist-editable-input {
|
||||
#editBMPanel_namePicker[droppable="false"] > .menulist-editable-box > html|*.menulist-editable-input {
|
||||
margin: 0px !important;
|
||||
border: none !important;
|
||||
padding: 0px !important;
|
||||
|
@ -1374,11 +1378,11 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark,
|
|||
font: inherit;
|
||||
}
|
||||
|
||||
#editBookmarkPanel #editBMPanel_namePicker[droppable="false"][focused="true"] > .menulist-editable-box > html|*.menulist-editable-input {
|
||||
#editBMPanel_namePicker[droppable="false"][focused="true"] > .menulist-editable-box > html|*.menulist-editable-input {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#editBookmarkPanel > #editBookmarkPanelContent > #editBookmarkPanelGrid > rows > row > label {
|
||||
#editBookmarkPanelGrid > rows > row > label {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
|
|
@ -283,7 +283,6 @@
|
|||
}
|
||||
|
||||
.small {
|
||||
font-size: x-small;
|
||||
min-width: 0px;
|
||||
padding: 0px 4px 0px 4px;
|
||||
margin: 0px;
|
||||
|
|
|
@ -59,3 +59,21 @@ body.normal > #errorPageContainer {
|
|||
#footerDesc > p {
|
||||
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
|
||||
}
|
||||
|
||||
#moreInfo {
|
||||
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
|
||||
-moz-padding-start: 25px;
|
||||
background: url("chrome://global/skin/icons/information-16.png") no-repeat top left;
|
||||
}
|
||||
|
||||
body[dir="rtl"] #moreInfo {
|
||||
background-position: top right;
|
||||
}
|
||||
|
||||
#moreInfoText {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#moreInfoLinkContainer {
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
%endif
|
||||
|
||||
#errorPageContainer {
|
||||
background-image: url("chrome://global/skin/icons/question-48.png");
|
||||
background-image: url("chrome://global/skin/icons/warning-large.png");
|
||||
}
|
||||
|
||||
#tabList {
|
||||
|
|
|
@ -1263,6 +1263,11 @@ statusbarpanel#statusbar-display {
|
|||
font-size: 130%;
|
||||
}
|
||||
|
||||
#editBookmarkPanelHeader,
|
||||
#editBookmarkPanelContent {
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
|
||||
/* Implements editBookmarkPanel resizing on folderTree un-collapse. */
|
||||
#editBMPanel_folderTree {
|
||||
min-width: 27em;
|
||||
|
|
|
@ -141,13 +141,15 @@ groupbox.collapsable caption .caption-icon {
|
|||
height: 9px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
-moz-margin-start: 1px;
|
||||
-moz-margin-end: 3px;
|
||||
-moz-margin-start: 2px;
|
||||
-moz-margin-end: 2px;
|
||||
background-image: url("chrome://global/skin/tree/twisty-open.png");
|
||||
}
|
||||
|
||||
groupbox.collapsable[closed="true"] {
|
||||
border: none;
|
||||
margin-bottom: 9px;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
||||
groupbox.collapsable[closed="true"] caption .caption-icon {
|
||||
|
@ -155,14 +157,10 @@ groupbox.collapsable[closed="true"] caption .caption-icon {
|
|||
}
|
||||
|
||||
groupbox tree {
|
||||
margin: 0;
|
||||
margin: 0 3px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
groupbox.treebox .groupbox-body {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
#securityBox description {
|
||||
-moz-margin-start: 10px;
|
||||
}
|
||||
|
|
|
@ -137,7 +137,6 @@
|
|||
}
|
||||
|
||||
.small, .small[disabled="true"] {
|
||||
font-size: x-small;
|
||||
min-width: 0px;
|
||||
padding: 0px 4px 0px 4px;
|
||||
margin: 0px;
|
||||
|
|
|
@ -147,6 +147,14 @@ radio[pane=paneAdvanced][selected="true"] {
|
|||
padding: 0px;
|
||||
}
|
||||
|
||||
/* Advanced Pane */
|
||||
|
||||
/* Adding padding-bottom prevents the bottom of the tabpanel from being cutoff
|
||||
when browser.preferences.animateFadeIn = true */
|
||||
#advancedPrefs {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
/* bottom-most box containing a groupbox in a prefpane. Prevents the bottom
|
||||
of the groupbox from being cutoff */
|
||||
.bottomBox {
|
||||
|
|
|
@ -54,8 +54,13 @@ DIRS = win32
|
|||
endif
|
||||
|
||||
ifdef WINCE
|
||||
# We need jemalloc built before the shunt
|
||||
ifdef MOZ_MEMORY
|
||||
DIRS += wince/tools $(DEPTH)/memory/jemalloc wince/shunt
|
||||
else
|
||||
DIRS += wince/tools wince/shunt
|
||||
endif
|
||||
endif
|
||||
|
||||
DIRS += pgo
|
||||
|
||||
|
|
|
@ -1,17 +1,10 @@
|
|||
/* Invoke unit tests on OS/2 */
|
||||
PARSE ARG dist prog parm
|
||||
dist=forwardtoback(dist);
|
||||
prog=forwardtoback(prog);
|
||||
'set BEGINLIBPATH='dist'\bin;%BEGINLIBPATH%'
|
||||
'set LIBPATHSTRICT=T'
|
||||
if substr(FILESPEC("name",prog),1,5) \= 'test_'
|
||||
then
|
||||
do
|
||||
prog=forwardtoback(prog)
|
||||
prog parm
|
||||
exit
|
||||
end
|
||||
else
|
||||
bash prog parm
|
||||
prog parm
|
||||
exit
|
||||
|
||||
forwardtoback: procedure
|
|
@ -0,0 +1,2 @@
|
|||
repo: f5ab154deef2ffa97f1b2139589ae4a1962090a4
|
||||
node: c07f9fe9fdaa85888314efa7001cd4fd768904c4
|
|
@ -0,0 +1,3 @@
|
|||
\.pyc$
|
||||
\.pyo$
|
||||
~$
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License
|
||||
|
||||
Copyright (c) 2009 The Mozilla Foundation <http://www.mozilla.org/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,64 @@
|
|||
INTRODUCTION
|
||||
|
||||
make.py (and the pymake modules that support it) are an implementation of the make tool
|
||||
which are mostly compatible with makefiles written for GNU make.
|
||||
|
||||
PURPOSE
|
||||
|
||||
The Mozilla project inspired this tool with several goals:
|
||||
|
||||
* Improve build speeds, especially on Windows. This can be done by reducing the total number
|
||||
of processes that are launched, especially MSYS shell processes which are expensive.
|
||||
|
||||
* Allow writing some complicated build logic directly in Python instead of in shell.
|
||||
|
||||
* Allow computing dependencies for special targets, such as members within ZIP files.
|
||||
|
||||
* Enable experiments with build system. By writing a makefile parser, we can experiment
|
||||
with converting in-tree makefiles to another build system, such as SCons, waf, ant, ...insert
|
||||
your favorite build tool here. Or we could experiment along the lines of makepp, keeping
|
||||
our existing makefiles, but change the engine to build a global dependency graph.
|
||||
|
||||
KNOWN INCOMPATIBILITIES
|
||||
|
||||
* Order-only prerequisites are not yet supported
|
||||
|
||||
* Secondary expansion is not yet supported.
|
||||
|
||||
* Target-specific variables behave differently than in GNU make: in pymake, the target-specific
|
||||
variable only applies to the specific target that is mentioned, and does not apply recursively
|
||||
to all dependencies which are remade. This is an intentional change: the behavior of GNU make
|
||||
is neither deterministic nor intuitive.
|
||||
|
||||
* $(eval) is only supported during the parse phase. Any attempt to recursively expand
|
||||
an $(eval) function during command execution will fail. This is an intentional incompatibility.
|
||||
|
||||
* There is a subtle difference in execution order that can cause unexpected changes in the
|
||||
following circumstance:
|
||||
** A file `foo.c` exists on the VPATH
|
||||
** A rule for `foo.c` exists with a dependency on `tool` and no commands
|
||||
** `tool` is remade for some other reason earlier in the file
|
||||
In this case, pymake resets the VPATH of `foo.c`, while GNU make does not. This shouldn't
|
||||
happen in the real world, since a target found on the VPATH without commands is silly. But
|
||||
mozilla/js/src happens to have a rule, which I'm patching.
|
||||
|
||||
* pymake does not implement any of the builtin implicit rules or the related variables. Mozilla
|
||||
only cares because pymake doesn't implicitly define $(RM), which I'm also fixing in the Mozilla
|
||||
code.
|
||||
|
||||
ISSUES
|
||||
|
||||
* Speed is a problem.
|
||||
|
||||
FUTURE WORK
|
||||
|
||||
* implement a new type of command which is implemented in python. This would allow us
|
||||
to replace the current `nsinstall` binary (and execution costs for the shell and binary) with an
|
||||
in-process python solution.
|
||||
|
||||
AUTHOR
|
||||
|
||||
Initial code was written by Benjamin Smedberg <benjamin@smedbergs.us>. For future releases see
|
||||
http://benjamin.smedbergs.us/pymake/
|
||||
|
||||
See the LICENSE file for license information (MIT license)
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
make.py
|
||||
|
||||
A drop-in or mostly drop-in replacement for GNU make.
|
||||
"""
|
||||
|
||||
import sys, os
|
||||
import pymake.command, pymake.process
|
||||
|
||||
pymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=sys.exit)
|
||||
pymake.process.ParallelContext.spin()
|
||||
assert False, "Not reached"
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import pymake.parser
|
||||
|
||||
for f in sys.argv[1:]:
|
||||
print "Parsing %s" % f
|
||||
fd = open(f)
|
||||
stmts = pymake.parser.parsestream(fd, f)
|
||||
fd.close()
|
||||
print stmts
|
|
@ -0,0 +1,10 @@
|
|||
"""
|
||||
Implicit variables; perhaps in the future this will also include some implicit
|
||||
rules, at least match-anything cancellation rules.
|
||||
"""
|
||||
|
||||
variables = {
|
||||
'RM': 'rm -f',
|
||||
'.LIBPATTERNS': 'lib%.so lib%.a',
|
||||
'.PYMAKE': '1',
|
||||
}
|
|
@ -0,0 +1,220 @@
|
|||
"""
|
||||
Makefile execution.
|
||||
|
||||
Multiple `makes` can be run within the same process. Each one has an entirely data.Makefile and .Target
|
||||
structure, environment, and working directory. Typically they will all share a parallel execution context,
|
||||
except when a submake specifies -j1 when the parent make is building in parallel.
|
||||
"""
|
||||
|
||||
import os, subprocess, sys, logging, time, traceback
|
||||
from optparse import OptionParser
|
||||
import data, parserdata, process, util
|
||||
|
||||
# TODO: If this ever goes from relocatable package to system-installed, this may need to be
|
||||
# a configured-in path.
|
||||
|
||||
makepypath = os.path.normpath(os.path.join(os.path.dirname(__file__), '../make.py'))
|
||||
|
||||
def parsemakeflags(env):
|
||||
"""
|
||||
Parse MAKEFLAGS from the environment into a sequence of command-line arguments.
|
||||
"""
|
||||
|
||||
makeflags = env.get('MAKEFLAGS', '')
|
||||
makeflags = makeflags.strip()
|
||||
|
||||
if makeflags == '':
|
||||
return []
|
||||
|
||||
if makeflags[0] not in ('-', ' '):
|
||||
makeflags = '-' + makeflags
|
||||
|
||||
opts = []
|
||||
curopt = ''
|
||||
|
||||
i = 0
|
||||
while i < len(makeflags):
|
||||
c = makeflags[i]
|
||||
if c.isspace():
|
||||
opts.append(curopt)
|
||||
curopt = ''
|
||||
i += 1
|
||||
while i < len(makeflags) and makeflags[i].isspace():
|
||||
i += 1
|
||||
continue
|
||||
|
||||
if c == '\\':
|
||||
i += 1
|
||||
if i == len(makeflags):
|
||||
raise data.DataError("MAKEFLAGS has trailing backslash")
|
||||
c = makeflags[i]
|
||||
|
||||
curopt += c
|
||||
i += 1
|
||||
|
||||
if curopt != '':
|
||||
opts.append(curopt)
|
||||
|
||||
return opts
|
||||
|
||||
def _version(*args):
|
||||
print """pymake: GNU-compatible make program
|
||||
Copyright (C) 2009 The Mozilla Foundation <http://www.mozilla.org/>
|
||||
This is free software; see the source for copying conditions.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE."""
|
||||
|
||||
_log = logging.getLogger('pymake.execution')
|
||||
|
||||
def main(args, env, cwd, cb):
|
||||
"""
|
||||
Start a single makefile execution, given a command line, working directory, and environment.
|
||||
|
||||
@param cb a callback to notify with an exit code when make execution is finished.
|
||||
"""
|
||||
|
||||
try:
|
||||
makelevel = int(env.get('MAKELEVEL', '0'))
|
||||
|
||||
op = OptionParser()
|
||||
op.add_option('-f', '--file', '--makefile',
|
||||
action='append',
|
||||
dest='makefiles',
|
||||
default=[])
|
||||
op.add_option('-d',
|
||||
action="store_true",
|
||||
dest="verbose", default=False)
|
||||
op.add_option('--debug-log',
|
||||
dest="debuglog", default=None)
|
||||
op.add_option('-C', '--directory',
|
||||
dest="directory", default=None)
|
||||
op.add_option('-v', '--version', action="store_true",
|
||||
dest="printversion", default=False)
|
||||
op.add_option('-j', '--jobs', type="int",
|
||||
dest="jobcount", default=1)
|
||||
op.add_option('--no-print-directory', action="store_false",
|
||||
dest="printdir", default=True)
|
||||
|
||||
options, arguments1 = op.parse_args(parsemakeflags(env))
|
||||
options, arguments2 = op.parse_args(args, values=options)
|
||||
|
||||
arguments = arguments1 + arguments2
|
||||
|
||||
if options.printversion:
|
||||
_version()
|
||||
cb(0)
|
||||
return
|
||||
|
||||
shortflags = []
|
||||
longflags = []
|
||||
|
||||
loglevel = logging.WARNING
|
||||
if options.verbose:
|
||||
loglevel = logging.DEBUG
|
||||
shortflags.append('d')
|
||||
|
||||
logkwargs = {}
|
||||
if options.debuglog:
|
||||
logkwargs['filename'] = options.debuglog
|
||||
longflags.append('--debug-log=%s' % options.debuglog)
|
||||
|
||||
if options.directory is None:
|
||||
workdir = cwd
|
||||
else:
|
||||
workdir = os.path.join(cwd, options.directory)
|
||||
|
||||
shortflags.append('j%i' % (options.jobcount,))
|
||||
|
||||
makeflags = ''.join(shortflags) + ' ' + ' '.join(longflags)
|
||||
|
||||
logging.basicConfig(level=loglevel, **logkwargs)
|
||||
|
||||
context = process.getcontext(options.jobcount)
|
||||
|
||||
if options.printdir:
|
||||
print "make.py[%i]: Entering directory '%s'" % (makelevel, workdir)
|
||||
sys.stdout.flush()
|
||||
|
||||
if len(options.makefiles) == 0:
|
||||
if os.path.exists(os.path.join(workdir, 'Makefile')):
|
||||
options.makefiles.append('Makefile')
|
||||
else:
|
||||
print "No makefile found"
|
||||
cb(2)
|
||||
return
|
||||
|
||||
overrides, targets = parserdata.parsecommandlineargs(arguments)
|
||||
|
||||
def makecb(error, didanything, makefile, realtargets, tstack, i, firsterror):
|
||||
if error is not None:
|
||||
print error
|
||||
if firsterror is None:
|
||||
firsterror = error
|
||||
|
||||
if i == len(realtargets):
|
||||
if options.printdir:
|
||||
print "make.py[%i]: Leaving directory '%s'" % (makelevel, workdir)
|
||||
sys.stdout.flush()
|
||||
|
||||
context.defer(cb, firsterror and 2 or 0)
|
||||
else:
|
||||
deferredmake = process.makedeferrable(makecb, makefile=makefile,
|
||||
realtargets=realtargets, tstack=tstack, i=i+1, firsterror=firsterror)
|
||||
|
||||
makefile.gettarget(realtargets[i]).make(makefile, tstack, [], cb=deferredmake)
|
||||
|
||||
|
||||
def remakecb(remade, restarts, makefile):
|
||||
if remade:
|
||||
if restarts > 0:
|
||||
_log.info("make.py[%i]: Restarting makefile parsing", makelevel)
|
||||
makefile = data.Makefile(restarts=restarts, make='%s %s' % (sys.executable.replace('\\', '/'), makepypath.replace('\\', '/')),
|
||||
makeflags=makeflags, makelevel=makelevel, workdir=workdir,
|
||||
context=context, env=env,
|
||||
targets=targets)
|
||||
|
||||
try:
|
||||
overrides.execute(makefile)
|
||||
for f in options.makefiles:
|
||||
makefile.include(f)
|
||||
makefile.finishparsing()
|
||||
makefile.remakemakefiles(process.makedeferrable(remakecb, restarts=restarts + 1, makefile=makefile))
|
||||
|
||||
except util.MakeError, e:
|
||||
print e
|
||||
context.defer(cb, 2)
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
if len(targets) == 0:
|
||||
if makefile.defaulttarget is None:
|
||||
print "No target specified and no default target found."
|
||||
context.defer(cb, 2)
|
||||
return
|
||||
|
||||
_log.info("Making default target %s", makefile.defaulttarget)
|
||||
realtargets = [makefile.defaulttarget]
|
||||
tstack = ['<default-target>']
|
||||
else:
|
||||
realtargets = targets
|
||||
tstack = ['<command-line>']
|
||||
|
||||
deferredmake = process.makedeferrable(makecb, makefile=makefile,
|
||||
realtargets=realtargets, tstack=tstack, i=1, firsterror=None)
|
||||
makefile.gettarget(realtargets[0]).make(makefile, tstack, [], cb=deferredmake)
|
||||
|
||||
context.defer(remakecb, True, 0, None)
|
||||
|
||||
except (util.MakeError), e:
|
||||
print e
|
||||
if options.printdir:
|
||||
print "make.py[%i]: Leaving directory '%s'" % (makelevel, workdir)
|
||||
sys.stdout.flush()
|
||||
cb(2)
|
||||
return
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,693 @@
|
|||
"""
|
||||
Makefile functions.
|
||||
"""
|
||||
|
||||
import parser, data, util
|
||||
import subprocess, os, logging
|
||||
from globrelative import glob
|
||||
from cStringIO import StringIO
|
||||
|
||||
log = logging.getLogger('pymake.data')
|
||||
|
||||
class Function(object):
|
||||
"""
|
||||
An object that represents a function call. This class is always subclassed
|
||||
with the following methods and attributes:
|
||||
|
||||
minargs = minimum # of arguments
|
||||
maxargs = maximum # of arguments (0 means unlimited)
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting)
|
||||
Calls the function
|
||||
calls fd.write() with strings
|
||||
"""
|
||||
|
||||
__slots__ = ('_arguments', 'loc')
|
||||
|
||||
def __init__(self, loc):
|
||||
self._arguments = []
|
||||
self.loc = loc
|
||||
assert self.minargs > 0
|
||||
|
||||
def __getitem__(self, key):
|
||||
return self._arguments[key]
|
||||
|
||||
def setup(self):
|
||||
argc = len(self._arguments)
|
||||
|
||||
if argc < self.minargs:
|
||||
raise data.DataError("Not enough arguments to function %s, requires %s" % (self.name, self.minargs), self.loc)
|
||||
|
||||
assert self.maxargs == 0 or argc <= self.maxargs, "Parser screwed up, gave us too many args"
|
||||
|
||||
def append(self, arg):
|
||||
assert isinstance(arg, (data.Expansion, data.StringExpansion))
|
||||
self._arguments.append(arg)
|
||||
|
||||
def __len__(self):
|
||||
return len(self._arguments)
|
||||
|
||||
class VariableRef(Function):
|
||||
__slots__ = ('vname', 'loc')
|
||||
|
||||
def __init__(self, loc, vname):
|
||||
self.loc = loc
|
||||
assert isinstance(vname, (data.Expansion, data.StringExpansion))
|
||||
self.vname = vname
|
||||
|
||||
def setup(self):
|
||||
assert False, "Shouldn't get here"
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
vname = self.vname.resolvestr(makefile, variables, setting)
|
||||
if vname in setting:
|
||||
raise data.DataError("Setting variable '%s' recursively references itself." % (vname,), self.loc)
|
||||
|
||||
flavor, source, value = variables.get(vname)
|
||||
if value is None:
|
||||
log.debug("%s: variable '%s' was not set" % (self.loc, vname))
|
||||
return
|
||||
|
||||
value.resolve(makefile, variables, fd, setting + [vname])
|
||||
|
||||
class SubstitutionRef(Function):
|
||||
"""$(VARNAME:.c=.o) and $(VARNAME:%.c=%.o)"""
|
||||
|
||||
__slots__ = ('loc', 'vname', 'substfrom', 'substto')
|
||||
|
||||
def __init__(self, loc, varname, substfrom, substto):
|
||||
self.loc = loc
|
||||
self.vname = varname
|
||||
self.substfrom = substfrom
|
||||
self.substto = substto
|
||||
|
||||
def setup(self):
|
||||
assert False, "Shouldn't get here"
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
vname = self.vname.resolvestr(makefile, variables, setting)
|
||||
if vname in setting:
|
||||
raise data.DataError("Setting variable '%s' recursively references itself." % (vname,), self.loc)
|
||||
|
||||
substfrom = self.substfrom.resolvestr(makefile, variables, setting)
|
||||
substto = self.substto.resolvestr(makefile, variables, setting)
|
||||
|
||||
flavor, source, value = variables.get(vname)
|
||||
if value is None:
|
||||
log.debug("%s: variable '%s' was not set" % (self.loc, vname))
|
||||
return
|
||||
|
||||
f = data.Pattern(substfrom)
|
||||
if not f.ispattern():
|
||||
f = data.Pattern('%' + substfrom)
|
||||
substto = '%' + substto
|
||||
|
||||
fd.write(' '.join([f.subst(substto, word, False)
|
||||
for word in value.resolvesplit(makefile, variables, setting + [vname])]))
|
||||
|
||||
class SubstFunction(Function):
|
||||
name = 'subst'
|
||||
minargs = 3
|
||||
maxargs = 3
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
s = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
r = self._arguments[1].resolvestr(makefile, variables, setting)
|
||||
d = self._arguments[2].resolvestr(makefile, variables, setting)
|
||||
fd.write(d.replace(s, r))
|
||||
|
||||
class PatSubstFunction(Function):
|
||||
name = 'patsubst'
|
||||
minargs = 3
|
||||
maxargs = 3
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
s = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
r = self._arguments[1].resolvestr(makefile, variables, setting)
|
||||
|
||||
p = data.Pattern(s)
|
||||
fd.write(' '.join([p.subst(r, word, False)
|
||||
for word in self._arguments[2].resolvesplit(makefile, variables, setting)]))
|
||||
|
||||
class StripFunction(Function):
|
||||
name = 'strip'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
util.joiniter(fd, self._arguments[0].resolvesplit(makefile, variables, setting))
|
||||
|
||||
class FindstringFunction(Function):
|
||||
name = 'findstring'
|
||||
minargs = 2
|
||||
maxargs = 2
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
s = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
r = self._arguments[1].resolvestr(makefile, variables, setting)
|
||||
if r.find(s) == -1:
|
||||
return
|
||||
fd.write(s)
|
||||
|
||||
class FilterFunction(Function):
|
||||
name = 'filter'
|
||||
minargs = 2
|
||||
maxargs = 2
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
plist = [data.Pattern(p)
|
||||
for p in self._arguments[0].resolvesplit(makefile, variables, setting)]
|
||||
|
||||
fd.write(' '.join([w for w in self._arguments[1].resolvesplit(makefile, variables, setting)
|
||||
if util.any((p.match(w) for p in plist))]))
|
||||
|
||||
class FilteroutFunction(Function):
|
||||
name = 'filter-out'
|
||||
minargs = 2
|
||||
maxargs = 2
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
plist = [data.Pattern(p)
|
||||
for p in self._arguments[0].resolvesplit(makefile, variables, setting)]
|
||||
|
||||
fd.write(' '.join([w for w in self._arguments[1].resolvesplit(makefile, variables, setting)
|
||||
if not util.any((p.match(w) for p in plist))]))
|
||||
|
||||
class SortFunction(Function):
|
||||
name = 'sort'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
d = list(self._arguments[0].resolvesplit(makefile, variables, setting))
|
||||
d.sort()
|
||||
util.joiniter(fd, d)
|
||||
|
||||
class WordFunction(Function):
|
||||
name = 'word'
|
||||
minargs = 2
|
||||
maxargs = 2
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
n = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
# TODO: provide better error if this doesn't convert
|
||||
n = int(n)
|
||||
words = list(self._arguments[1].resolvesplit(makefile, variables, setting))
|
||||
if n < 1 or n > len(words):
|
||||
return
|
||||
fd.write(words[n - 1])
|
||||
|
||||
class WordlistFunction(Function):
|
||||
name = 'wordlist'
|
||||
minargs = 3
|
||||
maxargs = 3
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
nfrom = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
nto = self._arguments[1].resolvestr(makefile, variables, setting)
|
||||
# TODO: provide better errors if this doesn't convert
|
||||
nfrom = int(nfrom)
|
||||
nto = int(nto)
|
||||
|
||||
words = list(self._arguments[2].resolvesplit(makefile, variables, setting))
|
||||
|
||||
if nfrom < 1:
|
||||
nfrom = 1
|
||||
if nto < 1:
|
||||
nto = 1
|
||||
|
||||
util.joiniter(fd, words[nfrom - 1:nto])
|
||||
|
||||
class WordsFunction(Function):
|
||||
name = 'words'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
fd.write(str(len(self._arguments[0].resolvesplit(makefile, variables, setting))))
|
||||
|
||||
class FirstWordFunction(Function):
|
||||
name = 'firstword'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
l = self._arguments[0].resolvesplit(makefile, variables, setting)
|
||||
if len(l):
|
||||
fd.write(l[0])
|
||||
|
||||
class LastWordFunction(Function):
|
||||
name = 'lastword'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
l = self._arguments[0].resolvesplit(makefile, variables, setting)
|
||||
if len(l):
|
||||
fd.write(l[-1])
|
||||
|
||||
def pathsplit(path, default='./'):
|
||||
"""
|
||||
Splits a path into dirpart, filepart on the last slash. If there is no slash, dirpart
|
||||
is ./
|
||||
"""
|
||||
dir, slash, file = util.strrpartition(path, '/')
|
||||
if dir == '':
|
||||
return default, file
|
||||
|
||||
return dir + slash, file
|
||||
|
||||
class DirFunction(Function):
|
||||
name = 'dir'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
fd.write(' '.join([pathsplit(path)[0]
|
||||
for path in self._arguments[0].resolvesplit(makefile, variables, setting)]))
|
||||
|
||||
class NotDirFunction(Function):
|
||||
name = 'notdir'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
fd.write(' '.join([pathsplit(path)[1]
|
||||
for path in self._arguments[0].resolvesplit(makefile, variables, setting)]))
|
||||
|
||||
class SuffixFunction(Function):
|
||||
name = 'suffix'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
@staticmethod
|
||||
def suffixes(words):
|
||||
for w in words:
|
||||
dir, file = pathsplit(w)
|
||||
base, dot, suffix = util.strrpartition(file, '.')
|
||||
if base != '':
|
||||
yield dot + suffix
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
util.joiniter(fd, self.suffixes(self._arguments[0].resolvesplit(makefile, variables, setting)))
|
||||
|
||||
class BasenameFunction(Function):
|
||||
name = 'basename'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
@staticmethod
|
||||
def basenames(words):
|
||||
for w in words:
|
||||
dir, file = pathsplit(w, '')
|
||||
base, dot, suffix = util.strrpartition(file, '.')
|
||||
if dot == '':
|
||||
base = suffix
|
||||
|
||||
yield dir + base
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
util.joiniter(fd, self.basenames(self._arguments[0].resolvesplit(makefile, variables, setting)))
|
||||
|
||||
class AddSuffixFunction(Function):
|
||||
name = 'addprefix'
|
||||
minargs = 2
|
||||
maxargs = 2
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
suffix = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
|
||||
fd.write(' '.join([w + suffix for w in self._arguments[1].resolvesplit(makefile, variables, setting)]))
|
||||
|
||||
class AddPrefixFunction(Function):
|
||||
name = 'addsuffix'
|
||||
minargs = 2
|
||||
maxargs = 2
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
prefix = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
|
||||
fd.write(' '.join([prefix + w for w in self._arguments[1].resolvesplit(makefile, variables, setting)]))
|
||||
|
||||
class JoinFunction(Function):
|
||||
name = 'join'
|
||||
minargs = 2
|
||||
maxargs = 2
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
@staticmethod
|
||||
def iterjoin(l1, l2):
|
||||
for i in xrange(0, max(len(l1), len(l2))):
|
||||
i1 = i < len(l1) and l1[i] or ''
|
||||
i2 = i < len(l2) and l2[i] or ''
|
||||
yield i1 + i2
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
list1 = list(self._arguments[0].resolvesplit(makefile, variables, setting))
|
||||
list2 = list(self._arguments[1].resolvesplit(makefile, variables, setting))
|
||||
|
||||
util.joiniter(fd, self.iterjoin(list1, list2))
|
||||
|
||||
class WildcardFunction(Function):
|
||||
name = 'wildcard'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
patterns = self._arguments[0].resolvesplit(makefile, variables, setting)
|
||||
|
||||
fd.write(' '.join([x.replace('\\','/')
|
||||
for p in patterns
|
||||
for x in glob(makefile.workdir, p)]))
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
class RealpathFunction(Function):
|
||||
name = 'realpath'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
fd.write(' '.join([os.path.realpath(os.path.join(makefile.workdir, path)).replace('\\', '/')
|
||||
for path in self._arguments[0].resolvesplit(makefile, variables, setting)]))
|
||||
|
||||
class AbspathFunction(Function):
|
||||
name = 'abspath'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
assert os.path.isabs(makefile.workdir)
|
||||
fd.write(' '.join([os.path.join(makefile.workdir, path).replace('\\', '/')
|
||||
for path in self._arguments[0].resolvesplit(makefile, variables, setting)]))
|
||||
|
||||
class IfFunction(Function):
|
||||
name = 'if'
|
||||
minargs = 1
|
||||
maxargs = 3
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def setup(self):
|
||||
Function.setup(self)
|
||||
self._arguments[0].lstrip()
|
||||
self._arguments[0].rstrip()
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
condition = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
|
||||
if len(condition):
|
||||
self._arguments[1].resolve(makefile, variables, fd, setting)
|
||||
elif len(self._arguments) > 2:
|
||||
return self._arguments[2].resolve(makefile, variables, fd, setting)
|
||||
|
||||
class OrFunction(Function):
|
||||
name = 'or'
|
||||
minargs = 1
|
||||
maxargs = 0
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
for arg in self._arguments:
|
||||
r = arg.resolvestr(makefile, variables, setting)
|
||||
if r != '':
|
||||
fd.write(r)
|
||||
return
|
||||
|
||||
class AndFunction(Function):
|
||||
name = 'and'
|
||||
minargs = 1
|
||||
maxargs = 0
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
r = ''
|
||||
|
||||
for arg in self._arguments:
|
||||
r = arg.resolvestr(makefile, variables, setting)
|
||||
if r == '':
|
||||
return
|
||||
|
||||
fd.write(r)
|
||||
|
||||
class ForEachFunction(Function):
|
||||
name = 'foreach'
|
||||
minargs = 3
|
||||
maxargs = 3
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
vname = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
e = self._arguments[2]
|
||||
|
||||
v = data.Variables(parent=variables)
|
||||
firstword = True
|
||||
|
||||
for w in self._arguments[1].resolvesplit(makefile, variables, setting):
|
||||
if firstword:
|
||||
firstword = False
|
||||
else:
|
||||
fd.write(' ')
|
||||
|
||||
v.set(vname, data.Variables.FLAVOR_SIMPLE, data.Variables.SOURCE_AUTOMATIC, w)
|
||||
e.resolve(makefile, v, fd, setting)
|
||||
|
||||
class CallFunction(Function):
|
||||
name = 'call'
|
||||
minargs = 1
|
||||
maxargs = 0
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
vname = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
if vname in setting:
|
||||
raise data.DataError("Recursively setting variable '%s'" % (vname,))
|
||||
|
||||
v = data.Variables(parent=variables)
|
||||
v.set('0', data.Variables.FLAVOR_SIMPLE, data.Variables.SOURCE_AUTOMATIC, vname)
|
||||
for i in xrange(1, len(self._arguments)):
|
||||
param = self._arguments[i].resolvestr(makefile, variables, setting)
|
||||
v.set(str(i), data.Variables.FLAVOR_SIMPLE, data.Variables.SOURCE_AUTOMATIC, param)
|
||||
|
||||
flavor, source, e = variables.get(vname)
|
||||
|
||||
if e is None:
|
||||
return
|
||||
|
||||
if flavor == data.Variables.FLAVOR_SIMPLE:
|
||||
log.warning("%s: calling variable '%s' which is simply-expanded" % (self.loc, vname))
|
||||
|
||||
# but we'll do it anyway
|
||||
e.resolve(makefile, v, fd, setting + [vname])
|
||||
|
||||
class ValueFunction(Function):
|
||||
name = 'value'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
varname = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
|
||||
flavor, source, value = variables.get(varname, expand=False)
|
||||
if value is not None:
|
||||
fd.write(value)
|
||||
|
||||
class EvalFunction(Function):
|
||||
name = 'eval'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
if makefile.parsingfinished:
|
||||
# GNU make allows variables to be set by recursive expansion during
|
||||
# command execution. This seems really dumb to me, so I don't!
|
||||
raise data.DataError("$(eval) not allowed via recursive expansion after parsing is finished", self.loc)
|
||||
|
||||
text = StringIO(self._arguments[0].resolvestr(makefile, variables, setting))
|
||||
stmts = parser.parsestream(text, 'evaluation from %s' % self.loc)
|
||||
stmts.execute(makefile)
|
||||
|
||||
class OriginFunction(Function):
|
||||
name = 'origin'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
vname = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
|
||||
flavor, source, value = variables.get(vname)
|
||||
if source is None:
|
||||
r = 'undefined'
|
||||
elif source == data.Variables.SOURCE_OVERRIDE:
|
||||
r = 'override'
|
||||
|
||||
elif source == data.Variables.SOURCE_MAKEFILE:
|
||||
r = 'file'
|
||||
elif source == data.Variables.SOURCE_ENVIRONMENT:
|
||||
r = 'environment'
|
||||
elif source == data.Variables.SOURCE_COMMANDLINE:
|
||||
r = 'command line'
|
||||
elif source == data.Variables.SOURCE_AUTOMATIC:
|
||||
r = 'automatic'
|
||||
|
||||
fd.write(r)
|
||||
|
||||
class FlavorFunction(Function):
|
||||
name = 'flavor'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
varname = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
|
||||
flavor, source, value = variables.get(varname)
|
||||
if flavor is None:
|
||||
r = 'undefined'
|
||||
elif flavor == data.Variables.FLAVOR_RECURSIVE:
|
||||
r = 'recursive'
|
||||
elif flavor == data.Variables.FLAVOR_SIMPLE:
|
||||
r = 'simple'
|
||||
fd.write(r)
|
||||
|
||||
class ShellFunction(Function):
|
||||
name = 'shell'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
#TODO: call this once up-front somewhere and save the result?
|
||||
shell, msys = util.checkmsyscompat()
|
||||
cline = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
|
||||
log.debug("%s: running shell command '%s'" % (self.loc, cline))
|
||||
if msys:
|
||||
cline = [shell, "-c", cline]
|
||||
p = subprocess.Popen(cline, shell=not msys, stdout=subprocess.PIPE, cwd=makefile.workdir)
|
||||
stdout, stderr = p.communicate()
|
||||
|
||||
stdout = stdout.replace('\r\n', '\n')
|
||||
if stdout.endswith('\n'):
|
||||
stdout = stdout[:-1]
|
||||
stdout = stdout.replace('\n', ' ')
|
||||
|
||||
fd.write(stdout)
|
||||
|
||||
class ErrorFunction(Function):
|
||||
name = 'error'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
v = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
raise data.DataError(v, self.loc)
|
||||
|
||||
class WarningFunction(Function):
|
||||
name = 'warning'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
v = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
log.warning(v)
|
||||
|
||||
class InfoFunction(Function):
|
||||
name = 'info'
|
||||
minargs = 1
|
||||
maxargs = 1
|
||||
|
||||
__slots__ = Function.__slots__
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting):
|
||||
v = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||
log.info(v)
|
||||
|
||||
functionmap = {
|
||||
'subst': SubstFunction,
|
||||
'patsubst': PatSubstFunction,
|
||||
'strip': StripFunction,
|
||||
'findstring': FindstringFunction,
|
||||
'filter': FilterFunction,
|
||||
'filter-out': FilteroutFunction,
|
||||
'sort': SortFunction,
|
||||
'word': WordFunction,
|
||||
'wordlist': WordlistFunction,
|
||||
'words': WordsFunction,
|
||||
'firstword': FirstWordFunction,
|
||||
'lastword': LastWordFunction,
|
||||
'dir': DirFunction,
|
||||
'notdir': NotDirFunction,
|
||||
'suffix': SuffixFunction,
|
||||
'basename': BasenameFunction,
|
||||
'addsuffix': AddSuffixFunction,
|
||||
'addprefix': AddPrefixFunction,
|
||||
'join': JoinFunction,
|
||||
'wildcard': WildcardFunction,
|
||||
'realpath': RealpathFunction,
|
||||
'abspath': AbspathFunction,
|
||||
'if': IfFunction,
|
||||
'or': OrFunction,
|
||||
'and': AndFunction,
|
||||
'foreach': ForEachFunction,
|
||||
'call': CallFunction,
|
||||
'value': ValueFunction,
|
||||
'eval': EvalFunction,
|
||||
'origin': OriginFunction,
|
||||
'flavor': FlavorFunction,
|
||||
'shell': ShellFunction,
|
||||
'error': ErrorFunction,
|
||||
'warning': WarningFunction,
|
||||
'info': InfoFunction,
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
"""
|
||||
Filename globbing like the python glob module with minor differences:
|
||||
|
||||
* glob relative to an arbitrary directory
|
||||
* include . and ..
|
||||
* check that link targets exist, not just links
|
||||
"""
|
||||
|
||||
import os, re, fnmatch
|
||||
|
||||
_globcheck = re.compile('[[*?]')
|
||||
|
||||
def hasglob(p):
|
||||
return _globcheck.search(p) is not None
|
||||
|
||||
def glob(fsdir, path):
|
||||
"""
|
||||
Yield paths matching the path glob. Sorts as a bonus. Excludes '.' and '..'
|
||||
"""
|
||||
|
||||
dir, leaf = os.path.split(path)
|
||||
if dir == '':
|
||||
return globpattern(fsdir, leaf)
|
||||
|
||||
if hasglob(dir):
|
||||
dirsfound = glob(fsdir, dir)
|
||||
else:
|
||||
dirsfound = [dir]
|
||||
|
||||
r = []
|
||||
|
||||
for dir in dirsfound:
|
||||
fspath = os.path.join(fsdir, dir)
|
||||
if not os.path.isdir(fspath):
|
||||
continue
|
||||
|
||||
r.extend((os.path.join(dir, found) for found in globpattern(fspath, leaf)))
|
||||
|
||||
return r
|
||||
|
||||
def globpattern(dir, pattern):
|
||||
"""
|
||||
Return leaf names in the specified directory which match the pattern.
|
||||
"""
|
||||
|
||||
if not hasglob(pattern):
|
||||
if pattern == '':
|
||||
if os.path.isdir(dir):
|
||||
return ['']
|
||||
return []
|
||||
|
||||
if os.path.exists(os.path.join(dir, pattern)):
|
||||
return [pattern]
|
||||
return []
|
||||
|
||||
leaves = os.listdir(dir) + ['.', '..']
|
||||
|
||||
# "hidden" filenames are a bit special
|
||||
if not pattern.startswith('.'):
|
||||
leaves = [leaf for leaf in leaves
|
||||
if not leaf.startswith('.')]
|
||||
|
||||
leaves = fnmatch.filter(leaves, pattern)
|
||||
leaves = filter(lambda l: os.path.exists(os.path.join(dir, l)), leaves)
|
||||
|
||||
leaves.sort()
|
||||
return leaves
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче