Author: kmachalkova
Date: Tue Jan 13 18:19:31 2009
New Revision: 54593
URL: http://svn.opensuse.org/viewcvs/yast?rev=54593&view=rev
Log:
Removed read progress dialog (but imperfectly, because
reading users takes too long, so the dialog hangs
in empty wizard window for some time) - #447586
Modified:
trunk/sudo/src/Sudo.ycp
trunk/sudo/src/complex.ycp
trunk/sudo/src/wizards.ycp
Modified: trunk/sudo/src/Sudo.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sudo/src/Sudo.ycp?rev=54593&r1=54592&r2=54593&view=diff
==============================================================================
--- trunk/sudo/src/Sudo.ycp (original)
+++ trunk/sudo/src/Sudo.ycp Tue Jan 13 18:19:31 2009
@@ -35,6 +35,7 @@
module "Sudo";
textdomain "sudo";
+import "Confirm";
import "Message";
import "Progress";
import "Report";
@@ -159,15 +160,13 @@
global boolean ReadLocalUsers() {
- boolean current_progress = Progress::set(false);
- boolean gui = Users::GetGUI ();
Users::SetGUI (false);
- Users::Read ();
+ Users::Read();
list <string> users = (list<string>) merge (
- UsersCache::GetUsernames("local"),
- UsersCache::GetUsernames("system")
- );
+ UsersCache::GetUsernames("local"),
+ UsersCache::GetUsernames("system")
+ );
list <string> available_groups = [];
map > all_groupnames = UsersCache::GetAllGroupnames ();
@@ -183,7 +182,6 @@
all_users = (list <string>) merge(users,available_groups);
- Progress::set(current_progress);
if(all_users == []) {
return false;
}
@@ -428,44 +426,36 @@
*/
global boolean Read() {
- /* Sudo read dialog caption */
+ if (!Confirm::MustBeRoot())
+ return false;
+
+ if(!ReadSudoSettings2())
+ Report::Error(Message::CannotReadCurrentSettings());
+
+ /* Error message */
+ if(!ReadLocalUsers())
+ Report::Error(_("Cannot read /etc/passwd."));
+
+ /* Sudo read dialog caption
string caption = _("Initializing sudo Configuration");
integer steps = 2;
Progress::New( caption, " ", steps, [
- /* Progress stage 1/2 */
+ /* Progress stage 1/2
_("Read sudo settings"),
- /* Progress stage 2/2 */
+ /* Progress stage 2/2
_("Read local users and groups")
], [
- /* Progress step 1/2 */
+ /* Progress step 1/2
_("Reading sudo settings..."),
- /* Progress step 2/2 */
+ /* Progress step 2/2
_("Reading local users and groups..."),
- /* Progress finished */
+ /* Progress finished
Message::Finished()
],
""
- );
-
- sleep(sl);
-
- if(PollAbort()) return false;
- Progress::NextStage();
- /* Error message */
- if(!ReadSudoSettings2()) Report::Error(Message::CannotReadCurrentSettings());
- sleep(sl);
-
- if(PollAbort()) return false;
- Progress::NextStep();
- /* Error message */
- if(!ReadLocalUsers()) Report::Error(_("Cannot read /etc/passwd."));
- sleep(sl);
-
- if(PollAbort()) return false;
- Progress::NextStage ();
- sleep(sl);
+ );*/
modified = false;
return true;
Modified: trunk/sudo/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sudo/src/complex.ycp?rev=54593&r1=54592&r2=54593&view=diff
==============================================================================
--- trunk/sudo/src/complex.ycp (original)
+++ trunk/sudo/src/complex.ycp Tue Jan 13 18:19:31 2009
@@ -213,9 +213,9 @@
return items;
}
-/* Read settings dialog
- * @return `abort if aborted and `next otherwise
- */
+/* Read settings dialog (currently unused)
+ * @return `abort if aborted and `next otherwisea
+ *
symbol ReadDialog() {
Wizard::RestoreHelp(HELPS["read"]:"");
@@ -225,7 +225,7 @@
boolean ret = Sudo::Read();
return ret ? `next : `abort;
- }
+ }*/
/**
* Write settings dialog
Modified: trunk/sudo/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sudo/src/wizards.ycp?rev=54593&r1=54592&r2=54593&view=diff
==============================================================================
--- trunk/sudo/src/wizards.ycp (original)
+++ trunk/sudo/src/wizards.ycp Tue Jan 13 18:19:31 2009
@@ -132,7 +132,6 @@
`next : "configuration",
],
];
-
any ret = Sequencer::Run(aliases, sequence);
return ret;
@@ -145,17 +144,12 @@
any SudoSequence() {
map aliases = $[
- "read" : [ ``( ReadDialog() ), true ],
"main" : ``( MainSequence() ),
"write" : [ ``( WriteDialog() ), true ]
];
map sequence = $[
- "ws_start" : "read",
- "read" : $[
- `abort : `abort,
- `next : "main"
- ],
+ "ws_start" : "main",
"main" : $[
`abort : `abort,
`next : "write"
@@ -168,6 +162,8 @@
Wizard::CreateDialog();
Wizard::SetDesktopIcon("sudo");
+ if (!Sudo::Read())
+ return `abort;
any ret = Sequencer::Run(aliases, sequence);
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org