Show data directory properly on Linux

Previously used a custom selectable alert when reveal() failed, but we
can just launch the directory, as we do for attachments
This commit is contained in:
Dan Stillman 2012-05-01 20:00:35 -04:00
parent 64701de5f9
commit 4bb7f7d08b
2 changed files with 3 additions and 29 deletions

View file

@ -1234,12 +1234,9 @@ function revealDataDirectory() {
dataDir.reveal();
}
catch (e) {
// On platforms that don't support nsILocalFile.reveal() (e.g. Linux), we
// open a small window with a selected read-only textbox containing the
// file path, so the user can open it, Control-c, Control-w, Alt-Tab, and
// Control-v the path into another app
var io = {alertText: dataDir.path};
window.openDialog('chrome://zotero/content/selectableAlert.xul', "zotero-reveal-window", "chrome", io);
// On platforms that don't support nsILocalFile.reveal() (e.g. Linux),
// launch the directory
window.opener.ZoteroPane_Local.launchFile(dataDir);
}
}

View file

@ -1,23 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window
orient="vertical"
width="400"
height="200"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<keyset>
<key id="key_close" key="W" modifiers="accel" command="cmd_close"/>
</keyset>
<command id="cmd_close" oncommand="window.close();"/>
<textbox id="alert-textbox" class="plain" flex="1" readonly="true"/>
<script>
window.addEventListener('load', function(e){
document.getElementById('alert-textbox').value = window.arguments[0].alertText;
document.getElementById('alert-textbox').select();
}, false);
</script>
</window>