From 25bd7ebf383cde646d7759cee3d2eab319174b70 Mon Sep 17 00:00:00 2001 From: Kimura Youichi Date: Fri, 16 Sep 2016 20:58:21 +0900 Subject: [PATCH] =?utf8?q?TweenMain.TabRename=E3=83=A1=E3=82=BD=E3=83=83?= =?utf8?q?=E3=83=89=E3=81=AEtabName=E5=BC=95=E6=95=B0=E3=81=8C=E3=80=81?= =?utf8?q?=E6=97=A7=E3=82=BF=E3=83=96=E5=90=8D=E3=81=AE=E5=85=A5=E5=8A=9B?= =?utf8?q?=E3=81=A8=E6=96=B0=E3=82=BF=E3=83=96=E5=90=8D=E3=81=AE=E5=87=BA?= =?utf8?q?=E5=8A=9B=E3=82=92=E5=85=BC=E3=81=AD=E3=81=A6=E3=81=84=E3=81=9F?= =?utf8?q?=E3=81=AE=E3=82=92=E5=88=86=E9=9B=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes: opentween/Tween_CoderRepos@3a5e6aa45 ("フィルタ管理画面拡張中") --- OpenTween/FilterDialog.cs | 8 +++++--- OpenTween/Tween.cs | 31 ++++++++++++++++--------------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/OpenTween/FilterDialog.cs b/OpenTween/FilterDialog.cs index 34ce059b..24c5a346 100644 --- a/OpenTween/FilterDialog.cs +++ b/OpenTween/FilterDialog.cs @@ -1093,12 +1093,14 @@ namespace OpenTween { if (ListTabs.SelectedIndex > -1 && !string.IsNullOrEmpty(ListTabs.SelectedItem.ToString())) { - string tb = ListTabs.SelectedItem.ToString(); int idx = ListTabs.SelectedIndex; - if (((TweenMain)this.Owner).TabRename(ref tb)) + + var origTabName = (string)this.ListTabs.SelectedItem; + string newTabName; + if (((TweenMain)this.Owner).TabRename(origTabName, out newTabName)) { ListTabs.Items.RemoveAt(idx); - ListTabs.Items.Insert(idx, tb); + ListTabs.Items.Insert(idx, newTabName); ListTabs.SelectedIndex = idx; } } diff --git a/OpenTween/Tween.cs b/OpenTween/Tween.cs index 2e3d7a2f..e1b25a55 100644 --- a/OpenTween/Tween.cs +++ b/OpenTween/Tween.cs @@ -7422,26 +7422,26 @@ namespace OpenTween this.TopMost = this._cfgCommon.AlwaysTop; } - public bool TabRename(ref string tabName) + public bool TabRename(string origTabName, out string newTabName) { //タブ名変更 - string newTabText = null; + newTabName = null; using (InputTabName inputName = new InputTabName()) { - inputName.TabName = tabName; + inputName.TabName = origTabName; inputName.ShowDialog(); if (inputName.DialogResult == DialogResult.Cancel) return false; - newTabText = inputName.TabName; + newTabName = inputName.TabName; } this.TopMost = this._cfgCommon.AlwaysTop; - if (!string.IsNullOrEmpty(newTabText)) + if (!string.IsNullOrEmpty(newTabName)) { //新タブ名存在チェック for (int i = 0; i < ListTab.TabCount; i++) { - if (ListTab.TabPages[i].Text == newTabText) + if (ListTab.TabPages[i].Text == newTabName) { - string tmp = string.Format(Properties.Resources.Tabs_DoubleClickText1, newTabText); + string tmp = string.Format(Properties.Resources.Tabs_DoubleClickText1, newTabName); MessageBox.Show(tmp, Properties.Resources.Tabs_DoubleClickText2, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return false; } @@ -7449,18 +7449,17 @@ namespace OpenTween //タブ名を変更 for (int i = 0; i < ListTab.TabCount; i++) { - if (ListTab.TabPages[i].Text == tabName) + if (ListTab.TabPages[i].Text == origTabName) { - ListTab.TabPages[i].Text = newTabText; + ListTab.TabPages[i].Text = newTabName; break; } } - _statuses.RenameTab(tabName, newTabText); + _statuses.RenameTab(origTabName, newTabName); SaveConfigsCommon(); SaveConfigsTabs(); - _rclickTabName = newTabText; - tabName = newTabText; + _rclickTabName = newTabName; return true; } else @@ -7487,8 +7486,8 @@ namespace OpenTween private void ListTab_DoubleClick(object sender, MouseEventArgs e) { - string tn = ListTab.SelectedTab.Text; - TabRename(ref tn); + string _; + TabRename(this.ListTab.SelectedTab.Text, out _); } private void ListTab_MouseDown(object sender, MouseEventArgs e) @@ -10267,7 +10266,9 @@ namespace OpenTween private void TabRenameMenuItem_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(_rclickTabName)) return; - TabRename(ref _rclickTabName); + + string _; + TabRename(_rclickTabName, out _); } private async void BitlyToolStripMenuItem_Click(object sender, EventArgs e) -- 2.11.0