Author: aschnell
Date: Tue Dec 16 17:29:50 2008
New Revision: 54197
URL: http://svn.opensuse.org/viewcvs/yast?rev=54197&view=rev
Log:
- escape HTML tags (bnc #450496)
- replaced getCommitActions and getCommitInfo by getCommitInfos
Modified:
trunk/installation/VERSION
trunk/installation/package/yast2-installation.changes
trunk/installation/src/include/misc.ycp
trunk/installation/yast2-installation.spec.in
trunk/storage/libstorage/examples/TestLoop.cc
trunk/storage/libstorage/examples/TestLvm.cc
trunk/storage/libstorage/examples/TestMd.cc
trunk/storage/libstorage/src/Storage.cc
trunk/storage/libstorage/src/Storage.h
trunk/storage/libstorage/src/StorageInterface.h
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/ep-main.ycp
trunk/storage/storage/src/inst_prepdisk.ycp
trunk/storage/storage/src/modules/Storage.ycp
trunk/yast2/library/packages/src/SlideShow.ycp
Modified: trunk/installation/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/VERSION?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/installation/VERSION (original)
+++ trunk/installation/VERSION Tue Dec 16 17:29:50 2008
@@ -1 +1 @@
-2.17.47
+2.18.0
Modified: trunk/installation/package/yast2-installation.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/package/yast2-installation.changes?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/installation/package/yast2-installation.changes (original)
+++ trunk/installation/package/yast2-installation.changes Tue Dec 16 17:29:50 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Dec 16 17:13:38 CET 2008 - aschnell@suse.de
+
+- adapted to storage API changes
+- 2.18.0
+
+-------------------------------------------------------------------
Tue Dec 16 12:29:27 CET 2008 - locilka@suse.cz
- Removed SLED control file labels that should be hidden
Modified: trunk/installation/src/include/misc.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/include/misc.ycp?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/installation/src/include/misc.ycp (original)
+++ trunk/installation/src/include/misc.ycp Tue Dec 16 17:29:50 2008
@@ -139,8 +139,11 @@
// Text for confirmation popup before the installation really starts 1/3
body = _("<p>All information required for the base installation is now complete.</p>");
- map commit_info = Storage::GetCommitInfo();
- if (commit_info[`destructive]:false)
+ boolean some_destructive = find(map info, Storage::GetCommitInfos(), {
+ return info[`destructive]:false;
+ }) != nil;
+
+ if (some_destructive)
{
// Text for confirmation popup before the installation really starts 2/3
body = body + _("<p>If you continue now, <b>existing
Modified: trunk/installation/yast2-installation.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/yast2-installation.spec.in?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/installation/yast2-installation.spec.in (original)
+++ trunk/installation/yast2-installation.spec.in Tue Dec 16 17:29:50 2008
@@ -40,8 +40,8 @@
# BNC #449818: "description_id" in DefaultDesktop
Requires: yast2-packager >= 2.17.49
-# Storage::GetCommitInfo() call in include/misc.ycp
-Requires: yast2-storage >= 2.17.47
+# Storage::GetCommitInfos() call in include/misc.ycp
+Requires: yast2-storage >= 2.18.0
# use in startup scripts
Requires: initviocons
Modified: trunk/storage/libstorage/examples/TestLoop.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/examples/TestLoop.cc?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/storage/libstorage/examples/TestLoop.cc (original)
+++ trunk/storage/libstorage/examples/TestLoop.cc Tue Dec 16 17:29:50 2008
@@ -20,12 +20,13 @@
}
void
-printCommitActions( StorageInterface* s )
- {
- deque<string> l = s->getCommitActions( false );
- for( deque<string>::iterator i=l.begin(); i!=l.end(); ++i )
- cout << *i << endl;
- }
+printCommitActions(StorageInterface* s)
+{
+ list<CommitInfo> l;
+ s->getCommitInfos(l);
+ for (list<CommitInfo>::iterator i=l.begin(); i!=l.end(); ++i)
+ cout << i->text << endl;
+}
int doCommit( StorageInterface* s )
{
Modified: trunk/storage/libstorage/examples/TestLvm.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/examples/TestLvm.cc?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/storage/libstorage/examples/TestLvm.cc (original)
+++ trunk/storage/libstorage/examples/TestLvm.cc Tue Dec 16 17:29:50 2008
@@ -20,12 +20,13 @@
}
void
-printCommitActions( StorageInterface* s )
- {
- deque<string> l = s->getCommitActions( false );
- for( deque<string>::iterator i=l.begin(); i!=l.end(); ++i )
- cout << *i << endl;
- }
+printCommitActions(StorageInterface* s)
+{
+ list<CommitInfo> l;
+ s->getCommitInfos(l);
+ for (list<CommitInfo>::iterator i=l.begin(); i!=l.end(); ++i)
+ cout << i->text << endl;
+}
int doCommit( StorageInterface* s )
{
Modified: trunk/storage/libstorage/examples/TestMd.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/examples/TestMd.cc?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/storage/libstorage/examples/TestMd.cc (original)
+++ trunk/storage/libstorage/examples/TestMd.cc Tue Dec 16 17:29:50 2008
@@ -20,12 +20,13 @@
}
void
-printCommitActions( StorageInterface* s )
- {
- deque<string> l = s->getCommitActions( false );
- for( deque<string>::iterator i=l.begin(); i!=l.end(); ++i )
- cout << *i << endl;
- }
+printCommitActions(StorageInterface* s)
+{
+ list<CommitInfo> l;
+ s->getCommitInfos(l);
+ for (list<CommitInfo>::iterator i=l.begin(); i!=l.end(); ++i)
+ cout << i->text << endl;
+}
int doCommit( StorageInterface* s )
{
Modified: trunk/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Storage.cc (original)
+++ trunk/storage/libstorage/src/Storage.cc Tue Dec 16 17:29:50 2008
@@ -3538,21 +3538,11 @@
}
-deque<string>
-Storage::getCommitActions(bool mark_destructive) const
-{
- CommitInfo info;
- getCommitInfo(mark_destructive, info);
- return info.actions;
-}
-
-
void
-Storage::getCommitInfo(bool mark_destructive, CommitInfo& info) const
+Storage::getCommitInfos(list<CommitInfo>& infos) const
{
- info.destructive = false;
- info.actions.clear();
-
+ static list<CommitInfo> s_infos;
+ s_infos.clear();
ConstContPair p = contPair();
y2mil("empty:" << p.empty());
if( !p.empty() )
@@ -3565,28 +3555,23 @@
ac.splice( ac.end(), l );
}
ac.sort( cont_less<commitAction>() );
- string txt;
for( list::const_iterator i=ac.begin(); i!=ac.end(); ++i )
{
- if ((*i)->destructive)
- info.destructive = true;
- txt.erase();
- if( mark_destructive && (*i)->destructive )
- txt += "<font color=red>";
- txt += (*i)->descr;
+ CommitInfo info;
+ info.destructive = (*i)->destructive;
+ info.text = (*i)->descr;
const Volume *v = (*i)->vol();
if( v && !v->getDescText().empty() )
{
- txt += ". ";
- txt += v->getDescText();
+ info.text += ". ";
+ info.text += v->getDescText();
}
- if( mark_destructive && (*i)->destructive )
- txt += "</font>";
- info.actions.push_back( txt );
+ s_infos.push_back(info);
delete *i;
}
}
- y2mil("destructive:" << info.destructive << " actions.size():" << info.actions.size());
+ infos = s_infos;
+ y2mil("infos.size:" << infos.size());
}
Modified: trunk/storage/libstorage/src/Storage.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.h?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Storage.h (original)
+++ trunk/storage/libstorage/src/Storage.h Tue Dec 16 17:29:50 2008
@@ -445,8 +445,7 @@
int removeDmraid( const string& name );
- deque<string> getCommitActions( bool mark_destructive ) const;
- void getCommitInfo(bool mark_destructive, CommitInfo& info) const;
+ void getCommitInfos(list<CommitInfo>& infos) const;
const string& getLastAction() const { return lastAction; }
const string& getExtendedErrorMessage() const { return extendedError; }
void eraseFreeInfo( const string& device );
Modified: trunk/storage/libstorage/src/StorageInterface.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageInterface.h?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/storage/libstorage/src/StorageInterface.h (original)
+++ trunk/storage/libstorage/src/StorageInterface.h Tue Dec 16 17:29:50 2008
@@ -105,7 +105,7 @@
enum MountByType { MOUNTBY_DEVICE, MOUNTBY_UUID, MOUNTBY_LABEL, MOUNTBY_ID, MOUNTBY_PATH };
enum EncryptType { ENC_NONE, ENC_TWOFISH, ENC_TWOFISH_OLD,
- ENC_TWOFISH256_OLD, ENC_LUKS, ENC_UNKNOWN };
+ ENC_TWOFISH256_OLD, ENC_LUKS, ENC_UNKNOWN };
enum MdType { RAID_UNK, RAID0, RAID1, RAID5, RAID6, RAID10, MULTIPATH };
@@ -115,30 +115,31 @@
enum UsedByType { UB_NONE, UB_LVM, UB_MD, UB_DM, UB_DMRAID, UB_DMMULTIPATH };
enum CType { CUNKNOWN, DISK, MD, LOOP, LVM, DM, DMRAID, NFSC, DMMULTIPATH,
- COTYPE_LAST_ENTRY };
+ COTYPE_LAST_ENTRY };
/**
- * typedef for a pointer to a function that is called on progress bar events
+ * typedef for a pointer to a function that is called on progress bar
+ * events.
*/
typedef void (*CallbackProgressBar)( const string& id, unsigned cur, unsigned max );
/**
- * typedef for a pointer to a function that is called with strings
- * telling the user what is currently going on
+ * typedef for a pointer to a function that is called with strings telling
+ * the user what is currently going on.
*/
typedef void (*CallbackShowInstallInfo)( const string& id );
/**
- * typedef for a pointer to a function that displays a popup with
- * the given text and waits for user confirmation
+ * typedef for a pointer to a function that displays a popup with the
+ * given text and waits for user confirmation.
*/
typedef void (*CallbackInfoPopup)( const string& text );
/**
- * typedef for a pointer to a function that displays a popup with
- * the given text and two buttons labels "Yes" and "No". The user
- * has to press on of these buttons. If he presses "Yes" true is
- * returned, false otherwise.
+ * typedef for a pointer to a function that displays a popup with the
+ * given text and two buttons labels "Yes" and "No". The user
+ * has to press on of these buttons. If he presses "Yes" true is returned,
+ * false otherwise.
*/
typedef bool (*CallbackYesNoPopup)( const string& text );
@@ -456,8 +457,9 @@
*/
struct CommitInfo
{
+ CommitInfo() {}
bool destructive;
- deque<string> actions;
+ string text;
};
@@ -1321,8 +1323,8 @@
/**
* Sets the value of description text.
- * This text will be returned together with the text returned by
- * getCommitInfo().
+ * This text will be returned together with the text returned by
+ * getCommitInfos().
*
* @param device name of volume, e.g. /dev/hda1
* @param txt description text for this partition
@@ -1833,25 +1835,11 @@
virtual int removeDmraid( const string& name ) = 0;
/**
- * Gets a list of string describing the actions to be executed
- * after next call to commit().
- *
- * Deprecated, use getCommitInfo().
- *
- * @param mark_destructive if true use <red> around </red>
- * destructive actions (like e.g. deletion, formatting, ...)
- * @return list of strings presentable to the user
- */
- virtual deque<string> getCommitActions(bool mark_destructive) const = 0;
-
- /**
* Gets info about actions to be executed after next call to commit().
*
- * @param mark_destructive if true use <red> around </red>
- * destructive actions (like e.g. deletion, formatting, ...)
- * @param info record that gets filled with data
+ * @param infos list of records that gets filled with infos
*/
- virtual void getCommitInfo(bool mark_destructive, CommitInfo& info) const = 0;
+ virtual void getCommitInfos(list<CommitInfo>& infos) const = 0;
/**
* Gets action performed last during previous call to commit()
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Tue Dec 16 17:29:50 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Dec 16 17:12:18 CET 2008 - aschnell@suse.de
+
+- escape HTML tags (bnc #450496)
+- replaced getCommitActions and getCommitInfo by getCommitInfos
+
+-------------------------------------------------------------------
Mon Dec 15 14:19:57 CET 2008 - aschnell@suse.de
- fixed typo (bnc #450455)
Modified: trunk/storage/storage/src/include/ep-main.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-main.ycp?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-main.ycp (original)
+++ trunk/storage/storage/src/include/ep-main.ycp Tue Dec 16 17:29:50 2008
@@ -238,15 +238,8 @@
symbol SummaryDialog()
{
symbol ret = `none;
- string doto = Storage::ChangeText();
- y2milestone("Summary of changes: %1", doto);
-
- /*if (size(doto) == 0)
- {
- // popup text
- Popup::Message(_("No unsaved changes exist."));
- return `back;
- }*/
+ string summary = Storage::ChangeText();
+ y2milestone("Summary of changes: %1", summary);
Wizard::CreateDialog();
Wizard::SetContentsButtons(caption + _(": Summary"),
@@ -255,7 +248,7 @@
Label::BackButton(),
Label::FinishButton());
Wizard::SetDesktopIcon("disk");
- UI::ChangeWidget(`id(`summary), `Value, _("<h1>Changes in Partitioning</h1>") + doto);
+ UI::ChangeWidget(`id(`summary), `Value, _("<h1>Changes in Partitioning</h1>") + summary);
while (true)
{
Modified: trunk/storage/storage/src/inst_prepdisk.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_prepdisk.ycp?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_prepdisk.ycp (original)
+++ trunk/storage/storage/src/inst_prepdisk.ycp Tue Dec 16 17:29:50 2008
@@ -109,7 +109,7 @@
// They are usually more than twice the reported value
// create, format, mount ...
- StorageClients::total_actions = Storage::ActionsCount() * 2.5;
+ StorageClients::total_actions = size(Storage::GetCommitInfos()) * 2.5;
y2milestone ("StorageClients::total_actions: %1", StorageClients::total_actions);
SlideShow::MoveToStage( "disk" );
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Tue Dec 16 17:29:50 2008
@@ -3999,15 +3999,14 @@
}
-global map GetCommitInfo()
+global list<map> GetCommitInfos()
{
- any info = LibStorage::CommitInfo::new("LibStorage::CommitInfo");
- LibStorage::StorageInterface::getCommitInfo(sint, true, info);
-
- map ret = $[
- `destructive : LibStorage::CommitInfo::swig_destructive_get(info)
- ];
-
+ list<any> infos = [];
+ LibStorage::StorageInterface::getCommitInfos(sint, infos);
+ list<map> ret = maplist(any info, infos, {
+ return $[ `destructive : LibStorage::CommitInfo::swig_destructive_get(info),
+ `text : LibStorage::CommitInfo::swig_text_get(info) ];
+ });
return ret;
}
@@ -4015,22 +4014,28 @@
string save_chtxt = "";
global string ChangeText()
+{
+ list<string> texts = maplist(map info, GetCommitInfos(), {
+ string text = String::EscapeTags(info[`text]:"");
+ if (info[`destructive]:false)
+ text = "<font color=red>" + text + "</font>";
+ return text;
+ });
+
+ string ret = (size(texts) == 0) ? "" : HTML::List(texts);
+
+ if (ret != save_chtxt)
{
- list<string> l = LibStorage::StorageInterface::getCommitActions( sint, true );
- string ret = "";
- if( size(l)>0 )
- ret = HTML::List( l );
- if( ret != save_chtxt )
- {
- foreach( string s, l,
- ``{
- y2milestone( "ChangeText %1", s );
- });
+ foreach(string text, texts, {
+ y2milestone("ChangeText %1", text);
+ });
save_chtxt = ret;
- }
- return( ret );
}
+ return ret;
+}
+
+
global string LastAction()
{
string ret = LibStorage::StorageInterface::getLastAction( sint );
@@ -6497,10 +6502,5 @@
return( ret );
}
-global integer ActionsCount()
- {
- return size(LibStorage::StorageInterface::getCommitActions( sint, true ));
- }
}
-
Modified: trunk/yast2/library/packages/src/SlideShow.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/packages/src/SlideShow.ycp?rev=54197&r1=54196&r2=54197&view=diff
==============================================================================
--- trunk/yast2/library/packages/src/SlideShow.ycp (original)
+++ trunk/yast2/library/packages/src/SlideShow.ycp Tue Dec 16 17:29:50 2008
@@ -375,7 +375,7 @@
*/
global void AppendMessageToInstLog (string msg)
{
- string log_line = "\n" + msg;
+ string log_line = msg + "\n";
inst_log = inst_log + log_line;
if ( ShowingDetails() )
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org