Author: jsuchome
Date: Mon Dec 13 18:53:37 2010
New Revision: 62988
URL: http://svn.opensuse.org/viewcvs/yast?rev=62988&view=rev
Log:
YaST module for filesystem snapshots manipulations
Added:
branches/tmp/jsuchome/snapper/
branches/tmp/jsuchome/snapper/MAINTAINER
branches/tmp/jsuchome/snapper/Makefile.cvs
branches/tmp/jsuchome/snapper/RPMNAME
branches/tmp/jsuchome/snapper/VERSION
branches/tmp/jsuchome/snapper/_cvsignore
branches/tmp/jsuchome/snapper/agents/
branches/tmp/jsuchome/snapper/agents/Makefile.am
branches/tmp/jsuchome/snapper/agents/_cvsignore
branches/tmp/jsuchome/snapper/configure.in.in
branches/tmp/jsuchome/snapper/doc/
branches/tmp/jsuchome/snapper/doc/Makefile.am
branches/tmp/jsuchome/snapper/doc/_cvsignore
branches/tmp/jsuchome/snapper/doc/autodocs/
branches/tmp/jsuchome/snapper/doc/autodocs/Makefile.am
branches/tmp/jsuchome/snapper/doc/autodocs/_cvsignore
branches/tmp/jsuchome/snapper/package/
branches/tmp/jsuchome/snapper/package/_cvsignore
branches/tmp/jsuchome/snapper/package/yast2-snapper.changes
branches/tmp/jsuchome/snapper/src/
branches/tmp/jsuchome/snapper/src/Makefile.am
branches/tmp/jsuchome/snapper/src/Snapper.ycp (with props)
branches/tmp/jsuchome/snapper/src/_cvsignore
branches/tmp/jsuchome/snapper/src/dialogs.ycp (with props)
branches/tmp/jsuchome/snapper/src/helps.ycp (with props)
branches/tmp/jsuchome/snapper/src/snapper.desktop
branches/tmp/jsuchome/snapper/src/snapper.ycp (with props)
branches/tmp/jsuchome/snapper/src/wizards.ycp (with props)
branches/tmp/jsuchome/snapper/testsuite/
branches/tmp/jsuchome/snapper/testsuite/Makefile.am
branches/tmp/jsuchome/snapper/testsuite/_cvsignore
branches/tmp/jsuchome/snapper/testsuite/tests/
branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.err
branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.out
branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.ycp (with props)
branches/tmp/jsuchome/snapper/testsuite/tests/_cvsignore
branches/tmp/jsuchome/snapper/yast2-snapper.spec.in
Added: branches/tmp/jsuchome/snapper/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/MAINTAINER?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/MAINTAINER (added)
+++ branches/tmp/jsuchome/snapper/MAINTAINER Mon Dec 13 18:53:37 2010
@@ -0,0 +1 @@
+Jiri Suchomel
Added: branches/tmp/jsuchome/snapper/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/Makefile.cvs?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/Makefile.cvs (added)
+++ branches/tmp/jsuchome/snapper/Makefile.cvs Mon Dec 13 18:53:37 2010
@@ -0,0 +1,22 @@
+#
+# Makefile.cvs
+#
+PREFIX = /usr
+
+LIB = $(shell y2tool get-lib)
+
+configure: all
+ ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB)
+
+all:
+ y2tool y2autoconf
+ y2tool y2automake
+ autoreconf --force --install
+
+install: configure
+ make
+ make install
+
+reconf: all
+ ./config.status --recheck
+ ./config.status
Added: branches/tmp/jsuchome/snapper/RPMNAME
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/RPMNAME?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/RPMNAME (added)
+++ branches/tmp/jsuchome/snapper/RPMNAME Mon Dec 13 18:53:37 2010
@@ -0,0 +1 @@
+yast2-snapper
Added: branches/tmp/jsuchome/snapper/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/VERSION?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/VERSION (added)
+++ branches/tmp/jsuchome/snapper/VERSION Mon Dec 13 18:53:37 2010
@@ -0,0 +1 @@
+2.15.0
Added: branches/tmp/jsuchome/snapper/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/_cvsignore?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/_cvsignore (added)
+++ branches/tmp/jsuchome/snapper/_cvsignore Mon Dec 13 18:53:37 2010
@@ -0,0 +1,20 @@
+Makefile
+Makefile.am
+Makefile.am.common
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.h.in
+config.log
+config.status
+config.sub
+configure
+configure.in
+depcomp
+install-sh
+missing
+mkinstalldirs
+stamp-h
+snapper.pot
+autom4te.cache
Added: branches/tmp/jsuchome/snapper/agents/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/agents/Makefile.am?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/agents/Makefile.am (added)
+++ branches/tmp/jsuchome/snapper/agents/Makefile.am Mon Dec 13 18:53:37 2010
@@ -0,0 +1,7 @@
+# Makefile.am for snapper/agents
+
+agent_SCRIPTS =
+
+scrconf_DATA =
+
+EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)
Added: branches/tmp/jsuchome/snapper/agents/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/agents/_cvsignore?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/agents/_cvsignore (added)
+++ branches/tmp/jsuchome/snapper/agents/_cvsignore Mon Dec 13 18:53:37 2010
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: branches/tmp/jsuchome/snapper/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/configure.in.in?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/configure.in.in (added)
+++ branches/tmp/jsuchome/snapper/configure.in.in Mon Dec 13 18:53:37 2010
@@ -0,0 +1,12 @@
+## YCP module configure.in.in
+
+## Initialize
+@YAST2-INIT-COMMON@
+@YAST2-INIT-YCP@
+
+## some common checks
+@YAST2-CHECKS-COMMON@
+@YAST2-CHECKS-YCP@
+
+## and generate the output...
+@YAST2-OUTPUT@
Added: branches/tmp/jsuchome/snapper/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/doc/Makefile.am?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/doc/Makefile.am (added)
+++ branches/tmp/jsuchome/snapper/doc/Makefile.am Mon Dec 13 18:53:37 2010
@@ -0,0 +1,10 @@
+# Makefile.am for snapper/doc
+
+SUBDIRS = autodocs
+
+htmldir = $(docdir)
+
+doc_DATA =
+html_DATA =
+
+EXTRA_DIST = $(doc_DATA) $(html_DATA)
Added: branches/tmp/jsuchome/snapper/doc/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/doc/_cvsignore?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/doc/_cvsignore (added)
+++ branches/tmp/jsuchome/snapper/doc/_cvsignore Mon Dec 13 18:53:37 2010
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: branches/tmp/jsuchome/snapper/doc/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/doc/autodocs/Makefile.am?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/doc/autodocs/Makefile.am (added)
+++ branches/tmp/jsuchome/snapper/doc/autodocs/Makefile.am Mon Dec 13 18:53:37 2010
@@ -0,0 +1,3 @@
+# Makefile.am for snapper/doc/autodocs
+
+include $(top_srcdir)/autodocs-ycp.ami
Added: branches/tmp/jsuchome/snapper/doc/autodocs/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/doc/autodocs/_cvsignore?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/doc/autodocs/_cvsignore (added)
+++ branches/tmp/jsuchome/snapper/doc/autodocs/_cvsignore Mon Dec 13 18:53:37 2010
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.html
Added: branches/tmp/jsuchome/snapper/package/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/package/_cvsignore?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/package/_cvsignore (added)
+++ branches/tmp/jsuchome/snapper/package/_cvsignore Mon Dec 13 18:53:37 2010
@@ -0,0 +1,2 @@
+*.spec
+*.bz2
Added: branches/tmp/jsuchome/snapper/package/yast2-snapper.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/package/yast2-snapper.changes?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/package/yast2-snapper.changes (added)
+++ branches/tmp/jsuchome/snapper/package/yast2-snapper.changes Mon Dec 13 18:53:37 2010
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------
+Mon Dec 13 18:51:43 2010 - jsuchome@suse.cz
+
+- initial version
Added: branches/tmp/jsuchome/snapper/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/Makefile.am?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/src/Makefile.am (added)
+++ branches/tmp/jsuchome/snapper/src/Makefile.am Mon Dec 13 18:53:37 2010
@@ -0,0 +1,31 @@
+# Makefile.am for snapper/src
+
+yncludedir = @yncludedir@/snapper
+
+client_DATA = \
+ snapper.ycp \
+ snapper_auto.ycp \
+ snapper_proposal.ycp
+
+ynclude_DATA = \
+ helps.ycp \
+ wizards.ycp \
+ dialogs.ycp \
+ complex.ycp
+
+desktop_DATA = \
+ snapper.desktop
+
+module_DATA = \
+ Snapper.ycp \
+ Snapper2.pm \
+ Snapper3.py
+
+# create a symlink for local build, #145327
+snapper:
+ ln -sf . $@
+ycpchook = snapper
+
+EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA)
+
+include $(top_srcdir)/Makefile.am.common
Added: branches/tmp/jsuchome/snapper/src/Snapper.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/Snapper.ycp?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/src/Snapper.ycp (added)
+++ branches/tmp/jsuchome/snapper/src/Snapper.ycp Mon Dec 13 18:53:37 2010
@@ -0,0 +1,125 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: modules/Snapper.ycp
+ * Summary: Snapper settings, input and output functions
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ *
+ * Representation of the configuration of snapper.
+ * Input and output routines.
+ */
+
+{
+
+module "Snapper";
+textdomain "snapper";
+
+import "Progress";
+import "Report";
+import "Summary";
+import "Message";
+
+
+
+global list<map> snapshots = [];
+
+/**
+ * Read all snapper settings
+ * @return true on success
+ */
+global boolean Read() {
+
+ /* Snapper read dialog caption */
+ string caption = _("Initializing Snapper");
+
+ integer steps = 2;
+
+ // We do not set help text here, because it was set outside
+ Progress::New( caption, " ", steps, [
+ /* Progress stage 1/3 */
+ _("Read the list of snapshots"),
+ ], [
+ /* Progress step 1/3 */
+ _("Reading the database..."),
+ /* Progress finished */
+ _("Finished")
+ ],
+ ""
+ );
+
+ Progress::NextStage();
+ // read database
+
+ snapshots = [
+ $[
+ "name" : "first",
+ "description" : "description of first snapshot",
+ "date" : "2010-10-10",
+ ],
+ $[
+ "name" : "second",
+ "description" : "YaST Users called",
+ "date" : "2010-11-11",
+ ]
+ ];
+
+ Progress::NextStage();
+ return true;
+}
+
+/**
+ * Write all snapper settings
+ * @return true on success
+ */
+global boolean Write() {
+
+ /* Snapper read dialog caption */
+ string caption = _("Saving snapper Configuration");
+
+ integer steps = 2;
+
+ Progress::New(caption, " ", steps, [
+ /* Progress stage 1/2 */
+ _("Write the settings"),
+ /* Progress stage 2/2 */
+ _("Run SuSEconfig")
+ ], [
+ /* Progress step 1/2 */
+ _("Writing the settings..."),
+ /* Progress step 2/2 */
+ _("Running SuSEconfig..."),
+ /* Progress finished */
+ _("Finished")
+ ],
+ ""
+ );
+
+ Progress::NextStage();
+ Progress::NextStage ();
+ Progress::NextStage();
+ return true;
+}
+
+
+/* EOF */
+}
Added: branches/tmp/jsuchome/snapper/src/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/_cvsignore?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/src/_cvsignore (added)
+++ branches/tmp/jsuchome/snapper/src/_cvsignore Mon Dec 13 18:53:37 2010
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep
Added: branches/tmp/jsuchome/snapper/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/dialogs.ycp?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/src/dialogs.ycp (added)
+++ branches/tmp/jsuchome/snapper/src/dialogs.ycp Mon Dec 13 18:53:37 2010
@@ -0,0 +1,332 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/snapper/dialogs.ycp
+ * Package: Configuration of snapper
+ * Summary: Dialogs definitions
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ */
+
+{
+
+textdomain "snapper";
+
+import "Label";
+import "Popup";
+import "Wizard";
+import "Snapper";
+
+include "snapper/helps.ycp";
+
+boolean ReallyAbort() {
+ return Popup::ReallyAbort(true);
+}
+
+/**
+ * Read settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol ReadDialog() {
+ Wizard::RestoreHelp(HELPS["read"]:"");
+ boolean ret = Snapper::Read();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Write settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol WriteDialog() {
+ Wizard::RestoreHelp(HELPS["write"]:"");
+ boolean ret = Snapper::Write();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Summary dialog
+ * @return dialog result
+ */
+any SummaryDialog() {
+
+ /* summary dialog caption */
+ string caption = _("Snapshots");
+
+ list<map> snapshots = Snapper::snapshots;
+ list snapshot_items = maplist (map s, snapshots, ``{
+ return `item (`id (s["name"]:""), s["date"]:"", s["name"]:"", s["description"]:"");
+ });
+
+ term contents = `VBox (
+ `Table (`id (`snapshots_table), `opt(`notify), `header (
+ // table header
+ _("Date"), _("Name"), _("Description")),
+ snapshot_items
+ ),
+ `HBox (
+ `PushButton (`id (`add), Label::NewButton ()),
+ `PushButton (`id (`show), _("Show")),
+ `PushButton (`id (`edit), Label::EditButton ()),
+ `Right (`PushButton (`id (`rollback), _("Rollback")))
+ )
+ );
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["summary"]:"",
+ Label::BackButton(), Label::FinishButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ if (ret == `snapshots_table) {
+ ret = `show;
+ }
+ if(ret == `abort || ret == `cancel || ret == `back) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ else if (ret == `add || ret == `show) {
+ break;
+ }
+ else if(ret == `next) {
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * @return dialog result
+ */
+any ShowDialog () {
+
+ // dialog caption
+ string caption = _("Selected Snapshot Overview");
+
+ term contents = `HBox (
+ `HWeight (1, `ReplacePoint (`id (`treeContents), `Top (`HBox ()))),
+ `HWeight (2, `ReplacePoint (`id (`entryContents), `Top (`HBox ())))
+ );
+ map display_info = UI::GetDisplayInfo ();
+ boolean textmode = display_info["TextMode"]:false;
+ string current = "";
+
+ // map of already read files
+ map files = $[];
+ // currently read subtree
+ list<string> subtree = [];
+ list<term> tree_items = [];
+ map open_items = $[];
+ string root = "/";
+ // information about selected file
+ map file_data = $[];
+
+ // FIXME how to get list of top directories?
+ tree_items = maplist (string dir, [ "/etc", "/opt", "/var", "/tmp"], {
+ return `item (`id(dir), dir, false, []);
+ });
+
+ // helper for set_tree_term function: create new items for subtrees
+ define list<term> update_items (list<term> its) {
+
+ return maplist (term it, its, {
+ string file = it[0,0]:"";
+ if (file == current)
+ {
+ return `item (`id(file), file, true,
+ maplist (string k, subtree, ``(
+ `item (`id(k), k, false, []))
+ )
+ );
+ }
+ integer last = size (it) - 1;
+ if (size (it[last]:[]) == 0)
+ return it;
+ // `OpenItems doesn't work in ncurses...
+ boolean open = haskey (open_items, file) && !textmode;
+ return `item (
+ `id(file), file, open, update_items (it[last]:[]));
+ });
+ }
+
+ // create the term with filesystem tree
+ define void set_tree_term () {
+
+ term cont = `HBox (`VSpacing (20), `VBox (`HSpacing(70),
+ `VSpacing (0.2),
+ `HBox (
+ `HSpacing (),
+ `ReplacePoint (`id (`reptree), `Tree (`id(`tree), root, [])),
+ `ReplacePoint (`id (`repbuttons), `Empty ()),
+ `HSpacing ()
+ ),
+ `HBox (
+ `HSpacing (1.5),
+ `HStretch (),
+ textmode ?
+ // button label
+ `PushButton (`id (`open), `opt (`key_F6),_("&Open")):
+ `Empty (),
+ `HSpacing (1.5)
+ ),
+ `VSpacing (0.6)
+ ));
+
+ UI::ReplaceWidget (`treeContents, cont);
+
+ if (size (tree_items) > 0)
+ {
+ UI::ReplaceWidget (`id (`reptree), textmode ?
+ `Tree (`id(`tree), root, tree_items) :
+ `Tree (`id(`tree), `opt(`notify), root, tree_items));
+ // no item is selected
+ UI::ChangeWidget (`tree, `CurrentItem, nil);
+ }
+
+ if (textmode)
+ UI::SetFocus (`id(`tree));
+
+ if (current != "")
+ UI::ChangeWidget (`id(`tree), `CurrentItem, current);
+ }
+
+ // create the term for selected file
+ define void set_entry_term () {
+
+ list items = [];
+
+ term cont = `Label ("info about " + current);
+
+ UI::ReplaceWidget (`entryContents, cont);
+
+ }
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["show"]:"",
+ Label::BackButton(), Label::NextButton());
+
+ set_tree_term ();
+
+ current = (string) UI::QueryWidget (`id(`tree), `CurrentItem);
+ if (current == nil) current = "";
+
+ set_entry_term ();
+ if (textmode)
+ UI::SetFocus (`id(`tree));
+
+ any ret = nil;
+ while(true) {
+
+ map event = UI::WaitForEvent ();
+ ret = (symbol) event["ID"]:nil;
+
+ current = (string) UI::QueryWidget (`id(`tree),`CurrentItem);
+ if (current == nil)
+ current = "";
+
+ // events in tree
+ if (ret == `tree)
+ {
+ if (! files[current]:false)
+ {
+ UI::BusyCursor ();
+ subtree = []; // FIXME read files under current
+
+ files [current] = true;
+ if (size (subtree) > 0)
+ {
+ open_items = (map) UI::QueryWidget (`tree, `OpenItems);
+ tree_items = update_items (tree_items);
+ UI::ReplaceWidget (`id (`reptree), textmode ?
+ `Tree (`id(`tree), root, tree_items) :
+ `Tree (`id(`tree), `opt(`notify), root, tree_items));
+ UI::ChangeWidget (`id(`tree), `CurrentItem, current);
+ open_items = $[];
+ }
+ current = (string) UI::QueryWidget (`id(`tree),`CurrentItem);
+ if (current == nil) current = "";
+ }
+ file_data = // FIXME read data for current item
+ set_entry_term ();
+ UI::NormalCursor ();
+ if (textmode)
+ UI::SetFocus (`id(`tree));
+ }
+ else if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ else if(ret == `next || ret == `back) {
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+/**
+ * @return dialog result
+ */
+any ConfigureDialog () {
+
+ // dialog caption
+ string caption = _("Creating Snapshot");
+
+ term contents = `Label (_("Here, enter data for new snapshot"));
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["add"]:"",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ else if(ret == `next || ret == `back) {
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+
+
+/* EOF */
+}
Added: branches/tmp/jsuchome/snapper/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/helps.ycp?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/src/helps.ycp (added)
+++ branches/tmp/jsuchome/snapper/src/helps.ycp Mon Dec 13 18:53:37 2010
@@ -0,0 +1,61 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/snapper/helps.ycp
+ * Package: Configuration of snapper
+ * Summary: Help texts of all the dialogs
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ */
+
+{
+
+textdomain "snapper";
+
+/**
+ * All helps are here
+ */
+map HELPS = $[
+
+ /* Read dialog help 1/2 */
+ "read" : _("<p><b><big>Initializing snapper Configuration</big></b><br>
+Please wait...<br></p>
+"),
+ /* Write dialog help 1/2 */
+ "write" : _("<p><b><big>Saving snapper Configuration</big></b><br>
+Please wait...<br></p>
+"),
+
+ /* Summary dialog help 1/3 */
+ "summary" : _("<p><b><big>Snapper Configuration</big></b><br>
+Configure snapper here.<br></p>
+"),
+
+ /* Add dialog help */
+ "add" : _("<p><b><big>Creating new snapshot</big></b><br>
+Press <b>Next</b> to continue.
+<br></p>"),
+
+];
+
+/* EOF */
+}
Added: branches/tmp/jsuchome/snapper/src/snapper.desktop
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/snapper.desktop?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/src/snapper.desktop (added)
+++ branches/tmp/jsuchome/snapper/src/snapper.desktop Mon Dec 13 18:53:37 2010
@@ -0,0 +1,25 @@
+[Desktop Entry]
+Type=Application
+Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;
+
+X-KDE-ModuleType=Library
+X-KDE-RootOnly=true
+X-KDE-HasReadOnlyMode=true
+X-KDE-Library=yast2
+X-SuSE-YaST-Call=snapper
+
+X-SuSE-YaST-Group=Misc
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=snapper
+
+Icon=yast-snapper
+Exec=/sbin/yast2 snapper
+
+Name=Snapper
+GenericName=snapper
+X-KDE-SubstituteUID=true
+StartupNotify=true
Added: branches/tmp/jsuchome/snapper/src/snapper.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/snapper.ycp?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/src/snapper.ycp (added)
+++ branches/tmp/jsuchome/snapper/src/snapper.ycp Mon Dec 13 18:53:37 2010
@@ -0,0 +1,90 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/snapper.ycp
+ * Package: Configuration of snapper
+ * Summary: Main file
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ *
+ * Main file for snapper configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of snapper</h3>
+ */
+
+textdomain "snapper";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("Snapper module started");
+
+import "Progress";
+import "Report";
+import "Summary";
+
+import "CommandLine";
+include "snapper/wizards.ycp";
+
+map cmdline_description = $[
+ "id" : "snapper",
+ /* Command line help text for the Xsnapper module */
+ "help" : _("Configuration of snapper"),
+ "guihandler" : SnapperSequence,
+ "initialize" : Snapper::Read,
+ "finish" : Snapper::Write,
+ "actions" : $[
+ // FIXME TODO: fill the functionality description here
+ ],
+ "options" : $[
+ // FIXME TODO: fill the option descriptions here
+ ],
+ "mappings" : $[
+ // FIXME TODO: fill the mappings of actions and options here
+ ]
+];
+
+/* is this proposal or not? */
+boolean propose = false;
+list args = WFM::Args();
+if(size(args) > 0) {
+ if(is(WFM::Args(0), path) && WFM::Args(0) == .propose) {
+ y2milestone("Using PROPOSE mode");
+ propose = true;
+ }
+}
+
+/* main ui function */
+any ret = CommandLine::Run(cmdline_description);
+y2debug("ret=%1", ret);
+
+/* Finish */
+y2milestone("Snapper module finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: branches/tmp/jsuchome/snapper/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/wizards.ycp?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/src/wizards.ycp (added)
+++ branches/tmp/jsuchome/snapper/src/wizards.ycp Mon Dec 13 18:53:37 2010
@@ -0,0 +1,133 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/snapper/wizards.ycp
+ * Package: Configuration of snapper
+ * Summary: Wizards definitions
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ */
+
+{
+
+textdomain "snapper";
+
+import "Sequencer";
+import "Wizard";
+
+include "snapper/dialogs.ycp";
+
+/**
+ * Add a configuration of snapper
+ * @return sequence result
+ */
+any AddSequence() {
+
+ map aliases = $[
+ "config" : ``(ConfigureDialog()),
+ ];
+
+ map sequence = $[
+ "ws_start" : "config",
+ "config" : $[
+ `abort : `abort,
+ `next : `next,
+ ],
+ ];
+
+ return Sequencer::Run(aliases, sequence);
+}
+
+/**
+ * Main workflow of the snapper configuration
+ * @return sequence result
+ */
+any MainSequence() {
+
+ map aliases = $[
+ "summary" : ``( SummaryDialog() ),
+ "show" : ``( ShowDialog() ),
+ "add" : [ ``( AddSequence() ), true ],
+ ];
+
+ map sequence = $[
+ "ws_start" : "summary",
+ "summary" : $[
+ `abort : `abort,
+ `next : `next,
+ `add : "add",
+ `show : "show",
+ ],
+ "add" : $[
+ `abort : `abort,
+ `next : "summary",
+ ],
+ "show" : $[
+ `abort : `abort,
+ `next : "summary",
+ ],
+ ];
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ return ret;
+}
+
+/**
+ * Whole configuration of snapper
+ * @return sequence result
+ */
+any SnapperSequence() {
+
+ map aliases = $[
+ "read" : [ ``( ReadDialog() ), true ],
+ "main" : ``( MainSequence() ),
+ "write" : [ ``( WriteDialog() ), true ]
+ ];
+
+ map sequence = $[
+ "ws_start" : "read",
+ "read" : $[
+ `abort : `abort,
+ `next : "main"
+ ],
+ "main" : $[
+ `abort : `abort,
+ `next : "write"
+ ],
+ "write" : $[
+ `abort : `abort,
+ `next : `next
+ ]
+ ];
+
+ Wizard::CreateDialog();
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ UI::CloseDialog();
+ return ret;
+}
+
+
+/* EOF */
+}
Added: branches/tmp/jsuchome/snapper/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/testsuite/Makefile.am?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/testsuite/Makefile.am (added)
+++ branches/tmp/jsuchome/snapper/testsuite/Makefile.am Mon Dec 13 18:53:37 2010
@@ -0,0 +1,21 @@
+#
+# Makefile.am for .../testsuite
+#
+# Do not edit this file (Makefile.am) as it will be overwritten!
+#
+
+AUTOMAKE_OPTIONS = dejagnu
+EXTRA_DIST = $(wildcard tests/*.out) $(wildcard tests/*.err) $(wildcard tests/*.ycp) $(wildcard tests/*.yh)
+
+testsuite_prepare = @ydatadir@/testsuite/Makefile.testsuite
+
+all-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir)
+
+clean-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) clean
+
+check-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) check
+
+# EOF
Added: branches/tmp/jsuchome/snapper/testsuite/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/testsuite/_cvsignore?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/testsuite/_cvsignore (added)
+++ branches/tmp/jsuchome/snapper/testsuite/_cvsignore Mon Dec 13 18:53:37 2010
@@ -0,0 +1,11 @@
+Makefile
+Makefile.in
+site.exp
+*.sum
+*.log
+tmp.out*
+tmp.err*
+tmp.log*
+config
+run
+*.test
Added: branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.err
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.err?rev=62988&view=auto
==============================================================================
(empty)
Added: branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.out
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.out?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.out (added)
+++ branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.out Mon Dec 13 18:53:37 2010
@@ -0,0 +1,2 @@
+Dump Snapper::Modified
+Return false
Added: branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.ycp?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.ycp (added)
+++ branches/tmp/jsuchome/snapper/testsuite/tests/Snapper.ycp Mon Dec 13 18:53:37 2010
@@ -0,0 +1,13 @@
+{
+
+// testedfiles: Snapper.ycp
+
+include "testsuite.ycp";
+TESTSUITE_INIT([], nil);
+
+import "Snapper";
+
+DUMP("Snapper::Modified");
+TEST(``(Snapper::Modified()), [], nil);
+
+}
Added: branches/tmp/jsuchome/snapper/testsuite/tests/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/testsuite/tests/_cvsignore?rev=62988&view=auto
==============================================================================
(empty)
Added: branches/tmp/jsuchome/snapper/yast2-snapper.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/yast2-snapper.spec.in?rev=62988&view=auto
==============================================================================
--- branches/tmp/jsuchome/snapper/yast2-snapper.spec.in (added)
+++ branches/tmp/jsuchome/snapper/yast2-snapper.spec.in Mon Dec 13 18:53:37 2010
@@ -0,0 +1,31 @@
+@HEADER-COMMENT@
+
+@HEADER@
+Requires: yast2
+BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-testsuite
+
+BuildArchitectures: noarch
+
+Summary: Configuration of snapper
+
+%description
+-
+
+@PREP@
+
+@BUILD@
+
+@INSTALL@
+
+@CLEAN@
+
+%files
+%defattr(-,root,root)
+%dir @yncludedir@/snapper
+@yncludedir@/snapper/*
+@clientdir@/snapper.ycp
+@clientdir@/snapper_*.ycp
+@moduledir@/Snapper.*
+@moduledir@/Snapper2.*
+@desktopdir@/snapper.desktop
+%doc @docdir@
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org