summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dda2959)
raw | patch | inline | side by side (parent: dda2959)
author | joncruz <joncruz@users.sourceforge.net> | |
Sun, 7 Dec 2008 07:05:10 +0000 (07:05 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Sun, 7 Dec 2008 07:05:10 +0000 (07:05 +0000) |
src/ui/dialog/document-properties.cpp | patch | blob | history | |
src/ui/dialog/document-properties.h | patch | blob | history | |
src/verbs.cpp | patch | blob | history | |
src/verbs.h | patch | blob | history |
index cb2bf6997650f4fda19ef6216eba15926f54a5cf..1bbd201363963a1b59660d841388c166eb990961 100644 (file)
}
void
-DocumentProperties::onEmbedProfile()
+DocumentProperties::linkSelectedProfile()
{
//store this profile in the SVG document (create <color-profile> element in the XML)
// TODO remove use of 'active' desktop
//Inkscape::GC::release(defsRepr);
// inform the document, so we can undo
- sp_document_done(desktop->doc(), SP_VERB_EDIT_EMBED_COLOR_PROFILE, _("Embed Color Profile"));
+ sp_document_done(desktop->doc(), SP_VERB_EDIT_LINK_COLOR_PROFILE, _("Link Color Profile"));
- populate_embedded_profiles_box();
+ populate_linked_profiles_box();
}
}
void
-DocumentProperties::populate_embedded_profiles_box()
+DocumentProperties::populate_linked_profiles_box()
{
- _EmbeddedProfilesListStore->clear();
+ _LinkedProfilesListStore->clear();
const GSList *current = sp_document_get_resource_list( SP_ACTIVE_DOCUMENT, "iccprofile" );
if (current) _emb_profiles_observer.set(SP_OBJECT(current->data)->parent);
while ( current ) {
SPObject* obj = SP_OBJECT(current->data);
Inkscape::ColorProfile* prof = reinterpret_cast<Inkscape::ColorProfile*>(obj);
- Gtk::TreeModel::Row row = *(_EmbeddedProfilesListStore->append());
- row[_EmbeddedProfilesListColumns.nameColumn] = prof->name;
-// row[_EmbeddedProfilesListColumns.previewColumn] = "Color Preview";
+ Gtk::TreeModel::Row row = *(_LinkedProfilesListStore->append());
+ row[_LinkedProfilesListColumns.nameColumn] = prof->name;
+// row[_LinkedProfilesListColumns.previewColumn] = "Color Preview";
current = g_slist_next(current);
}
}
-void DocumentProperties::embedded_profiles_list_button_release(GdkEventButton* event)
+void DocumentProperties::linked_profiles_list_button_release(GdkEventButton* event)
{
if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) {
_EmbProfContextMenu.popup(event->button, event->time);
@@ -561,13 +561,13 @@ void DocumentProperties::create_popup_menu(Gtk::Widget& parent, sigc::slot<void>
_EmbProfContextMenu.accelerate(parent);
}
-void DocumentProperties::remove_profile(){
+void DocumentProperties::removeSelectedProfile(){
Glib::ustring name;
- if(_EmbeddedProfilesList.get_selection()) {
- Gtk::TreeModel::iterator i = _EmbeddedProfilesList.get_selection()->get_selected();
+ if(_LinkedProfilesList.get_selection()) {
+ Gtk::TreeModel::iterator i = _LinkedProfilesList.get_selection()->get_selected();
if(i){
- name = (*i)[_EmbeddedProfilesListColumns.nameColumn];
+ name = (*i)[_LinkedProfilesListColumns.nameColumn];
} else {
return;
}
Inkscape::ColorProfile* prof = reinterpret_cast<Inkscape::ColorProfile*>(obj);
if (!name.compare(prof->name)){
sp_repr_unparent(obj->repr);
- sp_document_done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_COLOR_PROFILE, _("Remove embedded color profile"));
+ sp_document_done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_COLOR_PROFILE, _("Remove linked color profile"));
}
current = g_slist_next(current);
}
- populate_embedded_profiles_box();
+ populate_linked_profiles_box();
}
void
{
_page_cms.show();
- Gtk::Label *label_embed= manage (new Gtk::Label("", Gtk::ALIGN_LEFT));
- label_embed->set_markup (_("<b>Embedded Color Profiles:</b>"));
+ Gtk::Label *label_link= manage (new Gtk::Label("", Gtk::ALIGN_LEFT));
+ label_link->set_markup (_("<b>Linked Color Profiles:</b>"));
Gtk::Label *label_avail = manage (new Gtk::Label("", Gtk::ALIGN_LEFT));
label_avail->set_markup (_("<b>Available Color Profiles:</b>"));
- _embed_btn.set_label(_("Embed Profile"));
+ _link_btn.set_label(_("Link Profile"));
_page_cms.set_spacing(4);
gint row = 0;
- label_embed->set_alignment(0.0);
- _page_cms.table().attach(*label_embed, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
+ label_link->set_alignment(0.0);
+ _page_cms.table().attach(*label_link, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
row++;
- _page_cms.table().attach(_EmbeddedProfilesListScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
+ _page_cms.table().attach(_LinkedProfilesListScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
row++;
Gtk::HBox* spacer = Gtk::manage(new Gtk::HBox());
_page_cms.table().attach(*label_avail, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
row++;
_page_cms.table().attach(_combo_avail, 0, 2, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
- _page_cms.table().attach(_embed_btn, 2, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
+ _page_cms.table().attach(_link_btn, 2, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
populate_available_profiles();
_combo_avail.set_history(0);
_combo_avail.show_all();
- //# Set up the Embedded Profiles combo box
- _EmbeddedProfilesListStore = Gtk::ListStore::create(_EmbeddedProfilesListColumns);
- _EmbeddedProfilesList.set_model(_EmbeddedProfilesListStore);
- _EmbeddedProfilesList.append_column(_("Profile Name"), _EmbeddedProfilesListColumns.nameColumn);
-// _EmbeddedProfilesList.append_column(_("Color Preview"), _EmbeddedProfilesListColumns.previewColumn);
- _EmbeddedProfilesList.set_headers_visible(false);
-// TODO restore? _EmbeddedProfilesList.set_fixed_height_mode(true);
+ //# Set up the Linked Profiles combo box
+ _LinkedProfilesListStore = Gtk::ListStore::create(_LinkedProfilesListColumns);
+ _LinkedProfilesList.set_model(_LinkedProfilesListStore);
+ _LinkedProfilesList.append_column(_("Profile Name"), _LinkedProfilesListColumns.nameColumn);
+// _LinkedProfilesList.append_column(_("Color Preview"), _LinkedProfilesListColumns.previewColumn);
+ _LinkedProfilesList.set_headers_visible(false);
+// TODO restore? _LinkedProfilesList.set_fixed_height_mode(true);
- populate_embedded_profiles_box();
+ populate_linked_profiles_box();
- _EmbeddedProfilesListScroller.add(_EmbeddedProfilesList);
- _EmbeddedProfilesListScroller.set_shadow_type(Gtk::SHADOW_IN);
- _EmbeddedProfilesListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS);
- _EmbeddedProfilesListScroller.set_size_request(-1, 90);
+ _LinkedProfilesListScroller.add(_LinkedProfilesList);
+ _LinkedProfilesListScroller.set_shadow_type(Gtk::SHADOW_IN);
+ _LinkedProfilesListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS);
+ _LinkedProfilesListScroller.set_size_request(-1, 90);
- _embed_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::onEmbedProfile));
+ _link_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::linkSelectedProfile));
- _EmbeddedProfilesList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::embedded_profiles_list_button_release));
- create_popup_menu(_EmbeddedProfilesList, sigc::mem_fun(*this, &DocumentProperties::remove_profile));
+ _LinkedProfilesList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::linked_profiles_list_button_release));
+ create_popup_menu(_LinkedProfilesList, sigc::mem_fun(*this, &DocumentProperties::removeSelectedProfile));
const GSList *current = sp_document_get_resource_list( SP_ACTIVE_DOCUMENT, "defs" );
if (current) {
_emb_profiles_observer.set(SP_OBJECT(current->data)->parent);
}
- _emb_profiles_observer.signal_changed().connect(sigc::mem_fun(*this, &DocumentProperties::populate_embedded_profiles_box));
+ _emb_profiles_observer.signal_changed().connect(sigc::mem_fun(*this, &DocumentProperties::populate_linked_profiles_box));
}
#endif // ENABLE_LCMS
//------------------------------------------------Color Management page
#if ENABLE_LCMS
- populate_embedded_profiles_box();
+ populate_linked_profiles_box();
populate_available_profiles();
#endif // ENABLE_LCMS
index 5dd69385cae41c13d5141759250d229594824461..2428ab24a826a4030409e2eae3fed7558b59932b 100644 (file)
static void destroy();
void update_gridspage();
-
+
protected:
void build_page();
void build_grid();
virtual void on_response (int);
#if ENABLE_LCMS
void populate_available_profiles();
- void populate_embedded_profiles_box();
- void onEmbedProfile();
- void remove_profile();
- void embedded_profiles_list_button_release(GdkEventButton* event);
+ void populate_linked_profiles_box();
+ void linkSelectedProfile();
+ void removeSelectedProfile();
+ void linked_profiles_list_button_release(GdkEventButton* event);
void create_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
#endif // ENABLE_LCMS
//---------------------------------------------------------------
Gtk::Menu _menu;
Gtk::OptionMenu _combo_avail;
- Gtk::Button _embed_btn;
- class EmbeddedProfilesColumns : public Gtk::TreeModel::ColumnRecord
+ Gtk::Button _link_btn;
+ class LinkedProfilesColumns : public Gtk::TreeModel::ColumnRecord
{
public:
- EmbeddedProfilesColumns()
+ LinkedProfilesColumns()
{ add(nameColumn); add(previewColumn); }
Gtk::TreeModelColumn<Glib::ustring> nameColumn;
Gtk::TreeModelColumn<Glib::ustring> previewColumn;
};
- EmbeddedProfilesColumns _EmbeddedProfilesListColumns;
- Glib::RefPtr<Gtk::ListStore> _EmbeddedProfilesListStore;
- Gtk::TreeView _EmbeddedProfilesList;
- Gtk::ScrolledWindow _EmbeddedProfilesListScroller;
+ LinkedProfilesColumns _LinkedProfilesListColumns;
+ Glib::RefPtr<Gtk::ListStore> _LinkedProfilesListStore;
+ Gtk::TreeView _LinkedProfilesList;
+ Gtk::ScrolledWindow _LinkedProfilesListScroller;
Gtk::Menu _EmbProfContextMenu;
//---------------------------------------------------------------
Gtk::Notebook _grids_notebook;
// callback methods for buttons on grids page.
void onNewGrid();
- void onRemoveGrid();
+ void onRemoveGrid();
};
} // namespace Dialog
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 17fd00421e11ba51bb4497c08b8227307db2b419..36e4efaf9396e2d962710c91680a1fe5da3d73d4 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
case SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER:
sp_selection_next_patheffect_param(dt);
break;
- case SP_VERB_EDIT_EMBED_COLOR_PROFILE:
+ case SP_VERB_EDIT_LINK_COLOR_PROFILE:
break;
case SP_VERB_EDIT_REMOVE_COLOR_PROFILE:
break;
new LockAndHideVerb(SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS, "UnhideAllInAllLayers", N_("Unhide All in All Layers"),
N_("Unhide all objects in all layers"), NULL),
/*Color Management*/
- new EditVerb(SP_VERB_EDIT_EMBED_COLOR_PROFILE, "EmbedColorProfile", N_("Embed Color Profile"),
- N_("Embed an ICC color profile"), NULL),
+ new EditVerb(SP_VERB_EDIT_LINK_COLOR_PROFILE, "LinkColorProfile", N_("Link Color Profile"),
+ N_("Link an ICC color profile"), NULL),
new EditVerb(SP_VERB_EDIT_REMOVE_COLOR_PROFILE, "RemoveColorProfile", N_("Remove Color Profile"),
- N_("Remove an embedded ICC color profile"), NULL),
+ N_("Remove a linked ICC color profile"), NULL),
/* Footer */
new Verb(SP_VERB_LAST, " '\"invalid id", NULL, NULL, NULL)
};
diff --git a/src/verbs.h b/src/verbs.h
index a1f96ab5a345d7b3e0305a6411da92111d404360..2524aefefa7f057a789f1d6fee841fa1813aa59d 100644 (file)
--- a/src/verbs.h
+++ b/src/verbs.h
SP_VERB_UNHIDE_ALL,
SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS,
/* Color management */
- SP_VERB_EDIT_EMBED_COLOR_PROFILE,
+ SP_VERB_EDIT_LINK_COLOR_PROFILE,
SP_VERB_EDIT_REMOVE_COLOR_PROFILE,
/* Footer */
SP_VERB_LAST