Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54880 - in /trunk/nis-server: VERSION package/yast2-nis-server.changes src/NisServer.ycp src/details.ycp src/maps.ycp src/master.ycp src/securenets.ycp src/slave.ycp src/slaves.ycp src/what.ycp
  • From: jsuchome@xxxxxxxxxxxxxxxx
  • Date: Thu, 22 Jan 2009 09:26:20 -0000
  • Message-id: <E1LPvpN-0007Ew-2Q@xxxxxxxxxxxxxxxx>
Author: jsuchome
Date: Thu Jan 22 10:26:20 2009
New Revision: 54880

URL: http://svn.opensuse.org/viewcvs/yast?rev=54880&view=rev
Log:
- NisServer::modified used to indicate if changes were done
- ask for abort if changes were done (bnc#460168)
- code cleanup
- 2.18.0


Modified:
trunk/nis-server/VERSION
trunk/nis-server/package/yast2-nis-server.changes
trunk/nis-server/src/NisServer.ycp
trunk/nis-server/src/details.ycp
trunk/nis-server/src/maps.ycp
trunk/nis-server/src/master.ycp
trunk/nis-server/src/securenets.ycp
trunk/nis-server/src/slave.ycp
trunk/nis-server/src/slaves.ycp
trunk/nis-server/src/what.ycp

Modified: trunk/nis-server/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/VERSION?rev=54880&r1=54879&r2=54880&view=diff
==============================================================================
--- trunk/nis-server/VERSION (original)
+++ trunk/nis-server/VERSION Thu Jan 22 10:26:20 2009
@@ -1 +1 @@
-2.17.2
+2.18.0

Modified: trunk/nis-server/package/yast2-nis-server.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/package/yast2-nis-server.changes?rev=54880&r1=54879&r2=54880&view=diff
==============================================================================
--- trunk/nis-server/package/yast2-nis-server.changes (original)
+++ trunk/nis-server/package/yast2-nis-server.changes Thu Jan 22 10:26:20 2009
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Thu Jan 22 09:29:03 CET 2009 - jsuchome@xxxxxxx
+
+- NisServer::modified used to indicate if changes were done
+- ask for abort if changes were done (bnc#460168)
+- code cleanup
+- 2.18.0
+
+-------------------------------------------------------------------
Thu Sep 4 14:36:32 CEST 2008 - jsuchome@xxxxxxx

- use rpcbind instead of portmap if available (bnc#423026)

Modified: trunk/nis-server/src/NisServer.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/src/NisServer.ycp?rev=54880&r1=54879&r2=54880&view=diff
==============================================================================
--- trunk/nis-server/src/NisServer.ycp (original)
+++ trunk/nis-server/src/NisServer.ycp Thu Jan 22 10:26:20 2009
@@ -24,7 +24,6 @@
import "Summary";
import "SuSEFirewall";

-//TODO: make it work like Mail::Touch
/**
* Data was modified?
*/

Modified: trunk/nis-server/src/details.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/src/details.ycp?rev=54880&r1=54879&r2=54880&view=diff
==============================================================================
--- trunk/nis-server/src/details.ycp (original)
+++ trunk/nis-server/src/details.ycp Thu Jan 22 10:26:20 2009
@@ -37,7 +37,12 @@
* @return `back, `abort or `next
*/
define symbol DetailsDialog () ``{
- string srcdir = NisServer::pwd_srcdir;
+
+ string srcdir = NisServer::pwd_srcdir;
+
+ integer minuid = NisServer::minuid;
+ integer mingid = NisServer::mingid;
+ boolean merge_passwd = NisServer::merge_passwd;

// help text 1/3
string helptext = _("<p>You can change NIS server source directory
(usually
@@ -51,39 +56,34 @@
// help text 3/3
helptext = helptext + _("<p>You can also adjust the minimum user and
group id.</p>");

- boolean merge_passwd = NisServer::merge_passwd;
-
- term merge_pass_buttons = `VBox (`Left (
+ term minimals = `HBox (
+ // To translators: intfield label
+ `IntField (`id (`minuid), _("Minimum &UID"), 0, 50000, minuid),
+ `HSpacing (),
+ // To translators: intfield label
+ `IntField (`id (`mingid), _("Minimum &GID"), 0, 50000, mingid)
+ );
+
+ term contents = `HVSquash (`VBox (
+ `InputField (`id (`srcdir), `opt(`notify, `hstretch),
+ // To translators: textentry label
+ _("&YP Source directory"), srcdir),
+ `VSpacing (0.5),
// check box label
- `CheckBox (`id (`merge_passwd), _("Merge pa&sswords"), merge_passwd)
+ `Left (`CheckBox (`id (`merge_passwd), _("Merge pa&sswords"),
+ merge_passwd)
+ ),
+ `VSpacing (0.5),
+ minimals
));

- term minimals = `HBox ();
-
- // To translators: intfield label
- minimals = add (minimals, `IntField (`id (`minuid), _("Minimum &UID"),
0, 50000,
- NisServer::minuid));
- minimals = add (minimals, `HSpacing ());
- // To translators: intfield label
- minimals = add (minimals, `IntField (`id (`mingid), _("Minimum &GID"),
0, 50000,
- NisServer::mingid));
-
-
- term contents = `VBox ();
- // To translators: textentry label
- contents = add (contents, `TextEntry (`id (`srcdir), `opt(`notify),
_("&YP Source directory"),
- srcdir));
- contents = add (contents, `VSpacing (0.5));
- contents = add (contents, merge_pass_buttons);
- contents = add (contents, `VSpacing (0.5));
- contents = add (contents, minimals);
-
+ // To translators: dialog label
+ Wizard::SetContents (_("NIS Master Server Details Setup"),
+ contents, helptext, true, true);

- contents = `HVSquash (contents);
-
- // To translators: dialog label
- Wizard::SetContents (_("NIS Master Server Details Setup"), contents,
helptext, true, true);
+ Wizard::SetBackButton(`back, Label::CancelButton() );
Wizard::SetNextButton(`next, Label::OKButton() );
+ Wizard::HideAbortButton();

// If the source directory does not exist, it will be created
// with empty passwd, group, shadow
@@ -114,7 +114,8 @@

change_enabled = (ui == `srcdir);
srcdir = (string) UI::QueryWidget (`id (`srcdir), `Value);
- if (ui == `abort && !Popup::ReallyAbort (true)) ui = `again;
+ if (ui == `abort && !Popup::ReallyAbort (NisServer::modified))
+ ui = `again;
if (ui == `next)
{
if (SCR::Read (.target.dir, srcdir) == nil && !Mode::config ())
@@ -124,17 +125,27 @@
Message::DirectoryDoesNotExistCreate (srcdir))
? `next : `again;
}
+ merge_passwd = (boolean) UI::QueryWidget (`id
(`merge_passwd), `Value);
+ minuid = (integer) UI::QueryWidget (`id (`minuid),
`Value);
+ mingid = (integer) UI::QueryWidget (`id (`mingid),
`Value);
+ if (NisServer::minuid != minuid ||
+ NisServer::mingid != mingid ||
+ NisServer::merge_passwd != merge_passwd ||
+ NisServer::pwd_srcdir != srcdir)
+ {
+ NisServer::modified = true;
+ NisServer::minuid = minuid;
+ NisServer::mingid = mingid;
+ NisServer::merge_passwd = merge_passwd;
+ NisServer::pwd_srcdir = srcdir;
+ }
}
}
until (contains ([`back, `next, `abort], ui));

- NisServer::minuid = (integer) UI::QueryWidget (`id (`minuid), `Value);
- NisServer::mingid = (integer) UI::QueryWidget (`id (`mingid), `Value);
- NisServer::merge_passwd =
- (boolean) UI::QueryWidget (`id (`merge_passwd), `Value);
- NisServer::pwd_srcdir = srcdir;
-
+ Wizard::RestoreBackButton();
Wizard::RestoreNextButton();
+ Wizard::RestoreAbortButton();
return ui;
}
}

Modified: trunk/nis-server/src/maps.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/src/maps.ycp?rev=54880&r1=54879&r2=54880&view=diff
==============================================================================
--- trunk/nis-server/src/maps.ycp (original)
+++ trunk/nis-server/src/maps.ycp Thu Jan 22 10:26:20 2009
@@ -97,12 +97,17 @@
ui = `abort;
}

- if (ui == `abort && !Popup::ReallyAbort (true)) ui = `again;
+ if (ui == `abort && !Popup::ReallyAbort (NisServer::modified))
+ ui = `again;
}
until (contains ([`back, `next, `abort], ui));

- current = (list<string>) UI::QueryWidget (`id (`current),
`SelectedItems);
- NisServer::maps = current;
+ current = (list<string>)UI::QueryWidget (`id (`current),`SelectedItems);
+ if (ui == `next && (sort (current) != sort (NisServer::maps)))
+ {
+ NisServer::maps = current;
+ NisServer::modified = true;
+ }
return ui;
}
}

Modified: trunk/nis-server/src/master.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/src/master.ycp?rev=54880&r1=54879&r2=54880&view=diff
==============================================================================
--- trunk/nis-server/src/master.ycp (original)
+++ trunk/nis-server/src/master.ycp Thu Jan 22 10:26:20 2009
@@ -38,6 +38,14 @@
*/
define symbol MasterDialog () ``{

+ boolean pwd_chfn = NisServer::pwd_chfn;
+ boolean pwd_chsh = NisServer::pwd_chsh;
+ boolean start_yppasswdd = NisServer::start_yppasswdd;
+ string domain = NisServer::domain;
+ boolean start_ypbind = NisServer::start_ypbind;
+ boolean nopush = NisServer::nopush;
+ boolean start_ypxfrd = NisServer::start_ypxfrd;
+
map<string,any> firewall_widget = GetFirewallWidget ();
term firewall_layout = firewall_widget["custom_widget"]:`VBox ();

@@ -62,73 +70,68 @@

helptext = helptext + firewall_widget["help"]:"";

- term pass_yes_buttons = `VBox ();
- // To translators: checkbox label
- pass_yes_buttons = add (pass_yes_buttons, `Left (`CheckBox (`id
(`allow_gecos), _("Allow changes to &GECOS field"),
- NisServer::pwd_chfn)));
- // To translators: checkbox label
- pass_yes_buttons = add (pass_yes_buttons, `Left (`CheckBox (`id
(`allow_shell), _("Allow changes to login &shell"),
- NisServer::pwd_chsh)));
- pass_yes_buttons = `HBox (`HSpacing (3), pass_yes_buttons);
-
- term pass_buttons = `VBox ();
- pass_buttons = add (pass_buttons, `VSpacing (0.3));
- pass_buttons = add (pass_buttons, `Left (`CheckBox (`id
(`change_passwords), `opt (`notify),
- // To translators:
checkbox label
- _("Allow changes to &passwords"),
- NisServer::start_yppasswdd)));
- pass_buttons = add (pass_buttons, `VSpacing (0.3));
- pass_buttons = add (pass_buttons, pass_yes_buttons);
- pass_buttons = add (pass_buttons, `VSpacing (0.3));
- pass_buttons = `HBox (`HSpacing (), pass_buttons);
-
- term domain_frame = `VBox ();
- domain_frame = add (domain_frame, `VSpacing (0.3));
- domain_frame = add (domain_frame, `TextEntry (`id (`domain), "",
- NisServer::domain));
- domain_frame = add (domain_frame, `VSpacing (0.3));
- domain_frame = add (domain_frame, `Left (
- // To translators: checkbox label
- `CheckBox (`id (`also_client), _("This host is also a NIS &client"),
- NisServer::start_ypbind)));
- domain_frame = add (domain_frame, `VSpacing (0.3));
- domain_frame = `HBox (`HSpacing (), domain_frame, `HSpacing (4));
-
- term contents = `VBox ();
- contents = add (contents, `VSpacing (0.5));
- // To translators: frame label
- contents = add (contents, `Frame (_("NIS &Domain Name"), domain_frame));
- contents = add (contents, `VSpacing (0.5));
- // To translators: checkbox label
- contents = add (contents, `HBox (`HSpacing (), `Left (`CheckBox (`id
(`have_slave), _("Active Slave NIS server &exists"),
- !NisServer::nopush))));
- contents = add (contents, `VSpacing (0.5));
- // To translators: checkbox label
- contents = add (contents, `HBox (`HSpacing (),`Left (`CheckBox (`id
(`fast_map), _("&Fast Map distribution (rpc.ypxfrd)"),
- NisServer::start_ypxfrd))));
- contents = add (contents, `VSpacing (0.5));
- // To translators: frame label
- contents = add (contents, `Frame (_("Changing of passwords"),
pass_buttons));
- contents = add (contents, `VSpacing (0.5));
- contents = add (contents, firewall_layout);
+ term pass_yes_buttons = `HBox (`HSpacing (3), `VBox (
+ `Left (`CheckBox (`id (`allow_gecos),
+ // To translators: checkbox label
+ _("Allow changes to &GECOS field"), pwd_chfn)),
+ `Left (`CheckBox (`id (`allow_shell),
+ // To translators: checkbox label
+ _("Allow changes to login &shell"), pwd_chsh))
+ ));
+
+ term pass_buttons = `HBox (`HSpacing (), `VBox (
+ `VSpacing (0.3),
+ `Left (`CheckBox (`id (`change_passwords), `opt (`notify),
+ // To translators: checkbox label
+ _("Allow changes to &passwords"), start_yppasswdd)
+ ),
+ `VSpacing (0.3),
+ pass_yes_buttons,
+ `VSpacing (0.3)
+ ));
+
+ term domain_frame = `HBox (`HSpacing (), `VBox (
+ `VSpacing (0.3),
+ `InputField (`id (`domain), `opt (`hstretch), "", domain),
+ `VSpacing (0.3),
+ `Left (`CheckBox (`id (`also_client),
+ // To translators: checkbox label
+ _("This host is also a NIS &client"), start_ypbind)
+ ),
+ `VSpacing (0.3)
+ ), `HSpacing (4));

- contents = `VBox (
- contents,
+ term contents = `HBox (`HSpacing (4), `VBox (
+ `VSpacing (0.5),
+ // To translators: frame label
+ `Frame (_("NIS &Domain Name"), domain_frame),
+ `VSpacing (0.5),
+ `Left (`CheckBox (`id (`have_slave),
+ // To translators: checkbox label
+ _("Active Slave NIS server &exists"), !nopush)
+ ),
+ `VSpacing (0.5),
+ `Left (`CheckBox (`id (`fast_map),
+ // To translators: checkbox label
+ _("&Fast Map distribution (rpc.ypxfrd)"), start_ypxfrd)
+ ),
+ `VSpacing (0.5),
+ // To translators: frame label
+ `Frame (_("Changing of passwords"), pass_buttons),
+ `VSpacing (0.5),
+ firewall_layout,
`VSpacing (0.5),
`PushButton (`id (`details), `opt (`key_F7),
// To translators: pushbutton label
_("&Other global settings ..."))
- );
-
- contents = `HBox (`HSpacing (4), contents, `HSpacing (6));
+ ), `HSpacing (6));

// To translators: dialog label
Wizard::SetContents (_("Master Server Setup"),
contents, helptext, true, true);

- boolean a = NisServer::start_yppasswdd;
- UI::ChangeWidget (`id (`allow_shell), `Enabled, a);
- UI::ChangeWidget (`id (`allow_gecos), `Enabled, a);
+ UI::ChangeWidget (`id (`allow_shell), `Enabled, start_yppasswdd);
+ UI::ChangeWidget (`id (`allow_gecos), `Enabled, start_yppasswdd);

CWMFirewallInterfaces::OpenFirewallInit (firewall_widget, "");

@@ -146,32 +149,63 @@

if (ui == `change_passwords)
{
- boolean enabled = (boolean) UI::QueryWidget (`id
(`change_passwords), `Value);
- UI::ChangeWidget (`id (`allow_shell), `Enabled, enabled);
- UI::ChangeWidget (`id (`allow_gecos), `Enabled, enabled);
+ start_yppasswdd= (boolean)
+ UI::QueryWidget (`id (`change_passwords), `Value);
+ UI::ChangeWidget (`id (`allow_shell), `Enabled,start_yppasswdd);
+ UI::ChangeWidget (`id (`allow_gecos), `Enabled,start_yppasswdd);
}

else if (ui == `next)
{
- string domainname = (string) UI::QueryWidget (`id (`domain),
`Value);
+ string domainname = (string)
+ UI::QueryWidget (`id (`domain), `Value);

if (!Nis::check_nisdomainname (domainname))
{
UI::SetFocus (`id (`domain));
Popup::Error (Nis::valid_nisdomainname ());
ui = `again;
+ continue;
}
- if (ui == `next)
+ domain = domainname;
+ start_ypbind = (boolean)
+ UI::QueryWidget (`id (`also_client), `Value);
+ nopush = ! (boolean)
+ UI::QueryWidget (`id (`have_slave), `Value);
+ pwd_chfn = (boolean)
+ UI::QueryWidget (`id (`allow_gecos), `Value);
+ pwd_chsh = (boolean)
+ UI::QueryWidget (`id (`allow_shell), `Value);
+ start_yppasswdd = (boolean)
+ UI::QueryWidget (`id (`change_passwords), `Value);
+ start_ypxfrd = (boolean)
+ UI::QueryWidget (`id (`fast_map), `Value);
+
+ CheckForDHCPClient (domainname);
+ CWMFirewallInterfaces::OpenFirewallStore (
+ firewall_widget,"",event);
+
+ if (NisServer::modified ||
+ domain != NisServer::domain ||
+ start_ypbind != NisServer::start_ypbind ||
+ nopush != NisServer::nopush ||
+ pwd_chfn != NisServer::pwd_chfn ||
+ pwd_chsh != NisServer::pwd_chsh ||
+ start_yppasswdd != NisServer::start_yppasswdd ||
+ start_ypxfrd != NisServer::start_ypxfrd)
{
- NisServer::start_ypbind = (boolean)
- UI::QueryWidget (`id (`also_client), `Value);
- CheckForDHCPClient (domainname);
- CWMFirewallInterfaces::OpenFirewallStore (
- firewall_widget,"",event);
+ NisServer::modified = true;
+ NisServer::domain = domain;
+ NisServer::start_ypbind = start_ypbind;
+ NisServer::nopush = nopush;
+ NisServer::pwd_chfn = pwd_chfn;
+ NisServer::pwd_chsh = pwd_chsh;
+ NisServer::start_yppasswdd = start_yppasswdd;
+ NisServer::start_ypxfrd = start_ypxfrd;
}
}

- if (ui == `abort && !Popup::ReallyAbort (true))
+ if (ui == `abort && !Popup::ReallyAbort (NisServer::modified))
{
ui = `again;
}
@@ -179,19 +213,6 @@
until ( is (ui,symbol) &&
contains ([`next, `back, `abort, `details], (symbol) ui));

- NisServer::nopush =
- ! (boolean) UI::QueryWidget (`id (`have_slave), `Value);
- NisServer::pwd_chfn =
- (boolean) UI::QueryWidget (`id (`allow_gecos), `Value);
- NisServer::pwd_chsh =
- (boolean) UI::QueryWidget (`id (`allow_shell), `Value);
- NisServer::start_yppasswdd =
- (boolean) UI::QueryWidget (`id (`change_passwords), `Value);
- NisServer::start_ypxfrd =
- (boolean) UI::QueryWidget (`id (`fast_map), `Value);
- NisServer::domain =
- (string) UI::QueryWidget (`id (`domain), `Value);
-
return (symbol) ui;
}
}

Modified: trunk/nis-server/src/securenets.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/src/securenets.ycp?rev=54880&r1=54879&r2=54880&view=diff
==============================================================================
--- trunk/nis-server/src/securenets.ycp (original)
+++ trunk/nis-server/src/securenets.ycp Thu Jan 22 10:26:20 2009
@@ -81,24 +81,25 @@
*/
define term NetsEditPopup (integer id, string netmask, string network) ``{

- term buttons = `HBox ();
- buttons = add (buttons, `PushButton (`id (`ok), `opt (`default,
`key_F10), Label::OKButton()));
- buttons = add (buttons, `PushButton (`id (`cancel), `opt (`key_F9),
Label::CancelButton()));
-
- term contents = `VBox ();
- contents = add (contents, `VSpacing (0.3));
- // To translators: popup dialog heading
- contents = add (contents, `Heading (_("Edit netmask and network")));
- contents = add (contents, `VSpacing (0.5));
- // To translators: textentry label
- contents = add (contents, `TextEntry (`id(`netmask), _("Net&mask"),
netmask));
- contents = add (contents, `VSpacing (0.3));
- // To translators: textentry label
- contents = add (contents, `TextEntry (`id(`network), _("Net&work"),
network));
- contents = add (contents, `VSpacing (0.5));
- contents = add (contents, buttons);
- contents = add (contents, `VSpacing (0.3));
- contents = `HBox (`HSpacing (), contents, `HSpacing ());
+ term contents = `HBox (`HSpacing (), `VBox (
+ `VSpacing (0.3),
+ // To translators: popup dialog heading
+ `Heading (_("Edit netmask and network")),
+ `VSpacing (0.5),
+ // To translators: textentry label
+ `InputField (`id (`netmask), `opt (`hstretch), _("Net&mask"),
+ netmask),
+ `VSpacing (0.3),
+ // To translators: textentry label
+ `InputField (`id (`network), `opt (`hstretch), _("Net&work"),
+ network),
+ `VSpacing (0.5),
+ `ButtonBox (
+ `PushButton (`id (`ok), `opt (`default), Label::OKButton()),
+ `PushButton (`id (`cancel), Label::CancelButton())
+ ),
+ `VSpacing (0.3)
+ ), `HSpacing ());

UI::OpenDialog (contents);
UI::SetFocus (`id (`netmask));
@@ -158,14 +159,6 @@
list<term> allow_query = ItemizeSecurenets (NisServer::securenets);
integer n_items = size (allow_query);

- term buttons = `HBox (
- `PushButton (`id (`add), Label::AddButton ()),
- `PushButton (`id (`edit), Label::EditButton ()),
- `Left (
- `PushButton (`id (`delete), Label::DeleteButton ())
- )
- );
-
term contents = `VBox (
`Table (`id (`table), `opt (`notify, `immediate), `header (
// To translators: table header
@@ -173,7 +166,12 @@
// To translators: table header
_("Network")
), allow_query),
- buttons
+ `HBox (
+ `PushButton (`id (`add), Label::AddButton ()),
+ `PushButton (`id (`edit), Label::EditButton ()),
+ `PushButton (`id (`delete), Label::DeleteButton ()),
+ `HStretch ()
+ )
);

// To translators: dialog label
@@ -229,16 +227,22 @@
}
}

- if (ui == `abort && !Popup::ReallyAbort (true)) ui = `again;
+ if (ui == `abort && !Popup::ReallyAbort (NisServer::modified))
+ ui = `again;
}
until (contains ([`back, `next, `abort], ui));

if (ui == `back) Wizard::RestoreNextButton();

- // and finally merge
- NisServer::securenets = MergeNetsEntries (NisServer::securenets,
allow_query);
+ list<map> securenets =
+ MergeNetsEntries (NisServer::securenets, allow_query);

+ // and finally merge
+ if (ui == `next && (sort (securenets) != sort (NisServer::securenets)))
+ {
+ NisServer::securenets = securenets;
+ NisServer::modified = true;
+ }
return ui;
}
-
}

Modified: trunk/nis-server/src/slave.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/src/slave.ycp?rev=54880&r1=54879&r2=54880&view=diff
==============================================================================
--- trunk/nis-server/src/slave.ycp (original)
+++ trunk/nis-server/src/slave.ycp Thu Jan 22 10:26:20 2009
@@ -49,25 +49,22 @@

+ firewall_widget["help"]:"";

- term contents = `VBox ();
- contents = add (contents,
+ term contents = `HVSquash (`VBox (
// textentry label
- `TextEntry (`id(`domain),_("NIS &domain name:"),NisServer::domain));
- contents = add (contents, `VSpacing (0.5));
- contents = add (contents,
- // text entry label
- `TextEntry (`id (`master_ip), _("NIS &master server:"),
- NisServer::ui_master_ip));
-
- contents = add (contents, `VSpacing ());
- contents = add (contents,
- // checkbox label
- `CheckBox (`id (`also_client), _("This host is also a NIS &client"),
- NisServer::start_ypbind));
-
- contents = add (contents, `VSpacing (2));
- contents = add (contents, firewall_layout);
- contents = `HVSquash (contents);
+ `InputField (`id (`domain), `opt(`hstretch), _("N&IS domain name:"),
+ NisServer::domain),
+ `VSpacing (0.5),
+ `InputField (`id (`master_ip), `opt (`hstretch),
+ // text entry label
+ ("NIS &master server:"), NisServer::ui_master_ip),
+ `VSpacing (),
+ `Left (`CheckBox (`id (`also_client),
+ // checkbox label
+ _("This host is also a NIS &client"), NisServer::start_ypbind)
+ ),
+ `VSpacing (2),
+ firewall_layout
+ ));

// To translators: dialog label
Wizard::SetContents (_("Slave Server Setup"),
@@ -94,38 +91,43 @@
(string) UI::QueryWidget (`id (`master_ip), `Value);
string domainname =
(string) UI::QueryWidget (`id (`domain), `Value);
+ boolean start_ypbind =
+ (boolean) UI::QueryWidget (`id (`also_client), `Value);
if (!Address::Check4(master_ip))
{
// To translators: error message
UI::SetFocus (`id (`master_ip));
Popup::Error (Address::Valid4());
ui = `again;
+ continue;
}
else if (!Nis::check_nisdomainname (domainname))
{
UI::SetFocus (`id (`domain));
Popup::Error (Nis::valid_nisdomainname ());
ui = `again;
+ continue;
}
- if (ui == `next)
+ if (master_ip != NisServer::ui_master_ip ||
+ domainname!= NisServer::domain ||
+ start_ypbind != NisServer::start_ypbind)
{
- NisServer::start_ypbind = (boolean)
- UI::QueryWidget (`id (`also_client), `Value);
- CheckForDHCPClient (domainname);
- CWMFirewallInterfaces::OpenFirewallStore (
- firewall_widget,"",event);
+ NisServer::modified = true;
}
+
+ CheckForDHCPClient (domainname);
+ CWMFirewallInterfaces::OpenFirewallStore (
+ firewall_widget,"",event);
+ NisServer::start_ypbind = start_ypbind;
+ NisServer::ui_master_ip = master_ip;
+ NisServer::domain = domainname;
}

- if (ui == `abort && !Popup::ReallyAbort (true)) ui = `again;
+ if (ui == `abort && !Popup::ReallyAbort (NisServer::modified))
+ ui = `again;
}
until (ui == `next || ui == `back || ui == `abort);

- NisServer::ui_master_ip =
- (string) UI::QueryWidget (`id (`master_ip), `Value);
- NisServer::domain =
- (string) UI::QueryWidget (`id (`domain), `Value);
-
return (symbol) ui;
}
}

Modified: trunk/nis-server/src/slaves.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/src/slaves.ycp?rev=54880&r1=54879&r2=54880&view=diff
==============================================================================
--- trunk/nis-server/src/slaves.ycp (original)
+++ trunk/nis-server/src/slaves.ycp Thu Jan 22 10:26:20 2009
@@ -42,15 +42,17 @@
define string ChooseHostName(list<string> hosts) ``{
string hname = nil;

- UI::OpenDialog(
- `VBox(`HSpacing(40),
- `HBox(`VSpacing(10),
- // To translators: selection box label
- `SelectionBox(`id(`hosts), _("&Remote hosts"),
hosts)),
- `HBox(`PushButton(`id(`ok), `opt (`default, `key_F10),
- Label::OKButton()),
- `PushButton(`id(`cancel), `opt (`key_F9),
- Label::CancelButton()))));
+ UI::OpenDialog (`VBox (`HSpacing(40),
+ `HBox (
+ `VSpacing(10),
+ // To translators: selection box label
+ `SelectionBox(`id(`hosts), _("&Remote hosts"), hosts)
+ ),
+ `HBox (
+ `PushButton (`id(`ok), `opt (`default), Label::OKButton()),
+ `PushButton(`id(`cancel), Label::CancelButton())
+ )
+ ));
any ret = nil;
do {
ret = UI::UserInput();
@@ -72,27 +74,30 @@
*/
define string YPSlavePopup (string slave) ``{

- term hbox = `HBox ();
- // To translators: textentry label
- hbox = add (hbox, `TextEntry (`id(`slave), _("&Slave's host name"),
slave));
- // To translators: pushbutton label
- hbox = add (hbox, `VBox (`VSpacing (), `PushButton (`id (`browse), `opt
(`key_F6), _("&Browse"))));
-
- term contents = `VBox ();
- contents = add (contents, `VSpacing (0.3));
- // To translators: popup dialog heading
- contents = add (contents, `Heading (_("Edit slave")));
- contents = add (contents, `VSpacing (0.5));
- contents = add (contents, hbox);
- contents = add (contents, `VSpacing (0.5));
-
- hbox = `HBox ();
- hbox = add (hbox, `PushButton (`id (`ok), `opt (`default, `key_F10),
Label::OKButton()));
- hbox = add (hbox, `PushButton (`id (`cancel), `opt (`key_F9),
Label::CancelButton()));
-
- contents = add (contents, hbox);
- contents = add (contents, `VSpacing (0.3));
- contents = `HBox (`HSpacing (), contents, `HSpacing ());
+ term hbox = `HBox (
+ // To translators: textentry label
+ `InputField (`id (`slave), `opt (`hstretch),_("&Slave's host name"),
+ slave),
+ `VBox (
+ `VSpacing (),
+ `PushButton (`id (`browse), `opt (`key_F6),
+ Label::BrowseButton ())
+ )
+ );
+
+ term contents = `HBox (`HSpacing (), `VBox (
+ `VSpacing (0.3),
+ // To translators: popup dialog heading
+ `Heading (_("Edit slave")),
+ `VSpacing (0.5),
+ hbox,
+ `VSpacing (0.3),
+ `ButtonBox (
+ `PushButton (`id (`ok), `opt (`default), Label::OKButton ()),
+ `PushButton (`id (`cancel), Label::CancelButton ())
+ ),
+ `VSpacing (0.3)
+ ), `HSpacing ());

UI::OpenDialog (contents);
UI::SetFocus (`id (`slave));
@@ -153,28 +158,32 @@

list<string> slaves = NisServer::ypservers;

- term buttons = `HBox ();
- // To translators: pushbutton label
- buttons = add (buttons, `PushButton (`id (`add), `opt (`key_F3),
_("A&dd")));
- // To translators: pushbutton label
- buttons = add (buttons, `PushButton (`id (`edit), `opt (`key_F4),
_("&Edit")));
- // To translators: pushbutton label
- buttons = add (buttons, `PushButton (`id (`delete), `opt (`key_F5),
_("De&lete")));
-
- term contents = `VBox ();
- contents = add (contents, `ReplacePoint (`id (`replace),
- // To translators: selection box label
- `SelectionBox (`id (`slaves),
`opt (`notify), _("&Slaves"), sort(slaves))));
- contents = add (contents, buttons);
-
- // To translators: dialog label
- Wizard::SetContents (_("NIS Master Server Slaves Setup"), contents,
helptext, true, true);
+ term buttons = `HBox (
+ `PushButton (`id (`add), Label::AddButton ()),
+ `PushButton (`id (`edit), Label::EditButton ()),
+ `PushButton (`id (`delete), Label::DeleteButton ()),
+ `HStretch ()
+ );
+
+ term contents = `VBox (
+ `ReplacePoint (`id (`replace),
+ // To translators: selection box label
+ `SelectionBox (`id (`slaves), `opt (`notify), _("&Slaves"),
+ sort (slaves))
+ ),
+ buttons
+ );
+
+ // To translators: dialog label
+ Wizard::SetContents (_("NIS Master Server Slaves Setup"),
+ contents, helptext, true, true);

symbol ui = nil;

repeat
{
- boolean anyslaves = UI::QueryWidget (`id (`slaves), `CurrentItem)
!= nil;
+ boolean anyslaves =
+ UI::QueryWidget (`id (`slaves), `CurrentItem) != nil;
UI::ChangeWidget (`id (`edit), `Enabled, anyslaves);
UI::ChangeWidget (`id (`delete), `Enabled, anyslaves);

@@ -186,25 +195,30 @@

if (ui == `edit)
{
- string selected = (string) UI::QueryWidget (`id (`slaves),
`CurrentItem);
+ string selected =
+ (string) UI::QueryWidget (`id (`slaves), `CurrentItem);
if (selected == nil) continue;
string edited = YPSlavePopup (selected);
if (edited != nil)
{
slaves = filter (string e, slaves, ``(e != selected));
slaves = add (slaves, edited);
- // To translators: selectionbox label
- UI::ReplaceWidget (`id (`replace), `SelectionBox (`id
(`slaves), `opt (`notify), _("&Slaves"), sort (slaves)));
+ UI::ReplaceWidget (`id (`replace),
+ `SelectionBox (`id (`slaves),
+ `opt (`notify), _("&Slaves"), sort (slaves))
+ );
}
}

else if (ui == `delete)
{
- string selected = (string) UI::QueryWidget (`id (`slaves),
`CurrentItem);
+ string selected =
+ (string) UI::QueryWidget (`id (`slaves), `CurrentItem);
if (selected == nil) continue;
slaves = filter (string e, slaves, ``(e != selected));
- // To translators: selectionbox label
- UI::ReplaceWidget (`id (`replace), `SelectionBox (`id
(`slaves), `opt (`notify), _("&Slaves"), sort (slaves)));
+ UI::ReplaceWidget (`id (`replace), `SelectionBox (`id (`slaves),
+ `opt (`notify), _("&Slaves"), sort (slaves))
+ );
}

else if (ui == `add)
@@ -213,16 +227,23 @@
if (edited != nil && !contains (slaves, edited))
{
slaves = add (slaves, edited);
- // To translators: selectionbox label
- UI::ReplaceWidget (`id (`replace), `SelectionBox (`id
(`slaves), `opt (`notify), _("&Slaves"), sort (slaves)));
+ UI::ReplaceWidget (`id (`replace),
+ `SelectionBox (`id (`slaves),
+ `opt (`notify), _("&Slaves"), sort (slaves))
+ );
}
}

- if (ui == `abort && !Popup::ReallyAbort (true)) ui = `again;
+ if (ui == `abort && !Popup::ReallyAbort (NisServer::modified))
+ ui = `again;
}
until (contains ([`back, `next, `abort], ui));

- NisServer::ypservers = slaves;
+ if (ui == `next && sort (NisServer::ypservers) != slaves)
+ {
+ NisServer::ypservers = slaves;
+ NisServer::modified = true;
+ }

return ui;
}

Modified: trunk/nis-server/src/what.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/src/what.ycp?rev=54880&r1=54879&r2=54880&view=diff
==============================================================================
--- trunk/nis-server/src/what.ycp (original)
+++ trunk/nis-server/src/what.ycp Thu Jan 22 10:26:20 2009
@@ -158,12 +158,13 @@
Wizard::SetFocusToNextButton();

ui = (symbol) UI::UserInput ();
- if (ui == `cancel)
+ if (ui == `cancel || ui == `back)
{
ui = `abort;
}

- if (ui == `abort && !Popup::ReallyAbort (true)) ui = `again;
+ if (ui == `abort && NisServer::modified && !Popup::ReallyAbort
(true))
+ ui = `again;

}
until (contains ([`back, `next, `abort, `finish], ui));
@@ -182,6 +183,10 @@
}

current_button = (symbol) UI::QueryWidget (`id (`rb), `CurrentButton);
+
+ if (NisServer::ui_what != current_button)
+ NisServer::modified = true;
+
NisServer::ui_what = current_button;
return ui == `next ? current_button : ui;
}

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages