Skip to content

Commit 05244d4

Browse files
committed
Only add new page on empty notebooks when creating the notebook
1 parent c895e50 commit 05244d4

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/Services/Notebook.vala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ public class ENotes.NotebookTable : DatabaseTable {
172172

173173
var last = last_insert_row ();
174174
var notebook = load_notebook_data (last);
175+
PageTable.get_instance ().new_page (notebook.id);
176+
175177
notebook_added (notebook);
176178

177179
return last;
@@ -198,12 +200,12 @@ public class ENotes.NotebookTable : DatabaseTable {
198200

199201
return stmt.column_text (0);
200202
}
201-
203+
202204
public void move_notebook (Notebook notebook, Notebook? parent_notebook) {
203205
var stmt = create_stmt ("UPDATE Notebook SET parent_id = ? WHERE id = ?");
204206
bind_int (stmt, 1, parent_notebook != null ? parent_notebook.id : 0);
205207
bind_int (stmt, 2, notebook.id);
206-
208+
207209
stmt.step ();
208210
}
209211

src/Widgets/PagesList.vala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,6 @@ public class ENotes.PagesList : Gtk.Box {
193193
new_page (page);
194194
}
195195

196-
bool has_pages = added_pages.size > 0;
197-
198-
if (!has_pages) {
199-
new_blank_page ();
200-
}
201-
202196
toolbar.set_sensitive (true);
203197
minus_button.set_sensitive (false);
204198

0 commit comments

Comments
 (0)