The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Merge ../birdfont-2.x

These changes was commited to the Birdfont repository Sat, 22 Oct 2016 11:08:38 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sat, 22 Oct 2016 11:08:38 +0000 (13:08 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sat, 22 Oct 2016 11:08:38 +0000 (13:08 +0200)
commit c00f4f840746e9290c616567f33232ccabb153bb
tree 70f7bf8743d38d5e9cbd0acda0002cfa12dc54d9
parent 3607be16e7430d40192e8a4d28174f8eb35e9b2b
parent c26be84d8ac2111096a6fca861a08868230cfdb2
Merge ../birdfont-2.x

libbirdfont/BirdFont.vala
libbirdfont/SettingsTab.vala
libbirdfont/ThemeTab.vala
scripts/version.py
--- a/libbirdfont/BirdFont.vala +++ b/libbirdfont/BirdFont.vala @@ -498,7 +498,13 @@ #if ANDROID return t; #else - return _(t); + string translate = Preferences.get ("translate"); + + if (translate == "" || translate == "true") { + return _(t); + } else { + return t; + } #endif }
--- a/libbirdfont/SettingsTab.vala +++ b/libbirdfont/SettingsTab.vala @@ -18,6 +18,8 @@ namespace BirdFont { public class SettingsTab : SettingsDisplay { + + string restart_message = "You need to restart the program in order to apply this setting."; public SettingsTab () { base (); @@ -141,6 +143,25 @@ DrawingTools.pen_tool.set_simplification_threshold (simplification_threshold.get_value ()); }); + Tool translate_ui = new Tool ("translate"); + translate_ui.select_action.connect((self) => { + Preferences.set ("translate", @"true"); + ThemeTab.redraw_ui (); + translate_ui.selected = true; + MainWindow.show_dialog (new MessageDialog (restart_message)); + }); + + translate_ui.deselect_action.connect((self) => { + Preferences.set ("translate", @"false"); + translate_ui.selected = false; + MainWindow.show_dialog (new MessageDialog (restart_message)); + ThemeTab.redraw_ui (); + }); + + string translate_setting = Preferences.get ("translate"); + translate_ui.selected = translate_setting == "" || translate_setting == "true"; + tools.add (new SettingsItem (translate_ui, t_("Translate"))); + Tool themes = new Tool ("open_theme_tab"); themes.set_icon ("theme"); themes.select_action.connect((self) => {
--- a/libbirdfont/ThemeTab.vala +++ b/libbirdfont/ThemeTab.vala @@ -53,7 +53,6 @@ select_theme.select_action.connect((self) => { string theme_file = self.get_name (); - TabBar tb; Toolbox toolbox; Preferences.set ("theme", theme_file); @@ -76,17 +75,7 @@ e.redraw (); } - Toolbox.redraw_tool_box (); - - GlyphCanvas.redraw (); - - tb = MainWindow.get_tab_bar (); - tb.redraw (0, 0, tb.width, tb.height); - - OverViewItem.label_background = null; - OverViewItem.selected_label_background = null; - OverViewItem.label_background_no_menu = null; - OverViewItem.selected_label_background_no_menu = null; + redraw_ui (); }); select_theme.set_icon ("theme"); @@ -140,6 +129,22 @@ } } + public static void redraw_ui (){ + TabBar tb; + + Toolbox.redraw_tool_box (); + + GlyphCanvas.redraw (); + + tb = MainWindow.get_tab_bar (); + tb.redraw (0, 0, tb.width, tb.height); + + OverViewItem.label_background = null; + OverViewItem.selected_label_background = null; + OverViewItem.label_background_no_menu = null; + OverViewItem.selected_label_background_no_menu = null; + } + public static string get_label_from_file_name (string theme) { string label;
--- a/scripts/version.py +++ b/scripts/version.py @@ -13,7 +13,7 @@ Lesser General Public License for more details. """ - VERSION = '2.16.12' + VERSION = '2.17.0' SO_VERSION_MAJOR = '36' SO_VERSION_MINOR = '0' SO_VERSION = SO_VERSION_MAJOR + '.' + SO_VERSION_MINOR