[yast-commit] r52680 - /trunk/nfs-client/src/ui.ycp
Author: kmachalkova Date: Wed Oct 29 16:05:10 2008 New Revision: 52680 URL: http://svn.opensuse.org/viewcvs/yast?rev=52680&view=rev Log: Correct enabling/disabling of edit and delete buttons depending on # of nfs shares (#438665) Modified: trunk/nfs-client/src/ui.ycp Modified: trunk/nfs-client/src/ui.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/src/ui.ycp?rev=52680&r1=52679&r2=52680&view=diff ============================================================================== --- trunk/nfs-client/src/ui.ycp (original) +++ trunk/nfs-client/src/ui.ycp Wed Oct 29 16:05:10 2008 @@ -431,6 +431,12 @@ specific <b>NFSv4 Domain Name</b>, required for correct setting of file/directory access rights.</p>") + fw_cwm_widget["help"]:""; + void EnableDisableButtons() + { + UI::ChangeWidget(`id(`editbut), `Enabled, ( nfs_entries != [] ) ); + UI::ChangeWidget(`id(`delbut), `Enabled, ( nfs_entries != [] ) ); + } + term FstabTab() { term fstab_content = @@ -496,10 +502,7 @@ void InitFstabEntries( ) { UI::ChangeWidget (`id(`fstable), `Items, FstabTableItems (nfs_entries)); - - integer entryno = (integer) UI::QueryWidget(`id(`fstable), `CurrentItem); - UI::ChangeWidget (`id(`editbut), `Enabled, entryno != nil); - UI::ChangeWidget (`id(`delbut), `Enabled, entryno != nil); + EnableDisableButtons(); // Kludge, because a `Table still does not have a shortcut. // Simple to solve here: there's only the table and buttons, @@ -545,11 +548,13 @@ map<string,any> entry = GetFstabEntry (nil, (list<map>) union (Nfs::non_nfs_entries, nfs_entries)); if (entry != nil) - { + { nfs_entries = add (nfs_entries, entry); modify_line = entry; + EnableDisableButtons(); + Nfs::SetModified(); - } + } UI::ChangeWidget (`id(`fstable), `Items, FstabTableItems (nfs_entries)); } @@ -581,7 +586,9 @@ modify_line = share; nfs_entries = remove (nfs_entries, entryno); UI::ChangeWidget (`id(`fstable), `Items, FstabTableItems (nfs_entries)); - Nfs::SetModified(); + EnableDisableButtons(); + + Nfs::SetModified(); } } else if (widget == `enable_nfs4) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kmachalkova@svn.opensuse.org