Cleanup dead code
authorNikita Kitaev <nikitakit@gmail.com>
Thu, 15 Apr 2010 00:46:55 +0000 (17:46 -0700)
committerNikita Kitaev <nikitakit@gmail.com>
Thu, 15 Apr 2010 00:46:55 +0000 (17:46 -0700)
synfig-studio/src/gtkmm/instance.cpp
synfig-studio/src/gtkmm/keyframetree.cpp
synfig-studio/src/gtkmm/layergrouptreestore.cpp
synfig-studio/src/gtkmm/metadatatreestore.cpp
synfig-studio/src/gtkmm/toolbox.cpp
synfig-studio/src/gtkmm/widget_vector.cpp

index db48457..62d63a0 100644 (file)
@@ -82,15 +82,11 @@ int studio::Instance::instance_count_=0;
 
 Instance::Instance(synfig::Canvas::Handle canvas):
        synfigapp::Instance             (canvas),
-//     canvas_tree_store_              (Gtk::TreeStore::create(CanvasTreeModel())),
-//     canvas_tree_store_              (Gtk::TreeStore::create()),
+       canvas_tree_store_              (Gtk::TreeStore::create(canvas_tree_model)),
        history_tree_store_             (HistoryTreeStore::create(this)),
        undo_status_(false),
        redo_status_(false)
 {
-       CanvasTreeModel model;
-       canvas_tree_store_=Gtk::TreeStore::create(model);
-
        id_=instance_count_++;
 
        // Connect up all the signals
@@ -107,8 +103,6 @@ Instance::Instance(synfig::Canvas::Handle canvas):
                )
        );
 
-       canvas_tree_store_=Gtk::TreeStore::create(canvas_tree_model);
-
        refresh_canvas_tree();
 }
 
@@ -262,6 +256,7 @@ studio::Instance::dialog_save_as()
                                Layer::Handle parent_layer(dynamic_cast<Layer*>(node));
                                if(parent_layer && parent_layer->get_canvas()->get_root()!=get_canvas())
                                {
+                                       //! \todo Fix big involving "Save As" with referenced compositions
                                        string msg(strprintf(_("There is currently a bug when using \"SaveAs\"\n"
                                                "on a composition that is being referenced by other\n"
                                                "files that are currently open. Close these\n"
@@ -426,45 +421,8 @@ Instance::insert_canvas(Gtk::TreeRow row, synfig::Canvas::Handle canvas)
 
                for(iter=children.begin();iter!=children.end();iter++)
                        insert_canvas(*(canvas_tree_store()->append(row.children())),*iter);
-       }
-
-       /*
-       if(!canvas->value_node_list().empty())
-       {
-               Gtk::TreeRow valuenode_row = *(canvas_tree_store()->append(row.children()));
-
-               valuenode_row[canvas_tree_model.label] = "<defs>";
-               valuenode_row[canvas_tree_model.canvas] = canvas;
-               valuenode_row[canvas_tree_model.is_canvas] = false;
-               valuenode_row[canvas_tree_model.is_value_node] = false;
-
-               synfig::ValueNodeList::iterator iter;
-               synfig::ValueNodeList &value_node_list(canvas->value_node_list());
-
-               for(iter=value_node_list.begin();iter!=value_node_list.end();iter++)
-                       insert_value_node(*(canvas_tree_store()->append(valuenode_row.children())),canvas,*iter);
-       }
-       */
-}
-
-/*
-void
-Instance::insert_value_node(Gtk::TreeRow row,Canvas::Handle canvas,etl::handle<synfig::ValueNode> value_node)
-{
-       CanvasTreeModel canvas_tree_model;
-       assert(value_node);
-       assert(canvas);
-
-       row[canvas_tree_model.id] = value_node->get_id();
-       row[canvas_tree_model.name] = value_node->get_id();
-       row[canvas_tree_model.label] = value_node->get_id();
-       row[canvas_tree_model.canvas] = canvas;
-       row[canvas_tree_model.value_node] = value_node;
-       row[canvas_tree_model.is_canvas] = false;
-       row[canvas_tree_model.is_value_node] = true;
-       row[canvas_tree_model.icon] = Gtk::Button().render_icon(valuenode_icon(value_node),Gtk::ICON_SIZE_SMALL_TOOLBAR);
+       }       
 }
-*/
 
 void
 Instance::refresh_canvas_tree()
@@ -770,32 +728,6 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const synfigapp::Action::ParamLis
                        Gtk::Image* image(manage(new Gtk::Image()));
                        Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image);
 
-                       /*
-                       if(iter->task=="raise")
-                               Gtk::Stock::lookup(Gtk::Stock::GO_UP,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="lower")
-                               Gtk::Stock::lookup(Gtk::Stock::GO_DOWN,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="move_top")
-                               Gtk::Stock::lookup(Gtk::Stock::GOTO_TOP,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="move_bottom")
-                               Gtk::Stock::lookup(Gtk::Stock::GOTO_BOTTOM,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="remove")
-                               Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="set_on")
-                               Gtk::Stock::lookup(Gtk::Stock::YES,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="set_off")
-                               Gtk::Stock::lookup(Gtk::Stock::NO,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="duplicate")
-                               Gtk::Stock::lookup(Gtk::Stock::COPY,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="remove")
-                               Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
-                       else
-                       {
-                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
-                               Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) ||
-                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
-                       }
-                       */
                        menu->items().push_back(
                                Gtk::Menu_Helpers::ImageMenuElem(
                                        iter->local_name,
@@ -849,31 +781,6 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const synfigapp::Action::ParamLis
                        Gtk::Image* image(manage(new Gtk::Image()));
                        Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image);
 
-/*                     if(iter->task=="raise")
-                               Gtk::Stock::lookup(Gtk::Stock::GO_UP,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="lower")
-                               Gtk::Stock::lookup(Gtk::Stock::GO_DOWN,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="move_top")
-                               Gtk::Stock::lookup(Gtk::Stock::GOTO_TOP,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="move_bottom")
-                               Gtk::Stock::lookup(Gtk::Stock::GOTO_BOTTOM,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="remove")
-                               Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="set_on")
-                               Gtk::Stock::lookup(Gtk::Stock::YES,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="set_off")
-                               Gtk::Stock::lookup(Gtk::Stock::NO,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="duplicate")
-                               Gtk::Stock::lookup(Gtk::Stock::COPY,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="remove")
-                               Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
-                       else
-                       {
-                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
-                               Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) ||
-                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
-                       }
-*/
                        menu->items().push_back(
                                Gtk::Menu_Helpers::ImageMenuElem(
                                        iter->local_name,
@@ -899,31 +806,7 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const synfigapp::Action::ParamLis
                {
                        Gtk::Image* image(manage(new Gtk::Image()));
                        Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image);
-/*                     if(iter->task=="raise")
-                               Gtk::Stock::lookup(Gtk::Stock::GO_UP,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="lower")
-                               Gtk::Stock::lookup(Gtk::Stock::GO_DOWN,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="move_top")
-                               Gtk::Stock::lookup(Gtk::Stock::GOTO_TOP,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="move_bottom")
-                               Gtk::Stock::lookup(Gtk::Stock::GOTO_BOTTOM,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="remove")
-                               Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="set_on")
-                               Gtk::Stock::lookup(Gtk::Stock::YES,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="set_off")
-                               Gtk::Stock::lookup(Gtk::Stock::NO,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="duplicate")
-                               Gtk::Stock::lookup(Gtk::Stock::COPY,Gtk::ICON_SIZE_MENU,*image);
-                       else if(iter->task=="remove")
-                               Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
-                       else
-                       {
-                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
-                               Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) ||
-                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
-                       }
-*/
+
                        menu->items().push_back(
                                Gtk::Menu_Helpers::ImageMenuElem(
                                        iter->local_name,
index 14af5ab..e480292 100644 (file)
@@ -103,7 +103,6 @@ KeyframeTree::KeyframeTree()
 
                append_column(*column);
        }
-       // append_column_editable(_("Description"),model.description);
        {
                Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Description")) );
 
index 077436c..9c947c6 100644 (file)
@@ -471,7 +471,6 @@ LayerGroupTreeStore::row_draggable_vfunc (const TreeModel::Path& /*path*/)const
 //     Gtk::TreeModel::Row row(*get_iter(path));
 
        return true;
-//     return (bool)true;
 }
 
 bool
index 383cda1..98bb7c6 100644 (file)
@@ -106,7 +106,7 @@ MetaDataTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int co
 {
        if(column>=get_n_columns_vfunc())
        {
-               g_warning("KeyframeTreeStore::set_value_impl: Bad column (%d)",column);
+               g_warning("MetaDataTreeStore::set_value_impl: Bad column (%d)",column);
                return;
        }
 
@@ -126,13 +126,13 @@ MetaDataTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int colu
 {
        if(column>=get_n_columns_vfunc())
        {
-               g_warning("KeyframeTreeStore::set_value_impl: Bad column (%d)",column);
+               g_warning("MetaDataTreeStore::set_value_impl: Bad column (%d)",column);
                return;
        }
 
        if(!g_value_type_compatible(G_VALUE_TYPE(value.gobj()),get_column_type_vfunc(column)))
        {
-               g_warning("KeyframeTreeStore::set_value_impl: Bad value type");
+               g_warning("MetaDataTreeStore::set_value_impl: Bad value type");
                return;
        }
 
index af2931e..ea40e7d 100644 (file)
@@ -240,16 +240,6 @@ Toolbox::Toolbox():
        filemenu->items().push_back(Gtk::Menu_Helpers::SeparatorElem());
        filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Panels"),*dock_dialogs));
 
-       //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Canvas Browser..."),
-       //      sigc::mem_fun(studio::App::show_comp_view)));
-       //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Gradient Editor..."),
-       //      sigc::mem_fun(show_dialog_gradient)));
-       //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Tool Options"),
-       //      sigc::mem_fun(show_dialog_tool_options)));
-       //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Colors..."),
-       //      sigc::mem_fun(show_dialog_color)));
-       //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Color Palette..."),
-       //      sigc::mem_fun(show_dialog_palette)));
        filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Input Devices..."),
                sigc::ptr_fun(&show_dialog_input)));
        filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Setup..."),
@@ -349,9 +339,8 @@ Toolbox::Toolbox():
        table1->set_col_spacings(0);
        table1->attach(*menubar1,        0,1, 0,1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0);
        table1->attach(*file_buttons,    0,1, 1,2, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
-       //table1->attach(*manage(new Gtk::Label(_("Tools"))), 0, 1, 2, 3, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
-       table1->attach(*handle_tools,    0,1, 3,4, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
-       table1->attach(*handle_defaults, 0,1, 4,5, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
+       table1->attach(*handle_tools,    0,1, 2,3, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
+       table1->attach(*handle_defaults, 0,1, 3,4, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
        table1->show_all();
 
 
index ad82683..f905d34 100644 (file)
@@ -211,8 +211,6 @@ Widget_Vector::set_canvas(synfig::Canvas::LooseHandle x)
                {
                        spinbutton_x->hide();
                        spinbutton_y->hide();
-//                     delete spinbutton_x;
-//                     delete spinbutton_y;
                }
                distance_x->show();
                distance_y->show();