diff --git a/nixos/gui/README b/nixos/gui/README deleted file mode 100644 index c038314a0dc7..000000000000 --- a/nixos/gui/README +++ /dev/null @@ -1,16 +0,0 @@ -This file should become a nix expression. (see modules/installer/tools/tools.nix) - -you need to: -- download the latest jQuery from and copy it to chrome/content: - http://code.jquery.com/jquery-1.5.2.js - -- install 'xulrunner' with nix: - nix-env -Ai nixpkgs_sys.firefox40Pkgs.xulrunner - -- make sure nixos-option in your path - -- have /etc/nixos/nixpkgs -- have /etc/nixos/nixos - -run it: -- xulrunner /etc/nixos/nixos/gui/application.ini -jsconsole diff --git a/nixos/gui/application.ini b/nixos/gui/application.ini deleted file mode 100644 index d2494a1a5cd5..000000000000 --- a/nixos/gui/application.ini +++ /dev/null @@ -1,36 +0,0 @@ -[App] -; -; This field specifies your organization's name. This field is recommended, -; but optional. -Vendor=NixOS -; -; This field specifies your application's name. This field is required. -Name=NixOS-gui -; -; This field specifies your application's version. This field is optional. -Version=0.1 -; -; This field specifies your application's build ID (timestamp). This field is -; required. -BuildID=20110424 -; -; This field specifies a compact copyright notice for your application. This -; field is optional. -;Copyright= - -; -; This ID is just an example. Every XUL app ought to have it's own unique ID. -; You can use the microsoft "guidgen" or "uuidgen" tools, or go on -; irc.mozilla.org and /msg botbot uuid. This field is optional. -;ID= - -[Gecko] -; -; This field is required. It specifies the minimum Gecko version that this -; application requires. -MinVersion=1.9a5 -; -; This field is optional. It specifies the maximum Gecko version that this -; application requires. It should be specified if your application uses -; unfrozen interfaces. -MaxVersion=2.* diff --git a/nixos/gui/chrome.manifest b/nixos/gui/chrome.manifest deleted file mode 100644 index 865d6a88fb48..000000000000 --- a/nixos/gui/chrome.manifest +++ /dev/null @@ -1 +0,0 @@ -manifest chrome/chrome.manifest diff --git a/nixos/gui/chrome/chrome.manifest b/nixos/gui/chrome/chrome.manifest deleted file mode 100644 index 775445ee17bf..000000000000 --- a/nixos/gui/chrome/chrome.manifest +++ /dev/null @@ -1 +0,0 @@ -content nixos-gui content/ diff --git a/nixos/gui/chrome/content/io.js b/nixos/gui/chrome/content/io.js deleted file mode 100644 index 8d9c8c173656..000000000000 --- a/nixos/gui/chrome/content/io.js +++ /dev/null @@ -1,137 +0,0 @@ - -function inspect(obj, maxLevels, level) -{ - var str = '', type, msg; - - // Start Input Validations - // Don't touch, we start iterating at level zero - if(level == null) level = 0; - - // At least you want to show the first level - if(maxLevels == null) maxLevels = 1; - if(maxLevels < 1) - return 'Error: Levels number must be > 0'; - - // We start with a non null object - if(obj == null) - return 'Error: Object NULL'; - // End Input Validations - - // Each Iteration must be indented - str += ''; - - return str; -} - -// Run xulrunner application.ini -jsconsole -console, to see messages. -function log(str) -{ - Components.classes['@mozilla.org/consoleservice;1'] - .getService(Components.interfaces.nsIConsoleService) - .logStringMessage(str); -} - -function makeTempFile(prefix) -{ - var file = Components.classes["@mozilla.org/file/directory_service;1"] - .getService(Components.interfaces.nsIProperties) - .get("TmpD", Components.interfaces.nsIFile); - file.append(prefix || "xulrunner"); - file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0664); - return file; -} - -function writeToFile(file, data) -{ - // file is nsIFile, data is a string - var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"] - .createInstance(Components.interfaces.nsIFileOutputStream); - - // use 0x02 | 0x10 to open file for appending. - foStream.init(file, 0x02 | 0x08 | 0x20, 0664, 0); // write, create, truncate - foStream.write(data, data.length); - foStream.close(); -} - -function readFromFile(file) -{ - // |file| is nsIFile - var data = ""; - var fstream = Components.classes["@mozilla.org/network/file-input-stream;1"] - .createInstance(Components.interfaces.nsIFileInputStream); - var sstream = Components.classes["@mozilla.org/scriptableinputstream;1"] - .createInstance(Components.interfaces.nsIScriptableInputStream); - fstream.init(file, -1, 0, 0); - sstream.init(fstream); - - var str = sstream.read(4096); - while (str.length > 0) { - data += str; - str = sstream.read(4096); - } - - sstream.close(); - fstream.close(); - - return data; -} - -function runProgram(commandLine) -{ - // create an nsILocalFile for the executable - var file = Components.classes["@mozilla.org/file/local;1"] - .createInstance(Components.interfaces.nsILocalFile); - file.initWithPath("/bin/sh"); - - // create an nsIProcess - var process = Components.classes["@mozilla.org/process/util;1"] - .createInstance(Components.interfaces.nsIProcess); - process.init(file); - - // Run the process. - // If first param is true, calling thread will be blocked until - // called process terminates. - // Second and third params are used to pass command-line arguments - // to the process. - var args = ["-c", commandLine]; - process.run(true, args, args.length); -} - -// only for testing... -function testIO() -{ - var f = makeTempFile(); - writeToFile(f, "essai\ntest"); - alert(readFromFile(f)); - runProgram("zenity --info"); -} diff --git a/nixos/gui/chrome/content/main.js b/nixos/gui/chrome/content/main.js deleted file mode 100644 index ecfc5a8c5c99..000000000000 --- a/nixos/gui/chrome/content/main.js +++ /dev/null @@ -1,70 +0,0 @@ -// global variables. -var gNixOS; -var gOptionView; - -/* -var gProgressBar; -function setProgress(current, max) -{ - if (gProgressBar) { - gProgressBar.value = 100 * current / max; - log("progress: " + gProgressBar.value + "%"); - } - else - log("unknow progress bar"); -} -*/ - -function updateTextbox(id, value) -{ - // setting the height cause an overflow which resize the textbox to its - // content due to its onoverflow attribute. - $(id).attr("value", value).attr("height", 1); -}; - -function updatePanel(options) -{ - log("updatePanel: " + options.length); - if (options.length == 0) - return; - // FIXME: ignore the rest of the selection for now. - var o = options[0]; - $("#name").attr("label", o.path); - - if (o.typename != null) - $("#typename").attr("label", o.typename); - else - $("#typename").attr("label", ""); - - $("#desc").text(o.description); - - if (o.value != null) - updateTextbox("#val", o.value); - else - updateTextbox("#val", ""); - - if (o.defaultValue != null) - updateTextbox("#def", o.defaultValue); - else - updateTextbox("#def", ""); - - if (o.example != null) - updateTextbox("#exp", o.example); - else - updateTextbox("#exp", ""); - - updateTextbox("#decls", o.declarations.join("\n")); - updateTextbox("#defs", o.definitions.join("\n")); -} - - -function onload() -{ - var optionTree = document.getElementById("option-tree"); - // gProgressBar = document.getElementById("progress-bar"); - // setProgress(0, 1); - - gNixOS = new NixOS(); - gOptionView = new OptionView(gNixOS.option, updatePanel); - optionTree.view = gOptionView; -} diff --git a/nixos/gui/chrome/content/myviewer.xul b/nixos/gui/chrome/content/myviewer.xul deleted file mode 100644 index 2aeb9391d076..000000000000 --- a/nixos/gui/chrome/content/myviewer.xul +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - -