Author: lslezak
Date: Wed Sep 10 15:33:29 2008
New Revision: 50956
URL: http://svn.opensuse.org/viewcvs/yast?rev=50956&view=rev
Log:
- repositories.ycp - enabling/disabling service, hide 'Priority' widget in
service mode
Modified:
trunk/packager/src/clients/repositories.ycp
Modified: trunk/packager/src/clients/repositories.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/repositories.ycp?rev=50956&r1=50955&r2=50956&view=diff
==============================================================================
--- trunk/packager/src/clients/repositories.ycp (original)
+++ trunk/packager/src/clients/repositories.ycp Wed Sep 10 15:33:29 2008
@@ -130,10 +130,13 @@
map generalData = Pkg::SourceGeneralData( id );
y2milestone("generalData(%1): %2", id, generalData);
- string alias = haskey(sourceStatesOut[index]:$[], "name") ?
+ y2internal("Item: %1", source);
+
+ string name = repository_mode ? (haskey(sourceStatesOut[index]:$[], "name") ?
sourceStatesOut[index,"name"]:"" :
// unkown name (alias) of the source
- generalData[ "alias" ]:generalData[ "type" ]: _("Unknown Name");
+ generalData[ "alias" ]:generalData[ "type" ]: _("Unknown Name"))
+ : source["name"]:"";
integer priority = source["priority"]:default_priority;
@@ -145,7 +148,7 @@
source[ "enabled" ]:true ? UI::Glyph (`CheckMark) : "",
source[ "autorefresh" ]:true ? UI::Glyph (`CheckMark) : "",
// translators: unknown name for a given source
- alias,
+ name,
source[ "url" ]:""
)
: `item(
@@ -154,7 +157,7 @@
source[ "enabled" ]:true ? UI::Glyph (`CheckMark) : "",
source[ "autorefresh" ]:true ? UI::Glyph (`CheckMark) : "",
// translators: unknown name for a given source
- alias,
+ name,
source[ "url" ]:""
);
@@ -291,6 +294,10 @@
map data = sourceStatesOut[selected]:$[];
fillRepoInfo (selected, data);
}
+ else
+ {
+ y2internal("TODO display service info");
+ }
}
/**
@@ -444,10 +451,12 @@
return `Table(`id(`table),`opt(`notify, `immediate), tabheader, []);
}
-void ReplaceTableWidget(boolean repo_mode)
+void ReplaceWidgets(boolean repo_mode)
{
y2milestone("Replacing the table widget");
UI::ReplaceWidget(`id(`tabrp), TableWidget(repo_mode));
+
+ UI::ReplaceWidget(`id(`priorp), repo_mode ? `IntField(`id(`priority), `opt(`notify), _("&Priority"), 0, 200, default_priority) : `Empty());
}
any SummaryDialog () {
@@ -498,7 +507,7 @@
`Left (`CheckBox (`id (`autorefresh), `opt(`notify), _("Automatically &Refresh")))
)
),
- `HSquash(`IntField(`id(`priority), `opt(`notify), _("&Priority"), 0, 200, default_priority)),
+ `HSquash(`ReplacePoint(`id(`priorp), `IntField(`id(`priority), `opt(`notify), _("&Priority"), 0, 200, default_priority))),
`HStretch()
),
`VSpacing (0.4),
@@ -836,17 +845,40 @@
}
else if (input == `enable)
{
- boolean state = sourceState[ "enabled" ]:true;
- state = !state;
- // corresponds to the "Enable/Disable" button
- string newstate = ( state ? UI::Glyph (`CheckMark) : "");
- UI::ChangeWidget( `id( `table ), `Item( current, 1 ), newstate );
- sourceState[ "enabled" ] = state;
- sourceStatesOut[ current ] = sourceState;
+ if (repository_view)
+ {
+ boolean state = sourceState[ "enabled" ]:true;
+ state = !state;
+ // corresponds to the "Enable/Disable" button
+ string newstate = ( state ? UI::Glyph (`CheckMark) : "");
+ UI::ChangeWidget( `id( `table ), `Item( current, 1 ), newstate );
+ sourceState[ "enabled" ] = state;
+ sourceStatesOut[ current ] = sourceState;
- if (full_mode)
+ if (full_mode)
+ {
+ Pkg::SourceSetEnabled(sourceState["SrcId"]:-1, state);
+ }
+ }
+ else
{
- Pkg::SourceSetEnabled(sourceState["SrcId"]:-1, state);
+ if (displayed_service == "")
+ {
+ map