merge toolbar.xul into the collections view now that it's the only view to use the toolbar overlay

This commit is contained in:
Myk Melez 2008-12-12 11:52:49 -08:00
Родитель dacb2b868f
Коммит 950560123c
6 изменённых файлов: 40 добавлений и 151 удалений

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

@ -22,12 +22,6 @@ overlay chrome://snowl/content/list-sidebar.xul chrome://snowl/content/collectio
# Add the interface for writing messages to the stream view.
overlay chrome://snowl/content/stream.xul chrome://snowl/content/write.xul
# Add the toolbar to the collections and stream views.
# XXX Should we add the toolbar directly to the list and river views
# rather than indirectly via the collections view?
overlay chrome://snowl/content/collections.xul chrome://snowl/content/toolbar.xul
overlay chrome://snowl/content/stream.xul chrome://snowl/content/toolbar.xul
# Add preferences to the main Options dialog.
overlay chrome://browser/content/preferences/preferences.xul chrome://snowl/content/preferences.xul

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

@ -316,6 +316,18 @@ let CollectionsView = {
SnowlUtils.RestoreSelectionWithoutContentLoad(this._tree);
},
onSubscribe: function() {
gBrowserWindow.Snowl.onSubscribe();
},
onUnsubscribe: function() {
this.unsubscribe();
},
onRefresh: function() {
SnowlService.refreshAllSources();
},
refreshSource: function() {
let selectedSourceIDs = [];

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

@ -36,9 +36,15 @@
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://snowl/content/collections.css" type"text/css"?>
<?xml-stylesheet href="chrome://snowl/content/collections.css" type="text/css"?>
<?xml-stylesheet href="chrome://snowl/content/toolbar.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://snowl/locale/collections.dtd">
<!DOCTYPE overlay [
<!ENTITY % collectionsDTD SYSTEM "chrome://snowl/locale/collections.dtd">
%collectionsDTD;
<!ENTITY % toolbarDTD SYSTEM "chrome://snowl/locale/toolbar.dtd">
%toolbarDTD;
]>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@ -74,7 +80,22 @@
onmousedown="CollectionsView.onCollectionsTreeMouseDown(event)"/>
</tree>
<toolbar id="snowlToolbar"/>
<toolbar id="snowlToolbar" persist="hidden">
<toolbarbutton id="snowlSubscribeButton"
image="chrome://snowl/content/icons/add.png"
oncommand="CollectionsView.onSubscribe()"
tooltiptext="&subscribeButton.tooltip;"/>
<toolbarbutton id="snowlUnsubscribeButton"
image="chrome://snowl/content/icons/delete.png"
oncommand="CollectionsView.onUnsubscribe()"
tooltiptext="&unsubscribeButton.tooltip;"/>
<toolbarspring/>
<toolbarbutton id="snowlRefreshButton"
image="chrome://snowl/content/icons/arrow_refresh_small.png"
oncommand="CollectionsView.onRefresh()"
tooltiptext="&refreshButton.tooltip;"/>
</toolbar>
</vbox>
</overlay>

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

@ -36,11 +36,12 @@
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/" type"text/css"?>
<?xml-stylesheet href="chrome://snowl/content/stream.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://snowl/content/stream.css" type="text/css"?>
<?xml-stylesheet href="chrome://snowl/content/toolbar.css" type="text/css"?>
<!DOCTYPE page [
<!ENTITY % streamDTD SYSTEM "chrome://snowl/locale/stream.dtd">
<!ENTITY % streamDTD SYSTEM "chrome://snowl/locale/stream.dtd">
%streamDTD;
<!ENTITY % toolbarDTD SYSTEM "chrome://snowl/locale/toolbar.dtd">
%toolbarDTD;

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

@ -1,68 +0,0 @@
/* ***** 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 Snowl.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Myk Melez <myk@mozilla.org>
*
* 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 ***** */
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() {
gBrowserWindow.Snowl.onSubscribe();
},
// FIXME: make this not be specific to the tree in the collections view.
unsubscribe: function(aEvent) {
CollectionsView.unsubscribe();
},
onRefresh: function() {
SnowlService.refreshAllSources();
},
onExportOPML: function() {
SnowlOPML.export(window);
},
onToggleWrite: function(event) {
SnowlMessageView.onToggleWrite(event);
}
};

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

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ***** 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 Snowl.
-
- The Initial Developer of the Original Code is Mozilla.
- Portions created by the Initial Developer are Copyright (C) 2008
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Myk Melez <myk@mozilla.org>
-
- 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 ***** -->
<?xml-stylesheet href="chrome://snowl/content/toolbar.css" type"text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://snowl/locale/toolbar.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://snowl/content/toolbar.js"/>
<toolbar id="snowlToolbar" persist="hidden">
<toolbarbutton id="snowlSubscribeButton"
image="chrome://snowl/content/icons/add.png"
oncommand="SnowlToolbar.subscribe()"
tooltiptext="&subscribeButton.tooltip;"/>
<toolbarbutton id="snowlUnsubscribeButton"
image="chrome://snowl/content/icons/delete.png"
oncommand="SnowlToolbar.unsubscribe()"
tooltiptext="&unsubscribeButton.tooltip;"/>
<toolbarbutton id="snowlRefreshButton"
image="chrome://snowl/content/icons/arrow_refresh_small.png"
oncommand="SnowlToolbar.onRefresh()"
tooltiptext="&refreshButton.tooltip;"/>
<toolbarbutton id="snowlExportOPMLButton"
image="chrome://snowl/content/icons/opml-icon-16x16.png"
oncommand="SnowlToolbar.onExportOPML()"
tooltiptext="&exportButton.tooltip;"/>
<toolbarspring/>
<toolbarbutton id="snowlWriteButton" type="checkbox"
image="chrome://snowl/content/icons/email_add.png"
oncommand="SnowlToolbar.onToggleWrite(event)"
tooltiptext="&writeButton.tooltip;"/>
</toolbar>
</overlay>