}
void
+Dock_History::on_undo_tree_changed()
+{
+ Gtk::TreeModel::Children children(selected_instance->history_tree_store()->children());
+
+ if (!children.size())
+ return;
+
+ studio::HistoryTreeStore::Model model;
+
+ Gtk::TreeModel::Children::iterator iter, prev = children.end();
+ for (iter = children.begin(); iter != children.end(); prev = iter++)
+ if ((*iter)[model.is_redo])
+ {
+ if (prev == children.end())
+ action_tree->get_selection()->unselect_all();
+ else
+ {
+ action_tree->scroll_to_row(Gtk::TreePath(prev), 0.5);
+ action_tree->get_selection()->select(prev);
+ }
+ return;
+ }
+
+ action_tree->scroll_to_row(Gtk::TreePath(prev), 0.5);
+ action_tree->get_selection()->select(prev);
+}
+
+void
Dock_History::set_selected_instance_(etl::handle<studio::Instance> instance)
{
if(studio::App::shutdown_in_progress)
return;
+ if (on_undo_tree_changed_connection)
+ on_undo_tree_changed_connection.disconnect();
+
selected_instance=instance;
if(instance)
{
+ on_undo_tree_changed_connection = selected_instance->history_tree_store()->signal_undo_tree_changed().connect(
+ sigc::mem_fun(*this,&Dock_History::on_undo_tree_changed));
+
action_tree->set_model(instance->history_tree_store());
action_tree->show();
update_undo_redo();
Gtk::TreeView *action_tree;
etl::loose_handle<studio::Instance> selected_instance;
+
+ sigc::connection on_undo_tree_changed_connection;
+
+ void on_undo_tree_changed();
+
void set_selected_instance_(etl::handle<studio::Instance> x);
{
insert_action(*(append()),*iter,true,false,true);
}
+
+ signal_undo_tree_changed()();
}
void
row=*insert(iter);
insert_action(row,action);
+
+ signal_undo_tree_changed()();
}
void
private:
etl::loose_handle<studio::Instance> instance_;
+
+public:
Gtk::TreeIter curr_row;
/*
private:
/*
+ -- ** -- P R I V A T E D A T A ---------------------------------------------
+ */
+
+private:
+
+ sigc::signal<void> signal_undo_tree_changed_;
+
+ /*
+ -- ** -- S I G N A L I N T E R F A C E S -----------------------------------
+ */
+
+public:
+
+ sigc::signal<void>& signal_undo_tree_changed() { return signal_undo_tree_changed_; }
+
+ /*
-- ** -- S I G N A L T E R M I N A L S -------------------------------------
*/