summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 65eae23)
raw | patch | inline | side by side (parent: 65eae23)
author | speare <speare@users.sourceforge.net> | |
Mon, 9 Mar 2009 01:40:07 +0000 (01:40 +0000) | ||
committer | speare <speare@users.sourceforge.net> | |
Mon, 9 Mar 2009 01:40:07 +0000 (01:40 +0000) |
src/ui/dialog/layer-properties.cpp | patch | blob | history |
index 6cb0906a221a61105fa4e281abdb8ee82d19bbe2..ffa4642e77533f0c4327ee4d9fb0f1ffdfa2e64c 100644 (file)
SPDesktop *desktop=dialog._desktop;
dialog.set_title(_("Rename Layer"));
gchar const *name = desktop->currentLayer()->label();
- dialog._layer_name_entry.set_text(( name ? name : "" ));
+ dialog._layer_name_entry.set_text(( name ? name : _("Layer") ));
dialog._apply_button.set_label(_("_Rename"));
}
void LayerPropertiesDialog::Rename::perform(LayerPropertiesDialog &dialog) {
SPDesktop *desktop=dialog._desktop;
Glib::ustring name(dialog._layer_name_entry.get_text());
+ if (name.empty())
+ return;
desktop->layer_manager->renameLayer( desktop->currentLayer(),
- ( name.empty() ? NULL : (gchar *)name.c_str() ),
+ (gchar *)name.c_str(),
FALSE
);
sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE,
void LayerPropertiesDialog::Create::setup(LayerPropertiesDialog &dialog) {
dialog.set_title(_("Add Layer"));
- dialog._layer_name_entry.set_text("");
+ //TODO: find an unused layer number, forming name from _("Layer ") + "%d"
+ dialog._layer_name_entry.set_text(_("Layer"));
dialog._apply_button.set_label(_("_Add"));
dialog._setup_position_controls();
}
Gtk::ListStore::iterator activeRow(dialog._layer_position_combo.get_active());
position = activeRow->get_value(dialog._dropdown_columns.position);
}
+ Glib::ustring name(dialog._layer_name_entry.get_text());
+ if (name.empty())
+ return;
SPObject *new_layer=Inkscape::create_layer(desktop->currentRoot(), dialog._layer, position);
- Glib::ustring name(dialog._layer_name_entry.get_text());
if (!name.empty()) {
desktop->layer_manager->renameLayer( new_layer, (gchar *)name.c_str(), TRUE );
}