[Pkg-mozext-commits] [itsalltext] 367/459: Ticket #18 -- osx: no buttons on editor-problem dialog
David Prévot
taffit at moszumanska.debian.org
Tue Feb 24 23:26:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository itsalltext.
commit 498c24e69c90de66bc230d49db3b10830aae8ac0
Author: Christian Höltje <docwhat at gerf.org>
Date: Wed Dec 8 00:22:20 2010 -0500
Ticket #18 -- osx: no buttons on editor-problem dialog
This adds a close button when the preferences pane is opened as a modal dialog.
---
src/chrome/content/itsalltext.js | 4 ++--
src/chrome/content/preferences.js | 17 ++++++++++++++++-
src/chrome/locale/en-US/preferences.properties | 3 ++-
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/chrome/content/itsalltext.js b/src/chrome/content/itsalltext.js
index 3afe56f..37172d7 100644
--- a/src/chrome/content/itsalltext.js
+++ b/src/chrome/content/itsalltext.js
@@ -413,7 +413,7 @@ var ItsAllText = function () {
var paneID = that.MYSTRING + '_preferences',
psvc = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch),
instantApply = psvc.getBoolPref("browser.preferences.instantApply", false) && !wait,
- features = "chrome,titlebar,toolbar,centerscreen" + (instantApply ? ",dialog=no" : ",modal"),
+ features = "chrome,titlebar,toolbar,centerscreen" + (instantApply ? ",dialog" : ",modal"),
xpcom_wm = Components.classes["@mozilla.org/appshell/window-mediator;1"],
wm = xpcom_wm.getService(Components.interfaces.nsIWindowMediator),
win = wm.getMostRecentWindow("Browser:Preferences"),
@@ -427,7 +427,7 @@ var ItsAllText = function () {
}
} else {
openDialog('chrome://itsalltext/content/preferences.xul',
- "", features, paneID);
+ "preferences", features, paneID, wait);
}
};
diff --git a/src/chrome/content/preferences.js b/src/chrome/content/preferences.js
index 7cbc77d..93c5f44 100644
--- a/src/chrome/content/preferences.js
+++ b/src/chrome/content/preferences.js
@@ -92,7 +92,7 @@ function pref_onload() {
desc,
textnode;
document.getElementById('browse').focus();
- if (window['arguments'] && window['arguments'][0] && window['arguments'][0] == 'badeditor') {
+ if (window['arguments'] && window.arguments[0] && window.arguments[0] == 'badeditor') {
editor = document.getElementById('editor');
editor.style.color = 'black';
editor.style.backgroundColor = '#fb4';
@@ -113,6 +113,21 @@ function pref_onload() {
desc.style.maxWidth = '18em';
box.appendChild(desc);
}
+ if (window['arguments'] && window.arguments[1]) {
+ var button = document.createElement('button');
+ button.setAttribute('label', locale.getString('close.button'));
+ button.addEventListener('command', function (event) { window.close(); }, true);
+
+ var spacer = document.createElement('spacer');
+ spacer.setAttribute('flex', 1);
+
+ var box = document.createElement('hbox');
+ box.appendChild(spacer);
+ box.appendChild(button);
+
+ var pane = document.getElementById('itsalltext-pane');
+ pane.appendChild(box);
+ }
update_hotkey('disp-hotkey');
}
diff --git a/src/chrome/locale/en-US/preferences.properties b/src/chrome/locale/en-US/preferences.properties
index 1d76bc8..6a49863 100644
--- a/src/chrome/locale/en-US/preferences.properties
+++ b/src/chrome/locale/en-US/preferences.properties
@@ -1,3 +1,4 @@
picker.window.title=Choose your editor
problem.editor=I was unable to run your editor, '%1$S'. Use the browse button to choose another editor and try again.
-mac.hint=If you use Mac OS X then you probably want to use '/usr/bin/open' -- it will open the file using the default application for that file.
+mac.hint=If you use Mac OS X then '/Applications/TextEdit.app' is a safe choice.
+close.button=Close
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/itsalltext.git
More information about the Pkg-mozext-commits
mailing list