Make the options dialog resizeable.

This commit is contained in:
scott%scott-macgregor.org 2003-08-09 04:49:51 +00:00
Родитель efcc9d6699
Коммит fa058ffda8
4 изменённых файлов: 19 добавлений и 17 удалений

Просмотреть файл

@ -84,20 +84,7 @@ function toOpenWindowByType( inType, uri )
function toMessengerWindow() function toMessengerWindow()
{ {
var pref = Components.classes["@mozilla.org/preferences-service;1"] toOpenWindowByType("mail:3pane", "chrome://messenger/content/messenger.xul");
.getService(Components.interfaces.nsIPrefBranch);
var windowDoc = "chrome://messenger/content/messenger.xul";
try
{
var layoutType = pref.getIntPref("mail.pane_config");
windowDoc = !layoutType ? "chrome://messenger/content/messenger.xul" :
"chrome://messenger/content/mail3PaneWindowVertLayout.xul";
}
catch(ex)
{
}
toOpenWindowByType("mail:3pane", windowDoc);
} }
function toAddressBook() function toAddressBook()
@ -115,3 +102,18 @@ function CheckOnline()
{ {
return true; return true;
} }
function openOptionsDialog(containerID, paneURL, itemID)
{
//check for an existing pref window and focus it; it's not application modal
const kWindowMediatorContractID = "@mozilla.org/appshell/window-mediator;1";
const kWindowMediatorIID = Components.interfaces.nsIWindowMediator;
const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID);
var lastPrefWindow = kWindowMediator.getMostRecentWindow("mozilla:preferences");
if (lastPrefWindow)
lastPrefWindow.focus();
else
openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow",
"chrome,titlebar,resizable=yes", paneURL, containerID, itemID);
}

Просмотреть файл

@ -1491,7 +1491,7 @@
<menuitem label="&javaScriptConsoleCmd.label;" accesskey="&javaScriptConsoleCmd.accesskey;" oncommand="toJavaScriptConsole();"/> <menuitem label="&javaScriptConsoleCmd.label;" accesskey="&javaScriptConsoleCmd.accesskey;" oncommand="toJavaScriptConsole();"/>
<menuseparator/> <menuseparator/>
<menuitem label="&accountManagerCmd.label;" accesskey="&accountManagerCmd.accesskey;" oncommand="MsgAccountManager(null);"/> <menuitem label="&accountManagerCmd.label;" accesskey="&accountManagerCmd.accesskey;" oncommand="MsgAccountManager(null);"/>
<menuitem id="menu_preferences" oncommand="goPreferences('mailnews', 'chrome://messenger/content/pref-mailnews.xul','mailnews')"/> <menuitem id="menu_preferences" oncommand="openOptionsDialog('mailnews', 'chrome://messenger/content/pref-mailnews.xul','mailnews')"/>
</menupopup> </menupopup>
</menu> </menu>

Просмотреть файл

@ -358,7 +358,7 @@
<menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="AbExport()"/> <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="AbExport()"/>
<menuseparator /> <menuseparator />
<menuitem id="menu_preferences" label="&preferencesCmd.label;" accesskey="&preferencesCmd.accesskey;" <menuitem id="menu_preferences" label="&preferencesCmd.label;" accesskey="&preferencesCmd.accesskey;"
oncommand="goPreferences('mailnews', 'chrome://messenger/content/addressbook/pref-addressing.xul', 'mailaddressbookpref')"/> oncommand="openOptionsDialog('mailnews', 'chrome://messenger/content/addressbook/pref-addressing.xul', 'mailaddressbookpref')"/>
</menupopup> </menupopup>
</menu> </menu>

Просмотреть файл

@ -422,7 +422,7 @@
<menuseparator/> <menuseparator/>
<menuitem label="&accountManagerCmd.label;" accesskey="&accountManagerCmd.accesskey;" command="cmd_account"/> <menuitem label="&accountManagerCmd.label;" accesskey="&accountManagerCmd.accesskey;" command="cmd_account"/>
<menuitem id="menu_preferences" label="&preferencesCmd.label;" accesskey="&preferencesCmd.accesskey;" <menuitem id="menu_preferences" label="&preferencesCmd.label;" accesskey="&preferencesCmd.accesskey;"
oncommand="goPreferences('mailnews', 'chrome://messenger/content/messengercompose/pref-composing_messages.xul', 'mailcomposepref');"/> oncommand="openOptionsDialog('mailcomposepref', 'chrome://messenger/content/messengercompose/pref-composing_messages.xul', 'mailcomposepref');"/>
</menupopup> </menupopup>
</menu> </menu>