Author: jdsn
Date: Wed Aug 27 15:05:51 2008
New Revision: 50410
URL: http://svn.opensuse.org/viewcvs/yast?rev=50410&view=rev
Log:
dumbtab for qt/gtk and buttons for ncurses
agent to read system data
Added:
branches/tmp/jdsn/edu-users/agents/cfg_edu_users.scr
Modified:
branches/tmp/jdsn/edu-users/agents/Makefile.am
branches/tmp/jdsn/edu-users/src/EduUsers.ycp
branches/tmp/jdsn/edu-users/src/complex.ycp
branches/tmp/jdsn/edu-users/src/dialogs.ycp
Modified: branches/tmp/jdsn/edu-users/agents/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/edu-users/agents/Makefile.am?rev=50410&r1=50409&r2=50410&view=diff
==============================================================================
--- branches/tmp/jdsn/edu-users/agents/Makefile.am (original)
+++ branches/tmp/jdsn/edu-users/agents/Makefile.am Wed Aug 27 15:05:51 2008
@@ -2,6 +2,6 @@
agent_SCRIPTS =
-scrconf_DATA =
+scrconf_DATA = cfg_edu_users.scr
EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)
Added: branches/tmp/jdsn/edu-users/agents/cfg_edu_users.scr
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/edu-users/agents/cfg_edu_users.scr?rev=50410&view=auto
==============================================================================
--- branches/tmp/jdsn/edu-users/agents/cfg_edu_users.scr (added)
+++ branches/tmp/jdsn/edu-users/agents/cfg_edu_users.scr Wed Aug 27 15:05:51 2008
@@ -0,0 +1,25 @@
+/**
+ * File:
+ * cfg_suse_register.scr
+ * Summary:
+ * Agent to read and write /etc/sysconfig/suse_register
+ * using ini agent
+ * Authors:
+ * Jens Daniel Schmidt
+ * Example:
+ * Read(.sysconfig.suse_register.SOMETHING)
+ * ("no")
+ **
+ * Write(.sysconfig.suse_register.SOMETHING, "yes")
+ * (true)
+ *
+ * $Id: cfg_suse_register.scr 1 2006-03-18 00:10:10Z jdsn $
+ *
+ * Read and write the settings in /etc/sysconfig/suse_register
+ * needed by installation/inst_suse_register
+ */
+.sysconfig.edu_users
+
+`ag_ini(
+ `SysConfigFile("/etc/sysconfig/edu_users")
+)
Modified: branches/tmp/jdsn/edu-users/src/EduUsers.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/edu-users/src/EduUsers.ycp?rev=50410&r1=50409&r2=50410&view=diff
==============================================================================
--- branches/tmp/jdsn/edu-users/src/EduUsers.ycp (original)
+++ branches/tmp/jdsn/edu-users/src/EduUsers.ycp Wed Aug 27 15:05:51 2008
@@ -102,20 +102,20 @@
//global map allusers = $[];
-global map User = $[ `current : [],
- `change : [],
- `delete : []
- ];
-
-global map Group = $[ `current : [],
- `change : [],
- `delete : []
- ];
-
-global map Template = $[ `current : [],
- `change : [],
- `delete : []
- ];
+global map User = $[ `current : $[],
+ `change : $[],
+ `delete : $[]
+ ];
+
+global map Group = $[ `current : $[],
+ `change : $[],
+ `delete : $[]
+ ];
+
+global map Template = $[ `current : $[],
+ `change : $[],
+ `delete : $[]
+ ];
/**
* list of terms to hold the groups
@@ -142,15 +142,26 @@
* Read Users from the system
* @return true on success
*/
-global boolean readUsers()
+global boolean readUsers(symbol mode)
{
- // read data via YaPI::Users
- return (true);
+ // read data via YaPI::Users
+ map config = $[];
+ if(mode == `ldap)
+ {
+ config = $["type":"ldap","groupname":allgroups];
+ }
+ else
+ {
+ config = $["type":"local","groupname":allgroups];
+ }
+ map user = YaPI::USERS::UsersGet(config);
+ User[`current] = user;
+ y2milestone("UUUSER %1", user);
+ return true;
}
-
/**
* Read all edu-users settings
* @return true on success
@@ -181,15 +192,15 @@
if(Abort()) return false;
Progress::NextStage();
- string gettemplates = (string) SCR::Read(.sysconfig.educlient.TEMPLATES);
+ string gettemplates = (string) SCR::Read(.sysconfig.edu_users.EDU_TEMPLATES);
y2milestone("TEMPLATES: %1",gettemplates);
alltemplates = splitstring(gettemplates, ", ");
- string getgroups = (string) SCR::Read(.sysconfig.educlient.GROUPS);
+ string getgroups = (string) SCR::Read(.sysconfig.edu_users.EDU_GROUPS);
y2milestone("GROUPS: %1",getgroups);
+ if (getgroups == nil) { getgroups = ""; }
allgroups = splitstring(getgroups, ", ");
- // TODO read user data
- // addusers = something
+ readUsers(nil);
/* Error message */
if(false) Report::Error(_("Cannot read settings."));
@@ -258,30 +269,32 @@
* @return table of users
*/
global list<term> getUserItemList() {
- return [ `item(`id(`test1), "Tux", "Linux", "tux", "Youth"),
- `item(`id(`test2), "Geeko", "Green", "geeko", "Teen")
- ];
-
- // `item(`id("login"), "Name", "Surname", "Login", "Age", "Password")
- // TODO FIXME this is to become function to return the show table dynamically - do not store twice!
-
-
- // $["1000" :
- // $[ "addit_data":"",
- // "cn":"Peter S. Nelke",
- // "gidnumber":"100",
- // "grouplist":$["dialout":"1", "video":"1"],
- // "groupname":"users",
- // "homedirectory":"/home/pissnelke",
- // "loginshell":"/bin/bash",
- // "type":"local",
- // "uid":"psnelke",
- // "uidnumber":"1000",
- // "userpassword":nil ]
+ // `item(`id(`test2), "Geeko", "Green", "geeko", "Teen")
+ // ];
+
+ // `item(`id("login"), "Name", "Surname", "Login", "Age", "Password")
- //`current `change `delete
- //foreach( User );
+ // $["1000" :
+ // $[ "addit_data":"",
+ // "cn":"Peter S. Nelke",
+ // "gidnumber":"100",
+ // "grouplist":$["dialout":"1", "video":"1"],
+ // "groupname":"users",
+ // "homedirectory":"/home/pissnelke",
+ // "loginshell":"/bin/bash",
+ // "type":"local",
+ // "uid":"psnelke",
+ // "uidnumber":"1000",
+ // "userpassword":nil ]
+
+ list<term> result = [];
+ //`current `change `delete
+ foreach( string uidnumber, map userdetails, (map) User[`current]:$[], {
+ result = add(result, `item(`id(userdetails["uid"]:""), userdetails["cn"]:"", userdetails["uid"]:"", userdetails["groupname"]:"" ));
+ });
+ y2milestone("UUsers %1", result);
+ return result;
}
Modified: branches/tmp/jdsn/edu-users/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/edu-users/src/complex.ycp?rev=50410&r1=50409&r2=50410&view=diff
==============================================================================
--- branches/tmp/jdsn/edu-users/src/complex.ycp (original)
+++ branches/tmp/jdsn/edu-users/src/complex.ycp Wed Aug 27 15:05:51 2008
@@ -83,29 +83,45 @@
term content = `Empty();
term tabbar = `HBox();
- foreach (term t, tabs, {
- string label = t[1]:"blubb";
- tabbar = add (tabbar, `PushButton (t[0]:`id(label), `opt(`notify), label));
+ foreach (term t, tabs, {
+ string label = t[1]:"Error";
+ tabbar = add (tabbar, `PushButton (t[0]:`id(label), `opt(`notify), label));
});
term buttonbox = `HBox(
`PushButton(`id(`add), `opt(`key_F3), Label::AddButton()),
`PushButton(`id(`edit), `opt(`disabled, `key_F4), Label::EditButton() ),
- `PushButton(`id(`delete), `opt(`disabled, `key_F5), Label::DeleteButton() )
+ `PushButton(`id(`delete), `opt(`disabled, `key_F5), Label::DeleteButton() )
);
+ term elements = `VBox(
+ `MinSize(10, 5,
+ `ReplacePoint(`id(`tabContent),
+ `Table( `id(`edutable), `opt(`notify, `vstretch), `header( "" ), [] )
+ )
+ ),
+ `VSpacing(0.5),
+ buttonbox
+ );
+
+ term elementsntabs = `Empty();
+ if (UI::HasSpecialWidget(`DumbTab))
+ {
+ elementsntabs = `DumbTab(tabs, elements);
+ }
+ else
+ {
+ elementsntabs = `VBox(tabbar, elements);
+ }
+
+
+ content = `VBox(
+ `VSpacing(0.5),
+ elementsntabs,
+ `VSpacing(0.5)
+ );
- content=`VBox(
- `VBox ( `VSpacing(0.5),
- `Left( tabbar ),
- `MinSize(10,5, `ReplacePoint(`id(`tabContent), `Table( `id(`edutable), `opt(`notify, `vstretch) ,
- `header( "" ), [] ))),
- `VSpacing(0.5),
- buttonbox,
- `VSpacing(0.5)
- )
- );
Wizard::SetContentsButtons(caption, content, HELPS["users"]:"",
Label::BackButton(), Label::FinishButton());
Modified: branches/tmp/jdsn/edu-users/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/edu-users/src/dialogs.ycp?rev=50410&r1=50409&r2=50410&view=diff
==============================================================================
--- branches/tmp/jdsn/edu-users/src/dialogs.ycp (original)
+++ branches/tmp/jdsn/edu-users/src/dialogs.ycp Wed Aug 27 15:05:51 2008
@@ -152,10 +152,10 @@
// fill table with data
//Popup::Notify(_("Users"));
- list<term> users = EduUsers::getUserItems();
+ list<term> users = EduUsers::getUserItemList();
y2milestone("USERSUSERSUSERS: %1", users);
- UI::ReplaceWidget(`id(`tabContent), `Table( `id(`edutable), `opt(`notify, `vstretch) , `header( _("Name"), _("Surname"), _("Login"), _("Age") ), users ) );
+ UI::ReplaceWidget(`id(`tabContent), `Table( `id(`edutable), `opt(`notify, `vstretch) , `header( _("Name"), _("Login"), _("Age") ), users ) );
any ret = nil;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org