X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fapp.cpp;h=ba154c2d18596710c0e14b828af852534dee3cf9;hb=2349d242e18afb3d3f440dba872cb7b5b40e7096;hp=63cb57d8c1464827fbd1d982a0e1a5cac1788f63;hpb=aa1b0a73c81d6610500621a6680b417cf80e9985;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index 63cb57d..ba154c2 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; @@ -569,6 +572,7 @@ init_ui_manager() menus_action_group->add( Gtk::Action::create("menu-layer", _("_Layer")) ); menus_action_group->add( Gtk::Action::create("menu-duck-mask", _("Show/Hide Ducks")) ); menus_action_group->add( Gtk::Action::create("menu-preview-quality", _("Preview Quality")) ); + menus_action_group->add( Gtk::Action::create("menu-lowres-pixel", _("Low-Res Pixel Size")) ); menus_action_group->add( Gtk::Action::create("menu-layer-new", _("New Layer")) ); menus_action_group->add( Gtk::Action::create("menu-keyframe", _("Keyframe")) ); menus_action_group->add( Gtk::Action::create("menu-group", _("Group")) ); @@ -638,6 +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")); + 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")); @@ -645,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")); @@ -769,6 +777,17 @@ 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 += +" " " " " " //" " @@ -912,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")); @@ -925,7 +947,7 @@ init_ui_manager() ACCEL2(Gtk::AccelKey(',',Gdk::CONTROL_MASK,"//seek-prev-frame")); ACCEL2(Gtk::AccelKey('>',Gdk::CONTROL_MASK,"//seek-next-second")); ACCEL2(Gtk::AccelKey('<',Gdk::CONTROL_MASK,"//seek-prev-second")); - ACCEL2(Gtk::AccelKey('o',Gdk::CONTROL_MASK,"//toggle-onion-skin")); + ACCEL2(Gtk::AccelKey('o',Gdk::MOD1_MASK,"//toggle-onion-skin")); ACCEL("//play", "p"); ACCEL("//seek-begin","Home"); ACCEL("//seek-end","End"); @@ -1006,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)); } @@ -1040,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); @@ -1103,30 +1128,27 @@ App::App(int *argc, char ***argv): device_tracker=new studio::DeviceTracker(); studio_init_cb.task(_("Init Tools...")); + + /* row 1 */ state_manager->add_state(&state_normal); state_manager->add_state(&state_smooth_move); state_manager->add_state(&state_scale); state_manager->add_state(&state_rotate); + studio_init_cb.task(_("Init ModMirror...")); module_list_.push_back(new ModMirror()); module_list_.back()->start(); + /* row 2 */ state_manager->add_state(&state_bline); - - state_manager->add_state(&state_circle); state_manager->add_state(&state_rectangle); - state_manager->add_state(&state_gradient); - state_manager->add_state(&state_eyedrop); - state_manager->add_state(&state_fill); - - state_manager->add_state(&state_zoom); - - // Enabled - it's useful to be able to work with polygons without tangent ducks getting in the way. - // I know we can switch tangent ducks off, but why not allow this kind of layer as well? - if(!getenv("SYNFIG_DISABLE_POLYGON")) state_manager->add_state(&state_polygon); + if(!getenv("SYNFIG_DISABLE_POLYGON")) state_manager->add_state(&state_polygon); // Enabled - for working without ducks - // Enabled for now. Let's see whether they're good enough yet. - if(!getenv("SYNFIG_DISABLE_DRAW" )) state_manager->add_state(&state_draw); + /* row 3 */ + if(!getenv("SYNFIG_DISABLE_DRAW" )) state_manager->add_state(&state_draw); // Enabled for now. Let's see whether they're good enough yet. if(!getenv("SYNFIG_DISABLE_SKETCH" )) state_manager->add_state(&state_sketch); + state_manager->add_state(&state_fill); + state_manager->add_state(&state_eyedrop); + state_manager->add_state(&state_zoom); // Disabled by default - it doesn't work properly? if(getenv("SYNFIG_ENABLE_WIDTH" )) state_manager->add_state(&state_width); @@ -1134,10 +1156,6 @@ App::App(int *argc, char ***argv): studio_init_cb.task(_("Init ModPalette...")); module_list_.push_back(new ModPalette()); module_list_.back()->start(); - studio_init_cb.task(_("Init ModMirror...")); - module_list_.push_back(new ModMirror()); module_list_.back()->start(); - - studio_init_cb.task(_("Init Setup Dialog...")); dialog_setup=new studio::Dialog_Setup(); @@ -1158,7 +1176,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"), @@ -1181,20 +1199,26 @@ 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, // and load them if found. + bool opened_any = false; for(;*argc>=1;(*argc)--) if((*argv)[*argc] && (*argv)[*argc][0]!='-') { studio_init_cb.task(_("Loading files...")); - about_window.hide(); + splash_screen.hide(); open((*argv)[*argc]); - about_window.show(); + opened_any = true; + splash_screen.show(); } + // if no file was specified to be opened, create a new document to help new users get started more easily + if (!opened_any && !getenv("SYNFIG_DISABLE_AUTOMATIC_DOCUMENT_CREATION")) + new_instance(); + studio_init_cb.task(_("Done.")); studio_init_cb.amount_complete(10000,10000); @@ -1232,6 +1256,8 @@ App::~App() delete auto_recover; + delete about; + toolbox->hide(); // studio::App::iteration(false); @@ -2024,7 +2050,8 @@ App::get_instance(etl::handle canvas) void App::dialog_about() { - (new class About())->show(); + if(about) + about->show(); } void