[OPEN-ILS-DEV] Patch for staff client window to open other than maximized
Jason Boyer
jasonb at myjclibrary.org
Fri Jan 15 15:44:11 EST 2010
It would be nice if it behaved like other apps and save the current size /
position of the window when closing it, and automatically restoring that the
next time a window is opened. It sounds like this patch is already over
halfway there already.
Jason
--
Jason Boyer, IT Specialist
Jackson County Public Library
303 W Second St
Seymour, IN 47274
jasonb at myjclibrary.org
On Fri, Jan 15, 2010 at 3:03 PM, Lebbeous Fogle-Weekley <
lebbeous at esilibrary.com> wrote:
> 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();
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20100115/86db3e43/attachment.htm
More information about the Open-ils-dev
mailing list