X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fdockdialog.cpp;h=614e8dbb0c1edf122327edb6ddc309d64a8f60e1;hb=756c0d29ac1742f231e6615f9a577e574e35a4af;hp=1a9a6e47a9a17ea935bafcbfb88eb2fc3d290622;hpb=37600b4b217caa5e316984ec0b035c5e8f9698af;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/dockdialog.cpp b/synfig-studio/trunk/src/gtkmm/dockdialog.cpp index 1a9a6e4..614e8db 100644 --- a/synfig-studio/trunk/src/gtkmm/dockdialog.cpp +++ b/synfig-studio/trunk/src/gtkmm/dockdialog.cpp @@ -6,7 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley -** Copyright (c) 2007 Chris Moore +** Copyright (c) 2007, 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 @@ -50,6 +50,8 @@ #include #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -110,7 +112,7 @@ DockDialog::DockDialog(): // Set up the window //set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY); - set_title("Dock Dialog"); + set_title(_("Dock Panel")); // Register with the dock manager App::dock_manager->dock_dialog_list_.push_back(this); @@ -150,14 +152,14 @@ DockDialog::~DockDialog() { dock_book_list.front()->clear(); - //! \fixme: UGLY HACK + //! \todo Fix this UGLY HACK // The following line really should be uncommented, // but it causes crashes. Without it, a small // memory hole is created--but at least it doesn't crash // delete dock_book_list.front(); // Oddly enough, the following line should - // theoreticly do the same thing after this + // theoretically do the same thing after this // class is destroyed, but it doesn't seem to // cause a crash. It does, however, trigger this warning: // @@ -336,7 +338,7 @@ DockDialog::refresh() //prepend_button->show(); //append_button->show(); - pannels_.clear(); + panels_.clear(); if(dock_book_list.size()==1) { @@ -346,11 +348,11 @@ DockDialog::refresh() { Gtk::Paned* parent(manage(is_horizontal?(Gtk::Paned*)new Gtk::HPaned:(Gtk::Paned*)new Gtk::VPaned)); - pannels_.push_back(parent); + panels_.push_back(parent); - if(pannels_.size()<=dock_book_sizes_.size()) - pannels_.back()->set_position(dock_book_sizes_[pannels_.size()-1]); - pannels_.back()->property_position().signal_changed().connect( + if(panels_.size()<=dock_book_sizes_.size()) + panels_.back()->set_position(dock_book_sizes_[panels_.size()-1]); + panels_.back()->property_position().signal_changed().connect( sigc::mem_fun(*this,&DockDialog::rebuild_sizes) ); //parent->show(); @@ -363,11 +365,11 @@ DockDialog::refresh() for(next=dock_book_list.begin(),next++,iter=next++;next!=dock_book_list.end();iter=next++) { Gtk::Paned* current(manage(is_horizontal?(Gtk::Paned*)new Gtk::HPaned:(Gtk::Paned*)new Gtk::VPaned)); - pannels_.push_back(current); + panels_.push_back(current); - if(pannels_.size()<=dock_book_sizes_.size()) - pannels_.back()->set_position(dock_book_sizes_[pannels_.size()-1]); - pannels_.back()->property_position().signal_changed().connect( + if(panels_.size()<=dock_book_sizes_.size()) + panels_.back()->set_position(dock_book_sizes_[panels_.size()-1]); + panels_.back()->property_position().signal_changed().connect( sigc::mem_fun(*this,&DockDialog::rebuild_sizes) ); @@ -395,9 +397,9 @@ DockDialog::rebuild_sizes() { unsigned int i=0; dock_book_sizes_.clear(); - for(i=0;iget_position()); + dock_book_sizes_.push_back(panels_[i]->get_position()); } } @@ -405,9 +407,9 @@ void DockDialog::set_dock_book_sizes(const std::vector& new_sizes) { unsigned int i=0; - for(i=0;iset_position(new_sizes[i]); + panels_[i]->set_position(new_sizes[i]); } dock_book_sizes_=new_sizes; //rebuild_sizes(); @@ -442,7 +444,9 @@ DockDialog::refresh_accel_group() bool DockDialog::close() { - synfig::info("DockDialog::close(): DELETED!"); + if (getenv("SYNFIG_DEBUG_DESTRUCTORS")) + synfig::info("DockDialog::close(): Deleted"); + empty_sig.disconnect(); //get_dock_book().clear(); delete this; @@ -556,5 +560,5 @@ DockDialog::refresh_title() set_title(title); } else - set_title(_("Empty Dock Dialog")); + set_title(_("Empty Dock Panel")); }