mirror of
https://github.com/moparisthebest/FireTray
synced 2025-01-09 12:38:04 -05:00
add preferences item to popup menu
This commit is contained in:
parent
80b0384397
commit
c96ff01ebd
@ -1,5 +1,6 @@
|
||||
extensions.{9533f794-00b4-4354-aa15-c2bbda6989f8}.description=A system tray extension for linux.
|
||||
popupMenu.itemLabel.ResetIcon=Reset icon
|
||||
popupMenu.itemLabel.Preferences=Preferences
|
||||
popupMenu.itemLabel.Quit=Quit
|
||||
popupMenu.itemLabel.NewWindow=New window
|
||||
popupMenu.itemLabel.NewMessage=New message
|
||||
|
@ -392,6 +392,19 @@ firetray.Handler = {
|
||||
return url;
|
||||
},
|
||||
|
||||
openPrefWindow: function() {
|
||||
if (null == firetray.Handler._preferencesWindow ||
|
||||
firetray.Handler._preferencesWindow.closed) {
|
||||
for(var first in firetray.Handler.windows) break;
|
||||
firetray.Handler._preferencesWindow =
|
||||
firetray.Handler.windows[first].chromeWin.openDialog(
|
||||
"chrome://firetray/content/options.xul", null,
|
||||
"chrome,titlebar,toolbar,centerscreen", null);
|
||||
}
|
||||
|
||||
firetray.Handler._preferencesWindow.focus();
|
||||
},
|
||||
|
||||
openBrowserWindow: function() {
|
||||
try {
|
||||
var home = firetray.Handler._getHomePage();
|
||||
@ -402,8 +415,8 @@ firetray.Handler = {
|
||||
firetray.Handler.timers['open-browser-window'] =
|
||||
firetray.Utils.timer(FIRETRAY_DELAY_NOWAIT_MILLISECONDS,
|
||||
Ci.nsITimer.TYPE_ONE_SHOT, function() {
|
||||
for(var key in firetray.Handler.windows) break;
|
||||
firetray.Handler.windows[key].chromeWin.open(home);
|
||||
for(var first in firetray.Handler.windows) break;
|
||||
firetray.Handler.windows[first].chromeWin.open(home);
|
||||
});
|
||||
} catch (x) { log.error(x); }
|
||||
},
|
||||
|
@ -43,11 +43,16 @@ firetray.PopupMenu = {
|
||||
addMenuSeparator = true;
|
||||
}
|
||||
|
||||
var menuSeparator;
|
||||
if (addMenuSeparator) {
|
||||
var menuSeparator = gtk.gtk_separator_menu_item_new();
|
||||
menuSeparator = gtk.gtk_separator_menu_item_new();
|
||||
gtk.gtk_menu_shell_append(this.menuShell, ctypes.cast(menuSeparator, gtk.GtkWidget.ptr));
|
||||
}
|
||||
|
||||
this.addItem("Preferences", "gtk-preferences", "activate", firetray.Handler.openPrefWindow);
|
||||
menuSeparator = gtk.gtk_separator_menu_item_new();
|
||||
gtk.gtk_menu_shell_append(this.menuShell, ctypes.cast(menuSeparator, gtk.GtkWidget.ptr));
|
||||
|
||||
this.addItem("Quit", "gtk-quit", "activate", firetray.Handler.quitApplication);
|
||||
|
||||
var menuWidget = ctypes.cast(this.menu, gtk.GtkWidget.ptr);
|
||||
|
Loading…
Reference in New Issue
Block a user