added Glib::Markup::escape_text() to all strings in ZebraTreeViews

This commit is contained in:
fgerlits 2005-06-28 16:59:02 +00:00
parent 89695d798b
commit db6135efb8
6 changed files with 38 additions and 28 deletions

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.4 $ Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/BrowseItem.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/BrowseItem.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -34,6 +34,7 @@
#endif #endif
#include <iostream> #include <iostream>
#include <glibmm.h>
#include "LiveSupport/Widgets/WidgetFactory.h" #include "LiveSupport/Widgets/WidgetFactory.h"
@ -92,7 +93,8 @@ BrowseItem :: BrowseItem(
pack_start(*scrolledWindow, Gtk::PACK_SHRINK, 5); pack_start(*scrolledWindow, Gtk::PACK_SHRINK, 5);
try { try {
allString = *getResourceUstring("allStringForBrowse"); allString = Glib::Markup::escape_text(
*getResourceUstring("allStringForBrowse"));
} catch (std::invalid_argument &e) { } catch (std::invalid_argument &e) {
std::cerr << e.what() << std::endl; std::cerr << e.what() << std::endl;
std::exit(1); std::exit(1);
@ -157,7 +159,8 @@ BrowseItem :: onShow(void) throw ()
std::vector<Glib::ustring>::const_iterator valuesIt; std::vector<Glib::ustring>::const_iterator valuesIt;
for (valuesIt = values->begin(); valuesIt != values->end(); ++valuesIt) { for (valuesIt = values->begin(); valuesIt != values->end(); ++valuesIt) {
row = *treeModel->append(); row = *treeModel->append();
row[modelColumns.column] = *valuesIt; row[modelColumns.column] = Glib::Markup::escape_text(
*valuesIt);
row[modelColumns.rowNumberColumn] = rowNumber++; row[modelColumns.rowNumberColumn] = rowNumber++;
} }

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.24 $ Version : $Revision: 1.25 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/ScratchpadWindow.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/ScratchpadWindow.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -272,7 +272,8 @@ ScratchpadWindow :: showContents(void) throw ()
default: default:
break; break;
} }
row[modelColumns.titleColumn] = *playable->getTitle(); row[modelColumns.titleColumn] = Glib::Markup::escape_text(
*playable->getTitle());
row[modelColumns.rowNumberColumn] = rowNumber; row[modelColumns.rowNumberColumn] = rowNumber;
++it; ++it;

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.20 $ Version : $Revision: 1.21 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SearchWindow.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SearchWindow.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -352,11 +352,17 @@ SearchWindow :: onSearch(Ptr<SearchCriteria>::Ref criteria)
break; break;
} }
Ptr<const Glib::ustring>::Ref title = playable->getTitle(); Ptr<const Glib::ustring>::Ref
row[modelColumns.titleColumn] = title ? *title : ""; title = playable->getTitle();
row[modelColumns.titleColumn]
= title ? Glib::Markup::escape_text(*title)
: "";
Ptr<Glib::ustring>::Ref creator = playable->getMetadata("dc:creator"); Ptr<Glib::ustring>::Ref
row[modelColumns.creatorColumn] = creator ? *creator : ""; creator = playable->getMetadata("dc:creator");
row[modelColumns.creatorColumn]
= creator ? Glib::Markup::escape_text(*creator)
: "";
Ptr<time_duration>::Ref length = playable->getPlaylength(); Ptr<time_duration>::Ref length = playable->getPlaylength();
row[modelColumns.lengthColumn] = length ? to_simple_string(*length) row[modelColumns.lengthColumn] = length ? to_simple_string(*length)

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.13 $ Version : $Revision: 1.14 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -242,7 +242,7 @@ SimplePlaylistManagementWindow :: showContents(void) throw ()
row[modelColumns.startColumn] row[modelColumns.startColumn]
= to_simple_string(*playlistElem->getRelativeOffset()); = to_simple_string(*playlistElem->getRelativeOffset());
row[modelColumns.titleColumn] row[modelColumns.titleColumn]
= *playable->getTitle(); = Glib::Markup::escape_text(*playable->getTitle());
row[modelColumns.lengthColumn] row[modelColumns.lengthColumn]
= to_simple_string(*playable->getPlaylength()); = to_simple_string(*playable->getPlaylength());
} }

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.4 $ Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -74,20 +74,19 @@ using namespace LiveSupport::Widgets;
* The layout of this window is roughly the following: * The layout of this window is roughly the following:
* <pre><code> * <pre><code>
* +--- simple playlist management window --------+ * +--- simple playlist management window --------+
* | name: +-- name input ----+ | * | name: +-- name input -------------+ |
* | +-- playlist entries -------+ | * | +-- playlist entries ----------------------+ |
* | | +-- entry1 -------------+ | | * | | +-- entry1 ----------------------------+ | |
* | | +-- entry2 -------------+ | | * | | +-- entry2 ----------------------------+ | |
* | | ... | | * | | ... | |
* | +---------------------------+ | * | +------------------------------------------+ |
* | +-- save button ------------+ | * | +- save button -+ +- close button -+ |
* | +-- close button -----------+ | * | +-- status bar ----------------------------+ |
* | +-- status bar -------------+ |
* +----------------------------------------------+ * +----------------------------------------------+
* </code></pre> * </code></pre>
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.4 $ * @version $Revision: 1.5 $
*/ */
class SimplePlaylistManagementWindow : public WhiteWindow, class SimplePlaylistManagementWindow : public WhiteWindow,
public LocalizedObject public LocalizedObject
@ -100,7 +99,7 @@ class SimplePlaylistManagementWindow : public WhiteWindow,
* Lists one playlist entry per row. * Lists one playlist entry per row.
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.4 $ * @version $Revision: 1.5 $
*/ */
class ModelColumns : public ZebraTreeModelColumnRecord class ModelColumns : public ZebraTreeModelColumnRecord
{ {
@ -113,17 +112,17 @@ class SimplePlaylistManagementWindow : public WhiteWindow,
/** /**
* The column for the start of the playlist entry. * The column for the start of the playlist entry.
*/ */
Gtk::TreeModelColumn<Glib::ustring> startColumn; Gtk::TreeModelColumn<Glib::ustring> startColumn;
/** /**
* The column for the title of the audio clip or playlist. * The column for the title of the audio clip or playlist.
*/ */
Gtk::TreeModelColumn<Glib::ustring> titleColumn; Gtk::TreeModelColumn<Glib::ustring> titleColumn;
/** /**
* The column for the length of the playlist entry. * The column for the length of the playlist entry.
*/ */
Gtk::TreeModelColumn<Glib::ustring> lengthColumn; Gtk::TreeModelColumn<Glib::ustring> lengthColumn;
/** /**
* Constructor. * Constructor.

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.14 $ Version : $Revision: 1.15 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/UploadFileWindow.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/UploadFileWindow.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -275,6 +275,7 @@ UploadFileWindow :: updateFileInfo(void) throw ()
: playlength->seconds() + 1); : playlength->seconds() + 1);
lengthValueLabel->set_text(lengthStr.str()); lengthValueLabel->set_text(lengthStr.str());
statusBar->set_text("");
isAudioClipValid = true; isAudioClipValid = true;
} }