Hello community, here is the log from the commit of package notes-up for openSUSE:Factory checked in at 2019-02-27 15:07:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/notes-up (Old) and /work/SRC/openSUSE:Factory/.notes-up.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "notes-up" Wed Feb 27 15:07:11 2019 rev:5 rq:679480 version:1.6.3 Changes: -------- --- /work/SRC/openSUSE:Factory/notes-up/notes-up.changes 2018-10-02 19:49:28.157703367 +0200 +++ /work/SRC/openSUSE:Factory/.notes-up.new.28833/notes-up.changes 2019-02-27 15:07:16.514426435 +0100 @@ -1,0 +2,18 @@ +Tue Dec 25 15:26:56 UTC 2018 - Alexei Podvalsky <[email protected]> + +- Update to 1.6.3: + * Merge branch 'master' of github.com:Philip-Scott/Notes-up + * 1.6.2 Release + * Update .travis.yml + * Only add new page on empty notebooks when creating the + notebook + * Refresh headerbar title on page save + * Fix travis builds + * HelpBox: Fix styling for Juno + * Remove deprecated warnings + * Use new Granite.markup_accel_tooltip + * Fix amps in title + * Add tooltip to page deletion button + * Remember all sidebar sizes + +------------------------------------------------------------------- Old: ---- Notes-up-1.6.1.tar.gz New: ---- Notes-up-1.6.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ notes-up.spec ++++++ --- /var/tmp/diff_new_pack.BU2ZTd/_old 2019-02-27 15:07:17.134426246 +0100 +++ /var/tmp/diff_new_pack.BU2ZTd/_new 2019-02-27 15:07:17.134426246 +0100 @@ -17,7 +17,7 @@ Name: notes-up -Version: 1.6.1 +Version: 1.6.3 Release: 0 Summary: Markdown notes editor & manager License: GPL-3.0-only @@ -30,7 +30,7 @@ BuildRequires: pkgconfig BuildRequires: update-desktop-files BuildRequires: vala >= 0.39.0 -BuildRequires: pkgconfig(granite) >= 0.5 +BuildRequires: pkgconfig(granite) >= 5.2.0 BuildRequires: pkgconfig(gthread-2.0) BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtksourceview-3.0) ++++++ Notes-up-1.6.1.tar.gz -> Notes-up-1.6.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/.travis.yml new/Notes-up-1.6.3/.travis.yml --- old/Notes-up-1.6.1/.travis.yml 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/.travis.yml 2018-12-21 17:14:47.000000000 +0100 @@ -18,7 +18,8 @@ - libstdc++-5-dev install: - - npm install @elementaryos/houston + - npm i -g @elementaryos/houston script: - houston ci + --name-domain com.github.philip-scott.notes-up diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/CMakeLists.txt new/Notes-up-1.6.3/CMakeLists.txt --- old/Notes-up-1.6.1/CMakeLists.txt 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/CMakeLists.txt 2018-12-21 17:14:47.000000000 +0100 @@ -11,7 +11,7 @@ find_package(PkgConfig) pkg_check_modules(DEPS REQUIRED - granite>=0.3 + granite>=5.2.0 gee-0.8 gtksourceview-3.0>=3.10 gthread-2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/data/com.github.philip-scott.notes-up.appdata.xml new/Notes-up-1.6.3/data/com.github.philip-scott.notes-up.appdata.xml --- old/Notes-up-1.6.1/data/com.github.philip-scott.notes-up.appdata.xml 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/data/com.github.philip-scott.notes-up.appdata.xml 2018-12-21 17:14:47.000000000 +0100 @@ -21,6 +21,26 @@ <binary>com.github.philip-scott.notes-up</binary> </provides> <releases> + <release version="1.6.3" date="2018-12-21"> + <description> + <p>Quick Bug Fix</p> + <ul> + <li>Fixed problem where the notes folder would not be re-created if it was deleted, preventing the app from opening again...</li> + </ul> + </description> + </release> + <release version="1.6.2" date="2018-12-04"> + <description> + <p>Juno Papercuts</p> + <ul> + <li>Tooltips with shortcuts now use the new style</li> + <li>Fixed a problem where Notes-Up would forget the sidebar size.</li> + <li>The styles on the HelpBox have been updated for Juno</li> + <li>If you delete the empty page created when you make a notebook, it will not re-appear</li> + <li>And other small bug fixes</li> + </ul> + </description> + </release> <release version="1.6.1" date="2018-09-23"> <description> <p>A Very Juno Update</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/schemas/org.notes.gschema.xml new/Notes-up-1.6.3/schemas/org.notes.gschema.xml --- old/Notes-up-1.6.1/schemas/org.notes.gschema.xml 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/schemas/org.notes.gschema.xml 2018-12-21 17:14:47.000000000 +0100 @@ -31,6 +31,12 @@ <description></description> </key> + <key name="notebook-panel-size" type="i"> + <default>50</default> + <summary>The saved width of the notebook panel.</summary> + <description></description> + </key> + <key name="mode" type="i"> <default>0</default> <summary>The last used mode</summary> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Application.vala new/Notes-up-1.6.3/src/Application.vala --- old/Notes-up-1.6.1/src/Application.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Application.vala 2018-12-21 17:14:47.000000000 +0100 @@ -52,6 +52,7 @@ } namespace ENotes { + public unowned ENotes.Application app; public ENotes.Services.Settings settings; public ENotes.Window window; public string NOTES_DB; @@ -68,30 +69,26 @@ construct { application_id = "com.github.philip-scott.notes-up"; program_name = PROGRAM_NAME; - app_years = "2015-2017"; exec_name = TERMINAL_NAME; app_launcher = "com.github.philip-scott.notes-up"; build_version = Constants.VERSION; - app_icon = "com.github.philip-scott.notes-up"; - main_url = "https://github.com/Philip-Scott/Notes-up/"; - bug_url = "https://github.com/Philip-Scott/Notes-up/issues"; - help_url = "https://github.com/Philip-Scott/Notes-up/"; - translate_url = "https://github.com/Philip-Scott/Notes-up/tree/master/po"; - about_authors = {"Felipe Escoto <[email protected]>", null}; - about_translators = _("translator-credits"); - - about_license_type = Gtk.License.GPL_3_0; } public override void activate () { if (!running) { + ENotes.app = this; settings = ENotes.Services.Settings.get_instance (); + var notes_path = Path.build_filename (GLib.Environment.get_home_dir (), "/.local/share/notes-up/"); + var notes_dir = File.new_for_path (notes_path); + + if (!notes_dir.query_exists ()) { + DirUtils.create_with_parents (notes_path, 0766); + } + if (settings.notes_database == "") { // Init databases - var notes_dir = GLib.Environment.get_home_dir () + "/.local/share/notes-up/"; - DirUtils.create_with_parents (notes_dir, 0766); - settings.notes_database = notes_dir + "NotesUp.db"; + settings.notes_database = Path.build_filename (notes_path, "NotesUp.db"); } ENotes.NOTES_DIR = settings.notes_location; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Services/DatabaseTable.vala new/Notes-up-1.6.3/src/Services/DatabaseTable.vala --- old/Notes-up-1.6.1/src/Services/DatabaseTable.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Services/DatabaseTable.vala 2018-12-21 17:14:47.000000000 +0100 @@ -70,7 +70,6 @@ // Open DB. int res = Sqlite.Database.open_v2 (filename, out db, Sqlite.OPEN_READWRITE | Sqlite.OPEN_CREATE, null); - assert (res == Sqlite.OK); // Check if we have write access to database. if (filename != Db.IN_MEMORY_NAME) { @@ -448,4 +447,3 @@ throw_error ("commit_transaction", res); } } - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Services/Notebook.vala new/Notes-up-1.6.3/src/Services/Notebook.vala --- old/Notes-up-1.6.1/src/Services/Notebook.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Services/Notebook.vala 2018-12-21 17:14:47.000000000 +0100 @@ -172,6 +172,8 @@ var last = last_insert_row (); var notebook = load_notebook_data (last); + PageTable.get_instance ().new_page (notebook.id); + notebook_added (notebook); return last; @@ -198,12 +200,12 @@ return stmt.column_text (0); } - + public void move_notebook (Notebook notebook, Notebook? parent_notebook) { var stmt = create_stmt ("UPDATE Notebook SET parent_id = ? WHERE id = ?"); bind_int (stmt, 1, parent_notebook != null ? parent_notebook.id : 0); bind_int (stmt, 2, notebook.id); - + stmt.step (); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Services/Page.vala new/Notes-up-1.6.3/src/Services/Page.vala --- old/Notes-up-1.6.1/src/Services/Page.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Services/Page.vala 2018-12-21 17:14:47.000000000 +0100 @@ -45,10 +45,10 @@ public signal void page_saved (Page page); private static PageTable instance = null; - + // This list is used for complex commands mostly by plugins e.g. "" <youtube [Link]> private Gee.LinkedList<BLMember> regex_complex_commands = new Gee.LinkedList<BLMember> (); - + // regex_simple_elements used for symbols. Some symbols are part of more complex commands so these // list is used at the end // first regular expression replaces # ~ ` etc. with "" @@ -86,18 +86,18 @@ } set_table_name ("Page"); - ///This code summarises a notebook page. Instead of given youtube link this code changes into Youtube Video - + ///This code summarises a notebook page. Instead of given youtube link this code changes into Youtube Video + // Explaination for link: Regex for [Something](Something). As greedy as editor on markdown - var link = new BLMember(/\[[\p{L}\d_\.\?\/:\=\+&\-'" ]*\]\([\p{L}\d_\.\?\/:\=\+&\-'"]*\)/, ""); - - // \[\^\d+\]:? leads to e.g. [^32], [^68]: + var link = new BLMember(/\[[\p{L}\d_\.\?\/:\=\+&\-'" ]*\]\([\p{L}\d_\.\?\/:\=\+&\-'"]*\)/, ""); // " + + // \[\^\d+\]:? leads to e.g. [^32], [^68]: var anchor = new BLMember (/\[\^\d+\]:?/, ""); - + regex_complex_commands = (Gee.LinkedList) PluginManager.get_instance ().get_all_blacklist_members (); regex_complex_commands.add (link); regex_complex_commands.add (anchor); - + } public Page? get_page (int64 page_id) { @@ -238,24 +238,24 @@ page.subtitle = ""; } } - + private string cleanup (string line) { string output = line; try { foreach (var item in regex_complex_commands) { - output = item.reg.replace (output, -1, 0, item.replace); - } - + output = item.reg.replace (output, -1, 0, item.replace); + } + foreach (var item in regex_simple_elements) { - output = item.reg.replace (output, -1, 0, item.replace); + output = item.reg.replace (output, -1, 0, item.replace); } } catch (GLib.RegexError e) { return ""; } if (line.contains ("---")) return ""; - + if (output.contains ("&")) output = output.replace ("&","&"); if (output.length > 0 && output[0] == ' ') { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Services/Settings.vala new/Notes-up-1.6.3/src/Services/Settings.vala --- old/Notes-up-1.6.1/src/Services/Settings.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Services/Settings.vala 2018-12-21 17:14:47.000000000 +0100 @@ -27,6 +27,7 @@ public int window_width { get; set; } public int window_height { get; set; } public int panel_size { get; set; } + public int notebook_panel_size { get; set; } public int mode { get; set; } public int last_notebook { get; set; } public int last_page { get; set; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Widgets/BookmarkButton.vala new/Notes-up-1.6.3/src/Widgets/BookmarkButton.vala --- old/Notes-up-1.6.1/src/Widgets/BookmarkButton.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Widgets/BookmarkButton.vala 2018-12-21 17:14:47.000000000 +0100 @@ -41,7 +41,7 @@ expand = false; can_focus = false; has_tooltip = true; - tooltip_text = (_("Bookmark page") + Key.BOOKMARK.to_string ()); + set_tooltip_markup (Granite.markup_accel_tooltip (app.get_accels_for_action ("win.bookmark-action"), _("Bookmark page"))); connect_signals (); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Widgets/Editor.vala new/Notes-up-1.6.3/src/Widgets/Editor.vala --- old/Notes-up-1.6.1/src/Widgets/Editor.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Widgets/Editor.vala 2018-12-21 17:14:47.000000000 +0100 @@ -172,9 +172,26 @@ private Gtk.Box build_toolbar () { var box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); - bold_button = new ENotes.ToolbarButton ("format-text-bold-symbolic", "**", "**", _("Add bold to text") + Key.BOLD.to_string (), code_buffer); - italics_button = new ENotes.ToolbarButton ("format-text-italic-symbolic", "_", "_", _("Add italic to text") + Key.ITALICS.to_string (), code_buffer); - strike_button = new ENotes.ToolbarButton ("format-text-strikethrough-symbolic", "~~", "~~", _("Strikethrough text") + Key.STRIKE.to_string (), code_buffer); + bold_button = new ENotes.ToolbarButton ( + "format-text-bold-symbolic", + "**", "**", + Granite.markup_accel_tooltip (app.get_accels_for_action ("win.bold-action"), _("Add bold to text")), + code_buffer + ); + + italics_button = new ENotes.ToolbarButton ( + "format-text-italic-symbolic", + "_", "_", + Granite.markup_accel_tooltip (app.get_accels_for_action ("win.italics-action"), _("Add italic to text")), + code_buffer + ); + + strike_button = new ENotes.ToolbarButton ( + "format-text-strikethrough-symbolic", + "~~", "~~", + Granite.markup_accel_tooltip (app.get_accels_for_action ("win.strike-action"), _("Strikethrough text")), + code_buffer + ); var quote_button = new ENotes.ToolbarButton ("format-indent-less-rtl", "> ", "", _("Insert a quote"), code_buffer); var code_button = new ENotes.ToolbarButton ("system-run", "`", "`", _("Insert code"), code_buffer); @@ -188,12 +205,12 @@ var separator1 = new Gtk.Separator (Gtk.Orientation.VERTICAL); var separator2 = new Gtk.Separator (Gtk.Orientation.VERTICAL); var separator3 = new Gtk.Separator (Gtk.Orientation.VERTICAL); - separator1.margin_left = 4; - separator2.margin_left = 4; - separator3.margin_left = 4; - separator1.margin_right = 4; - separator2.margin_right = 4; - separator3.margin_right = 4; + separator1.margin_start = 4; + separator2.margin_start = 4; + separator3.margin_start = 4; + separator1.margin_end = 4; + separator2.margin_end = 4; + separator3.margin_end = 4; box.add (bold_button); box.add (italics_button); @@ -252,6 +269,7 @@ current_page.data = this.get_text (); current_page.html_cache = ""; PageTable.get_instance ().save_page (current_page); + ViewEditStack.get_instance ().refresh_headerbar_title (); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Widgets/Headerbar.vala new/Notes-up-1.6.3/src/Widgets/Headerbar.vala --- old/Notes-up-1.6.1/src/Widgets/Headerbar.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Widgets/Headerbar.vala 2018-12-21 17:14:47.000000000 +0100 @@ -62,7 +62,7 @@ mode_button.append_text (_("Edit")); mode_button.valign = Gtk.Align.CENTER; - mode_button.set_tooltip_text (_("Change mode") + Key.CHANGE_MODE.to_string ()); + mode_button.set_tooltip_markup (Granite.markup_accel_tooltip (app.get_accels_for_action ("win.change-mode"), _("Change mode"))); create_menu (); @@ -75,7 +75,7 @@ search_entry.visibility = true; search_entry.expand = true; search_entry.max_width_chars = 30; - search_entry.margin_right = 12; + search_entry.margin_end = 12; search_entry_revealer = new Gtk.Revealer(); search_entry_revealer.valign = Gtk.Align.CENTER; @@ -85,7 +85,8 @@ search_button_revealer.transition_type = Gtk.RevealerTransitionType.SLIDE_LEFT; search_button = new Gtk.Button.from_icon_name ("edit-find-symbolic", Gtk.IconSize.LARGE_TOOLBAR); - search_button.tooltip_text = (_("Search your current notebook") + Key.FIND.to_string ()); + search_button.set_tooltip_markup (Granite.markup_accel_tooltip (app.get_accels_for_action ("win.find-action"), _("Search your current notebook"))); + search_button.clicked.connect(show_search); search_button_revealer.add(search_button); @@ -161,6 +162,8 @@ } else { this.title = ""; } + + this.title = this.title.replace ("&", "&"); } private void connect_signals () { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Widgets/HelpBox.vala new/Notes-up-1.6.3/src/Widgets/HelpBox.vala --- old/Notes-up-1.6.1/src/Widgets/HelpBox.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Widgets/HelpBox.vala 2018-12-21 17:14:47.000000000 +0100 @@ -31,7 +31,7 @@ grid = new Gtk.Grid (); grid.margin = 12; - grid.row_spacing = 4; + grid.expand = false; var scroll_box = new Gtk.ScrolledWindow (null, null); scroll_box.get_style_context ().add_class ("list"); @@ -68,8 +68,6 @@ private void add_item (string _name, string _style_class, string _code) { var title = new Gtk.Label (_name); - var code = new Gtk.Button.with_label (_code.replace ("\n", "")); - title.halign = Gtk.Align.START; title.set_use_markup (true); @@ -77,17 +75,29 @@ title.get_style_context ().add_class (_style_class); } - code.can_focus = false; + var code = new Gtk.Label (_code.replace ("\n", "")); + code.hexpand = true; code.halign = Gtk.Align.END; code.valign = Gtk.Align.CENTER; - code.get_style_context ().add_class ("tooltip"); - code.get_style_context ().remove_class ("button"); - code.clicked.connect (() => { + code.get_style_context ().add_class ("overlay-bar"); + code.get_style_context ().add_class ("h3"); + + var item_button = new Gtk.Button (); + item_button.get_style_context ().add_class ("flat"); + + item_button.clicked.connect (() => { insert_requested (_code); }); - grid.attach (title, 0, row, 1, 1); - grid.attach (code, 1, row++, 1, 1); - grid.attach (new Gtk.Separator (Gtk.Orientation.HORIZONTAL), 0, row++, 2, 1); + var item_grid = new Gtk.Grid (); + item_grid.orientation = Gtk.Orientation.HORIZONTAL; + item_grid.column_spacing = 6; + item_grid.add (title); + item_grid.add (code); + + item_button.add (item_grid); + + grid.attach (item_button, 0, row++, 1, 1); + grid.attach (new Gtk.Separator (Gtk.Orientation.HORIZONTAL), 0, row++, 1, 1); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Widgets/PageItem.vala new/Notes-up-1.6.3/src/Widgets/PageItem.vala --- old/Notes-up-1.6.1/src/Widgets/PageItem.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Widgets/PageItem.vala 2018-12-21 17:14:47.000000000 +0100 @@ -49,14 +49,14 @@ line1.ellipsize = Pango.EllipsizeMode.END; ((Gtk.Misc) line1).xalign = 0; line1.margin_top = 4; - line1.margin_left = 8; - line1.margin_right = 8; + line1.margin_start = 8; + line1.margin_end = 8; line1.margin_bottom = 4; line2 = new Gtk.Label (""); line2.halign = Gtk.Align.START; - line2.margin_left = 8; - line2.margin_right = 8; + line2.margin_start = 8; + line2.margin_end = 8; line2.margin_bottom = 4; line2.use_markup = true; line2.set_line_wrap (true); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Widgets/PagesList.vala new/Notes-up-1.6.3/src/Widgets/PagesList.vala --- old/Notes-up-1.6.1/src/Widgets/PagesList.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Widgets/PagesList.vala 2018-12-21 17:14:47.000000000 +0100 @@ -100,31 +100,35 @@ var box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); plus_button = new Gtk.Button.from_icon_name ("document-new-symbolic", Gtk.IconSize.SMALL_TOOLBAR); + + plus_button.set_tooltip_markup (Granite.markup_accel_tooltip (app.get_accels_for_action ("win.new-action"), _("New Page"))); + plus_button.get_style_context ().add_class ("flat"); + plus_button.can_focus = false; + minus_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic", Gtk.IconSize.SMALL_TOOLBAR); + minus_button.set_tooltip_text (_("Delete Page")); + minus_button.get_style_context ().add_class ("flat"); + minus_button.halign = Gtk.Align.END; + minus_button.no_show_all = true; + minus_button.can_focus = false; + minus_button.visible = false; + notebook_name = new Gtk.Label (""); page_total = new Gtk.Label (""); separator = new Gtk.Separator (Gtk.Orientation.VERTICAL); - minus_button.get_style_context ().add_class ("flat"); - plus_button.get_style_context ().add_class ("flat"); - notebook_name.halign = Gtk.Align.START; page_total.halign = Gtk.Align.END; - minus_button.halign = Gtk.Align.END; - minus_button.visible = false; + separator.visible = false; notebook_name.hexpand = true; - minus_button.can_focus = false; - plus_button.can_focus = false; - minus_button.no_show_all = true; separator.no_show_all = true; - plus_button.set_tooltip_text (_("New Page") + Key.NEW_PAGE.to_string ()); notebook_name.ellipsize = Pango.EllipsizeMode.END; notebook_name.get_style_context ().add_class ("h4"); - notebook_name.margin_left = 6; - notebook_name.margin_right = 6; - page_total.margin_right = 6; + notebook_name.margin_start = 6; + notebook_name.margin_end = 6; + page_total.margin_end = 6; box.add (notebook_name); box.add (page_total); @@ -189,12 +193,6 @@ new_page (page); } - bool has_pages = added_pages.size > 0; - - if (!has_pages) { - new_blank_page (); - } - toolbar.set_sensitive (true); minus_button.set_sensitive (false); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Widgets/ToolbarButton.vala new/Notes-up-1.6.3/src/Widgets/ToolbarButton.vala --- old/Notes-up-1.6.1/src/Widgets/ToolbarButton.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Widgets/ToolbarButton.vala 2018-12-21 17:14:47.000000000 +0100 @@ -42,7 +42,7 @@ this.first_half = first_half; this.second_half = second_half; - set_tooltip_text (description); + set_tooltip_markup (description); connect_signal (); } @@ -109,7 +109,7 @@ var wrapped_text = WordWrapper.wrap_string (word, first_half, second_half); this.change_text (start, end, wrapped_text); } else { - // prints the wrapping text and put cursor in the middle + // prints the wrapping text and put cursor in the middle code_buffer.insert_at_cursor (first_half + second_half, -1); code_buffer.get_iter_at_offset (out cursor_position, code_buffer.cursor_position); cursor_position.backward_chars (second_half.length); @@ -124,8 +124,8 @@ * Detects if cursor is inside a word */ private bool is_cursor_inside_word (Gtk.TextIter cursor_position, string first_half, string second_half) { - return cursor_position.inside_word () || - cursor_position.get_char ().isspace () || + return cursor_position.inside_word () || + cursor_position.get_char ().isspace () || cursor_position.get_char ().to_string () in first_half || cursor_position.get_char ().to_string () in second_half; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Widgets/ViewEditStack.vala new/Notes-up-1.6.3/src/Widgets/ViewEditStack.vala --- old/Notes-up-1.6.1/src/Widgets/ViewEditStack.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Widgets/ViewEditStack.vala 2018-12-21 17:14:47.000000000 +0100 @@ -44,6 +44,7 @@ private Gtk.Stack stack; public ENotes.Page? current_page {get; private set; default = null;} + public ENotes.Notebook? current_notebook {get; private set; default = null;} public static ViewEditStack get_instance () { if (instance == null) { @@ -76,14 +77,13 @@ return; } } - + editor.save_file (); current_page = PageTable.get_instance ().get_page (page.id); + current_notebook = ENotes.NotebookTable.get_instance().load_notebook_data (current_page.notebook_id); + editor.current_page = current_page; viewer.load_page (current_page); - - var ntbook = ENotes.NotebookTable.get_instance().load_notebook_data(current_page.notebook_id); - ENotes.Headerbar.get_instance ().set_title (page.name, ntbook.name); bookmark_button.set_page (current_page); page_set (current_page); @@ -93,6 +93,11 @@ } editor.set_sensitive (!Trash.get_instance ().is_page_trashed (page)); + refresh_headerbar_title (); + } + + public void refresh_headerbar_title () { + ENotes.Headerbar.get_instance ().set_title (current_page.name, current_notebook.name); } public void show_edit () { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Notes-up-1.6.1/src/Widgets/Window.vala new/Notes-up-1.6.3/src/Widgets/Window.vala --- old/Notes-up-1.6.1/src/Widgets/Window.vala 2018-09-24 06:59:47.000000000 +0200 +++ new/Notes-up-1.6.3/src/Widgets/Window.vala 2018-12-21 17:14:47.000000000 +0100 @@ -30,12 +30,65 @@ private Gtk.Paned pane1; private Gtk.Paned pane2; + private SimpleAction change_mode; + private SimpleAction save_action; + private SimpleAction close_action; + private SimpleAction new_action; + private SimpleAction find_action; + private SimpleAction bookmark_action; + private SimpleAction bold_action; + private SimpleAction italics_action; + private SimpleAction strike_action; + public Window (Gtk.Application app) { Object (application: app); DatabaseTable.init (ENotes.NOTES_DB); + change_mode = new SimpleAction ("change-mode", null); + save_action = new SimpleAction ("save", null); + close_action = new SimpleAction ("close-action", null); + new_action = new SimpleAction ("new-action", null); + find_action = new SimpleAction ("find-action", null); + bookmark_action = new SimpleAction ("bookmark-action", null); + bold_action = new SimpleAction ("bold-action", null); + italics_action = new SimpleAction ("italics-action", null); + strike_action = new SimpleAction ("strike-action", null); + + add_action (change_mode); + add_action (save_action); + add_action (close_action); + add_action (new_action); + add_action (find_action); + add_action (bookmark_action); + add_action (bold_action); + add_action (italics_action); + add_action (strike_action); + + app.set_accels_for_action ("win.change-mode", {ENotes.Key.CHANGE_MODE.to_key() }); + app.set_accels_for_action ("win.save", {ENotes.Key.SAVE.to_key()}); + app.set_accels_for_action ("win.close-action", {ENotes.Key.QUIT.to_key()}); + app.set_accels_for_action ("win.new-action", {ENotes.Key.NEW_PAGE.to_key()}); + app.set_accels_for_action ("win.find-action", {ENotes.Key.FIND.to_key()}); + app.set_accels_for_action ("win.bookmark-action", {ENotes.Key.BOOKMARK.to_key()}); + app.set_accels_for_action ("win.bold-action", {ENotes.Key.BOLD.to_key()}); + app.set_accels_for_action ("win.italics-action", {ENotes.Key.ITALICS.to_key()}); + app.set_accels_for_action ("win.strike-action", {ENotes.Key.STRIKE.to_key()}); + build_ui (); - connect_signals (app); + + change_mode.activate.connect (toggle_edit); + save_action.activate.connect (save); + close_action.activate.connect (request_close); + new_action.activate.connect (new_page); + find_action.activate.connect (headerbar.show_search); + bookmark_action.activate.connect (BookmarkButton.get_instance ().main_action); + bold_action.activate.connect (bold_act); + italics_action.activate.connect (italics_act); + strike_action.activate.connect (strike_act); + headerbar.mode_changed.connect ((mode) => { + set_mode (mode); + }); + load_settings (); Sidebar.get_instance ().first_start (); } @@ -59,64 +112,12 @@ pane1.pack2 (pane2, true, false); pane2.pack1 (pages_list, false, false); pane2.pack2 (view_edit_stack, true, false); - pane1.position = (50); this.move (settings.pos_x, settings.pos_y); this.add (pane1); this.show_all (); } - private void connect_signals (Gtk.Application app) { - var change_mode = new SimpleAction ("change-mode", null); - change_mode.activate.connect (toggle_edit); - add_action (change_mode); - app.set_accels_for_action ("win.change-mode", {ENotes.Key.CHANGE_MODE.to_key()}); - - var save_action = new SimpleAction ("save", null); - save_action.activate.connect (save); - add_action (save_action); - app.set_accels_for_action ("win.save", {ENotes.Key.SAVE.to_key()}); - - var close_action = new SimpleAction ("close-action", null); - close_action.activate.connect (request_close); - add_action (close_action); - app.set_accels_for_action ("win.close-action", {ENotes.Key.QUIT.to_key()}); - - var new_action = new SimpleAction ("new-action", null); - new_action.activate.connect (new_page); - add_action (new_action); - app.set_accels_for_action ("win.new-action", {ENotes.Key.NEW_PAGE.to_key()}); - - var find_action = new SimpleAction ("find-action", null); - find_action.activate.connect (headerbar.show_search); - add_action (find_action); - app.set_accels_for_action ("win.find-action", {ENotes.Key.FIND.to_key()}); - - var bookmark_action = new SimpleAction ("bookmark-action", null); - bookmark_action.activate.connect (BookmarkButton.get_instance ().main_action); - add_action (bookmark_action); - app.set_accels_for_action ("win.bookmark-action", {ENotes.Key.BOOKMARK.to_key()}); - - var bold_action = new SimpleAction ("bold-action", null); - bold_action.activate.connect (bold_act); - add_action (bold_action); - app.set_accels_for_action ("win.bold-action", {ENotes.Key.BOLD.to_key()}); - - var italics_action = new SimpleAction ("italics-action", null); - italics_action.activate.connect (italics_act); - add_action (italics_action); - app.set_accels_for_action ("win.italics-action", {ENotes.Key.ITALICS.to_key()}); - - var strike_action = new SimpleAction ("strike-action", null); - strike_action.activate.connect (strike_act); - add_action (strike_action); - app.set_accels_for_action ("win.strike-action", {ENotes.Key.STRIKE.to_key()}); - - headerbar.mode_changed.connect ((mode) => { - set_mode (mode); - }); - } - private void bold_act () { if (editor_open ()) Editor.get_instance ().bold_button.clicked (); } @@ -145,6 +146,7 @@ settings.pos_x = x; settings.pos_y = y; + settings.notebook_panel_size = pane1.position; settings.panel_size = pane2.position; settings.window_width = width; settings.window_height = height; @@ -159,6 +161,7 @@ private void load_settings () { resize (settings.window_width, settings.window_height); + pane1.position = settings.notebook_panel_size; pane2.position = settings.panel_size; if (settings.last_notebook != 0) { @@ -200,7 +203,6 @@ view_edit_stack.show_view (); } else { view_edit_stack.show_edit (); - pane2.set_position (0); } }
