summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/svg-fonts-dialog.cpp
diff options
context:
space:
mode:
authorFelipe Corr??a da Silva Sanches <juca@members.fsf.org>2008-06-25 16:18:02 +0000
committerJucaBlues <JucaBlues@users.sourceforge.net>2008-06-25 16:18:02 +0000
commitd7221942795e4bf740efb6851af320cf50bf0f96 (patch)
tree5b86940e8f05cc5462d1e9aff47bf3e3f3b8d4c3 /src/ui/dialog/svg-fonts-dialog.cpp
parentwarning cleanup (diff)
downloadinkscape-d7221942795e4bf740efb6851af320cf50bf0f96.tar.gz
inkscape-d7221942795e4bf740efb6851af320cf50bf0f96.zip
adding list of available SVGFonts to the SVGFonts dialog
(bzr r6059)
Diffstat (limited to 'src/ui/dialog/svg-fonts-dialog.cpp')
-rw-r--r--src/ui/dialog/svg-fonts-dialog.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
index f6d357a0e..284003c92 100644
--- a/src/ui/dialog/svg-fonts-dialog.cpp
+++ b/src/ui/dialog/svg-fonts-dialog.cpp
@@ -23,11 +23,43 @@ namespace Dialog {
/*** SvgFontsDialog ***/
+/* Add all fonts in the document to the combobox. */
+void SvgFontsDialog::update_fonts()
+{
+g_warning("update_fonts");
+ SPDesktop* desktop = this->getDesktop();
+ SPDocument* document = sp_desktop_document(desktop);
+ const GSList* fonts = sp_document_get_resource_list(document, "font");
+
+ _model->clear();
+g_warning("after _model->clear()");
+ for(const GSList *l = fonts; l; l = l->next) {
+ Gtk::TreeModel::Row row = *_model->append();
+ SPFont* f = (SPFont*)l->data;
+ row[_columns.font] = f;
+ const gchar* lbl = f->label();
+g_warning("label: %s", lbl);
+ const gchar* id = SP_OBJECT_ID(f);
+ row[_columns.label] = lbl ? lbl : (id ? id : "font");
+ }
+
+// update_selection(desktop->selection);
+// _dialog.update_filter_general_settings_view();
+}
+
SvgFontsDialog::SvgFontsDialog()
: UI::Widget::Panel("", "dialogs.svgfonts", SP_VERB_DIALOG_SVG_FONTS)
{
- Gtk::Label* label = Gtk::manage(new Gtk::Label("Here we will have settings for the SVGFonts used in the document."));
- _getContents()->add(*label);
+ //Gtk::Label* label = Gtk::manage(new Gtk::Label("Here we will have settings for the SVGFonts used in the document."));
+ _getContents()->add(_list);
+g_warning("a");
+ _model = Gtk::ListStore::create(_columns);
+g_warning("b");
+ _list.set_model(_model);
+ _list.append_column_editable("_Font", _columns.label);
+g_warning("c");
+ this->update_fonts();
+g_warning("d");
}
SvgFontsDialog::~SvgFontsDialog(){}