Author: jsuchome Date: Thu Feb 24 11:01:57 2011 New Revision: 63464 URL: http://svn.opensuse.org/viewcvs/yast?rev=63464&view=rev Log: help texts, 2 restore buttons for snapshot couple Modified: branches/tmp/jsuchome/snapper/src/dialogs.ycp branches/tmp/jsuchome/snapper/src/helps.ycp Modified: branches/tmp/jsuchome/snapper/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/dialogs.ycp?rev=63464&r1=63463&r2=63464&view=diff ============================================================================== --- branches/tmp/jsuchome/snapper/src/dialogs.ycp (original) +++ branches/tmp/jsuchome/snapper/src/dialogs.ycp Thu Feb 24 11:01:57 2011 @@ -70,7 +70,6 @@ integer i = -1; list snapshot_items = []; -// list coupled_snapshot_items = []; foreach (map s, snapshots, { i = i + 1; @@ -106,25 +105,8 @@ }); term contents = `VBox ( - /* - // table label - `Left (`Label (_("Single Snapshots"))), - `Table (`id (`single_snapshots_table), `opt(`notify, `keepSorting), `header ( - // table header - _("Date"), _("Number"), _("Description")), - single_snapshot_items - ), - `HBox ( - `PushButton (`id (`show_s), _("Show Changes")), - `HStretch () - ), - `VSpacing (0.5), - // table label - `Left (`Label (_("Coupled Snapshots"))), - */ `Table (`id (`snapshots_table), `opt(`notify, `keepSorting), `header ( // table header -// _("Pre ID"), _("Start Date"), _("Post ID"), _("End Date"), _("Description")), _("ID"), _("Type"), _("Start Date"), _("End Date"), _("Description")), snapshot_items ), @@ -140,10 +122,6 @@ Wizard::HideAbortButton (); UI::SetFocus (`id (`snapshots_table)); - /* - if (coupled_snapshot_items == [] && single_snapshot_items != []) - UI::SetFocus (`id (`single_snapshots_table)); - */ any ret = nil; while(true) { @@ -152,16 +130,6 @@ integer selected = 0; - /* - if (ret == `single_snapshots_table || ret == `coupled_snapshots_table) { - selected = (integer) UI::QueryWidget (`id (ret), `CurrentItem); - ret = `show; - } - if (ret == `show_s) { - selected = (integer) UI::QueryWidget (`id (`single_snapshots_table), `CurrentItem); - ret = `show; - } - */ if (ret == `show_c || ret == `snapshots_table) { selected = (integer) UI::QueryWidget (`id (`snapshots_table), `CurrentItem); ret = `show; @@ -233,7 +201,10 @@ { to = snapshot["post_num"]:0; } + // busy popup message + Popup::ShowFeedback ("", _("Calculating changed files...")); snapshot["files"] = Snapper::ReadModifiedFiles (from, to); + Popup::ClearFeedback (); file_list = snapshot["files"]:[]; // update the global snapshots list Snapper::snapshots[Snapper::selected_snapshot_index] = snapshot; @@ -341,8 +312,12 @@ } UI::ReplaceWidget (`id (`diff_content), `HBox (`HSpacing (0.5), `VBox ( content, - // button label - `VSquash (`Right (`PushButton (`id (`restore), _("Restore")))) + `VSquash (`HBox ( + `HStretch (), + type == `SINGLE ? `Empty () : `PushButton (`id (`restore_pre), _("Restore From First")), + // button label + `PushButton (`id (`restore), type == `SINGLE ? _("Restore") : _("Restore From Second")) + )) ), `HSpacing (0.5)) ); } @@ -435,7 +410,8 @@ ); // show the dialog contents with empty tree, compute items later - Wizard::SetContentsButtons (caption, contents, HELPS["show"]:"", + Wizard::SetContentsButtons (caption, contents, + type == `SINGLE ? HELPS["show_single"]:"" : HELPS["show_couple"]:"", // button label Label::CancelButton(), _("Restore Selected")); @@ -550,12 +526,27 @@ else if (ret == `abort || ret == `cancel || ret == `back) { break; } + else if (ret == `restore_pre) { + // yes/no question, %1 is file name, %2 is number + if (Popup::YesNo (sformat ("Do you want to copy the file + +%1 + +from snapshot '%2' to current system?", current_file, previous_num))) + { + Snapper::RestoreFiles (previous_num, [current_file]); + } + continue; + } else if (ret == `restore) { - if (Popup::YesNo (sformat ("Do you want to copy the file '%1' from snapshot '%2' to current system? + // yes/no question, %1 is file name, %2 is number + if (Popup::YesNo (sformat ("Do you want to copy the file + +%1 -This will probably break your system. Are you sure?", current_file, snapshot_name))) +from snapshot '%2' to current system?", current_file, snapshot_num))) { - y2milestone ("restoring file %1...", current_file); + Snapper::RestoreFiles (snapshot_num, [current_file]); } continue; } @@ -575,7 +566,7 @@ // popup headline if (Popup::AnyQuestionRichText (_("Restoring files"), // popup message, %1 is snapshot number, %2 list of files - sformat (_("These files will be copied from snapshot %1 to current system:<p>%2</p>Are you sure?"), + sformat (_("These files will be copied from snapshot '%1' to current system: <p>%2</p>Are you sure?"), previous_num, mergestring (files, "<br>")), 60, 20, Label::YesButton (), Label::NoButton (), `focus_no)) { Modified: branches/tmp/jsuchome/snapper/src/helps.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/helps.ycp?rev=63464&r1=63463&r2=63464&view=diff ============================================================================== --- branches/tmp/jsuchome/snapper/src/helps.ycp (original) +++ branches/tmp/jsuchome/snapper/src/helps.ycp Thu Feb 24 11:01:57 2011 @@ -36,24 +36,34 @@ */ 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> + /* Read dialog help */ + "read" : _("<p><b><big>Reading the list of snapshots</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> + /* Summary dialog help: */ + "summary" : _("<p><b><big>Snapshots Configuration</big></b><p> +<p>The table shows a list of root filesystem snapshots. There are three types of snapshots, <b>single</b>, <b>pre</b> and <b>post</b>. Single snapshots are used for storing file system state in certain time, while Pre and Post are used to define the changes done by special operation proceeded between taking those two snapshots. Pre and Post snapshots are coupled together in the table.</p> +<p>Select a snapshot or snapshot couple and click <b>Show Changes</b> to see the file system changes new in specified snapshot.</p> "), - /* Add dialog help */ - "add" : _("<p><b><big>Creating new snapshot</big></b><br> -Press <b>Next</b> to continue. -<br></p>"), + /* Show snapshot dialog help */ + "show_couple" : _("<p><b><big>Snapshot Overview</big></b><p> +<p> +The tree shows all the files that were modified between creating first ('pre') and second ('post') snapshot. On the right side, you can see the description generated when the first snapshot was created and the time of creation for both snapshots. +</p> +<p> +When file is selected in the tree, you can see the changes done to it. By default, changes between selected coupled snapshots are shown, but it is possible to compare the file with different versions. +</p>"), + + /* Show snapshot dialog help, alternative for single snapshots */ + "show_single" : _("<p><b><big>Snapshot Overview</big></b><p> +<p> +The tree shows all the files that are different between selected snapshot and current system. On the right side, you can see the snapshot description and time of its creation. +</p> +<p> +When file is selected in the tree, you can see the its difference between snapshot version and current system. +</p>"), ]; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org