Hello, list,

Many of you will be aware that after logging in to the Evergreen staff client, the main window that opens up does so in a maximized state. While this is probably optimal for many workstations, it isn't *always* optimal, and I have long wanted to have an option to configure whether it opens maximized or not.

Here's a quick patch against trunk that allows for that. With this in place, one can add a short file called "window_customization" to one's per-user openils profile chrome directory, the contents of which should look something like:

{
    "maximized": false,
    "width": 800,
    "height": 600
}

including the curly braces.

Any of those inner three lines can be omitted if you wish to accept the existing defaults, and of course you can substitute any reasonable number of pixels for 800 and 600 above. Those are just examples.

That openils profile chrome directory that I mentioned, on UNIX workstations, should be located at a path resembling

~/.openils/open_ils_staff_client/SOME_CHARACTERS.default/chrome

where SOME_CHARACTERS represents some string of characters, mostly hexadecimal digits, which vary from installation to installation.

I'm not sure what the equivalent location is for Windows or Mac, but I'm hoping some helpful soul will post them in a reply to the list.

Thanks for any feedback!
--
Lebbeous


Please join us for the Evergreen 2010 International Conference!
It is being held April 20 - 23, 2010 at the Amway Grand Hotel and
Convention Center, Grand Rapids, Michigan.
http://www.evergreen2010.org/
diff --git Open-ILS/xul/staff_client/chrome/content/main/menu_frame.xul 
Open-ILS/xul/staff_client/chrome/content/main/menu_frame.xul
index 9b87990..341c7e3 100644
--- Open-ILS/xul/staff_client/chrome/content/main/menu_frame.xul
+++ Open-ILS/xul/staff_client/chrome/content/main/menu_frame.xul
@@ -67,6 +67,33 @@
             // idleService.removeIdleObserver(idleObserver, delay);
             // ... but why would we?
         }
+        function apply_window_customization() {
+            JSAN.use("util.file");
+            var file = new util.file("window_customization");
+            if (file._file.exists()) {
+                var obj = file.get_object();
+                if (obj) {
+                    var w = document.getElementById("menu_frame_win");
+
+                    for (var key in obj) {
+                        switch(key) {
+                            case "maximized":
+                                if (!obj[key])
+                                    w.setAttribute("sizemode", "normal");
+                                break;
+                            case "width":
+                            case "height":
+                                    w.setAttribute(key, obj[key]);
+                                break;
+                            default:
+                                /* ignore other keys */
+                                break;
+                        }
+                    }
+                }
+                file.close();
+            }
+        }
         function my_init() {
             try {
 
@@ -80,6 +107,7 @@
                 JSAN.use('util.error'); g.error = new util.error();
                 g.error.sdump('D_TRACE','my_init() for menu_frame.xul');
 
+                apply_window_customization();
                 g.cgi = new CGI();
 
                 JSAN.use('main.menu'); g.menu = new main.menu();

Reply via email to