Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / src / ui / dialog / layers.cpp
index 962d78df8d354e2fbbf9bb5ad37a0bdaa43444b9..0eca5bbca2435947c64d62dbc47a9630a99d85c6 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Authors:
  *   Jon A. Cruz
+ *   Abhishek Sharma
  *
  * Copyright (C) 2006,2010 Jon A. Cruz
  *
@@ -468,8 +469,8 @@ void LayersPanel::_toggled( Glib::ustring const& str, int targetCol )
                 row[_model->_colVisible] = newValue;
                 item->setHidden( !newValue  );
                 item->updateRepr();
-                SPDocumentUndo::done( _desktop->doc() , SP_VERB_DIALOG_LAYERS,
-                                  newValue? _("Unhide layer") : _("Hide layer"));
+                DocumentUndo::done( _desktop->doc() , SP_VERB_DIALOG_LAYERS,
+                                    newValue? _("Unhide layer") : _("Hide layer"));
             }
             break;
 
@@ -479,8 +480,8 @@ void LayersPanel::_toggled( Glib::ustring const& str, int targetCol )
                 row[_model->_colLocked] = newValue;
                 item->setLocked( newValue );
                 item->updateRepr();
-                SPDocumentUndo::done( _desktop->doc() , SP_VERB_DIALOG_LAYERS,
-                                  newValue? _("Lock layer") : _("Unlock layer"));
+                DocumentUndo::done( _desktop->doc() , SP_VERB_DIALOG_LAYERS,
+                                    newValue? _("Lock layer") : _("Unlock layer"));
             }
             break;
         }
@@ -631,32 +632,30 @@ LayersPanel::LayersPanel() :
     _buttonsRow.set_child_min_width( 16 );
 
     Gtk::Button* btn = manage( new Gtk::Button() );
-    _styleButton( *btn, targetDesktop, SP_VERB_LAYER_NEW, GTK_STOCK_ADD, _("New") );
+    _styleButton( *btn, targetDesktop, SP_VERB_LAYER_NEW, GTK_STOCK_ADD, C_("Layers", "New") );
     btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_NEW) );
     _buttonsRow.add( *btn );
 
     btn = manage( new Gtk::Button() );
-    //TRANSLATORS: only translate "string" in "context|string".
-    // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS
-    _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_TOP, GTK_STOCK_GOTO_TOP, Q_("layers|Top") );
+    _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_TOP, GTK_STOCK_GOTO_TOP, C_("Layers", "Top") );
     btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_TOP) );
     _watchingNonTop.push_back( btn );
     _buttonsRow.add( *btn );
 
     btn = manage( new Gtk::Button() );
-    _styleButton( *btn, targetDesktop, SP_VERB_LAYER_RAISE, GTK_STOCK_GO_UP, _("Up") );
+    _styleButton( *btn, targetDesktop, SP_VERB_LAYER_RAISE, GTK_STOCK_GO_UP, C_("Layers", "Up") );
     btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_UP) );
     _watchingNonTop.push_back( btn );
     _buttonsRow.add( *btn );
 
     btn = manage( new Gtk::Button() );
-    _styleButton( *btn, targetDesktop, SP_VERB_LAYER_LOWER, GTK_STOCK_GO_DOWN, _("Dn") );
+    _styleButton( *btn, targetDesktop, SP_VERB_LAYER_LOWER, GTK_STOCK_GO_DOWN, C_("Layers", "Dn") );
     btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_DOWN) );
     _watchingNonBottom.push_back( btn );
     _buttonsRow.add( *btn );
 
     btn = manage( new Gtk::Button() );
-    _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_BOTTOM, GTK_STOCK_GOTO_BOTTOM, _("Bot") );
+    _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_BOTTOM, GTK_STOCK_GOTO_BOTTOM, C_("Layers", "Bot") );
     btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_BOTTOM) );
     _watchingNonBottom.push_back( btn );
     _buttonsRow.add( *btn );
@@ -768,7 +767,7 @@ void LayersPanel::setDesktop( SPDesktop* desktop )
         }
     }
 /*
-    GSList const *layers=sp_document_get_resource_list( _desktop->doc(), "layer" );
+    GSList const *layers = _desktop->doc()->getResourceList( "layer" );
     g_message( "layers list starts at %p", layers );
     for ( GSList const *iter=layers ; iter ; iter = iter->next ) {
         SPObject *layer=static_cast<SPObject *>(iter->data);
@@ -794,4 +793,4 @@ void LayersPanel::setDesktop( SPDesktop* desktop )
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :