summaryrefslogtreecommitdiff
path: root/profile-switcher
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-11-15 14:28:55 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-11-15 14:28:55 -0500
commitffd447bca3311e490928b56d74da8215d4f9fb9b (patch)
tree6f327d0f4d7ee6121d0a520aec9027c916df974e /profile-switcher
parent5765792bc3b4565d280701726d08e58b27f7a68c (diff)
downloadaura-central-ffd447bca3311e490928b56d74da8215d4f9fb9b.tar.gz
Revert "Move add-ons to add-ons"
This reverts commit 9aa27ea2c82254e9ee53dc8457893fb42b206f8d.
Diffstat (limited to 'profile-switcher')
-rw-r--r--profile-switcher/addon/install.rdf50
-rw-r--r--profile-switcher/addon/moz.build6
-rw-r--r--profile-switcher/app.mozbuild8
-rw-r--r--profile-switcher/build.mk7
-rw-r--r--profile-switcher/chrome.manifest.in13
-rw-r--r--profile-switcher/content/jar.mn15
-rw-r--r--profile-switcher/content/moz.build6
-rw-r--r--profile-switcher/content/overlay.js27
-rw-r--r--profile-switcher/content/overlay.xul33
-rw-r--r--profile-switcher/content/profileSelection.js177
-rw-r--r--profile-switcher/content/profileSelection.xul61
-rw-r--r--profile-switcher/locale/jar.mn12
-rw-r--r--profile-switcher/locale/moz.build6
-rw-r--r--profile-switcher/locale/overlay.dtd6
-rw-r--r--profile-switcher/locale/profileSelection.dtd20
-rw-r--r--profile-switcher/locale/profileSelection.properties6
-rw-r--r--profile-switcher/moz.build12
-rw-r--r--profile-switcher/moz.configure67
-rw-r--r--profile-switcher/skin/jar.mn11
-rw-r--r--profile-switcher/skin/migrate.gifbin0 -> 135 bytes
-rw-r--r--profile-switcher/skin/moz.build6
-rw-r--r--profile-switcher/skin/profile.css63
-rw-r--r--profile-switcher/skin/profileManager.css19
23 files changed, 631 insertions, 0 deletions
diff --git a/profile-switcher/addon/install.rdf b/profile-switcher/addon/install.rdf
new file mode 100644
index 000000000..bc1d8e99f
--- /dev/null
+++ b/profile-switcher/addon/install.rdf
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+
+<!-- This Source Code is subject to the terms of the Mozilla Public License
+ - version 2.0 (the "License"). You can obtain a copy of the License at
+ - http://mozilla.org/MPL/2.0/. -->
+
+#filter substitution
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+ <Description about="urn:mozilla:install-manifest">
+ <em:id>@ADDON_ID@</em:id>
+ <em:version>@ADDON_VERSION@</em:version>
+ <em:name>@ADDON_NAME@</em:name>
+ <em:description>@ADDON_SHORT_DESC@</em:description>
+ <em:creator>@ADDON_AUTHOR@</em:creator>
+#ifdef ADDON_URL
+ <em:homepageURL>@ADDON_URL@</em:homepageURL>
+#endif
+ <em:type>2</em:type>
+ <em:targetApplication>
+ <Description>
+ <!-- @ADDON_TARGET_APP_NAME@ -->
+ <em:id>@ADDON_TARGET_APP_ID@</em:id>
+ <em:minVersion>@ADDON_TARGET_APP_MINVER@</em:minVersion>
+ <em:maxVersion>@ADDON_TARGET_APP_MAXVER@</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Interlink -->
+ <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
+ <em:minVersion>52.0</em:minVersion>
+ <em:maxVersion>52.*</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+#ifdef ADDON_TARGET_BASILISK
+ <em:targetApplication>
+ <Description>
+ <!-- Basilisk -->
+ <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+ <em:minVersion>52.0</em:minVersion>
+ <em:maxVersion>55.*</em:maxVersion>
+ <em:basilisk>true</em:basilisk>
+ </Description>
+ </em:targetApplication>
+#endif
+</Description>
+</RDF>
diff --git a/profile-switcher/addon/moz.build b/profile-switcher/addon/moz.build
new file mode 100644
index 000000000..ee6ee0c40
--- /dev/null
+++ b/profile-switcher/addon/moz.build
@@ -0,0 +1,6 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+FINAL_TARGET_PP_FILES += ['install.rdf']
diff --git a/profile-switcher/app.mozbuild b/profile-switcher/app.mozbuild
new file mode 100644
index 000000000..9d5c9aefb
--- /dev/null
+++ b/profile-switcher/app.mozbuild
@@ -0,0 +1,8 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# Never add tier dirs after the application srcdir because they
+# apparently won't get packaged properly on Mac.
+DIRS += ['/profile-switcher']
diff --git a/profile-switcher/build.mk b/profile-switcher/build.mk
new file mode 100644
index 000000000..92fe1b147
--- /dev/null
+++ b/profile-switcher/build.mk
@@ -0,0 +1,7 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+package:
+ cd $(DIST)/bin; \
+ zip -Dr9X ../${ADDON_XPI_NAME}-${ADDON_VERSION}.xpi * -x \*/.mkdir.done; \
diff --git a/profile-switcher/chrome.manifest.in b/profile-switcher/chrome.manifest.in
new file mode 100644
index 000000000..8e5956d55
--- /dev/null
+++ b/profile-switcher/chrome.manifest.in
@@ -0,0 +1,13 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# Content registration
+content @ADDON_CHROME_NAME@ content/
+locale @ADDON_CHROME_NAME@ en-US locale/
+skin @ADDON_CHROME_NAME@ classic/1.0 skin/
+
+# Browser overlays
+
+
+
diff --git a/profile-switcher/content/jar.mn b/profile-switcher/content/jar.mn
new file mode 100644
index 000000000..636e399e8
--- /dev/null
+++ b/profile-switcher/content/jar.mn
@@ -0,0 +1,15 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#filter substitution
+
+[.] chrome.jar:
+% content @ADDON_CHROME_NAME@ chrome/content/
+ content/profileSelection.js
+* content/profileSelection.xul
+* content/overlay.js
+* content/overlay.xul
+
+% overlay chrome://browser/content/browser.xul chrome://@ADDON_CHROME_NAME@/content/overlay.xul
+% overlay chrome://messenger/content/messenger.xul chrome://@ADDON_CHROME_NAME@/content/overlay.xul
diff --git a/profile-switcher/content/moz.build b/profile-switcher/content/moz.build
new file mode 100644
index 000000000..e0eb66aac
--- /dev/null
+++ b/profile-switcher/content/moz.build
@@ -0,0 +1,6 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+JAR_MANIFESTS += ['jar.mn']
diff --git a/profile-switcher/content/overlay.js b/profile-switcher/content/overlay.js
new file mode 100644
index 000000000..fafdc9082
--- /dev/null
+++ b/profile-switcher/content/overlay.js
@@ -0,0 +1,27 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#filter substitution
+
+function toProfileManager()
+{
+ var promgrWin = Services.wm.getMostRecentWindow("mozilla:profileSelection");
+ if (promgrWin) {
+ promgrWin.focus();
+ } else {
+ var params = Components.classes["@mozilla.org/embedcomp/dialogparam;1"]
+ .createInstance(Components.interfaces.nsIDialogParamBlock);
+
+ params.SetNumberStrings(1);
+ params.SetString(0, "menu");
+ window.openDialog("chrome://@ADDON_CHROME_NAME@/content/profileSelection.xul",
+ "",
+ "centerscreen,chrome,titlebar,centerscreen,modal",
+ params);
+ }
+ // Here, we don't care about the result code
+ // that was returned in the param block.
+}
+
+
diff --git a/profile-switcher/content/overlay.xul b/profile-switcher/content/overlay.xul
new file mode 100644
index 000000000..212f638f9
--- /dev/null
+++ b/profile-switcher/content/overlay.xul
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+#filter substitution
+
+<!DOCTYPE overlay [
+<!ENTITY % overlayDTD SYSTEM "chrome://@ADDON_CHROME_NAME@/locale/overlay.dtd">
+%overlayDTD;
+]>
+
+<overlay id="profileswitcher-overlay"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <script type="application/javascript" src="chrome://@ADDON_CHROME_NAME@/content/overlay.js" />
+
+ <menupopup id="menu_ToolsPopup">
+ <menuseparator id="sep_switchprofile"/>
+ <menuitem id="cmd_switchprofile" oncommand="toProfileManager();" position="18711" label="&switchProfileCmd.label;"/>
+ </menupopup>
+
+ <menupopup id="taskPopup">
+ <menuseparator id="sep_switchprofile"/>
+ <menuitem id="cmd_switchprofile" oncommand="toProfileManager();" position="18711" label="&switchProfileCmd.label;"/>
+ </menupopup>
+
+ <vbox id="appmenuPrimaryPane">
+ <menuitem id="cmd_switchprofile" oncommand="toProfileManager();" insertbefore="appmenu_restart" label="&switchProfileCmd.label;"/>
+ </vbox>
+</overlay>
+
diff --git a/profile-switcher/content/profileSelection.js b/profile-switcher/content/profileSelection.js
new file mode 100644
index 000000000..21a782b8a
--- /dev/null
+++ b/profile-switcher/content/profileSelection.js
@@ -0,0 +1,177 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+Components.utils.import("resource://gre/modules/Services.jsm");
+
+var gProfileBundle;
+var gBrandBundle;
+var gProfileService;
+var gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
+ .getService(Components.interfaces.nsIPromptService);
+var gProfileManagerMode = "selection";
+var gDialogParams = window.arguments[0]
+ .QueryInterface(Components.interfaces.nsIDialogParamBlock);
+
+function StartUp()
+{
+ gProfileBundle = document.getElementById("bundle_profile");
+ gBrandBundle = document.getElementById("bundle_brand");
+ if (gDialogParams.objects) {
+ document.documentElement.getButton("accept").setAttribute("label",
+ document.documentElement.getAttribute("buttonlabelstart"));
+ document.documentElement.getButton("cancel").setAttribute("label",
+ document.documentElement.getAttribute("buttonlabelexit"));
+ document.getElementById('offlineState').hidden = false;
+ gDialogParams.SetInt(0, 0);
+ }
+
+ gProfileService = Components.classes["@mozilla.org/toolkit/profile-service;1"]
+ .getService(Components.interfaces.nsIToolkitProfileService);
+ var profileEnum = gProfileService.profiles;
+ var selectedProfile = null;
+ try {
+ selectedProfile = gProfileService.selectedProfile;
+ }
+ catch (ex) {
+ }
+ while (profileEnum.hasMoreElements()) {
+ AddItem(profileEnum.getNext().QueryInterface(Components.interfaces.nsIToolkitProfile),
+ selectedProfile);
+ }
+
+ var autoSelect = document.getElementById("autoSelect");
+ if (Services.prefs.getBoolPref("profile.manage_only_at_launch"))
+ autoSelect.hidden = true;
+ else
+ autoSelect.checked = gProfileService.startWithLastProfile;
+}
+
+// function : <profileSelection.js>::AddItem();
+// purpose : utility function for adding items to a tree.
+function AddItem(aProfile, aProfileToSelect)
+{
+ var tree = document.getElementById("profiles");
+ var treeitem = document.createElement("treeitem");
+ var treerow = document.createElement("treerow");
+ var treecell = document.createElement("treecell");
+ var treetip = document.getElementById("treetip");
+ var profileDir = gProfileService.getProfileByName(aProfile.name).rootDir;
+
+ treecell.setAttribute("label", aProfile.name);
+ treerow.appendChild(treecell);
+ treeitem.appendChild(treerow);
+ treeitem.setAttribute("tooltip", profileDir.path);
+ treetip.setAttribute("value", profileDir.path);
+ tree.lastChild.appendChild(treeitem);
+ treeitem.profile = aProfile;
+ if (aProfile == aProfileToSelect) {
+ var profileIndex = tree.view.getIndexOfItem(treeitem);
+ tree.view.selection.select(profileIndex);
+ tree.treeBoxObject.ensureRowIsVisible(profileIndex);
+ }
+}
+
+// function : <profileSelection.js>::AcceptDialog();
+// purpose : sets the current profile to the selected profile (user choice: "Start Mozilla")
+function AcceptDialog()
+{
+ var autoSelect = document.getElementById("autoSelect");
+ gProfileService.startWithLastProfile = autoSelect.checked;
+ gProfileService.flush();
+
+ var profileTree = document.getElementById("profiles");
+ var selected = profileTree.view.getItemAtIndex(profileTree.currentIndex);
+
+ if (!gDialogParams.objects) {
+ var dirServ = Components.classes['@mozilla.org/file/directory_service;1']
+ .getService(Components.interfaces.nsIProperties);
+ var profD = dirServ.get("ProfD", Components.interfaces.nsIFile);
+ var profLD = dirServ.get("ProfLD", Components.interfaces.nsIFile);
+
+ if (selected.profile.rootDir.equals(profD) &&
+ selected.profile.localDir.equals(profLD))
+ return true;
+ }
+
+ try {
+ var profileLock = selected.profile.lock({});
+ gProfileService.selectedProfile = selected.profile;
+ gProfileService.defaultProfile = selected.profile;
+ gProfileService.flush();
+ if (gDialogParams.objects) {
+ gDialogParams.objects.insertElementAt(profileLock, 0);
+ gProfileService.startOffline = document.getElementById("offlineState").checked;
+ gDialogParams.SetInt(0, 1);
+ gDialogParams.SetString(0, selected.profile.name);
+ return true;
+ }
+ profileLock.unlock();
+ } catch (e) {
+ var brandName = gBrandBundle.getString("brandShortName");
+ var message = gProfileBundle.getFormattedString("dirLocked",
+ [brandName, selected.profile.name]);
+ gPromptService.alert(window, null, message);
+ return false;
+ }
+
+ // Although switching profile works by performing a restart internally,
+ // the user is quitting the old profile, so make it look like a quit.
+ var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"]
+ .createInstance(Components.interfaces.nsISupportsPRBool);
+ Components.classes["@mozilla.org/observer-service;1"]
+ .getService(Components.interfaces.nsIObserverService)
+ .notifyObservers(cancelQuit, "quit-application-requested", null);
+ if (cancelQuit.data)
+ return false;
+
+ try {
+ var env = Components.classes["@mozilla.org/process/environment;1"]
+ .getService(Components.interfaces.nsIEnvironment);
+ env.set("XRE_PROFILE_NAME", selected.profile.name);
+ env.set("XRE_PROFILE_PATH", selected.profile.rootDir.path);
+ env.set("XRE_PROFILE_LOCAL_PATH", selected.profile.localDir.path);
+ var app = Components.classes["@mozilla.org/toolkit/app-startup;1"]
+ .getService(Components.interfaces.nsIAppStartup);
+ app.quit(app.eAttemptQuit | app.eRestart);
+ return true;
+ }
+ catch (e) {
+ env.set("XRE_PROFILE_NAME", "");
+ env.set("XRE_PROFILE_PATH", "");
+ env.set("XRE_PROFILE_LOCAL_PATH", "");
+ return false;
+ }
+}
+
+// handle key event on tree
+function HandleKeyEvent(aEvent)
+{
+ if (gProfileManagerMode != "manager")
+ return;
+
+}
+
+function HandleClickEvent(aEvent)
+{
+ if (aEvent.button == 0 && aEvent.target.parentNode.view.selection.count != 0 && AcceptDialog()) {
+ window.close();
+ return true;
+ }
+
+ return false;
+}
+
+function HandleToolTipEvent(aEvent)
+{
+ var treeTip = document.getElementById("treetip");
+ var tree = document.getElementById("profiles");
+
+ var cell = tree.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY);
+ if (cell.row < 0)
+ aEvent.preventDefault();
+ else
+ treeTip.label = tree.view.getItemAtIndex(cell.row).tooltip;
+}
diff --git a/profile-switcher/content/profileSelection.xul b/profile-switcher/content/profileSelection.xul
new file mode 100644
index 000000000..2993a5d6a
--- /dev/null
+++ b/profile-switcher/content/profileSelection.xul
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
+
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+#filter substitution
+
+<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://@ADDON_CHROME_NAME@/skin/profile.css" type="text/css"?>
+
+<!DOCTYPE dialog [
+<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
+%brandDTD;
+<!ENTITY % profileDTD SYSTEM "chrome://@ADDON_CHROME_NAME@/locale/profileSelection.dtd">
+%profileDTD;
+]>
+
+<dialog id="profileWindow"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ title="&windowTitle.label;"
+ windowtype="mozilla:profileSelection"
+ orient="vertical"
+ style="width: 30em; height: 25em"
+ buttons="accept,cancel"
+ buttonlabelaccept="&select.label;"
+ buttonlabelstart="&start.label;"
+ buttonlabelexit="&exit.label;"
+ ondialogaccept="return AcceptDialog();"
+ onload="StartUp();">
+
+ <stringbundle id="bundle_profile"
+ src="chrome://@ADDON_CHROME_NAME@/locale/profileSelection.properties"/>
+ <stringbundle id="bundle_brand"
+ src="chrome://branding/locale/brand.properties"/>
+
+ <script type="application/javascript" src="chrome://@ADDON_CHROME_NAME@/content/profileSelection.js"/>
+ <script type="application/javascript" src="chrome://mozapps/content/profile/createProfileWizard.js"/>
+
+ <dialogheader id="header" title="&profileManager.title;"/>
+
+ <hbox class="wizard-box" flex="1">
+ <vbox flex="1">
+ <tooltip id="treetip"
+ onpopupshowing="HandleToolTipEvent(event);">
+ </tooltip>
+ <tree id="profiles" flex="1" seltype="single"
+ hidecolumnpicker="true"
+ onkeypress="HandleKeyEvent(event);">
+ <treecols>
+ <treecol label="&availableProfiles.label;" flex="1" sortLocked="true"/>
+ </treecols>
+ <treechildren tooltip="treetip"
+ ondblclick="HandleClickEvent(event);"/>
+ </tree>
+ <checkbox id="offlineState" label="&offlineState.label;" accesskey="&offlineState.accesskey;" hidden="true"/>
+ <checkbox id="autoSelect" label="&autoSelect.label;" accesskey="&autoSelect.accesskey;"/>
+ </vbox>
+</hbox>
+</dialog>
diff --git a/profile-switcher/locale/jar.mn b/profile-switcher/locale/jar.mn
new file mode 100644
index 000000000..a78b9421b
--- /dev/null
+++ b/profile-switcher/locale/jar.mn
@@ -0,0 +1,12 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#filter substitution
+
+[.] chrome.jar:
+% locale @ADDON_CHROME_NAME@ en-US chrome/locale/
+ locale/profileSelection.dtd
+ locale/profileSelection.properties
+ locale/overlay.dtd
+
diff --git a/profile-switcher/locale/moz.build b/profile-switcher/locale/moz.build
new file mode 100644
index 000000000..e0eb66aac
--- /dev/null
+++ b/profile-switcher/locale/moz.build
@@ -0,0 +1,6 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+JAR_MANIFESTS += ['jar.mn']
diff --git a/profile-switcher/locale/overlay.dtd b/profile-switcher/locale/overlay.dtd
new file mode 100644
index 000000000..47df2c4c9
--- /dev/null
+++ b/profile-switcher/locale/overlay.dtd
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<!ENTITY switchProfileCmd.label "Switch Profile...">
+
diff --git a/profile-switcher/locale/profileSelection.dtd b/profile-switcher/locale/profileSelection.dtd
new file mode 100644
index 000000000..1f89de663
--- /dev/null
+++ b/profile-switcher/locale/profileSelection.dtd
@@ -0,0 +1,20 @@
+<!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
+
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<!ENTITY windowTitle.label "Switch Profile">
+<!ENTITY profileManager.title "Select a &brandShortName; Profile">
+
+<!ENTITY select.label "Use Profile">
+<!ENTITY availableProfiles.label "Available Profiles">
+
+<!ENTITY autoSelect.label "Use the selected profile without asking at startup">
+<!ENTITY autoSelect.accesskey "S">
+
+<!ENTITY start.label "Start &brandShortName;">
+<!ENTITY exit.label "Exit">
+
+<!ENTITY offlineState.label "Work offline">
+<!ENTITY offlineState.accesskey "o">
diff --git a/profile-switcher/locale/profileSelection.properties b/profile-switcher/locale/profileSelection.properties
new file mode 100644
index 000000000..5bf2a0caf
--- /dev/null
+++ b/profile-switcher/locale/profileSelection.properties
@@ -0,0 +1,6 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+dirLocked=%S cannot use the profile "%S". It may be in use, unavailable or damaged.\n\nPlease choose another profile or create a new one.
+
diff --git a/profile-switcher/moz.build b/profile-switcher/moz.build
new file mode 100644
index 000000000..0a8a53f8d
--- /dev/null
+++ b/profile-switcher/moz.build
@@ -0,0 +1,12 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += [
+ 'addon',
+ 'content',
+ 'locale',
+ 'skin',
+]
+
diff --git a/profile-switcher/moz.configure b/profile-switcher/moz.configure
new file mode 100644
index 000000000..4fb359679
--- /dev/null
+++ b/profile-switcher/moz.configure
@@ -0,0 +1,67 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# We could use confvars.sh and configure.in but for some reason it gets a bit messy...
+# Just use what we have.. While UXP may reduce the importance of moz.configure we
+# likely will never be able to eliminate it entirely... Oh well.
+
+# Disables building the platform code
+# NOTE: This negates any possiblity of an XPIDL or Binary XPCOM Components
+set_config('MOZ_DISABLE_PLATFORM', '1')
+
+# Minimum required by moz.configure since we don't want everything in
+# toolkit/moz.configure when the platform isn't built
+set_config('MOZ_PACKAGER_FORMAT', 'omni')
+set_config('MOZ_JAR_MAKER_FILE_FORMAT', 'flat')
+
+# moz.configure won't allow setting normal variables in a global context so
+# create a function that can be called to get specific info
+def confvars(key):
+ metadata = {
+ 'name': 'Profile Switcher',
+ 'id': 'profileswitcher@projects.binaryoutcast.com',
+ 'version': '1.0.1',
+ 'creator': 'Binary Outcast',
+ 'description': 'Easily switch profiles',
+ 'slug': 'profile-switcher',
+ 'targetApp': 'Pale Moon',
+ 'targetID': '{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}',
+ 'targetMinVer': '27.0.0',
+ 'targetMaxVer': '28.*',
+ 'basilisk': '1'
+ }
+
+ return metadata[key]
+
+# These will set the config/substs
+set_config('ADDON_NAME', confvars('name'))
+set_config('ADDON_ID', confvars('id'))
+set_config('ADDON_VERSION', confvars('version'))
+set_config('ADDON_AUTHOR', confvars('creator'))
+set_config('ADDON_SHORT_DESC', confvars('description'))
+set_config('ADDON_XPI_NAME', confvars('slug'))
+set_config('ADDON_CHROME_NAME', confvars('slug'))
+set_config('ADDON_TARGET_APP_NAME', confvars('targetApp'))
+set_config('ADDON_TARGET_APP_ID', confvars('targetID'))
+set_config('ADDON_TARGET_APP_MINVER', confvars('targetMinVer'))
+set_config('ADDON_TARGET_APP_MAXVER', confvars('targetMaxVer'))
+set_config('ADDON_TARGET_BASILISK', confvars('basilisk'))
+
+# These will set defines
+# Should weed them down to just what is required which I believe
+# is just ADDON_TARGET_BASILISK
+set_define('ADDON_NAME', confvars('name'))
+set_define('ADDON_ID', confvars('id'))
+set_define('ADDON_VERSION', confvars('version'))
+set_define('ADDON_AUTHOR', confvars('creator'))
+set_define('ADDON_SHORT_DESC', confvars('description'))
+set_define('ADDON_XPI_NAME', confvars('slug'))
+set_define('ADDON_CHROME_NAME', confvars('slug'))
+set_define('ADDON_TARGET_APP_NAME', confvars('targetApp'))
+set_define('ADDON_TARGET_APP_ID', confvars('targetID'))
+set_define('ADDON_TARGET_APP_MINVER', confvars('targetMinVer'))
+set_define('ADDON_TARGET_APP_MAXVER', confvars('targetMaxVer'))
+set_define('ADDON_TARGET_BASILISK', confvars('basilisk'))
diff --git a/profile-switcher/skin/jar.mn b/profile-switcher/skin/jar.mn
new file mode 100644
index 000000000..7e26ffff0
--- /dev/null
+++ b/profile-switcher/skin/jar.mn
@@ -0,0 +1,11 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#filter substitution
+
+[.] chrome.jar:
+% skin @ADDON_CHROME_NAME@ classic/1.0 chrome/skin/
+ skin/migrate.gif
+* skin/profile.css
+ skin/profileManager.css
diff --git a/profile-switcher/skin/migrate.gif b/profile-switcher/skin/migrate.gif
new file mode 100644
index 000000000..5b4380995
--- /dev/null
+++ b/profile-switcher/skin/migrate.gif
Binary files differ
diff --git a/profile-switcher/skin/moz.build b/profile-switcher/skin/moz.build
new file mode 100644
index 000000000..e0eb66aac
--- /dev/null
+++ b/profile-switcher/skin/moz.build
@@ -0,0 +1,6 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+JAR_MANIFESTS += ['jar.mn']
diff --git a/profile-switcher/skin/profile.css b/profile-switcher/skin/profile.css
new file mode 100644
index 000000000..0ceca7f30
--- /dev/null
+++ b/profile-switcher/skin/profile.css
@@ -0,0 +1,63 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+@import url("chrome://global/skin/global.css");
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+%filter substitution
+
+treechildren::-moz-tree-image {
+ margin-inline-end: 2px;
+ list-style-image: url("chrome://mozapps/skin/profile/profileicon.png");
+}
+
+treechildren::-moz-tree-image(rowMigrate-no) {
+ list-style-image: url("chrome://@ADDON_CHROME_NAME@/skin/migrate.gif");
+}
+
+/* profile selection dialog */
+
+/* Override global.css */
+hbox.wizard-box {
+ padding: 10px 10px 10px 10px;
+}
+
+#header {
+ -moz-box-orient: vertical;
+ margin-top: -8px;
+ margin-bottom: 0;
+ margin-inline-start: -8px;
+ margin-inline-end: -10px;
+ border-left: none;
+ border-right: none;
+ border-top: none;
+ -moz-border-bottom-colors: ThreeDHighlight ThreeDShadow;
+ padding-top: 12px;
+ padding-bottom: 12px;
+ padding-inline-start: 25px;
+ padding-inline-end: 5px;
+ background-color: Window;
+ color: WindowText;
+}
+
+#header > .dialogheader-title {
+ font: inherit;
+ font-weight: bold;
+}
+
+#header > .dialogheader-description {
+ margin-inline-start: 12px !important;
+}
+
+#intro,
+#label {
+ width: 17em;
+}
+
+#managebuttons > button {
+ min-width: 8em;
+}
diff --git a/profile-switcher/skin/profileManager.css b/profile-switcher/skin/profileManager.css
new file mode 100644
index 000000000..5fc14dc66
--- /dev/null
+++ b/profile-switcher/skin/profileManager.css
@@ -0,0 +1,19 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+#dialoginfo {
+ width: 576px;
+ height: 576px;
+}
+
+#table-housing {
+ background-color: white;
+ height: 100%;
+}
+
+#buttons-box {
+ margin-inline-start: 1em;
+}