Author: mzugec
Date: Wed Oct 27 10:16:02 2010
New Revision: 62689
URL: http://svn.opensuse.org/viewcvs/yast?rev=62689&view=rev
Log:
backported layout change for repository (bnc#510794)
Modified:
branches/SuSE-Code-11-SP1-Branch/packager/VERSION
branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes
branches/SuSE-Code-11-SP1-Branch/packager/src/clients/repositories.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/packager/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/packager/VERSION?rev=62689&r1=62688&r2=62689&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/packager/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/packager/VERSION Wed Oct 27 10:16:02 2010
@@ -1 +1 @@
-2.17.78
+2.17.79
Modified: branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes?rev=62689&r1=62688&r2=62689&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes Wed Oct 27 10:16:02 2010
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Oct 27 10:14:52 CEST 2010 - mzugec@suse.cz
+
+- backported layout change for repository (bnc#510794)
+- 2.17.79
+
+-------------------------------------------------------------------
Thu May 6 13:28:47 CEST 2010 - jsrain@suse.cz
- add hv_netvsc to MODULES_LOADED_ON_BOOT on HyperV (bnc#600792)
Modified: branches/SuSE-Code-11-SP1-Branch/packager/src/clients/repositories.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/packager/src/clients/repositories.ycp?rev=62689&r1=62688&r2=62689&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/packager/src/clients/repositories.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/packager/src/clients/repositories.ycp Wed Oct 27 10:16:02 2010
@@ -69,6 +69,8 @@
const string priority_label = _("&Priority");
+ const string keeppackages_label = _("Keep Downloaded Packages");
+
// current view:
// selected service (or empty) if all services are selected
string displayed_service = "";
@@ -207,6 +209,7 @@
"type" : generalData["type"]:"",
"priority" : source["priority"]:default_priority,
"service" : source["service"]:"",
+ "keeppackages" : source["keeppackages"]:false,
];
return out;
@@ -262,7 +265,14 @@
string url = sformat (_("URL: %1"), raw_url);
- return sformat("<P>%1<B><BIG>%2</BIG></B></P><P>%3</P><P>%4</P><P>%5</P>", icon_tag, name, url, category, service);
+ string ret = sformat("<P>%1<B><BIG>%2</BIG></B></P><P>%3</P><P>%4</P>", icon_tag, name, url, category);
+
+ if (service != "")
+ {
+ ret = ret + sformat("<P>%1</P>", service);
+ }
+
+ return ret;
}
term repoInfoTerm(string name, string url, string category, string service)
@@ -275,7 +285,7 @@
`Left(`Label(`id(`service), `opt(`hstretch), service))
)
:
- `VSquash(`MinHeight(7, `RichText(`id(`repo_info), "")));
+ `VSquash(`MinHeight(6, `RichText(`id(`repo_info), "")));
}
void fillRepoInfo(integer index, map source, boolean repo_mode, string service_name)
@@ -327,8 +337,9 @@
if (repo_mode)
{
- // priority is displayed only for repositories
+ // priority and keeppackages are displayed only for repositories
UI::ChangeWidget (`id (`priority), `Value, info["priority"]:default_priority);
+ UI::ChangeWidget (`id (`keeppackages), `Value, info["keeppackages"]:false);
}
}
@@ -497,7 +508,7 @@
// otherwise we will not get their details
list<integer> added = newSources (sourceStatesIn, sourceStatesOut);
list<integer> deleted = newSources (sourceStatesOut, sourceStatesIn);
- boolean have_rug = false;
+ boolean have_rug = !norug && (integer)SCR::Read (.target.size, "/usr/bin/rug") >= 0;
boolean any_changed = added != [] || deleted != []; // #217697
if (success && have_rug && any_changed) {
UI::OpenDialog (
@@ -551,28 +562,32 @@
return success;
}
-list<term> buildTree()
+list<term> buildList()
{
- list<term> ret = [];
-
- list<term> services_t = [];
+ list<term> ret = [
+ `item(`id(`all_repositories), _("All repositories")),
+ `item(`id(`all_services), _("All services"))
+ ];
foreach(map srv_state, serviceStatesOut,
{
- term t = `item(`id(srv_state["alias"]:""), srv_state["name"]:"");
- services_t = add(services_t, t);
+ term t = `item(`id(srv_state["alias"]:""), sformat(_("Service '%1'"), srv_state["name"]:""));
+ ret = add(ret, t);
}
);
- // alphabetically sort the repositories (by "name" key)
- // TODO FIXME: use lsort
-// repositories_t = sort(term repo1, term repo2, repositories_t, {y2internal("val: %1", repo1[1]:""); return repo1[1]:"" < repo2[1]:"";});
-
- return [
- // true = open the node
- `item(`id(`services), _("Services"), true, services_t),
- `item(`id(`repositories), _("Repositories"), true, [])
- ];
+ return ret;
+}
+
+term RepoFilterWidget()
+{
+ // combobox label
+ return `ComboBox(`id(`service_filter), `opt(`notify), _("View"), buildList());
+}
+
+void UpdateCombobox()
+{
+ UI::ReplaceWidget(`id(`filter_rp), RepoFilterWidget());
}
// return table widget definition
@@ -614,6 +629,7 @@
UI::ReplaceWidget(`id(`tabrp), TableWidget(repo_mode));
UI::ReplaceWidget(`id(`priorp), repo_mode ? `IntField(`id(`priority), `opt(`notify), priority_label, 0, 200, default_priority) : `Empty());
+ UI::ReplaceWidget(`id(`keeppkg_rp), repo_mode ? `CheckBox(`id(`keeppackages), `opt(`notify), keeppackages_label) : `Empty());
}
void RemoveReposFromService(string service_alias)
@@ -694,74 +710,59 @@
}
term contents =
- `HBox(
- `Tree(`id(`tree), `opt(`notify), "", buildTree()),
- `VBox(
- `HBox(
- `VSpacing(9),
- `ReplacePoint(`id(`tabrp), TableWidget(repository_view)),
- `HSpacing()
+ `VBox(
+ `Right(`ReplacePoint(`id(`filter_rp), RepoFilterWidget())),
+ `VWeight(1, `ReplacePoint(`id(`tabrp), TableWidget(repository_view))),
+ repoInfoTerm("", "", "", ""),
+
+ // label
+ `Left (`Label (_("Properties"))),
+
+ `HBox(
+ `HSquash(
+ `VBox(
+ // check box
+ `Left (`CheckBox (`id (`enable), `opt(`notify), _("&Enabled"))),
+ // check box
+ `Left (`CheckBox (`id (`autorefresh), `opt(`notify), _("Automatically &Refresh"))),
+ // check box
+ `Left(`ReplacePoint(`id(`keeppkg_rp), `CheckBox(`id(`keeppackages), `opt(`notify), keeppackages_label)))
+ )
),
- `HBox (
- `HSpacing(0.35),
- `HWeight (1, `Frame ("",
- `HBox (
- `HSpacing (1),
- `HWeight( 1, `VBox (
- repoInfoTerm("", "", "", ""),
- // label
- `Left (`Label (_("Properties"))),
- // check box
- `HBox(
- `HSquash(
- `VBox(
- `Left (`CheckBox (`id (`enable), `opt(`notify), _("&Enabled"))),
- // check box
- `Left (`CheckBox (`id (`autorefresh), `opt(`notify), _("Automatically &Refresh")))
- )
- ),
- `HSquash(`ReplacePoint(`id(`priorp), `IntField(`id(`priority), `opt(`notify), priority_label, 0, 200, default_priority))),
- `HStretch()
- ),
- `VSpacing (0.4),
- (have_rug) ?
- `Left (`CheckBox (`id (`zmdsync),
- // Checkbox label
- _("Synchronize Changes with &ZENworks"),
- !norug && sync_zmd))
- : `Empty()
- )),
- `HSpacing (0.4)
- )
- )),
- `HSpacing (1.35)
- ),
- `VSpacing(0.3),
- `HBox(
- `PushButton (`id (`add), `opt(`key_F3),
- Label::AddButton ()),
- `PushButton(`id(`replace), `opt(`key_F4),
- Label::EditButton ()),
- `PushButton (`id(`delete), `opt(`key_F5),
- Label::DeleteButton ()),
- `HStretch (),
- `PushButton (`id (`key_mgr), _("&GPG Keys...")),
+ `HSpacing(1),
+ `HSquash(`ReplacePoint(`id(`priorp), `IntField(`id(`priority), `opt(`notify), priority_label, 0, 200, default_priority))),
+ `HStretch()
+ ),
+ `VSpacing (0.4),
+
+ (have_rug) ?
+ // Checkbox label
+ `Left (`CheckBox (`id (`zmdsync), _("Synchronize Changes with &ZENworks"), !norug && sync_zmd))
+ : `Empty(),
+
+ `HBox(
+ `PushButton (`id (`add), `opt(`key_F3),
+ Label::AddButton ()),
+ `PushButton(`id(`replace), `opt(`key_F4),
+ Label::EditButton ()),
+ `PushButton (`id(`delete), `opt(`key_F5),
+ Label::DeleteButton ()),
+ `HStretch (),
+ // push button label
+ `PushButton (`id (`key_mgr), _("&GPG Keys...")),
+ // menu button label
+ `MenuButton (`id(`menu_button), `opt(`key_F6), _("Refresh"), [
+ `item(`id(`refresh), refreshButtonLabel ),
// menu button label
- `MenuButton (`id(`menu_button), `opt(`key_F6), _("Refresh"), [
- `item(`id(`refresh), refreshButtonLabel ),
- // menu button label
- `item(`id(`autorefresh_all), _("Refresh All Autor&efreshed")),
- // menu button label
- `item(`id(`refresh_enabled), _("Refresh All &Enabled"))
- ])
- ),
- `VSpacing( 0.5 )
+ `item(`id(`autorefresh_all), _("Refresh All Autor&efreshed")),
+ // menu button label
+ `item(`id(`refresh_enabled), _("Refresh All &Enabled"))
+ ])
)
);
// dialog caption
string title = _("Configured Software Repositories");
-// string title = _("Media Containing the Software Repository");
// help
string help_text = _("<p>
@@ -815,20 +816,21 @@
help_text = help_text + _("<P><B>Priority of a Repository</B><BR>
Priority of a repository is an integer value between 0 (the highest priority) and 200 (the lowest priority). Default priority is 99. If a package is available in more repositories the repository with the highest priority is used.</P>");
+ // help text, continued
help_text = help_text + _("<P>Use the tree displayed on the left side for navigation in repositories and services.</P>");
+ // help text, continued
+ help_text = help_text + _("<P><B>Keep Downloaded Packages</B><BR>Check this option to keep downloaded packages in a local cache so they can be reused later when the packages are reinstalled. If unchecked the downloaded packages are deleted after installation.</P>") + _("<P>The default local cache is located in directory <B>/var/cache/zypp/packages</B>, the location can be changed in <B>/etc/zypp/zypp.conf</B> file.</P>");
+
Wizard::SetNextButton(`next, Label::OKButton() );
Wizard::SetAbortButton(`abort, Label::CancelButton() );
Wizard::SetContents(title, contents, help_text, false, true);
- Wizard::DisableBackButton();
+ Wizard::HideBackButton();
fillTable(repository_view, displayed_service);
fillCurrentRepoInfo();
- // set the current view to repositories
- UI::ChangeWidget(`id(`tree), `CurrentItem, `repositories);
-
symbol input = nil;
integer current = -1;
@@ -923,23 +925,23 @@
// start the GPG key manager
//RunGPGKeyMgmt();
}
- else if (input == `tree)
+ else if (input == `service_filter)
{
- // handle tree events here...
- any current_item = UI::QueryWidget(`id(`tree), `CurrentItem);
+ // handle the combobox events here...
+ any current_item = UI::QueryWidget(`id(`service_filter), `Value);
// rebuild the dialog if needed
- y2milestone("Current tree item: %1", current_item);
+ y2milestone("Current combobox item: %1", current_item);
boolean update_table_widget = false;
- if (current_item == `repositories)
+ if (current_item == `all_repositories)
{
update_table_widget = !repository_view || displayed_service != "";
y2milestone("Switching to repository view");
repository_view = true;
displayed_service = "";
}
- else if (current_item == `services)
+ else if (current_item == `all_services)
{
update_table_widget = repository_view;
y2milestone("Switching to service view");
@@ -1106,8 +1108,8 @@
fillTable(repository_view, displayed_service);
fillCurrentRepoInfo();
- // refresh also the tree widget
- UI::ChangeWidget(`id(`tree), `Items, buildTree());
+ // refresh also the combobox widget
+ UpdateCombobox();
}
}
else
@@ -1143,8 +1145,8 @@
}
);
- // refresh also the tree widget
- UI::ChangeWidget(`id(`tree), `Items, buildTree());
+ // refresh also the combobox widget
+ UpdateCombobox();
}
}
@@ -1293,8 +1295,8 @@
fillTable(repository_view, displayed_service);
fillCurrentRepoInfo();
- // refresh also the tree widget
- UI::ChangeWidget(`id(`tree), `Items, buildTree());
+ // refresh also the combobox widget
+ UpdateCombobox();
}
}
}
@@ -1402,6 +1404,25 @@
y2error("Ignoring event `priority: the widget should NOT be displayed in service mode!");
}
}
+ else if (input == `keeppackages)
+ {
+ if (repository_view)
+ {
+ // refresh the value in the table
+ boolean new_keep = (boolean)UI::QueryWidget(`id(`keeppackages), `Value);
+ y2internal("New keep packages option: %1", new_keep);
+
+ sourceState[ "keeppackages" ] = new_keep;
+ sourceStatesOut[ global_current ] = sourceState;
+
+ // do not refresh the item in the table
+ current = -1;
+ }
+ else
+ {
+ y2error("Ignoring event `keeppackages: the widget should NOT be displayed in service mode!");
+ }
+ }
else if (input != `table)
{
y2warning("Unknown user input: %1", input);
@@ -1451,7 +1472,7 @@
}
else
{
- selected_url_scheme = URL::Parse(SourceDialogs::GetRawURL())["scheme"]:"";
+ selected_url_scheme = URL::Parse(SourceDialogs::GetURL())["scheme"]:"";
y2milestone("Selected URL scheme: %1", selected_url_scheme);
if (selected_url_scheme == nil || selected_url_scheme == "")
@@ -1488,7 +1509,7 @@
// main function - start the workflow
symbol StartInstSource()
{
- have_rug = false;
+ have_rug = (integer)SCR::Read (.target.size, "/usr/bin/rug") >= 0;
norug = !have_rug || (size(WFM::Args()) > 0 && WFM::Args(0) == "norug");
Wizard::CreateDialog();
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org