X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fkeyframetree.cpp;h=14af5abdc8febcd962f6704fef1ca8f2bea8d8d2;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=54f5bd2743122cfc47b25a33de02e7fff76a18f7;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/keyframetree.cpp b/synfig-studio/trunk/src/gtkmm/keyframetree.cpp index 54f5bd2..14af5ab 100644 --- a/synfig-studio/trunk/src/gtkmm/keyframetree.cpp +++ b/synfig-studio/trunk/src/gtkmm/keyframetree.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -34,6 +35,8 @@ #include #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -61,17 +64,14 @@ KeyframeTree::KeyframeTree() cell_renderer_time = Gtk::manage( new CellRenderer_Time() ); column->pack_start(*cell_renderer_time,true); column->add_attribute(cell_renderer_time->property_time(), model.time); - cell_renderer_time->signal_edited().connect(sigc::mem_fun(*this,&studio::KeyframeTree::on_edited_time)); column->set_reorderable(); column->set_resizable(); column->set_clickable(); - //column->set_sort_column_id(COLUMNID_TIME); - column->set_sort_column_id(model.time); + column->set_sort_column(model.time); append_column(*column); - //column->clicked(); } { Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Length")) ); @@ -79,39 +79,31 @@ KeyframeTree::KeyframeTree() cell_renderer_time_delta = Gtk::manage( new CellRenderer_Time() ); column->pack_start(*cell_renderer_time_delta,true); column->add_attribute(cell_renderer_time_delta->property_time(), model.time_delta); - cell_renderer_time_delta->signal_edited().connect(sigc::mem_fun(*this,&studio::KeyframeTree::on_edited_time_delta)); column->set_reorderable(); column->set_resizable(); - - column->set_sort_column_id(model.time_delta); - column->set_clickable(false); + // column->set_sort_column(model.time_delta); append_column(*column); - //column->clicked(); } { Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Jump")) ); Gtk::CellRendererText* cell_renderer_jump=Gtk::manage(new Gtk::CellRendererText()); column->pack_start(*cell_renderer_jump,true); - - cell_renderer_jump->property_text()="(JMP)"; + cell_renderer_jump->property_text()=_("(JMP)"); cell_renderer_jump->property_foreground()="#003a7f"; column->set_reorderable(); column->set_resizable(); - - column->set_sort_column_id(COLUMNID_JUMP); - column->set_clickable(false); + column->set_sort_column(COLUMNID_JUMP); // without this, (JMP) needs a double click?! append_column(*column); - //column->clicked(); } - //append_column_editable(_("Description"),model.description); + // append_column_editable(_("Description"),model.description); { Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Description")) ); @@ -123,8 +115,7 @@ KeyframeTree::KeyframeTree() column->set_reorderable(); column->set_resizable(); column->set_clickable(); - //column->set_sort_column_id(COLUMNID_DESCRIPTION); - column->set_sort_column_id(model.description); + column->set_sort_column(model.description); append_column(*column); } @@ -141,7 +132,8 @@ KeyframeTree::KeyframeTree() KeyframeTree::~KeyframeTree() { - synfig::info("KeyframeTree::~KeyframeTree(): deleted"); + if (getenv("SYNFIG_DEBUG_DESTRUCTORS")) + synfig::info("KeyframeTree::~KeyframeTree(): Deleted"); } void @@ -161,8 +153,8 @@ KeyframeTree::set_model(Glib::RefPtr keyframe_tree_store) { Glib::RefPtr sorted_store(Gtk::TreeModelSort::create(keyframe_tree_store_)); sorted_store->set_default_sort_func(sigc::ptr_fun(&studio::KeyframeTreeStore::time_sorter)); - sorted_store->set_sort_func(model.time.index(),sigc::ptr_fun(&studio::KeyframeTreeStore::time_sorter)); - sorted_store->set_sort_column_id(model.time.index(), Gtk::SORT_ASCENDING); + sorted_store->set_sort_func(model.time, sigc::ptr_fun(&studio::KeyframeTreeStore::time_sorter)); + sorted_store->set_sort_func(model.description, sigc::ptr_fun(&studio::KeyframeTreeStore::description_sorter)); Gtk::TreeView::set_model(sorted_store); } else