Cleanup dead code
authorNikita Kitaev <nikitakit@gmail.com>
Sun, 11 Apr 2010 02:57:18 +0000 (19:57 -0700)
committerNikita Kitaev <nikitakit@gmail.com>
Sun, 11 Apr 2010 03:54:54 +0000 (20:54 -0700)
Also rename gradient dialog button from "grab" to "set_default"

synfig-studio/src/gtkmm/app.cpp
synfig-studio/src/gtkmm/autorecover.cpp
synfig-studio/src/gtkmm/cellrenderer_value.cpp
synfig-studio/src/gtkmm/childrentree.cpp
synfig-studio/src/gtkmm/childrentree.h
synfig-studio/src/gtkmm/dialog_gradient.cpp
synfig-studio/src/gtkmm/dialog_gradient.h
synfig-studio/src/gtkmm/widget_defaults.cpp

index 874ee35..95452d3 100644 (file)
@@ -74,7 +74,6 @@
 #include "dialog_gradient.h"
 #include "dialog_color.h"
 #include "toolbox.h"
-#include "compview.h"
 #include "onemoment.h"
 
 #include "dockmanager.h"
@@ -1430,14 +1429,8 @@ App::~App()
 
        toolbox->hide();
 
-//     studio::App::iteration(false);
-
        delete toolbox;
 
-//     studio::App::iteration(false);
-
-//     studio::App::iteration(false);
-
        delete dialog_setup;
 
        delete dialog_gradient;
@@ -1449,8 +1442,6 @@ App::~App()
        delete dock_manager;
 
        instance_list.clear();
-
-//     studio::App::iteration(false);
 }
 
 String
@@ -1958,7 +1949,7 @@ App::dialog_open_file(const std::string &title, std::string &filename, std::stri
        }
        return false;
 
-#else
+#else   // not USE_WIN32_FILE_DIALOGS
        synfig::String prev_path;
 
        if(!_preferences.get_value(preference, prev_path))
@@ -1989,52 +1980,7 @@ App::dialog_open_file(const std::string &title, std::string &filename, std::stri
 
     delete dialog;
     return false;
-
-    /*
-
-       GtkWidget *ok;
-       GtkWidget *cancel;
-       int val=0;
-
-       GtkWidget *fileselection;
-       fileselection = gtk_file_selection_new(title.c_str());
-
-
-       if(basename(filename)==filename)
-       {
-               gtk_file_selection_set_filename(GTK_FILE_SELECTION(fileselection),(prev_path+ETL_DIRECTORY_SEPARATOR).c_str());
-       }
-       else
-               gtk_file_selection_set_filename(GTK_FILE_SELECTION(fileselection),dirname(filename).c_str());
-
-       gtk_file_selection_complete(GTK_FILE_SELECTION(fileselection),basename(filename).c_str());
-
-       ok=GTK_FILE_SELECTION(fileselection)->ok_button;
-       cancel=GTK_FILE_SELECTION(fileselection)->cancel_button;
-
-       gtk_signal_connect(GTK_OBJECT(ok),"clicked",GTK_SIGNAL_FUNC(Signal_Open_Ok),&val);
-       gtk_signal_connect(GTK_OBJECT(cancel),"clicked",GTK_SIGNAL_FUNC(Signal_Open_Cancel),&val);
-
-       gtk_widget_show(fileselection);
-
-       while(!val)
-               iteration();
-
-
-       if(val==1)
-       {
-               filename=gtk_file_selection_get_filename(GTK_FILE_SELECTION(fileselection));
-               _preferences.set_value(preference,dirname(filename));
-       }
-       else
-       {
-               gtk_widget_destroy(fileselection);
-               return false;
-       }
-       gtk_widget_destroy(fileselection);
-       return true;
-    */
-#endif
+#endif   // not USE_WIN32_FILE_DIALOGS
 }
 
 bool
index 1b55eb4..4e9eeb8 100644 (file)
@@ -126,7 +126,6 @@ AutoRecover::set_timeout(int milliseconds)
        auto_backup_connect.disconnect();
        if(timeout)
                auto_backup_connect=Glib::signal_timeout().connect(sigc::ptr_fun(&AutoRecover::auto_backup),timeout);
-//             auto_backup_connect=App::main.get_context()->signal_timeout().connect(sigc::mem_fun(&AutoRecover::auto_backup),timeout);
 }
 
 synfig::String
index 456dee7..f0403fd 100644 (file)
@@ -534,7 +534,7 @@ CellRenderer_ValueBase::start_editing_vfunc(
                                path
                        )
                );
-               App::dialog_gradient->grab_button_set_sensitive(true);
+               App::dialog_gradient->set_default_button_set_sensitive(true);
                App::dialog_gradient->present();
 
                return NULL;
index aa47850..01ef95e 100644 (file)
@@ -180,7 +180,10 @@ ChildrenTree::ChildrenTree()
        tree_view.set_enable_search(true);
        tree_view.set_search_column(model.label);
 
-/*
+/*  // Buttons to raise/lower/duplicate/delete children valuenodes
+       //   Commented out because these functions are not implemented
+    //   and children sort themselves alphabetically
+
        Gtk::Image *icon;
        //Gtk::IconSize iconsize(Gtk::IconSize::from_name("synfig-small_icon"));
        Gtk::IconSize iconsize(Gtk::ICON_SIZE_SMALL_TOOLBAR);
index 34a216f..d307fd0 100644 (file)
@@ -130,6 +130,7 @@ private:
 
        void on_dirty_preview();
 
+       //! \todo Implement raise/lower/duplicate/delete functions
        void on_raise_pressed();
 
        void on_lower_pressed();
index 5a3edca..fe060b9 100644 (file)
@@ -72,17 +72,10 @@ Dialog_Gradient::Dialog_Gradient():
        set_role("gradient_editor");
 
        // Setup the buttons
-       grab_button = manage(new class Gtk::Button(Gtk::StockID(_("Set as Default"))));
-       grab_button->show();
-       add_action_widget(*grab_button,2);
-       grab_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Gradient::on_grab_pressed));
-
-       /*
-       Gtk::Button *apply_button(manage(new class Gtk::Button(Gtk::StockID("gtk-apply"))));
-       apply_button->show();
-       add_action_widget(*apply_button,1);
-       apply_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Gradient::on_apply_pressed));
-       */
+       set_default_button = manage(new class Gtk::Button(Gtk::StockID(_("Set as Default"))));
+       set_default_button->show();
+       add_action_widget(*set_default_button,2);
+       set_default_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Gradient::on_set_default_pressed));
 
        Gtk::Button *cancel_button(manage(new class Gtk::Button(Gtk::StockID("gtk-close"))));
        cancel_button->show();
@@ -136,18 +129,9 @@ Dialog_Gradient::reset()
 }
 
 void
-Dialog_Gradient::on_grab_pressed()
+Dialog_Gradient::on_set_default_pressed()
 {
        synfigapp::Main::set_gradient(get_gradient());
-//     signal_edited_(get_gradient());
-//     reset();
-//     hide();
-}
-
-void
-Dialog_Gradient::on_apply_pressed()
-{
-       signal_edited_(get_gradient());
 }
 
 void
index f9d674c..698ba3c 100644 (file)
@@ -77,16 +77,14 @@ class Dialog_Gradient : public Gtk::Dialog
 
        sigc::connection value_changed_connection;
 
-       void on_ok_pressed();
-       void on_apply_pressed();
-       void on_grab_pressed();
+       void on_set_default_pressed();
 
        void on_cpoint_selected(synfig::Gradient::CPoint x);
        void on_values_adjusted();
 
        Widget_Gradient* widget_gradient;
        Widget_ColorEdit* widget_color;
-       Gtk::Button *grab_button;
+       Gtk::Button *set_default_button;
 
        void on_changed();
 
@@ -98,14 +96,14 @@ public:
 
        const synfig::Gradient& get_gradient()const { return widget_gradient->get_value(); }
 
-       void grab_button_set_sensitive(bool sensitive) { grab_button->set_sensitive(sensitive); }
+       void set_default_button_set_sensitive(bool sensitive) { set_default_button->set_sensitive(sensitive); }
 
        void reset();
 
 
        Dialog_Gradient();
        ~Dialog_Gradient();
-       //! Inerface to external calls to fill in the Gradient Editor Dialog
+       //! Interface to external calls to fill in the Gradient Editor Dialog
        //! when a Constant ValueNode or a Animated ValueNode is double cliked.
        void edit(const synfigapp::ValueDesc &x, etl::handle<synfigapp::CanvasInterface> canvas_interface, synfig::Time time=0);
 }; // END of Dialog_Gradient
index e672b8f..20cabfe 100644 (file)
@@ -464,7 +464,7 @@ Widget_Defaults::on_gradient_clicked()
        App::dialog_gradient->set_gradient(synfigapp::Main::get_gradient());
        App::dialog_gradient->reset();
        App::dialog_gradient->signal_edited().connect(sigc::ptr_fun(synfigapp::Main::set_gradient));
-       App::dialog_gradient->grab_button_set_sensitive(false);
+       App::dialog_gradient->set_default_button_set_sensitive(false);
        App::dialog_gradient->present();
 }