new separate subscribe/options dialog

This commit is contained in:
alta88 2008-12-01 12:24:19 -08:00
Родитель 0c01dba383
Коммит 1305d31457
8 изменённых файлов: 206 добавлений и 219 удалений

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

@ -239,7 +239,30 @@ let Snowl = {
},
onSubscribe: function() {
openPreferences("paneSnowl", { "snowlTab" : "snowlPrefsTabSubscribe" });
return this.openSnowlPreferences("subscribe");
},
openSnowlPreferences: function(paneID, extraArgs) {
// let instantApply = getBoolPref("browser.preferences.instantApply", false);
let instantApply = true;
let features = "chrome,titlebar,toolbar,resizable=yes" +
(instantApply ? ",dialog=no" : ",modal");
let wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
let win = wm.getMostRecentWindow("Snowl:Preferences");
if (win) {
win.focus();
if (paneID) {
var pane = win.document.getElementById(paneID);
win.document.documentElement.showPane(pane);
}
return win;
}
return openDialog("chrome://snowl/content/preferences.xul",
"SnowlPreferences", features, paneID, extraArgs);
},
onImportOPML: function() {

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

@ -193,14 +193,14 @@
</menu>
<menuseparator/>
<menuitem label="&subscribe.label;" accesskey="&subscribe.accesskey;"
oncommand="Snowl.onSubscribe()"/>
oncommand="Snowl.openSnowlPreferences('subscribe');"/>
<menuitem label="&importOPML.label;" accesskey="&importOPML.accesskey;"
oncommand="Snowl.onImportOPML()"/>
<menuitem label="&exportOPML.label;" accesskey="&exportOPML.accesskey;"
oncommand="Snowl.onExportOPML()"/>
<menuseparator/>
<menuitem label="&options.label;" accesskey="&options.accesskey;"
oncommand="openPreferences('paneSnowl');"/>
oncommand="Snowl.openSnowlPreferences();"/>
</menupopup>
</menu>
</menupopup>

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

@ -36,17 +36,26 @@
/******************************************************************************/
/* Preferences dialog button */
/* Preferences dialog */
#SnowlPreferences {
width: 30em;
min-height: 32em;
}
#SnowlPreferences radio[pane] {
padding: 5px 3px 1px;
}
/* XXX make a png, maybe also activity images */
#BrowserPreferences radio[pane="paneSnowl"] {
#SnowlPreferences radio[pane="subscribe"] {
list-style-image: url("chrome://snowl/content/icons/snowl-40.jpg");
}
radio[pane="paneSnowl"],
radio[pane="paneSnowl"]:hover,
radio[pane="paneSnowl"][selected="true"],
radio[pane="paneSnowl"]:active {
radio[pane="subscribe"],
radio[pane="subscribe"]:hover,
radio[pane="subscribe"][selected="true"],
radio[pane="subscribe"]:active {
-moz-image-region: rect(0px, 0px, 0px, 0px)
}
@ -57,12 +66,16 @@ radio[pane="paneSnowl"]:active {
}
/* gnomestripe */
#paneSnowl {
#subscribe {
padding-bottom: 10px;
}
#resizerBox {
margin-top: -14px;
}
/******************************************************************************/
/* Subscribe tab */
/* Preferences dialog Subscribe pane */
#statusIcon[status="active"] {
list-style-image: url("chrome://global/skin/icons/loading_16.png");
@ -77,7 +90,7 @@ radio[pane="paneSnowl"]:active {
}
/******************************************************************************/
/* Subscribe page */
/* Feed Subscribe page */
#content {
border: 1px solid threedshadow;

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

@ -21,6 +21,7 @@
-
- Contributor(s):
- Myk Melez <myk@mozilla.org>
- alta88 <alta88@gmail.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
@ -36,19 +37,23 @@
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/"?>
<?xml-stylesheet href="chrome://snowl/content/preferences.css"?>
<!DOCTYPE overlay [
<!DOCTYPE prefwindow [
<!ENTITY % snowlPreferencesDTD SYSTEM "chrome://snowl/locale/preferences.dtd">
<!ENTITY % snowlLoginDTD SYSTEM "chrome://snowl/locale/login.dtd">
%snowlPreferencesDTD;
%snowlLoginDTD;
]>
<overlay id="snowlPreferencesPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefwindow id="BrowserPreferences">
<prefwindow id="SnowlPreferences"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
type="prefwindow"
windowtype="Snowl:Preferences"
XXXondialoghelp="openPrefsHelp()"
title="&prefWindow.title;"
persist="width height screenX screenY lastSelected sizemode">
<script type="application/x-javascript" src="chrome://snowl/content/preferences.js"/>
<script type="application/x-javascript" src="chrome://snowl/content/strands.js"/>
@ -59,200 +64,144 @@
src="chrome://snowl/locale/preferences.properties"/>
</stringbundleset>
<prefpane id="paneSnowl"
label="&paneSnowl.title;"
onpaneload="SnowlPreferences.onPaneLoad();"
insertbefore="paneAdvanced">
<!-- Subscribe -->
<prefpane id="subscribe"
label="&subscribe.title;"
onpaneload="SnowlPreferences.onPaneLoad();">
<!--
<preferences id="snowlPreferences">
<preference id="extensions.snowl.preferences.selectedTabIndex"
name="extensions.snowl.preferences.selectedTabIndex"
type="int"/>
</preferences>
</preferences> -->
<!-- General tab
<preference id="accessibility.browsewithcaret"
name="accessibility.browsewithcaret"
type="bool"/>
<preference id="accessibility.typeaheadfind"
name="accessibility.typeaheadfind"
type="bool"/>
-->
<!-- New Source -->
<groupbox>
<caption label="&source.label;"/>
<radiogroup id="subscribeRadio"
orient="horizontal"
oncommand="SnowlPreferences.selectSubcribeDeck()">
<radio label="&feeds.label;"
accesskey="&feeds.accesskey;"/>
<radio label="&twitter.label;"
accesskey="&twitter.accesskey;"/>
<radio label="&mail.label;" disabled="true"
accesskey="&mail.accesskey;"/>
<radio label="&newsgroup.label;" disabled="true"
accesskey="&newsgroup.accesskey;"/>
</radiogroup>
<separator class="groove-thin"/>
<!-- Subscribe tab
<preference id="browser.cache.disk.capacity"
name="browser.cache.disk.capacity"
type="int"/>
<preference id="browser.offline-apps.notify"
name="browser.offline-apps.notify"
type="bool"/>
-->
<deck id="subscribeDeck">
<grid id="feedSubscribe">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<hbox flex="1" pack="end">
<label control="locationTextbox" value="&location.label;"/>
</hbox>
<textbox id="locationTextbox" clickSelectsAll="true"/>
</row>
<row align="center">
<hbox flex="1" pack="end">
<label control="nameTextbox" value="&name.label;"/>
</hbox>
<textbox id="nameTextbox" readonly="true" clickSelectsAll="true"/>
</row>
<row>
<box/>
<hbox pack="start">
<button label="&subscribeButton.label;" default="true"
accesskey="&subscribeButton.accesskey;"
oncommand="Subscriber.subscribeFeed()"/>
<spacer flex="1"/>
<button label="&clearButton.label;"
accesskey="&clearButton.accesskey;"
oncommand="SnowlPreferences.clearFields()"/>
</hbox>
</row>
</rows>
</grid>
<!-- Organize tab
<preference id="app.update.enabled"
name="app.update.enabled"
type="bool"
onchange="gAdvancedPane.updateAppUpdateItems();
gAdvancedPane.updateAutoItems();
gAdvancedPane.updateModeItems();"/>
</preferences>
-->
<grid id="twitterSubscribe">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<hbox flex="1" pack="end">
<label control="twitterUsername" value="&username.label;"/>
</hbox>
<textbox id="twitterUsername"/>
</row>
<row align="center">
<hbox flex="1" pack="end">
<label control="twitterPassword" value="&password.label;"/>
</hbox>
<textbox id="twitterPassword" type="password"/>
</row>
<row align="center">
<box/>
<checkbox id="showTwitterPassword" label="&showPassword.label;"
oncommand="Subscriber.showTwitterPassword()"/>
</row>
<row align="center">
<box/>
<checkbox id="rememberTwitterPassword" label="&rememberPassword.label;"/>
</row>
<row>
<box/>
<hbox >
<button label="&subscribeButton.label;" default="true"
accesskey="&subscribeButton.accesskey;"
oncommand="Subscriber.subscribeTwitter()"/>
<spacer flex="1"/>
<button label="&clearButton.label;"
accesskey="&clearButton.accesskey;"
oncommand="SnowlPreferences.clearFields()"/>
</hbox>
</row>
</rows>
</grid>
</deck>
<tabbox id="snowlPrefs" flex="1"
persist="selectedIndex">
</groupbox>
<tabs id="snowlPrefsTabs">
<!--<tab id="snowlPrefsTabGeneral"-->
<!-- label="&generalTab.label;"-->
<!-- XXXhelpTopic="prefs-snowl-general"/>-->
<tab id="snowlPrefsTabSubscribe"
label="&subscribeTab.label;"
XXXhelpTopic="prefs-snowl-subscribe"/>
<!--<tab id="snowlPrefsTabOrganize"-->
<!-- label="&organizeTab.label;"-->
<!-- disabled="true"-->
<!-- XXXhelpTopic="prefs-snowl-organize"/>-->
</tabs>
<tabpanels id="snowlPrefsPanels" flex="1">
<!-- General -->
<!--<tabpanel id="snowlPrefsGeneralPanel" orient="vertical">-->
<!-- Layouts -->
<!--<groupbox id="snowlPanel1a" align="start">-->
<!-- <caption label="Layouts"/>-->
<!--</groupbox>-->
<!-- Browsing -->
<!-- <groupbox id="snowlPanel1b" align="start">-->
<!-- <caption label="Other"/>-->
<!-- </groupbox>-->
<!--</tabpanel>-->
<!-- Subscribe -->
<tabpanel id="snowlPrefsSubscribePanel" orient="vertical">
<!-- New Source -->
<groupbox>
<caption label="&source.label;"/>
<radiogroup id="subscribeRadio"
orient="horizontal"
oncommand="SnowlPreferences.selectSubcribeDeck()">
<radio label="&feeds.label;"
accesskey="&feeds.accesskey;"/>
<radio label="&twitter.label;"
accesskey="&twitter.accesskey;"/>
<radio label="&mail.label;" disabled="true"
accesskey="&mail.accesskey;"/>
<radio label="&newsgroup.label;" disabled="true"
accesskey="&newsgroup.accesskey;"/>
</radiogroup>
<separator class="groove-thin"/>
<deck id="subscribeDeck">
<grid id="feedSubscribe">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<hbox flex="1" pack="end">
<label control="locationTextbox" value="&location.label;"/>
</hbox>
<textbox id="locationTextbox" clickSelectsAll="true"/>
</row>
<row align="center">
<hbox flex="1" pack="end">
<label control="nameTextbox" value="&name.label;"/>
</hbox>
<textbox id="nameTextbox" readonly="true" clickSelectsAll="true"/>
</row>
<row>
<box/>
<hbox pack="start">
<button label="&subscribeButton.label;" default="true"
accesskey="&subscribeButton.accesskey;"
oncommand="Subscriber.subscribeFeed()"/>
<spacer flex="1"/>
<button label="&clearButton.label;"
accesskey="&clearButton.accesskey;"
oncommand="SnowlPreferences.clearFields()"/>
</hbox>
</row>
</rows>
</grid>
<grid id="twitterSubscribe">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<hbox flex="1" pack="end">
<label control="twitterUsername" value="&username.label;"/>
</hbox>
<textbox id="twitterUsername"/>
</row>
<row align="center">
<hbox flex="1" pack="end">
<label control="twitterPassword" value="&password.label;"/>
</hbox>
<textbox id="twitterPassword" type="password"/>
</row>
<row align="center">
<box/>
<checkbox id="showTwitterPassword" label="&showPassword.label;"
oncommand="Subscriber.showTwitterPassword()"/>
</row>
<row align="center">
<box/>
<checkbox id="rememberTwitterPassword" label="&rememberPassword.label;"/>
</row>
<row>
<box/>
<hbox >
<button label="&subscribeButton.label;" default="true"
accesskey="&subscribeButton.accesskey;"
oncommand="Subscriber.subscribeTwitter()"/>
<spacer flex="1"/>
<button label="&clearButton.label;"
accesskey="&clearButton.accesskey;"
oncommand="SnowlPreferences.clearFields()"/>
</hbox>
</row>
</rows>
</grid>
</deck>
</groupbox>
<hbox id="statusBox">
<vbox pack="center">
<image id="statusIcon" />
</vbox>
<description id="statusMessage" flex="1"/>
</hbox>
</tabpanel>
<!-- Organize -->
<!--<tabpanel id="snowlPrefsOrganizePanel" orient="vertical">-->
<!-- -->
<!--<groupbox id="snowlPanel3a">-->
<!-- <caption label="snowlPanel3a"/>-->
<!--</groupbox>-->
<!-- -->
<!-- <groupbox id="snowlPanel3b">-->
<!-- <caption label="snowlPanel3b"/>-->
<!-- </groupbox>-->
<!---->
<!--</tabpanel>-->
</tabpanels>
</tabbox>
<hbox id="statusBox">
<vbox pack="center">
<image id="statusIcon" />
</vbox>
<description id="statusMessage" flex="1"/>
</hbox>
</prefpane>
<!-- Subscriptions -->
<prefpane id="subscriptions"
label="&subscriptions.title;"
XXXonpaneload="SnowlPreferences.onPaneLoad();">
<groupbox>
<caption label="Subscriptions"/>
</groupbox>
</prefpane>
<!-- Organize -->
<prefpane id="organize"
label="&organize.title;"
XXXonpaneload="SnowlPreferences.onPaneLoad();">
<groupbox>
<caption label="Organize"/>
</groupbox>
</prefpane>
<hbox id="resizerBox" flex="1">
<spacer flex="1"/>
<resizer dir="bottomright"/>
</hbox>
</prefwindow>
</overlay>

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

@ -34,18 +34,19 @@
*
* ***** END LICENSE BLOCK ***** */
let gBrowserWindow = window.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIWebNavigation).
QueryInterface(Ci.nsIDocShellTreeItem).
rootTreeItem.
QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIDOMWindow);
Cu.import("resource://snowl/modules/service.js");
Cu.import("resource://snowl/modules/opml.js");
let SnowlToolbar = {
subscribe: function(event) {
// The subscriptions interface has been moved to the options dialog,
// so open the options dialog when the user presses the subscribe button.
// Note: even though we open this in a tab, it will cause the Preferences
// dialog to open. Ultimately the subscriptions interface will be in its
// own dialog and we'll directly open that dialog here (see the code
// in options.xul for how to open it).
openPreferences("paneSnowl", { "snowlTab" : "snowlPrefsTabSubscribe" });
subscribe: function() {
gBrowserWindow.Snowl.onSubscribe();
},
// FIXME: make this not be specific to the tree in the collections view.

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

@ -42,7 +42,6 @@
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/x-javascript" src="chrome://snowl/content/toolbar.js"/>
<toolbar id="snowlToolbar" persist="hidden">

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

@ -10,7 +10,7 @@
<em:description>conversations redelivered</em:description>
<em:creator>Myk Melez</em:creator>
<em:homepageURL>http://labs.mozilla.com/projects/snowl/</em:homepageURL>
<em:optionsURL>chrome://snowl/content/options.xul</em:optionsURL>
<em:optionsURL>chrome://snowl/content/preferences.xul</em:optionsURL>
<em:aboutURL>chrome://snowl/content/about.xul</em:aboutURL>
<!-- Firefox -->

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

@ -1,13 +1,12 @@
<!-- Snowl Options -->
<!ENTITY paneSnowl.title "Snowl">
<!ENTITY noPreferences.message "Snowl does not yet have preferences.">
<!ENTITY prefWindow.title "Snowl Options">
<!ENTITY page.title "Snowl: Subscribe to Message Sources">
<!-- General tab -->
<!ENTITY generalTab.label "General">
<!-- General pane -->
<!ENTITY general.title "General">
<!-- Subscribe tab -->
<!ENTITY subscribeTab.label "Subscribe">
<!-- Subscribe pane -->
<!ENTITY subscribe.title "Subscribe">
<!ENTITY source.label "New Source">
<!ENTITY feeds.label "Feed">
<!ENTITY feeds.accesskey "F">
@ -26,5 +25,8 @@
<!ENTITY clearButton.label "Clear">
<!ENTITY clearButton.accesskey "C">
<!-- Organize tab -->
<!ENTITY organizeTab.label "Organize">
<!-- Subscriptions pane -->
<!ENTITY subscriptions.title "Subscriptions">
<!-- Organize pane -->
<!ENTITY organize.title "Organize">