X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fapp.cpp;h=c01ee32be23df4df6f274ef4e006c6a22398cab4;hb=528053937deeba8d8ae63078306f1bc951229781;hp=6c185a45eee75d65ba2c25de451e955f535e09ce;hpb=78432386722217ddba2ba0597a96ad5d81e069ca;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index 6c185a4..c01ee32 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -55,6 +55,7 @@ #include "app.h" #include "about.h" +#include "splash.h" #include "instance.h" #include "canvasview.h" #include "dialog_setup.h" @@ -222,6 +223,8 @@ const etl::handle& App::get_ui_interface() { return ui_i etl::handle App::selected_instance; etl::handle App::selected_canvas_view; +studio::About *studio::App::about=NULL; + studio::Toolbox *studio::App::toolbox=NULL; studio::AutoRecover *studio::App::auto_recover=NULL; @@ -639,21 +642,8 @@ init_ui_manager() DEFINE_ACTION("quality-08", _("Use Quality Level 8")); DEFINE_ACTION("quality-09", _("Use Quality Level 9")); DEFINE_ACTION("quality-10", _("Use Quality Level 10")); - DEFINE_ACTION("lowres-pixel-2", _("Set Low-Res pixel size to 2")); - DEFINE_ACTION("lowres-pixel-3", _("Set Low-Res pixel size to 3")); - DEFINE_ACTION("lowres-pixel-4", _("Set Low-Res pixel size to 4")); - DEFINE_ACTION("lowres-pixel-5", _("Set Low-Res pixel size to 5")); - DEFINE_ACTION("lowres-pixel-6", _("Set Low-Res pixel size to 6")); - DEFINE_ACTION("lowres-pixel-8", _("Set Low-Res pixel size to 8")); - DEFINE_ACTION("lowres-pixel-10", _("Set Low-Res pixel size to 10")); - DEFINE_ACTION("lowres-pixel-12", _("Set Low-Res pixel size to 12")); - DEFINE_ACTION("lowres-pixel-15", _("Set Low-Res pixel size to 15")); - DEFINE_ACTION("lowres-pixel-20", _("Set Low-Res pixel size to 20")); - DEFINE_ACTION("lowres-pixel-24", _("Set Low-Res pixel size to 24")); - DEFINE_ACTION("lowres-pixel-30", _("Set Low-Res pixel size to 30")); - DEFINE_ACTION("lowres-pixel-40", _("Set Low-Res pixel size to 40")); - DEFINE_ACTION("lowres-pixel-60", _("Set Low-Res pixel size to 60")); - DEFINE_ACTION("lowres-pixel-120", _("Set Low-Res pixel size to 120")); + for(list::iterator iter = CanvasView::get_pixel_sizes().begin(); iter != CanvasView::get_pixel_sizes().end(); iter++) + DEFINE_ACTION(strprintf("lowres-pixel-%d", *iter), strprintf(_("Set Low-Res pixel size to %d"), *iter)); DEFINE_ACTION("play", _("Play")); // DEFINE_ACTION("pause", _("Pause")); DEFINE_ACTION("stop", _("Stop")); @@ -661,6 +651,8 @@ init_ui_manager() DEFINE_ACTION("toggle-grid-snap", _("Toggle Grid Snap")); DEFINE_ACTION("toggle-guide-show", _("Toggle Guide Show")); DEFINE_ACTION("toggle-low-res", _("Toggle Low-Res")); + DEFINE_ACTION("decrease-low-res-pixel-size", _("Decrease Low-Res Pixel Size")); + DEFINE_ACTION("increase-low-res-pixel-size", _("Increase Low-Res Pixel Size")); DEFINE_ACTION("toggle-onion-skin", _("Toggle Onion Skin")); DEFINE_ACTION("canvas-zoom-in", Gtk::StockID("gtk-zoom-in")); DEFINE_ACTION("canvas-zoom-out", Gtk::StockID("gtk-zoom-out")); @@ -786,21 +778,15 @@ init_ui_manager() " " " " " " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " +" " +; + + for(list::iterator iter = CanvasView::get_pixel_sizes().begin(); iter != CanvasView::get_pixel_sizes().end(); iter++) + ui_info += strprintf(" ", *iter); + + ui_info += " " " " " " @@ -945,6 +931,9 @@ init_ui_manager() ACCEL("//time-zoom-in","+"); ACCEL("//time-zoom-out","_"); */ + ACCEL2(Gtk::AccelKey('(',Gdk::CONTROL_MASK,"//decrease-low-res-pixel-size")); + ACCEL2(Gtk::AccelKey(')',Gdk::CONTROL_MASK,"//increase-low-res-pixel-size")); + ACCEL2(Gtk::AccelKey('(',Gdk::MOD1_MASK|Gdk::CONTROL_MASK,"//amount-dec")); ACCEL2(Gtk::AccelKey(')',Gdk::MOD1_MASK|Gdk::CONTROL_MASK,"//amount-inc")); @@ -1039,13 +1028,13 @@ App::App(int *argc, char ***argv): } Glib::set_application_name(_("Synfig Studio")); - About about_window; - about_window.set_can_self_destruct(false); - about_window.show(); + Splash splash_screen; + splash_screen.set_can_self_destruct(false); + splash_screen.show(); shutdown_in_progress=false; - SuperCallback synfig_init_cb(about_window.get_callback(),0,9000,10000); - SuperCallback studio_init_cb(about_window.get_callback(),9000,10000,10000); + SuperCallback synfig_init_cb(splash_screen.get_callback(),0,9000,10000); + SuperCallback studio_init_cb(splash_screen.get_callback(),9000,10000,10000); // Initialize the Synfig library try { synfigapp_main=etl::smart_ptr(new synfigapp::Main(etl::dirname((*argv)[0]),&synfig_init_cb)); } @@ -1073,6 +1062,9 @@ App::App(int *argc, char ***argv): studio_init_cb.task(_("Init Toolbox...")); toolbox=new studio::Toolbox(); + studio_init_cb.task(_("Init About Dialog...")); + about=new studio::About(); + studio_init_cb.task(_("Init Tool Options...")); dialog_tool_options=new studio::Dialog_ToolOptions(); dock_manager->register_dockable(*dialog_tool_options); @@ -1191,7 +1183,7 @@ App::App(int *argc, char ***argv): if(auto_recover->recovery_needed()) { - about_window.hide(); + splash_screen.hide(); if( get_ui_interface()->yes_no( _("Auto Recovery"), @@ -1214,7 +1206,7 @@ App::App(int *argc, char ***argv): "idea to review them and save them now.") ); } - about_window.show(); + splash_screen.show(); } // Look for any files given on the command line, @@ -1224,10 +1216,10 @@ App::App(int *argc, char ***argv): if((*argv)[*argc] && (*argv)[*argc][0]!='-') { studio_init_cb.task(_("Loading files...")); - about_window.hide(); + splash_screen.hide(); open((*argv)[*argc]); opened_any = true; - about_window.show(); + splash_screen.show(); } // if no file was specified to be opened, create a new document to help new users get started more easily @@ -1271,6 +1263,8 @@ App::~App() delete auto_recover; + delete about; + toolbox->hide(); // studio::App::iteration(false); @@ -2063,7 +2057,8 @@ App::get_instance(etl::handle canvas) void App::dialog_about() { - (new class About())->show(); + if(about) + about->show(); } void