From: <hs...@mt...> - 2002-11-29 12:49:14
|
坂本です。 > 荒木です:-) > 現在、GUI 設定画面からの変更は、~/.mlterm/main に保存されませんが、 > これを保存できるように、以下のようなシーケンスを追加しようかと思っ > ています。 w3mmlconfig は自前で保存する機能を持っていますが、 mlterm 側でやってくれるというわけですね。 conf_menu_path とか word_separators などの config できない ものをマージするのがちょっと面倒かも。 # w3mmlconfig を古いままにしててすみません。 # 一応、作っていますが、なんかちょっと問題があってそのままに # してました。(何がいけなかったか忘れてしまいました。-_-) ----------------------------------- 坂本 浩則 <hs...@mt...> http://www2u.biglobe.ne.jp/~hsaka/ diff -x mlconfig-data.pl -x mlconfig.cgi -x w3mmlconfig -x *.html -urN w3mmlconfig.orig/Makefile w3mmlconfig/Makefile --- w3mmlconfig.orig/Makefile Fri Mar 22 13:43:20 2002 +++ w3mmlconfig/Makefile Wed Jul 17 15:21:00 2002 @@ -19,6 +19,7 @@ INSTALL = install -c INSTALL_SCRIPT = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 +TAR = tar .SUFFIXES: .in @@ -36,7 +37,7 @@ @rm -rf $(distdir)/$(DISTNAME) $(MKDIR) $(distdir)/$(DISTNAME) cp -rp $(DISTFILES) $(distdir)/$(DISTNAME) - (cd $(distdir); tar -cf - $(DISTNAME) | GZIP='' gzip) \ + (cd $(distdir); $(TAR) -cf - $(DISTNAME) | GZIP='' gzip) \ > $(distdir)/$(DISTNAME).tar.gz @rm -rf $(distdir)/$(DISTNAME) diff -x mlconfig-data.pl -x mlconfig.cgi -x w3mmlconfig -x *.html -urN w3mmlconfig.orig/key/_bgtype w3mmlconfig/key/_bgtype --- w3mmlconfig.orig/key/_bgtype Thu Jan 1 09:00:00 1970 +++ w3mmlconfig/key/_bgtype Wed Jul 17 16:06:50 2002 @@ -0,0 +1,3 @@ +color Color +picture Picture +transparent Transparent diff -x mlconfig-data.pl -x mlconfig.cgi -x w3mmlconfig -x *.html -urN w3mmlconfig.orig/mlconfig-data w3mmlconfig/mlconfig-data --- w3mmlconfig.orig/mlconfig-data Mon Jun 17 15:58:46 2002 +++ w3mmlconfig/mlconfig-data Wed Jul 17 15:20:37 2002 @@ -1,6 +1,6 @@ # id title encoding Encoding -color Color +font Font +background Background scrollbar Scrollbar -appearance Appearance others Others diff -x mlconfig-data.pl -x mlconfig.cgi -x w3mmlconfig -x *.html -urN w3mmlconfig.orig/mlconfig.cgi.in w3mmlconfig/mlconfig.cgi.in --- w3mmlconfig.orig/mlconfig.cgi.in Mon Jun 17 15:58:48 2002 +++ w3mmlconfig/mlconfig.cgi.in Wed Jul 17 16:29:03 2002 @@ -23,6 +23,7 @@ } if ($method) { if ($value->{SAVE}) { + &check_value(); if ($value->{SAVE} eq 'Yes') { &save_config(); } @@ -100,7 +101,7 @@ <input type=hidden name="QUIT" value="$value->{QUIT}"> <center> <b>mlterm configuration</b> -<table border=1 width=200> +<table border=1> EOF $value->{SECTION} ||= $value->{"default-SECTION"}; $value->{SECTION} =~ tr/A-Z/a-z/; @@ -185,22 +186,37 @@ local($type) = $attr->{type}; local($i); - if (! $attr->{col}) { + if ($attr->{col} <= 1) { print "<tr>"; + } + if (! $attr->{col}) { if ($type =~ /^checkbox/ || $type =~ /^none/) { print "<td colspan=2>\n"; } elsif ($type =~ /^radio/) { print "<td colspan=2><nobr>$attr->{title}\n"; } else { - print "<td><nobr>$attr->{title}</nobr>\n"; - print "<td>"; + print "<td><nobr>$attr->{title}</nobr><td>\n"; } } else { - print " \n"; + if ($attr->{col} == 1) { + print "<td colspan=2>\n"; + } else { + print " \n"; + } + if ($type =~ /^checkbox/ || $type =~ /^none/) { + } elsif ($type =~ /^radio/) { + print "<nobr>$attr->{title}\n"; + } else { + print "<nobr>$attr->{title}</nobr>\n"; + } } if ($type =~ /^text/) { print "<input type=text name=\"$k\" value=\"", - &html_quote($value->{$k}), "\">\n"; + &html_quote($value->{$k}), "\""; + if ($type =~ /digit/) { + print " size=6"; + } + print ">\n"; } elsif ($type =~ /^select/) { print "<select name=\"$k\">\n"; for $i (@{$attr->{item}}) { @@ -275,6 +291,31 @@ ? $value->{"default-$k"} : $attr->{default}; } } + if (!($value->{_bgtype} eq 'color' || + $value->{_bgtype} eq 'picture' || + $value->{_bgtype} eq 'transparent')) { + if ($value->{use_transbg} eq 'true') { + $value->{_bgtype} = 'transparent'; + } elsif ($value->{wall_picture}) { + $value->{_bgtype} = 'pictrue'; + } else { + $value->{_bgtype} = 'color'; + } + } + if (! $value->{"default-_bgcolor"}) { + $value->{"default-_bgcolor"} = $value->{_bgtype}; + } + if ($value->{_bgtype} eq 'color') { + $value->{wall_picture} = ''; + $value->{use_transbg} = 'false'; + } elsif ($value->{_bgtype} eq 'picture') { + $value->{bg_color} = ''; + $value->{use_transbg} = 'false'; + } else { + $value->{bg_color} = ''; + $value->{wall_picture} = ''; + $value->{use_transbg} = 'true'; + } } sub get_config { @@ -348,6 +389,7 @@ } open(F, ">$config_file") || return; for $k (split(" ", $value->{KEYS})) { + $k =~ /^_/ && next; print F "$k=$value->{$k}\n"; } close(F); @@ -379,9 +421,11 @@ for $s (@section) { $attr = $section_attr->{$s}; for $k (@{$attr->{key}}) { + $k =~ /^_/ && next; defined($config->{$k}) && delete $config->{$k}; $v = $value->{$k}; - if ($key_attr->{$k}{type} eq 'none' +# if ($key_attr->{$k}{type} eq 'none' + if ($k =~ /^_/ || $key_attr->{$k}{default} eq '-' || $v eq $key_attr->{$k}{default} || $v eq '') { diff -x mlconfig-data.pl -x mlconfig.cgi -x w3mmlconfig -x *.html -urN w3mmlconfig.orig/section/appearance w3mmlconfig/section/appearance --- w3mmlconfig.orig/section/appearance Mon Jun 17 15:58:55 2002 +++ w3mmlconfig/section/appearance Thu Jan 1 09:00:00 1970 @@ -1,8 +0,0 @@ -fontsize text:digit 16 0 Font size (pixels) -line_space text:digit 0 0 Line space (pixels) -screen_width_ratio text:digit 100 0 Width ratio -screen_height_ratio text:digit 100 0 Height ratio -use_anti_alias checkbox false 0 Anti Alias -use_variable_column_width checkbox false 1 Variable column width -none none - 0 -none none - 0 diff -x mlconfig-data.pl -x mlconfig.cgi -x w3mmlconfig -x *.html -urN w3mmlconfig.orig/section/background w3mmlconfig/section/background --- w3mmlconfig.orig/section/background Thu Jan 1 09:00:00 1970 +++ w3mmlconfig/section/background Wed Jul 17 16:26:53 2002 @@ -0,0 +1,9 @@ +_bgtype_title none - 0 Background type +_bgtype radio:lower color 0 +bg_color text:lower white 0 Color +wall_picture text none 0 Picture +use_transbg none false 0 +_picture none - 0 Picture/Transparent +brightness text:digit 100 1 Brightness +contrast text:digit 100 2 Contrast +gamma text:digit 100 0 Gamma diff -x mlconfig-data.pl -x mlconfig.cgi -x w3mmlconfig -x *.html -urN w3mmlconfig.orig/section/color w3mmlconfig/section/color --- w3mmlconfig.orig/section/color Mon Jun 17 15:58:56 2002 +++ w3mmlconfig/section/color Thu Jan 1 09:00:00 1970 @@ -1,7 +0,0 @@ -fg_color text:lower black 0 Foreground color -bg_color text:lower white 0 Background color -fade_ratio text:digit 100 0 Fade ratio on unfocus -wall_picture text none 0 Wall picture -brightness text:digit 100 0 Wall picture brightness -use_transbg checkbox false 0 Transparent background -none none - 0 diff -x mlconfig-data.pl -x mlconfig.cgi -x w3mmlconfig -x *.html -urN w3mmlconfig.orig/section/encoding w3mmlconfig/section/encoding --- w3mmlconfig.orig/section/encoding Mon Jun 17 15:58:58 2002 +++ w3mmlconfig/section/encoding Wed Jul 17 16:27:11 2002 @@ -3,7 +3,7 @@ iscii_lang select:lower malayalam 0 ISCII lang xim text - 0 X Input Method locale text - 0 XIM locale -use_bidi checkbox true 0 Bidi (UTF8 only) -use_combining checkbox true 1 Combining +use_bidi checkbox true 1 Bidi (UTF8 only) +use_combining checkbox true 2 Combining copy_paste_via_ucs checkbox false 0 Process received strings via Unicode -none none - 0 +_none none - 0 diff -x mlconfig-data.pl -x mlconfig.cgi -x w3mmlconfig -x *.html -urN w3mmlconfig.orig/section/font w3mmlconfig/section/font --- w3mmlconfig.orig/section/font Thu Jan 1 09:00:00 1970 +++ w3mmlconfig/section/font Wed Jul 17 16:04:08 2002 @@ -0,0 +1,9 @@ +fontsize text:digit 16 0 Font size (pixels) +line_space text:digit 0 0 Line space (pixels) +_screen none - 0 Screen ratio against font size +screen_width_ratio text:digit 100 1 Width +screen_height_ratio text:digit 100 2 Height +fg_color text:lower black 0 Foreground color +fade_ratio text:digit 100 0 Fade ratio on unfocus +use_anti_alias checkbox false 1 Anti Alias +use_variable_column_width checkbox false 2 Variable column width diff -x mlconfig-data.pl -x mlconfig.cgi -x w3mmlconfig -x *.html -urN w3mmlconfig.orig/section/scrollbar w3mmlconfig/section/scrollbar --- w3mmlconfig.orig/section/scrollbar Mon Jun 17 15:59:00 2002 +++ w3mmlconfig/section/scrollbar Wed Jul 17 16:27:17 2002 @@ -2,6 +2,6 @@ scrollbar_view_name text simple 0 View sb_fg_color text:lower black 0 Foreground color sb_bg_color text:lower white 0 Background color -none none - 0 -none none - 0 -none none - 0 +_none none - 0 +_none none - 0 +_none none - 0 |