projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Create a new Document tab in the Settings Dialog and move the preferred X and Y sizes...
[synfig.git]
/
synfig-studio
/
trunk
/
src
/
gtkmm
/
app.cpp
diff --git
a/synfig-studio/trunk/src/gtkmm/app.cpp
b/synfig-studio/trunk/src/gtkmm/app.cpp
index
52a3023
..
09a2875
100644
(file)
--- a/
synfig-studio/trunk/src/gtkmm/app.cpp
+++ b/
synfig-studio/trunk/src/gtkmm/app.cpp
@@
-89,6
+89,7
@@
#include "state_rectangle.h"
#include "state_smoothmove.h"
#include "state_scale.h"
#include "state_rectangle.h"
#include "state_smoothmove.h"
#include "state_scale.h"
+#include "state_star.h"
#include "state_text.h"
#include "state_width.h"
#include "state_rotate.h"
#include "state_text.h"
#include "state_width.h"
#include "state_rotate.h"
@@
-273,6
+274,8
@@
bool studio::App::use_colorspace_gamma=true;
bool studio::App::single_threaded=false;
#endif
bool studio::App::restrict_radius_ducks=false;
bool studio::App::single_threaded=false;
#endif
bool studio::App::restrict_radius_ducks=false;
+int studio::App::preferred_x_size=480;
+int studio::App::preferred_y_size=270;
#ifdef USE_OPEN_FOR_URLS
String studio::App::browser_command("open"); // MacOS only
#else
#ifdef USE_OPEN_FOR_URLS
String studio::App::browser_command("open"); // MacOS only
#else
@@
-510,7
+513,16
@@
public:
value=App::browser_command;
return true;
}
value=App::browser_command;
return true;
}
-
+ if(key=="preferred_x_size")
+ {
+ value=strprintf("%i",App::preferred_x_size);
+ return true;
+ }
+ if(key=="preferred_y_size")
+ {
+ value=strprintf("%i",App::preferred_y_size);
+ return true;
+ }
return synfigapp::Settings::get_value(key,value);
}
return synfigapp::Settings::get_value(key,value);
}
@@
-579,7
+591,18
@@
public:
App::browser_command=value;
return true;
}
App::browser_command=value;
return true;
}
-
+ if(key=="preferred_x_size")
+ {
+ int i(atoi(value.c_str()));
+ App::preferred_x_size=i;
+ return true;
+ }
+ if(key=="preferred_y_size")
+ {
+ int i(atoi(value.c_str()));
+ App::preferred_y_size=i;
+ return true;
+ }
return synfigapp::Settings::set_value(key,value);
}
return synfigapp::Settings::set_value(key,value);
}
@@
-597,6
+620,8
@@
public:
ret.push_back("auto_recover_backup_interval");
ret.push_back("restrict_radius_ducks");
ret.push_back("browser_command");
ret.push_back("auto_recover_backup_interval");
ret.push_back("restrict_radius_ducks");
ret.push_back("browser_command");
+ ret.push_back("preferred_x_size");
+ ret.push_back("preferred_y_size");
return ret;
}
};
return ret;
}
};
@@
-669,6
+694,8
@@
init_ui_manager()
DEFINE_ACTION("copy", Gtk::StockID("gtk-copy"));
DEFINE_ACTION("paste", Gtk::StockID("gtk-paste"));
DEFINE_ACTION("select-all-ducks", _("Select All Ducks"));
DEFINE_ACTION("copy", Gtk::StockID("gtk-copy"));
DEFINE_ACTION("paste", Gtk::StockID("gtk-paste"));
DEFINE_ACTION("select-all-ducks", _("Select All Ducks"));
+ DEFINE_ACTION("unselect-all-ducks", _("Unselect All Ducks"));
+ DEFINE_ACTION("select-all-layers", _("Select All Layers"));
DEFINE_ACTION("unselect-all-layers", _("Unselect All Layers"));
DEFINE_ACTION("properties", _("Properties"));
DEFINE_ACTION("unselect-all-layers", _("Unselect All Layers"));
DEFINE_ACTION("properties", _("Properties"));
@@
-797,8
+824,10
@@
init_ui_manager()
" <menuitem action='copy'/>"
" <menuitem action='paste'/>"
" <separator name='bleh06'/>"
" <menuitem action='copy'/>"
" <menuitem action='paste'/>"
" <separator name='bleh06'/>"
-" <menuitem action='select-all-
duck
s'/>"
+" <menuitem action='select-all-
layer
s'/>"
" <menuitem action='unselect-all-layers'/>"
" <menuitem action='unselect-all-layers'/>"
+" <menuitem action='select-all-ducks'/>"
+" <menuitem action='unselect-all-ducks'/>"
" <separator name='bleh07'/>"
" <menuitem action='properties'/>"
" </menu>"
" <separator name='bleh07'/>"
" <menuitem action='properties'/>"
" </menu>"
@@
-937,7
+966,9
@@
init_ui_manager()
}
ACCEL("<Actions>//select-all-ducks","<Control>a");
}
ACCEL("<Actions>//select-all-ducks","<Control>a");
- ACCEL("<Actions>//unselect-all-layers","<Control>d");
+ ACCEL("<Actions>//unselect-all-ducks","<Control>d");
+ ACCEL("<Actions>//select-all-layers","<Control><Shift>a");
+ ACCEL("<Actions>//unselect-all-layers","<Control><Shift>d");
ACCEL("<Actions>//render","F9");
ACCEL("<Actions>//preview","F11");
ACCEL("<Actions>//properties","F8");
ACCEL("<Actions>//render","F9");
ACCEL("<Actions>//preview","F11");
ACCEL("<Actions>//properties","F8");
@@
-1001,25
+1032,25
@@
init_ui_manager()
ACCEL("<Actions>//state-normal", "<Mod1>a");
ACCEL("<Actions>//state-smooth_move", "<Mod1>v");
ACCEL("<Actions>//state-normal", "<Mod1>a");
ACCEL("<Actions>//state-smooth_move", "<Mod1>v");
- ACCEL("<Actions>//state-scale", "<Mod1>d");
- ACCEL("<Actions>//state-rotate", "<Mod1>s");
+ ACCEL("<Actions>//state-scale", "<Mod1>s");
+ ACCEL("<Actions>//state-rotate", "<Mod1>t");
+ ACCEL("<Actions>//state-mirror", "<Mod1>m");
- ACCEL("<Actions>//state-bline", "<Mod1>b");
ACCEL("<Actions>//state-circle", "<Mod1>c");
ACCEL("<Actions>//state-rectangle", "<Mod1>r");
ACCEL("<Actions>//state-circle", "<Mod1>c");
ACCEL("<Actions>//state-rectangle", "<Mod1>r");
+ ACCEL("<Actions>//state-star", "<Mod1>q");
ACCEL("<Actions>//state-gradient", "<Mod1>g");
ACCEL("<Actions>//state-gradient", "<Mod1>g");
+ ACCEL("<Actions>//state-polygon", "<Mod1>p");
- ACCEL("<Actions>//state-eyedrop", "<Mod1>e");
+ ACCEL("<Actions>//state-bline", "<Mod1>b");
+ ACCEL("<Actions>//state-text", "<Mod1>x");
ACCEL("<Actions>//state-fill", "<Mod1>f");
ACCEL("<Actions>//state-fill", "<Mod1>f");
+ ACCEL("<Actions>//state-eyedrop", "<Mod1>e");
ACCEL("<Actions>//state-zoom", "<Mod1>z");
ACCEL("<Actions>//state-zoom", "<Mod1>z");
- ACCEL("<Actions>//state-polygon", "<Mod1>p");
- ACCEL("<Actions>//state-draw", "<Mod1>
w
");
+ ACCEL("<Actions>//state-draw", "<Mod1>
d
");
ACCEL("<Actions>//state-sketch", "<Mod1>k");
ACCEL("<Actions>//state-sketch", "<Mod1>k");
- ACCEL("<Actions>//state-width", "<Mod1>t");
- ACCEL("<Actions>//state-mirror", "<Mod1>m");
-
- ACCEL("<Actions>//state-text", "<Mod1>x");
+ ACCEL("<Actions>//state-width", "<Mod1>w");
ACCEL("<Actions>//canvas-zoom-fit","<Control><Shift>z");
ACCEL("<Actions>//canvas-zoom-fit","<Control><Shift>z");
@@
-1185,20
+1216,21
@@
App::App(int *argc, char ***argv):
studio_init_cb.task(_("Init ModMirror...")); module_list_.push_back(new ModMirror()); module_list_.back()->start();
/* row 2 */
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_circle);
state_manager->add_state(&state_rectangle);
+ state_manager->add_state(&state_star);
state_manager->add_state(&state_gradient);
if(!getenv("SYNFIG_DISABLE_POLYGON")) state_manager->add_state(&state_polygon); // Enabled - for working without ducks
/* row 3 */
state_manager->add_state(&state_gradient);
if(!getenv("SYNFIG_DISABLE_POLYGON")) state_manager->add_state(&state_polygon); // Enabled - for working without ducks
/* 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_bline);
+
state_manager->add_state(&state_text
);
state_manager->add_state(&state_fill);
state_manager->add_state(&state_eyedrop);
state_manager->add_state(&state_zoom);
state_manager->add_state(&state_fill);
state_manager->add_state(&state_eyedrop);
state_manager->add_state(&state_zoom);
- state_manager->add_state(&state_text);
+ 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);
// Disabled by default - it doesn't work properly?
if(getenv("SYNFIG_ENABLE_WIDTH" )) state_manager->add_state(&state_width);
// Disabled by default - it doesn't work properly?
if(getenv("SYNFIG_ENABLE_WIDTH" )) state_manager->add_state(&state_width);
@@
-1616,10
+1648,13
@@
App::load_settings()
{
if(!window_size_broken && !file_window_size)
window_size_broken = true;
{
if(!window_size_broken && !file_window_size)
window_size_broken = true;
- if(!window_size_broken)
- add_recent_file(recent_file,recent_file_window_size);
- else
- add_recent_file(recent_file);
+ if (std::ifstream(recent_file.c_str()))
+ {
+ if(!window_size_broken)
+ add_recent_file(recent_file,recent_file_window_size);
+ else
+ add_recent_file(recent_file);
+ }
}
}
if(!window_size_broken && file_window_size)
}
}
if(!window_size_broken && file_window_size)
@@
-1668,6
+1703,8
@@
App::reset_initial_window_configuration()
synfigapp::Main::settings().set_value("pref.single_threaded","0");
#endif
synfigapp::Main::settings().set_value("pref.restrict_radius_ducks","0");
synfigapp::Main::settings().set_value("pref.single_threaded","0");
#endif
synfigapp::Main::settings().set_value("pref.restrict_radius_ducks","0");
+ synfigapp::Main::settings().set_value("pref.preferred_x_size","480");
+ synfigapp::Main::settings().set_value("pref.preferred_y_size","270");
synfigapp::Main::settings().set_value("window.toolbox.pos","4 4");
}
synfigapp::Main::settings().set_value("window.toolbox.pos","4 4");
}
@@
-1784,7
+1821,7
@@
static OPENFILENAME ofn={};
bool
App::dialog_open_file(const std::string &title, std::string &filename, std::string preference)
{
bool
App::dialog_open_file(const std::string &title, std::string &filename, std::string preference)
{
- info("App::dialog_open_file('%s', '%s', '%s')", title.c_str(), filename.c_str(), preference.c_str());
+
//
info("App::dialog_open_file('%s', '%s', '%s')", title.c_str(), filename.c_str(), preference.c_str());
#ifdef USE_WIN32_FILE_DIALOGS
static TCHAR szFilter[] = TEXT ("All Files (*.*)\0*.*\0\0") ;
#ifdef USE_WIN32_FILE_DIALOGS
static TCHAR szFilter[] = TEXT ("All Files (*.*)\0*.*\0\0") ;
@@
-1851,7
+1888,7
@@
App::dialog_open_file(const std::string &title, std::string &filename, std::stri
if(dialog->run() == GTK_RESPONSE_ACCEPT) {
filename = dialog->get_filename();
if(dialog->run() == GTK_RESPONSE_ACCEPT) {
filename = dialog->get_filename();
- info("Saving preference %s = '%s' in App::dialog_open_file()", preference.c_str(), dirname(filename).c_str());
+
//
info("Saving preference %s = '%s' in App::dialog_open_file()", preference.c_str(), dirname(filename).c_str());
_preferences.set_value(preference, dirname(filename));
delete dialog;
return true;
_preferences.set_value(preference, dirname(filename));
delete dialog;
return true;
@@
-1910,7
+1947,7
@@
App::dialog_open_file(const std::string &title, std::string &filename, std::stri
bool
App::dialog_save_file(const std::string &title, std::string &filename, std::string preference)
{
bool
App::dialog_save_file(const std::string &title, std::string &filename, std::string preference)
{
- info("App::dialog_save_file('%s', '%s', '%s')", title.c_str(), filename.c_str(), preference.c_str());
+
//
info("App::dialog_save_file('%s', '%s', '%s')", title.c_str(), filename.c_str(), preference.c_str());
#if USE_WIN32_FILE_DIALOGS
static TCHAR szFilter[] = TEXT ("All Files (*.*)\0*.*\0\0") ;
#if USE_WIN32_FILE_DIALOGS
static TCHAR szFilter[] = TEXT ("All Files (*.*)\0*.*\0\0") ;
@@
-2010,7
+2047,7
@@
App::dialog_save_file(const std::string &title, std::string &filename, std::stri
if (preference == ANIMATION_DIR_PREFERENCE)
set_file_version(synfig::ReleaseVersion(file_type_enum->get_value()));
filename = dialog->get_filename();
if (preference == ANIMATION_DIR_PREFERENCE)
set_file_version(synfig::ReleaseVersion(file_type_enum->get_value()));
filename = dialog->get_filename();
- info("Saving preference %s = '%s' in App::dialog_save_file()", preference.c_str(), dirname(filename).c_str());
+
//
info("Saving preference %s = '%s' in App::dialog_save_file()", preference.c_str(), dirname(filename).c_str());
_preferences.set_value(preference, dirname(filename));
delete dialog;
return true;
_preferences.set_value(preference, dirname(filename));
delete dialog;
return true;
@@
-2336,8
+2373,8
@@
App::new_instance()
canvas->rend_desc().set_y_res(DPI2DPM(72.0f));
canvas->rend_desc().set_tl(Vector(-4,2.25));
canvas->rend_desc().set_br(Vector(4,-2.25));
canvas->rend_desc().set_y_res(DPI2DPM(72.0f));
canvas->rend_desc().set_tl(Vector(-4,2.25));
canvas->rend_desc().set_br(Vector(4,-2.25));
- canvas->rend_desc().set_w(
480
);
- canvas->rend_desc().set_h(
270
);
+ canvas->rend_desc().set_w(
preferred_x_size
);
+ canvas->rend_desc().set_h(
preferred_y_size
);
canvas->rend_desc().set_antialias(1);
canvas->rend_desc().set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN);
canvas->set_file_name(file_name);
canvas->rend_desc().set_antialias(1);
canvas->rend_desc().set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN);
canvas->set_file_name(file_name);