Author: jdsn
Date: Sat Aug 30 01:00:48 2008
New Revision: 50498
URL: http://svn.opensuse.org/viewcvs/yast?rev=50498&view=rev
Log:
- using exact display parameters during installation
(bnc#399411) and (bnc#331664)
- removed 32bit color depth from autoyast (bnc#405797)
- tablet setup during installation (fate#302888)
- make sure traversal has numeric value (bnc#388259)
- cleanup in XMessages strings
Modified:
trunk/x11/VERSION
trunk/x11/package/yast2-x11.changes
trunk/x11/src/XLib.pm
trunk/x11/src/XMessages.ycp
trunk/x11/src/autoyast/dialog/autoDialog.ycp
trunk/x11/src/dialog/x11Dialog.ycp
trunk/x11/src/proposal/x11_proposal.ycp
Modified: trunk/x11/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/VERSION?rev=50498&r1=50497&r2=50498&view=diff
==============================================================================
--- trunk/x11/VERSION (original)
+++ trunk/x11/VERSION Sat Aug 30 01:00:48 2008
@@ -1 +1 @@
-2.17.0
+2.17.1
Modified: trunk/x11/package/yast2-x11.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/package/yast2-x11.changes?rev=50498&r1=50497&r2=50498&view=diff
==============================================================================
--- trunk/x11/package/yast2-x11.changes (original)
+++ trunk/x11/package/yast2-x11.changes Sat Aug 30 01:00:48 2008
@@ -1,4 +1,19 @@
-------------------------------------------------------------------
+Fri Aug 29 23:02:24 CEST 2008 - jdsn@suse.de
+
+- tablet configuration support during installation (fate#302888)
+- make sure traversal has numeric value (bnc#388259)
+- consistent dialogs for proposal changes
+- cleanup in XMessages strings
+- 2.17.1
+
+-------------------------------------------------------------------
+Thu Aug 22 19:45:39 CEST 2008 - jdsn@suse.de
+
+- using exact display parameters during installation (bnc#399411)
+- removed 32bit color depth from autoyast (bnc#405797)
+
+-------------------------------------------------------------------
Tue Jun 24 19:00:47 CEST 2008 - jdsn@suse.de
- proper type conversion in autoinstallation (bnc#307967)
Modified: trunk/x11/src/XLib.pm
URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/XLib.pm?rev=50498&r1=50497&r2=50498&view=diff
==============================================================================
--- trunk/x11/src/XLib.pm (original)
+++ trunk/x11/src/XLib.pm Sat Aug 30 01:00:48 2008
@@ -35,6 +35,7 @@
my %section;
my $config;
my %cdb;
+my %tabletCDB;
#==========================================
# GetFbColor
@@ -258,52 +259,13 @@
my $traversal = $mDesktop->getDisplayTraversal();
my @ratio = @{$mDesktop->getDisplayRatio()};
if (defined $traversal) {
- # if traversal is empty, set a minimal default value (bnc#388259)
- if ($traversal eq "") { $traversal = 12.2; }
- $traversal = sprintf ("%.1f",$traversal);
- if ($traversal < 12.2) {
- $traversal = 10.0;
- } elsif (($traversal >= 12.2) && ($traversal < 13.3)) {
- $traversal = 12.2;
- } elsif (($traversal >= 13.3) && ($traversal < 14.1)) {
- $traversal = 13.3;
- } elsif (($traversal >= 14.1) && ($traversal < 14.5)) {
- $traversal = 14.1;
- } elsif (($traversal >= 14.5) && ($traversal < 15.4)) {
- $traversal = 15;
- } elsif (($traversal >= 15.4) && ($traversal < 16.5)) {
- $traversal = 15.4;
- } elsif (($traversal >= 16.5) && ($traversal < 18.0)) {
- $traversal = 17;
- } elsif (($traversal >= 18.0) && ($traversal < 18.3)) {
- $traversal = 18;
- } elsif (($traversal >= 18.3) && ($traversal < 18.5)) {
- $traversal = 18.1;
- } elsif (($traversal >= 18.5) && ($traversal < 19.5)) {
- $traversal = 19;
- } elsif (($traversal >= 19.5) && ($traversal < 20.5)) {
- $traversal = 20;
- } elsif (($traversal >= 20.5) && ($traversal < 21.3)) {
- $traversal = 21.1;
- } elsif (($traversal >= 21.3) && ($traversal < 21.5)) {
- $traversal = 21.3;
- } elsif (($traversal >= 21.5) && ($traversal < 22.2)) {
- $traversal = 22.2;
- } elsif (($traversal >= 22.2) && ($traversal < 23.5)) {
- $traversal = 23;
- } elsif (($traversal >= 23.5) && ($traversal < 24.5)) {
- $traversal = 24;
- } elsif (($traversal >= 24.5) && ($traversal < 30.5)) {
- $traversal = 30;
- } elsif (($traversal >= 30.5) && ($traversal < 31.8)) {
- $traversal = 31.5;
- } elsif (($traversal >= 31.8) && ($traversal < 32.5)) {
- $traversal = 32;
- } elsif (($traversal >= 32.5) && ($traversal < 40.5)) {
- $traversal = 40;
- } elsif ($traversal >= 40.5) {
- $traversal = 46;
- }
+ # if traversal is empty or not a numeric, set it to undef and do not operate on it (bnc#388259)
+ if ($traversal eq "" || $traversal !~ /^\d+\.?\d*$/)
+ { $traversal = "undef"; }
+ else
+ # just round the computed (real) traversal to a tenth
+ { $traversal = sprintf ("%.1f", $traversal); }
+
@result = ($traversal,@ratio);
}
return \@result;
@@ -898,6 +860,95 @@
}
#==========================================
+# getTabletCDB
+#------------------------------------------
+BEGIN{ $TYPEINFO{getTabletCDB} = ["function",["map","string",["list","string"]]]; }
+sub getTabletCDB {
+ my $class = shift;
+ my $size = keys %tabletCDB;
+ if ($size > 0) {
+ return \%tabletCDB;
+ }
+ my $mTablet = new SaX::SaXManipulateTablets (
+ $section{Pointers},$section{Layout}
+ );
+ $mTablet->selectPointer (1);
+ my @vendorList = @{$mTablet->getTabletVendorList()};
+ foreach my $vendor (@vendorList) {
+ my $modelList = $mTablet->getTabletModelList ($vendor);
+ $tabletCDB{$vendor} = $modelList;
+ }
+ return \%tabletCDB;
+}
+#==========================================
+# getTabletVendor
+#------------------------------------------
+BEGIN{ $TYPEINFO{getTabletVendor} = ["function", "string"]; }
+sub getTabletVendor {
+ my $class = shift;
+ my $mTablet = new SaX::SaXManipulateTablets (
+ $section{Pointers},$section{Layout}
+ );
+ $mTablet->selectPointer(1);
+ my $vendor = $mTablet->getVendor();
+ if ($vendor =~ /Unknown/i) {
+ return "undef";
+ }
+ return $vendor;
+}
+#==========================================
+# getTabletModel
+#------------------------------------------
+BEGIN{ $TYPEINFO{getTabletModel} = ["function", "string"]; }
+sub getTabletModel {
+ my $class = shift;
+ my $mTablet = new SaX::SaXManipulateTablets (
+ $section{Pointers},$section{Layout}
+ );
+ $mTablet->selectPointer(1);
+ my $model = $mTablet->getName();
+ if ($model =~ /Unknown/i) {
+ return "undef";
+ }
+ return $model;
+}
+#==========================================
+# getTabletPointer
+#------------------------------------------
+BEGIN{ $TYPEINFO{getTabletPointer} = ["function", "string"]; }
+sub getTabletPointer {
+ my $class = shift;
+ my $mTablet = new SaX::SaXManipulateTablets (
+ $section{Pointers},$section{Layout}
+ );
+ # check if one of the first 5 pointer devices is a tablet
+ my $i;
+ for ( $i=0 ; $i <= 4 ; $i++ )
+ {
+ $mTablet->selectPointer($i);
+ if ($mTablet->isTablet() )
+ {
+ return "$i";
+ }
+ }
+ return "undef";
+}
+#==========================================
+# setTablet
+#------------------------------------------
+BEGIN{ $TYPEINFO{setTablet} = ["function","void",["list","string"]]; }
+sub setTablet {
+ my $vendor = shift;
+ my $model = shift;
+ my $mTablet = new SaX::SaXManipulateTablets (
+ $section{Pointers},$section{Layout}
+ );
+ $mTablet->selectPointer(1);
+ $mTablet->setTablet($vendor, $model);
+}
+
+
+#==========================================
# test code
#------------------------------------------
if (0) {
Modified: trunk/x11/src/XMessages.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/XMessages.ycp?rev=50498&r1=50497&r2=50498&view=diff
==============================================================================
--- trunk/x11/src/XMessages.ycp (original)
+++ trunk/x11/src/XMessages.ycp Sat Aug 30 01:00:48 2008
@@ -60,17 +60,20 @@
// 65536 colors - upper case
string colors65k_uc = _("65536 Colors");
-// 16.7 m colors - lower case
-string colors16m_lc = _("16.7 m colors");
-// 16.7 M colors - upper case
-string colors16m_uc = _("16.7 M Colors");
-// 16.7 Mio. colors - business language
-string colors16m_uc_business = _("16.7 Mio. Colors");
+// 16.7 M colors - lower case
+string colors16M_lc = _("16.7 M colors");
+// 16.7 M Colors - upper case
+string colors16M_uc = _("16.7 M Colors");
+
+// 16.7 Mio. colors - lower case - business language
+string colors16Mio_lc_business = _("16.7 Mio. colors");
+// 16.7 Mio. Colors - business language
+string colors16Mio_uc_business = _("16.7 Mio. Colors");
global string colors256 = colors256_uc;
global string colors32k = colors32k_uc;
global string colors65k = colors65k_uc;
-global string colors16m = colors16m_uc_business;
+global string colors16m = colors16M_uc;
//=============================================
@@ -78,18 +81,27 @@
global string colors = _("Colors");
// string for a drop-down box
-global string color8bit = _("256 [ 8 bit ]");
+global string color8bit = _("256 [8 bit]");
// string for a drop-down box
-global string color15bit = _("32768 [ 15 bit ]");
+global string color15bit = _("32768 [15 bit]");
+// string for a drop-down box, PPC meaning: the PowerPC architecture
+global string color15bitPPC = _("32768 [15 bit] (PPC)");
// string for a drop-down box
-global string color16bit = _("65536 [ 16 bit ]");
-// string for a drop-down box - lower case
-string color24bit_lc = _("16.7 m [ 24 bit ]");
-// string for a drop-down box - upper case
-string color24bit_uc = _("16.7 M [ 24 bit ]");
+global string color16bit = _("65536 [16 bit]");
+// string for a drop-down box, meaning "16.7 million" (colors)
+string color24bitM = _("16.7 M [24 bit]");
// string for a drop-down box - business language
-string color24bit_uc_business = _("16.7 Mio. [ 24 bit ]");
-global string color24bit = color24bit_uc_business;
+string color24bitMio = _("16.7 Mio. [24 bit]");
+// string for a drop-down box
+string color24bitMillion = _("16.7 Million [24 bit]");
+global string color24bit = color24bitM;
+// string for a drop-down box, meaning "16.7 million" (colors)
+string color32bitM = _("16.7 M [32 bit]");
+// string for a drop-down box - business language
+string color32bitMio = _("16.7 Mio. [32 bit]");
+// string for a drop-down box
+string color32bitMillion = _("16.7 Million [32 bit]");
+global string color32bit = color32bitM;
//=============================================
// Xgl strings
@@ -123,7 +135,8 @@
//=============================================
// colorDepth
//---------------------------------------------
-global string colorDepth = _("Colordepth: ");
+global string colorDepthOld = _("Colordepth: ");
+global string colorDepth = _("Color Depth: ");
//=============================================
// deactivated
@@ -151,6 +164,11 @@
global string selectColorDepth = _("Select color depth:");
//=============================================
+// resolution
+//---------------------------------------------
+global string resolution = _("Resolution:");
+
+//=============================================
// selectResolution
//---------------------------------------------
global string selectResolution = _("Select resolution:");
@@ -158,7 +176,19 @@
//=============================================
// selectMonitor
//---------------------------------------------
-global string selectMonitor = _("Select Monitor Vendor and Model:");
+global string selectMonitorOld = _("Select Monitor Vendor and Model:");
+global string selectMonitor = _("Select Monitor Vendor and Model");
+
+// selectTablet
+global string selectTablet = _("Select Tablet Vendor and Model");
+
+// tablet
+global string Tablet = _("Tablet:");
+
+// vendor - meaning "monitor vendor" (like "hardware vendor")
+global string Vendor = _("Vendor:");
+// model - meaning "monitor model"
+global string Model = _("Model:");
//=============================================
// selectLink
@@ -178,9 +208,11 @@
//=============================================
// selectDisplaySize
//---------------------------------------------
-global string selectDisplayTraversal = _("Traversal") + " [ " + Inches + " ]:";
+global string selectDisplayTraversal = _("Traversal") + " [" + Inches + "]:";
global string selectDisplayRatio = _("Aspect Ratio:");
+global string displaySettings = _("Display Settings");
+
//=============================================
// proposal menu and title text
//---------------------------------------------
@@ -197,6 +229,9 @@
//---------------------------------------------
global string unconfigured = _("Unconfigured");
+// configure - in lower case
+global string configure = _("configure");
+
//=============================================
// warnNoteBook
//---------------------------------------------
Modified: trunk/x11/src/autoyast/dialog/autoDialog.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/autoyast/dialog/autoDialog.ycp?rev=50498&r1=50497&r2=50498&view=diff
==============================================================================
--- trunk/x11/src/autoyast/dialog/autoDialog.ycp (original)
+++ trunk/x11/src/autoyast/dialog/autoDialog.ycp Sat Aug 30 01:00:48 2008
@@ -12,6 +12,7 @@
import "AutoinstX11";
import "Wizard";
import "Popup";
+ import "XMessages";
/**
* Build main Dialog
@@ -44,27 +45,17 @@
"2800x2100 (QSXGA+)",
"3200x2400 (QUXGA)"
];
+
+ // made color depth list consistent and removed the 32bit special settings (bnc#405797)
list<map> depths_list = [
- $[
- "desc" :_("8 Bit / 256 Colors"),
- "depth" : 8
- ],
- $[
- "desc" :_("15 Bit / 32 K Colors (PPC)"),
- "depth" : 15
- ],
- $[
- "desc" :_("16 Bit / 64 K Colors"),
- "depth" : 16
- ],
- $[
- "desc" :_("24 Bit / 16 M Colors"),
- "depth" : 24
- ],
- $[
- "desc" :_("32 Bit / 16 M Colors"),
- "depth" : 32
- ]
+ $[ "desc" : XMessages::color8bit,
+ "depth" : 8 ],
+ $[ "desc" : XMessages::color15bit,
+ "depth" : 15 ],
+ $[ "desc" : XMessages::color16bit,
+ "depth" : 16 ],
+ $[ "desc" : XMessages::color24bit,
+ "depth" : 24 ]
];
@@ -75,7 +66,7 @@
foreach(map d, depths_list , ``{
color_depths=add(color_depths,
- `item( `id(d["depth"]:16), d["desc"]:_("16 Bit / 64 K Colors") ,
+ `item( `id(d["depth"]:16), d["desc"]:XMessages::color16bit,
( d["depth"]:16 == x11["color_depth"]:16)));
});
list displaymanager =
Modified: trunk/x11/src/dialog/x11Dialog.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/dialog/x11Dialog.ycp?rev=50498&r1=50497&r2=50498&view=diff
==============================================================================
--- trunk/x11/src/dialog/x11Dialog.ycp (original)
+++ trunk/x11/src/dialog/x11Dialog.ycp Sat Aug 30 01:00:48 2008
@@ -48,188 +48,348 @@
//================================
// setupColors
//--------------------------------
-define string setupColors ( string currentRes, string currentText ) ``{
- string space = " ";
- string topic = XMessages::selectColorDepth + space;
- UI::OpenDialog(
- `VBox(
- `HBox(`ComboBox(`id(`depth),`opt(`hstretch),topic,
- [
- `item(`id(`bit8), "256 [ 8 bit ]" ),
- `item(`id(`bit15), "32768 [ 15 bit ]" ),
- `item(`id(`bit16), "65536 [ 16 bit ]" ),
- `item(`id(`bit24), "16.7 Mio. [ 24 bit ]" )
- ]
- )),
- `Right (`HBox (
- `PushButton(`id(`ok),Label::OKButton()),
- `PushButton(`id(`cancel),Label::CancelButton())
- ))
- )
- );
- while (true) {
- UI::ChangeWidget(`id(`depth), `Value, currentText);
- any id = UI::UserInput();
- if (id == `cancel) {
- UI::CloseDialog();
- if (currentText == "256 [ 8 bit ]") {
- return "8";
- }
- if (currentText == "32768 [ 15 bit ]") {
- return "15";
- }
- if (currentText == "65536 [ 16 bit ]") {
- return "16";
- }
- if (currentText == "16.7 Mio. [ 24 bit ]") {
- return "24";
- }
- return "undef";
- }
- any col=UI::QueryWidget(`id(`depth), `Value);
- string color = "8";
- if ( col == `bit8 ) color = "8";
- if ( col == `bit15 ) color = "15";
- if ( col == `bit16 ) color = "16";
- if ( col == `bit24 ) color = "24";
- if (! XLib::hasValidColorResolutionSetup (color,currentRes)) {
- warnInvalidColorResolution();
- continue;
- }
- UI::CloseDialog();
- return (string)color;
- }
+define string setupColors ( string currentRes, string currentDepth )
+{ // rewritten due to consistency with setupDisplaySize
+
+ string topic = XMessages::colorDepth;
+ UI::OpenDialog( `MarginBox( 0.5, 0.5,
+ `VBox(
+ `Heading(XMessages::displaySettings),
+ `HBox(`ComboBox(`id(`depth),`opt(`hstretch), topic,
+ [
+ `item(`id("8"), XMessages::color8bit ),
+ `item(`id("15"), XMessages::color15bit ),
+ `item(`id("16"), XMessages::color16bit ),
+ `item(`id("24"), XMessages::color24bit ),
+ ]
+ )),
+ `VSpacing(0.5),
+ `HBox (
+ `PushButton(`id(`ok),Label::OKButton()),
+ `PushButton(`id(`cancel),Label::CancelButton())
+ )
+ )
+ ));
+
+ string color = "8";
+ if (contains(["8", "15", "16", "24"], currentDepth))
+ { color = currentDepth; }
+ else
+ { currentDepth = "undef"; }
+ UI::ChangeWidget(`id(`depth), `Value, color);
+
+ any ret = nil;
+
+ repeat
+ {
+ ret = UI::UserInput();
+
+ color = (string) UI::QueryWidget(`id(`depth), `Value);
+
+ if (! XLib::hasValidColorResolutionSetup (color,currentRes))
+ {
+ warnInvalidColorResolution();
+ ret = nil;
+ }
+
+ } until ( ret == `ok || ret == `cancel);
+
+ UI::CloseDialog();
+ if (ret == `cancel)
+ {
+ UI::CloseDialog();
+ return currentDepth;
+ }
+
+ return color;
+
};
//================================
// setupResolutions
//--------------------------------
-define string setupResolutions (
- list reslist, string currentText, string currentColor
-) ``{
- string space = " ";
- string topic = XMessages::selectResolution + space;
- UI::OpenDialog(
- `VBox(
- `HBox(`Left ( `ComboBox(`id(`resitem),topic, reslist))),
- `Right (`HBox (
- `PushButton(`id(`ok),Label::OKButton()),
- `PushButton(`id(`cancel),Label::CancelButton())
- ))
- )
- );
- while (true) {
- UI::ChangeWidget(`id(`resitem), `Value, currentText);
- any id = UI::UserInput();
- if (id == `cancel) {
- UI::CloseDialog();
- return currentText;
- }
- any res=UI::QueryWidget(`id(`resitem), `Value);
- if (! XLib::hasValidColorResolutionSetup (currentColor,(string)res)) {
- warnInvalidColorResolution();
- continue;
- }
- UI::CloseDialog();
- return (string)res;
- }
+define string setupResolutions (list reslist, string currentText, string currentColor)
+{ // rewritten to be consistent with
+
+ string topic = XMessages::resolution;
+ UI::OpenDialog( `MarginBox( 0.5, 0.5,
+ `VBox(
+ `Heading(XMessages::displaySettings),
+ `VSpacing(0.5),
+ `ComboBox(`id(`resitem),topic, reslist),
+ `VSpacing(0.5),
+ `HBox (
+ `PushButton(`id(`ok),Label::OKButton()),
+ `PushButton(`id(`cancel),Label::CancelButton())
+ )
+ )
+ ));
+
+ UI::ChangeWidget(`id(`resitem), `Value, currentText);
+ any ret = nil;
+ string res = "";
+
+ repeat
+ {
+ ret = UI::UserInput();
+
+ res = (string) UI::QueryWidget(`id(`resitem), `Value);
+ if (! XLib::hasValidColorResolutionSetup(currentColor, res))
+ {
+ warnInvalidColorResolution();
+ ret = nil;
+ }
+ } until (ret == `ok || ret == `cancel);
+
+ UI::CloseDialog();
+ if (ret == `cancel) { return currentText; }
+ return res;
+
};
//================================
// setupDisplaySize
//--------------------------------
-define list<string> setupDisplaySize (
- string currentTraversal, string currentRatios
-) ``{
- //string space = " ";
- string topic1 = XMessages::selectDisplayTraversal;
- string topic2 = XMessages::selectDisplayRatio;
- list<string> traverlist = ["21","20","19","18.1","17","15.4","15","14.1","13.3","12.2"];
- list<string> ratioslist = ["4/3","5/4","16/10"];
- UI::OpenDialog(
- `VBox(
- `HBox(
- `Left ( `ComboBox(`id(`traveritem),topic1, traverlist)),
- `Right ( `ComboBox(`id(`ratiositem),topic2, ratioslist))
- ),
- `Right (`HBox (
- `PushButton(`id(`ok),Label::OKButton()),
- `PushButton(`id(`cancel),Label::CancelButton())
- ))
- )
- );
- UI::ChangeWidget(`id(`traveritem), `Value, currentTraversal);
- UI::ChangeWidget(`id(`ratiositem), `Value, currentRatios);
- any id = UI::UserInput();
- list<string> result = [];
- if (id == `cancel) {
- UI::CloseDialog();
- result = add (result,currentTraversal);
- result = add (result,currentRatios);
- return result;
- }
- any traversal=UI::QueryWidget(`id(`traveritem), `Value);
- any ratios=UI::QueryWidget(`id(`ratiositem), `Value);
- result = add (result,(string)traversal);
- result = add (result,(string)ratios);
- UI::CloseDialog();
- return result;
+define list<string> setupDisplaySize (string currentTraversal, string currentRatio)
+{
+ // function rewritten because of (bnc#331664) and (bnc#399411)
+
+ string topic1 = XMessages::selectDisplayTraversal;
+ string topic2 = XMessages::selectDisplayRatio;
+ // offer some common display settings
+ list<string> traversallist = [ "32.0", "31.5", "30.0", "26.0", "24.0", "23.0",
+ "22.2", "21.3", "21.1", "20.0", "19.0", "18.1",
+ "17.0", "15.4", "15.0", "14.1", "13.3", "12.2", "10.0" ];
+ list<string> ratiolist = [ "4/3", "5/4", "16/9", "16/10" ];
+
+ string traversal = currentTraversal;
+ string ratio = currentRatio;
+ string traversalCheck = "";
+ string ratioCheck = "";
+
+ // merge calculated values into the predefined lists
+ traversallist = (list<string>) sort(union(traversallist, [traversal]));
+ ratiolist = (list<string>) sort(union(ratiolist, [ratio]));
+
+ UI::OpenDialog(`MarginBox(0.5, 0.5,
+ `VBox(
+ `Heading(_("Display Settings")),
+ `VSpacing(0.5),
+ `HBox(
+ `HSpacing(`opt(`hstretch), 0.5),
+ `VBox(
+ `Left( `ComboBox(`id(`traversal), `opt(`notify, `editable), topic1, traversallist)),
+ `Left( `ComboBox(`id(`ratio), `opt(`notify, `editable), topic2, ratiolist))
+ ),
+ `HSpacing(`opt(`hstretch), 0.5)
+ ),
+ `VSpacing(0.5),
+ `HBox (
+ `PushButton(`id(`ok),Label::OKButton()),
+ `PushButton(`id(`cancel),Label::CancelButton())
+ )
+ )
+ ));
+
+ UI::ChangeWidget(`id(`traversal), `ValidChars, "1234567890.");
+ UI::ChangeWidget(`id(`ratio), `ValidChars, "1234567890/");
+
+ UI::ChangeWidget(`id(`traversal), `Value, traversal);
+ UI::ChangeWidget(`id(`ratio), `Value, ratio);
+
+
+ any ret = nil;
+ repeat
+ {
+ // wait for event from user
+ ret = UI::UserInput();
+
+ traversal = (string) UI::QueryWidget(`id(`traversal), `Value);
+ ratio = (string) UI::QueryWidget(`id(`ratio), `Value);
+
+ traversalCheck = regexpsub(traversal, "([1-9]+[0-9]*)(\.[0-9]?)?", "\\1\\2");
+ if (traversalCheck == nil) { traversal = ""; traversalCheck = ""; }
+ if (traversalCheck != traversal)
+ {
+ traversal = traversalCheck;
+ UI::ChangeWidget(`id(`traversal), `Value, traversal);
+ }
+
+ // here for ratio just sanity check
+ ratioCheck = regexpsub(ratio, "([1-9]+[0-9]*)(\/([1-9]+[0-9]*)?)?", "\\1\\2");
+ if (ratioCheck == nil) { ratio = ""; ratioCheck = ""; }
+ if (ratioCheck != ratio)
+ {
+ ratio = ratioCheck;
+ UI::ChangeWidget(`id(`ratio), `Value, ratio);
+ }
+
+ if (ret == `ok)
+ {
+ string ratioOrig = ratio;
+ ratio = regexpsub(ratio, "([1-9]+[0-9]*)\/([1-9]+[0-9]*)", "\\1\/\\2");
+ if (ratio != ratioOrig || ratioOrig == "" || ratio == nil)
+ {
+ Popup::Message(_("The value for the display ratio is invalid, please correct."));
+ ret = nil;
+ }
+
+ if (traversal == "" || traversal == nil)
+ {
+ Popup::Message(_("The value for the display traversal is invalid, please correct."));
+ ret = nil;
+ }
+ }
+
+ } until (ret == `ok || ret == `cancel);
+
+
+ list<string> result = [traversal, ratio];
+ if (ret == `cancel)
+ {
+ result = [currentTraversal, currentRatio];
+ }
+
+ UI::CloseDialog();
+ return result;
};
//================================
// setupMonitor
//--------------------------------
-define list setupMonitor (
- map