From 532fa5436c6ccba2cf8bab25951642161d636a65 Mon Sep 17 00:00:00 2001 From: Laurence Luo Date: Sun, 14 Jul 2024 21:17:06 +0800 Subject: [PATCH] Update --- KindleMate2/FrmMain.Designer.cs | 25 +++++++++++++------------ KindleMate2/FrmMain.cs | 9 +++++++++ KindleMate2/FrmMain.resx | 20 ++++++++++---------- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/KindleMate2/FrmMain.Designer.cs b/KindleMate2/FrmMain.Designer.cs index 1fcf63c..002a6dd 100644 --- a/KindleMate2/FrmMain.Designer.cs +++ b/KindleMate2/FrmMain.Designer.cs @@ -47,9 +47,9 @@ private void InitializeComponent() { menuKindle = new ToolStripMenuItem(); menuTheme = new ToolStripMenuItem(); menuLang = new ToolStripMenuItem(); - menuLangEN = new ToolStripMenuItem(); menuLangSC = new ToolStripMenuItem(); menuLangTC = new ToolStripMenuItem(); + menuLangEN = new ToolStripMenuItem(); menuLangAuto = new ToolStripMenuItem(); toolStripMenuItem1 = new ToolStripMenuItem(); splitContainerMain = new SplitContainer(); @@ -295,13 +295,6 @@ private void InitializeComponent() { menuLang.Size = new Size(50, 36); menuLang.Text = Strings.Language; // - // menuLangEN - // - menuLangEN.Name = "menuLangEN"; - menuLangEN.Size = new Size(213, 40); - menuLangEN.Text = "英文"; - menuLangEN.Click += MenuLangEN_Click; - // // menuLangSC // menuLangSC.Name = "menuLangSC"; @@ -316,6 +309,13 @@ private void InitializeComponent() { menuLangTC.Text = "繁体中文"; menuLangTC.Click += MenuLangTC_Click; // + // menuLangEN + // + menuLangEN.Name = "menuLangEN"; + menuLangEN.Size = new Size(213, 40); + menuLangEN.Text = "英文"; + menuLangEN.Click += MenuLangEN_Click; + // // menuLangAuto // menuLangAuto.Name = "menuLangAuto"; @@ -409,13 +409,13 @@ private void InitializeComponent() { menuClippings.ImageScalingSize = new Size(28, 28); menuClippings.Items.AddRange(new ToolStripItem[] { menuClippingsRefresh, menuClippingsCopy, menuClippingsDelete }); menuClippings.Name = "menuClippings"; - menuClippings.Size = new Size(127, 106); + menuClippings.Size = new Size(271, 144); // // menuClippingsRefresh // menuClippingsRefresh.Name = "menuClippingsRefresh"; menuClippingsRefresh.ShortcutKeyDisplayString = ""; - menuClippingsRefresh.Size = new Size(126, 34); + menuClippingsRefresh.Size = new Size(270, 34); menuClippingsRefresh.Text = Strings.Refresh; menuClippingsRefresh.Click += MenuClippingsRefresh_Click; // @@ -423,7 +423,7 @@ private void InitializeComponent() { // menuClippingsCopy.Name = "menuClippingsCopy"; menuClippingsCopy.ShortcutKeyDisplayString = ""; - menuClippingsCopy.Size = new Size(126, 34); + menuClippingsCopy.Size = new Size(270, 34); menuClippingsCopy.Text = Strings.Copy; menuClippingsCopy.Click += ClippingMenuCopy_Click; // @@ -431,7 +431,7 @@ private void InitializeComponent() { // menuClippingsDelete.Name = "menuClippingsDelete"; menuClippingsDelete.ShortcutKeyDisplayString = ""; - menuClippingsDelete.Size = new Size(126, 34); + menuClippingsDelete.Size = new Size(270, 34); menuClippingsDelete.Text = Strings.Delete; menuClippingsDelete.Click += ClippingMenuDelete_Click; // @@ -759,6 +759,7 @@ private void InitializeComponent() { SizeGripStyle = SizeGripStyle.Show; StartPosition = FormStartPosition.CenterScreen; Text = "Kindle Mate 2"; + FormClosing += FrmMain_FormClosing; Load += FrmMain_Load; menuStrip.ResumeLayout(false); menuStrip.PerformLayout(); diff --git a/KindleMate2/FrmMain.cs b/KindleMate2/FrmMain.cs index d861c9a..b186b6a 100644 --- a/KindleMate2/FrmMain.cs +++ b/KindleMate2/FrmMain.cs @@ -307,6 +307,8 @@ private void UpdateFrequency() { private void RefreshData() { try { + _staticData.CommitTransaction(); + if (dataGridView.CurrentRow is not null) { _selectedIndex = dataGridView.CurrentRow.Index; } @@ -1205,6 +1207,7 @@ private void BooksMenuDelete_Click(object sender, EventArgs e) { var bookname = treeViewBooks.SelectedNode.Text; if (!_staticData.DeleteClippingsByBook(bookname)) { Dialog(Strings.Delete_Failed, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); + _selectedBook = string.Empty; } break; @@ -1234,6 +1237,8 @@ private void BooksMenuDelete_Click(object sender, EventArgs e) { Dialog(Strings.Delete_Failed, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); } + _selectedWord = string.Empty; + break; } @@ -2050,5 +2055,9 @@ private void MenuLangAuto_Click(object sender, EventArgs e) { private void MenuListRefresh_Click(object sender, EventArgs e) { RefreshData(); } + + private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) { + _staticData.CommitTransaction(); + } } } \ No newline at end of file diff --git a/KindleMate2/FrmMain.resx b/KindleMate2/FrmMain.resx index 5e265ab..97c875c 100644 --- a/KindleMate2/FrmMain.resx +++ b/KindleMate2/FrmMain.resx @@ -122,10 +122,10 @@ - 1133, 17 + 1021, 17 - 885, 17 + 798, 17 17, 17 @@ -135,7 +135,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAKh8AAAJNU0Z0AUkBTAIBAQMB - AAGYAQkBmAEJARQBAAEUAQAD/wEAASEBAAj/AUIBTQE2BwABNgMAASgDAAFQAwABFAMAAQEBAAEgBgAB + AAGoAQkBqAEJARQBAAEUAQAD/wEAASEBAAj/AUIBTQE2BwABNgMAASgDAAFQAwABFAMAAQEBAAEgBgAB GRIAAxEBFgNKAYkCWAFaAb0DXQHMA10BzANdAcwDXQHMA10BzANdAcwDXQHMA10BzANdAcwDXQHMA10B zAJcAV8ByANYAbgDMQFMAw8BFGAAAzYBWQFCAUEBQgFyAUIBQQFCAXIDQgFyA0IBcwNCAXIDQgFyA0IB cgNCAXIDQgFyA0IBcgNCAXIDQgFyA0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