• R/O
  • HTTP
  • SSH
  • HTTPS

open-tween: Commit

開発に使用するリポジトリ


Commit MetaInfo

Revision46eef6ea13b110b073bd17484fafb758c5b38bce (tree)
Time2014-08-12 08:05:04
AuthorKimura Youichi <kim.upsilon@bucy...>
CommiterKimura Youichi

Log Message

検索タブに NG 設定の機能を追加 (thx ID:67v5i2dW0!)

Tweenスレに貼られた下記URLからソースコードを取得

http://anago.2ch.net/test/read.cgi/software/1358481754/938
http://www2.axfc.net/u/3293102

Change Summary

Incremental Difference

--- /dev/null
+++ b/OpenTween/EditNgDialog.Designer.cs
@@ -0,0 +1,210 @@
1+namespace OpenTween
2+{
3+ partial class EditNgDialog
4+ {
5+ /// <summary>
6+ /// Required designer variable.
7+ /// </summary>
8+ private System.ComponentModel.IContainer components = null;
9+
10+ /// <summary>
11+ /// Clean up any resources being used.
12+ /// </summary>
13+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14+ protected override void Dispose(bool disposing)
15+ {
16+ if (disposing && (components != null))
17+ {
18+ components.Dispose();
19+ }
20+ base.Dispose(disposing);
21+ }
22+
23+ #region Windows Form Designer generated code
24+
25+ /// <summary>
26+ /// Required method for Designer support - do not modify
27+ /// the contents of this method with the code editor.
28+ /// </summary>
29+ private void InitializeComponent()
30+ {
31+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
32+ this.groupBox3 = new System.Windows.Forms.GroupBox();
33+ this.dataGridViewSource = new System.Windows.Forms.DataGridView();
34+ this.groupBox2 = new System.Windows.Forms.GroupBox();
35+ this.dataGridViewWord = new System.Windows.Forms.DataGridView();
36+ this.groupBox1 = new System.Windows.Forms.GroupBox();
37+ this.dataGridViewScreenName = new System.Windows.Forms.DataGridView();
38+ this.panel1 = new System.Windows.Forms.Panel();
39+ this.buttonCancel = new System.Windows.Forms.Button();
40+ this.buttonOk = new System.Windows.Forms.Button();
41+ this.tableLayoutPanel1.SuspendLayout();
42+ this.groupBox3.SuspendLayout();
43+ ((System.ComponentModel.ISupportInitialize)(this.dataGridViewSource)).BeginInit();
44+ this.groupBox2.SuspendLayout();
45+ ((System.ComponentModel.ISupportInitialize)(this.dataGridViewWord)).BeginInit();
46+ this.groupBox1.SuspendLayout();
47+ ((System.ComponentModel.ISupportInitialize)(this.dataGridViewScreenName)).BeginInit();
48+ this.panel1.SuspendLayout();
49+ this.SuspendLayout();
50+ //
51+ // tableLayoutPanel1
52+ //
53+ this.tableLayoutPanel1.ColumnCount = 3;
54+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
55+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
56+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
57+ this.tableLayoutPanel1.Controls.Add(this.groupBox3, 2, 0);
58+ this.tableLayoutPanel1.Controls.Add(this.groupBox2, 1, 0);
59+ this.tableLayoutPanel1.Controls.Add(this.groupBox1, 0, 0);
60+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
61+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
62+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
63+ this.tableLayoutPanel1.RowCount = 1;
64+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
65+ this.tableLayoutPanel1.Size = new System.Drawing.Size(624, 398);
66+ this.tableLayoutPanel1.TabIndex = 0;
67+ //
68+ // groupBox3
69+ //
70+ this.groupBox3.Controls.Add(this.dataGridViewSource);
71+ this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
72+ this.groupBox3.Location = new System.Drawing.Point(419, 3);
73+ this.groupBox3.Name = "groupBox3";
74+ this.groupBox3.Size = new System.Drawing.Size(202, 392);
75+ this.groupBox3.TabIndex = 2;
76+ this.groupBox3.TabStop = false;
77+ this.groupBox3.Text = "Source";
78+ //
79+ // dataGridViewSource
80+ //
81+ this.dataGridViewSource.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
82+ this.dataGridViewSource.ColumnHeadersVisible = false;
83+ this.dataGridViewSource.Dock = System.Windows.Forms.DockStyle.Fill;
84+ this.dataGridViewSource.Location = new System.Drawing.Point(3, 15);
85+ this.dataGridViewSource.Name = "dataGridViewSource";
86+ this.dataGridViewSource.RowTemplate.Height = 21;
87+ this.dataGridViewSource.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
88+ this.dataGridViewSource.Size = new System.Drawing.Size(196, 374);
89+ this.dataGridViewSource.TabIndex = 2;
90+ //
91+ // groupBox2
92+ //
93+ this.groupBox2.Controls.Add(this.dataGridViewWord);
94+ this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
95+ this.groupBox2.Location = new System.Drawing.Point(211, 3);
96+ this.groupBox2.Name = "groupBox2";
97+ this.groupBox2.Size = new System.Drawing.Size(202, 392);
98+ this.groupBox2.TabIndex = 1;
99+ this.groupBox2.TabStop = false;
100+ this.groupBox2.Text = "発言内容";
101+ //
102+ // dataGridViewWord
103+ //
104+ this.dataGridViewWord.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
105+ this.dataGridViewWord.ColumnHeadersVisible = false;
106+ this.dataGridViewWord.Dock = System.Windows.Forms.DockStyle.Fill;
107+ this.dataGridViewWord.Location = new System.Drawing.Point(3, 15);
108+ this.dataGridViewWord.Name = "dataGridViewWord";
109+ this.dataGridViewWord.RowTemplate.Height = 21;
110+ this.dataGridViewWord.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
111+ this.dataGridViewWord.Size = new System.Drawing.Size(196, 374);
112+ this.dataGridViewWord.TabIndex = 1;
113+ //
114+ // groupBox1
115+ //
116+ this.groupBox1.Controls.Add(this.dataGridViewScreenName);
117+ this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
118+ this.groupBox1.Location = new System.Drawing.Point(3, 3);
119+ this.groupBox1.Name = "groupBox1";
120+ this.groupBox1.Size = new System.Drawing.Size(202, 392);
121+ this.groupBox1.TabIndex = 0;
122+ this.groupBox1.TabStop = false;
123+ this.groupBox1.Text = "ユーザーID";
124+ //
125+ // dataGridViewScreenName
126+ //
127+ this.dataGridViewScreenName.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
128+ this.dataGridViewScreenName.ColumnHeadersVisible = false;
129+ this.dataGridViewScreenName.Dock = System.Windows.Forms.DockStyle.Fill;
130+ this.dataGridViewScreenName.Location = new System.Drawing.Point(3, 15);
131+ this.dataGridViewScreenName.Name = "dataGridViewScreenName";
132+ this.dataGridViewScreenName.RowTemplate.Height = 21;
133+ this.dataGridViewScreenName.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
134+ this.dataGridViewScreenName.Size = new System.Drawing.Size(196, 374);
135+ this.dataGridViewScreenName.TabIndex = 0;
136+ //
137+ // panel1
138+ //
139+ this.panel1.Controls.Add(this.buttonCancel);
140+ this.panel1.Controls.Add(this.buttonOk);
141+ this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
142+ this.panel1.Location = new System.Drawing.Point(0, 398);
143+ this.panel1.Name = "panel1";
144+ this.panel1.Size = new System.Drawing.Size(624, 44);
145+ this.panel1.TabIndex = 1;
146+ //
147+ // buttonCancel
148+ //
149+ this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
150+ this.buttonCancel.Location = new System.Drawing.Point(537, 9);
151+ this.buttonCancel.Name = "buttonCancel";
152+ this.buttonCancel.Size = new System.Drawing.Size(75, 23);
153+ this.buttonCancel.TabIndex = 1;
154+ this.buttonCancel.Text = "キャンセル";
155+ this.buttonCancel.UseVisualStyleBackColor = true;
156+ this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
157+ //
158+ // buttonOk
159+ //
160+ this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
161+ this.buttonOk.Location = new System.Drawing.Point(456, 9);
162+ this.buttonOk.Name = "buttonOk";
163+ this.buttonOk.Size = new System.Drawing.Size(75, 23);
164+ this.buttonOk.TabIndex = 0;
165+ this.buttonOk.Text = "OK";
166+ this.buttonOk.UseVisualStyleBackColor = true;
167+ this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click);
168+ //
169+ // EditNgDialog
170+ //
171+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
172+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
173+ this.ClientSize = new System.Drawing.Size(624, 442);
174+ this.ControlBox = false;
175+ this.Controls.Add(this.tableLayoutPanel1);
176+ this.Controls.Add(this.panel1);
177+ this.MaximizeBox = false;
178+ this.MinimizeBox = false;
179+ this.Name = "EditNgDialog";
180+ this.ShowIcon = false;
181+ this.ShowInTaskbar = false;
182+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
183+ this.Text = "NG設定";
184+ this.TopMost = true;
185+ this.tableLayoutPanel1.ResumeLayout(false);
186+ this.groupBox3.ResumeLayout(false);
187+ ((System.ComponentModel.ISupportInitialize)(this.dataGridViewSource)).EndInit();
188+ this.groupBox2.ResumeLayout(false);
189+ ((System.ComponentModel.ISupportInitialize)(this.dataGridViewWord)).EndInit();
190+ this.groupBox1.ResumeLayout(false);
191+ ((System.ComponentModel.ISupportInitialize)(this.dataGridViewScreenName)).EndInit();
192+ this.panel1.ResumeLayout(false);
193+ this.ResumeLayout(false);
194+
195+ }
196+
197+ #endregion
198+
199+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
200+ private System.Windows.Forms.Panel panel1;
201+ private System.Windows.Forms.Button buttonOk;
202+ private System.Windows.Forms.Button buttonCancel;
203+ private System.Windows.Forms.GroupBox groupBox3;
204+ private System.Windows.Forms.GroupBox groupBox2;
205+ private System.Windows.Forms.GroupBox groupBox1;
206+ private System.Windows.Forms.DataGridView dataGridViewSource;
207+ private System.Windows.Forms.DataGridView dataGridViewWord;
208+ private System.Windows.Forms.DataGridView dataGridViewScreenName;
209+ }
210+}
\ No newline at end of file
--- /dev/null
+++ b/OpenTween/EditNgDialog.cs
@@ -0,0 +1,97 @@
1+using System;
2+using System.Collections.Generic;
3+using System.ComponentModel;
4+using System.Data;
5+using System.Drawing;
6+using System.Linq;
7+using System.Text;
8+using System.Threading.Tasks;
9+using System.Windows.Forms;
10+
11+namespace OpenTween
12+{
13+ public partial class EditNgDialog : OTBaseForm
14+ {
15+ private TabClass _tabClass = null;
16+ public TabClass TabClass
17+ {
18+ get
19+ {
20+ return this._tabClass;
21+ }
22+ set
23+ {
24+ this._tabClass = value;
25+ if (value != null)
26+ {
27+ this.dataGridViewScreenName.DataSource = createDataTableFromList(value.SearchNgScreenNames);
28+ this.dataGridViewWord.DataSource = createDataTableFromList(value.SearchNgWords);
29+ this.dataGridViewSource.DataSource = createDataTableFromList(value.SearchNgSources);
30+ }
31+ }
32+ }
33+
34+ public EditNgDialog()
35+ {
36+ InitializeComponent();
37+
38+ this.TabClass = null;
39+ }
40+
41+ private void buttonOk_Click(object sender, EventArgs e)
42+ {
43+ if (this.TabClass != null)
44+ {
45+ this.TabClass.SearchNgScreenNames = createListFromDataTable((DataTable)this.dataGridViewScreenName.DataSource);
46+ this.TabClass.SearchNgWords = createListFromDataTable((DataTable)this.dataGridViewWord.DataSource);
47+ this.TabClass.SearchNgSources = createListFromDataTable((DataTable)this.dataGridViewSource.DataSource);
48+
49+ this.DialogResult = DialogResult.OK;
50+ }
51+ else
52+ {
53+ this.DialogResult = DialogResult.Cancel;
54+ }
55+ this.Close();
56+ }
57+
58+ private void buttonCancel_Click(object sender, EventArgs e)
59+ {
60+ this.DialogResult = DialogResult.Cancel;
61+ this.Close();
62+ }
63+
64+ private DataTable createDataTableFromList(List<string> list)
65+ {
66+ DataTable dt = new DataTable();
67+
68+ dt.Columns.Add("text");
69+
70+ if (list != null)
71+ {
72+ list.ForEach(delegate(string text)
73+ {
74+ dt.Rows.Add(text);
75+ });
76+ }
77+
78+ return dt;
79+ }
80+
81+ private List<string> createListFromDataTable(DataTable dt)
82+ {
83+ List<string> list = new List<string>();
84+
85+ foreach (DataRow row in dt.Rows)
86+ {
87+ // 重複チェック
88+ if (!list.Contains((string)row[0]))
89+ {
90+ list.Add((string)row[0]);
91+ }
92+ }
93+
94+ return list;
95+ }
96+ }
97+}
--- /dev/null
+++ b/OpenTween/EditNgDialog.resx
@@ -0,0 +1,120 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<root>
3+ <!--
4+ Microsoft ResX Schema
5+
6+ Version 2.0
7+
8+ The primary goals of this format is to allow a simple XML format
9+ that is mostly human readable. The generation and parsing of the
10+ various data types are done through the TypeConverter classes
11+ associated with the data types.
12+
13+ Example:
14+
15+ ... ado.net/XML headers & schema ...
16+ <resheader name="resmimetype">text/microsoft-resx</resheader>
17+ <resheader name="version">2.0</resheader>
18+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+ <value>[base64 mime encoded serialized .NET Framework object]</value>
24+ </data>
25+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+ <comment>This is a comment</comment>
28+ </data>
29+
30+ There are any number of "resheader" rows that contain simple
31+ name/value pairs.
32+
33+ Each data row contains a name, and value. The row also contains a
34+ type or mimetype. Type corresponds to a .NET class that support
35+ text/value conversion through the TypeConverter architecture.
36+ Classes that don't support this are serialized and stored with the
37+ mimetype set.
38+
39+ The mimetype is used for serialized objects, and tells the
40+ ResXResourceReader how to depersist the object. This is currently not
41+ extensible. For a given mimetype the value must be set accordingly:
42+
43+ Note - application/x-microsoft.net.object.binary.base64 is the format
44+ that the ResXResourceWriter will generate, however the reader can
45+ read any of the formats listed below.
46+
47+ mimetype: application/x-microsoft.net.object.binary.base64
48+ value : The object must be serialized with
49+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50+ : and then encoded with base64 encoding.
51+
52+ mimetype: application/x-microsoft.net.object.soap.base64
53+ value : The object must be serialized with
54+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+ : and then encoded with base64 encoding.
56+
57+ mimetype: application/x-microsoft.net.object.bytearray.base64
58+ value : The object must be serialized into a byte array
59+ : using a System.ComponentModel.TypeConverter
60+ : and then encoded with base64 encoding.
61+ -->
62+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64+ <xsd:element name="root" msdata:IsDataSet="true">
65+ <xsd:complexType>
66+ <xsd:choice maxOccurs="unbounded">
67+ <xsd:element name="metadata">
68+ <xsd:complexType>
69+ <xsd:sequence>
70+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
71+ </xsd:sequence>
72+ <xsd:attribute name="name" use="required" type="xsd:string" />
73+ <xsd:attribute name="type" type="xsd:string" />
74+ <xsd:attribute name="mimetype" type="xsd:string" />
75+ <xsd:attribute ref="xml:space" />
76+ </xsd:complexType>
77+ </xsd:element>
78+ <xsd:element name="assembly">
79+ <xsd:complexType>
80+ <xsd:attribute name="alias" type="xsd:string" />
81+ <xsd:attribute name="name" type="xsd:string" />
82+ </xsd:complexType>
83+ </xsd:element>
84+ <xsd:element name="data">
85+ <xsd:complexType>
86+ <xsd:sequence>
87+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89+ </xsd:sequence>
90+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93+ <xsd:attribute ref="xml:space" />
94+ </xsd:complexType>
95+ </xsd:element>
96+ <xsd:element name="resheader">
97+ <xsd:complexType>
98+ <xsd:sequence>
99+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100+ </xsd:sequence>
101+ <xsd:attribute name="name" type="xsd:string" use="required" />
102+ </xsd:complexType>
103+ </xsd:element>
104+ </xsd:choice>
105+ </xsd:complexType>
106+ </xsd:element>
107+ </xsd:schema>
108+ <resheader name="resmimetype">
109+ <value>text/microsoft-resx</value>
110+ </resheader>
111+ <resheader name="version">
112+ <value>2.0</value>
113+ </resheader>
114+ <resheader name="reader">
115+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+ </resheader>
117+ <resheader name="writer">
118+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119+ </resheader>
120+</root>
\ No newline at end of file
--- a/OpenTween/OpenTween.csproj
+++ b/OpenTween/OpenTween.csproj
@@ -116,6 +116,10 @@
116116 <Compile Include="Connection\Imgur.cs" />
117117 <Compile Include="Connection\Networking.cs" />
118118 <Compile Include="Connection\TwipplePhoto.cs" />
119+ <Compile Include="EditNgDialog.cs" />
120+ <Compile Include="EditNgDialog.Designer.cs">
121+ <DependentUpon>EditNgDialog.cs</DependentUpon>
122+ </Compile>
119123 <Compile Include="EventViewerDialog.cs">
120124 <SubType>Form</SubType>
121125 </Compile>
@@ -403,6 +407,9 @@
403407 <EmbeddedResource Include="AuthDialog.resx">
404408 <DependentUpon>AuthDialog.cs</DependentUpon>
405409 </EmbeddedResource>
410+ <EmbeddedResource Include="EditNgDialog.resx">
411+ <DependentUpon>EditNgDialog.cs</DependentUpon>
412+ </EmbeddedResource>
406413 <EmbeddedResource Include="EventViewerDialog.en.resx">
407414 <DependentUpon>EventViewerDialog.cs</DependentUpon>
408415 </EmbeddedResource>
--- a/OpenTween/Resources/ChangeLog.txt
+++ b/OpenTween/Resources/ChangeLog.txt
@@ -1,6 +1,7 @@
11 更新履歴
22
33 ==== Ver 1.2.3-beta1(2014/xx/xx)
4+ * NEW: 検索タブに NG 設定の機能を追加 (thx ID:67v5i2dW0!)
45
56 ==== Ver 1.2.2(2014/07/06)
67 * このバージョンのOpenTweenは pic.twitter.com に複数枚の画像が含まれている場合の表示に対応していますが、
--- a/OpenTween/StatusDictionary.cs
+++ b/OpenTween/StatusDictionary.cs
@@ -1247,6 +1247,34 @@ namespace OpenTween
12471247 if (tb == null) return;
12481248 if (tb.Contains(Item.StatusId)) return;
12491249 //tb.Add(Item.StatusId, Item.IsRead, true);
1250+ //TODO:ここで弾く処理。
1251+ if (tb.TabType == MyCommon.TabUsageType.PublicSearch)
1252+ {
1253+ // NG ID
1254+ if (tb.SearchNgScreenNames.Count > 0 &&
1255+ tb.SearchNgScreenNames.Contains(Item.ScreenName))
1256+ {
1257+ return;
1258+ }
1259+ // NG ワード
1260+ if (tb.SearchNgWords.Count > 0)
1261+ {
1262+ // TODO: なんか処理重そう
1263+ foreach (string word in tb.SearchNgWords)
1264+ {
1265+ if (Item.Text.Contains(word))
1266+ {
1267+ return;
1268+ }
1269+ }
1270+ }
1271+ // NG ソース
1272+ if (tb.SearchNgSources.Count > 0 &&
1273+ tb.SearchNgSources.Contains(Item.Source))
1274+ {
1275+ return;
1276+ }
1277+ }
12501278 tb.AddPostToInnerStorage(Item);
12511279 }
12521280 }
@@ -1972,6 +2000,10 @@ namespace OpenTween
19722000 private string _searchWords = "";
19732001 private string _nextPageQuery = "";
19742002
2003+ private List<string> _searchNgScreenNames = new List<string>();
2004+ private List<string> _searchNgWords = new List<string>();
2005+ private List<string> _searchNgSources = new List<string>();
2006+
19752007 public string SearchLang
19762008 {
19772009 get
@@ -1996,6 +2028,39 @@ namespace OpenTween
19962028 _searchWords = value.Trim();
19972029 }
19982030 }
2031+ public List<string> SearchNgScreenNames
2032+ {
2033+ get
2034+ {
2035+ return _searchNgScreenNames;
2036+ }
2037+ set
2038+ {
2039+ _searchNgScreenNames = value;
2040+ }
2041+ }
2042+ public List<string> SearchNgWords
2043+ {
2044+ get
2045+ {
2046+ return _searchNgWords;
2047+ }
2048+ set
2049+ {
2050+ _searchNgWords = value;
2051+ }
2052+ }
2053+ public List<string> SearchNgSources
2054+ {
2055+ get
2056+ {
2057+ return _searchNgSources;
2058+ }
2059+ set
2060+ {
2061+ _searchNgSources = value;
2062+ }
2063+ }
19992064
20002065 public string NextPageQuery
20012066 {
--- a/OpenTween/Tween.Designer.cs
+++ b/OpenTween/Tween.Designer.cs
@@ -61,6 +61,8 @@
6161 this.ToolStripSeparator18 = new System.Windows.Forms.ToolStripSeparator();
6262 this.FilterEditMenuItem = new System.Windows.Forms.ToolStripMenuItem();
6363 this.ToolStripSeparator19 = new System.Windows.Forms.ToolStripSeparator();
64+ this.NgEditMenuItem = new System.Windows.Forms.ToolStripMenuItem();
65+ this.toolStripSeparator46 = new System.Windows.Forms.ToolStripSeparator();
6466 this.ClearTabMenuItem = new System.Windows.Forms.ToolStripMenuItem();
6567 this.ToolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
6668 this.DeleteTabMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -199,6 +201,8 @@
199201 this.ToolStripSeparator29 = new System.Windows.Forms.ToolStripSeparator();
200202 this.EditRuleTbMenuItem = new System.Windows.Forms.ToolStripMenuItem();
201203 this.ToolStripSeparator30 = new System.Windows.Forms.ToolStripSeparator();
204+ this.NgEditTabMenuItem = new System.Windows.Forms.ToolStripMenuItem();
205+ this.toolStripSeparator47 = new System.Windows.Forms.ToolStripSeparator();
202206 this.ClearTbMenuItem = new System.Windows.Forms.ToolStripMenuItem();
203207 this.ToolStripSeparator31 = new System.Windows.Forms.ToolStripSeparator();
204208 this.DeleteTbMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -584,6 +588,8 @@
584588 this.ToolStripSeparator18,
585589 this.FilterEditMenuItem,
586590 this.ToolStripSeparator19,
591+ this.NgEditMenuItem,
592+ this.toolStripSeparator46,
587593 this.ClearTabMenuItem,
588594 this.ToolStripSeparator11,
589595 this.DeleteTabMenuItem});
@@ -654,6 +660,17 @@
654660 resources.ApplyResources(this.ToolStripSeparator19, "ToolStripSeparator19");
655661 this.ToolStripSeparator19.Name = "ToolStripSeparator19";
656662 //
663+ // NgEditMenuItem
664+ //
665+ resources.ApplyResources(this.NgEditMenuItem, "NgEditMenuItem");
666+ this.NgEditMenuItem.Name = "NgEditMenuItem";
667+ this.NgEditMenuItem.Click += new System.EventHandler(this.NgEditMenuItem_Click);
668+ //
669+ // toolStripSeparator46
670+ //
671+ resources.ApplyResources(this.toolStripSeparator46, "toolStripSeparator46");
672+ this.toolStripSeparator46.Name = "toolStripSeparator46";
673+ //
657674 // ClearTabMenuItem
658675 //
659676 resources.ApplyResources(this.ClearTabMenuItem, "ClearTabMenuItem");
@@ -1621,6 +1638,8 @@
16211638 this.ToolStripSeparator29,
16221639 this.EditRuleTbMenuItem,
16231640 this.ToolStripSeparator30,
1641+ this.NgEditTabMenuItem,
1642+ this.toolStripSeparator47,
16241643 this.ClearTbMenuItem,
16251644 this.ToolStripSeparator31,
16261645 this.DeleteTbMenuItem});
@@ -1688,6 +1707,17 @@
16881707 resources.ApplyResources(this.ToolStripSeparator30, "ToolStripSeparator30");
16891708 this.ToolStripSeparator30.Name = "ToolStripSeparator30";
16901709 //
1710+ // NgEditTabMenuItem
1711+ //
1712+ resources.ApplyResources(this.NgEditTabMenuItem, "NgEditTabMenuItem");
1713+ this.NgEditTabMenuItem.Name = "NgEditTabMenuItem";
1714+ this.NgEditTabMenuItem.Click += new System.EventHandler(this.NgEditMenuItem_Click);
1715+ //
1716+ // toolStripSeparator47
1717+ //
1718+ resources.ApplyResources(this.toolStripSeparator47, "toolStripSeparator47");
1719+ this.toolStripSeparator47.Name = "toolStripSeparator47";
1720+ //
16911721 // ClearTbMenuItem
16921722 //
16931723 resources.ApplyResources(this.ClearTbMenuItem, "ClearTbMenuItem");
@@ -2841,6 +2871,10 @@
28412871 internal System.Windows.Forms.ToolStripMenuItem IconSize48_2ToolStripMenuItem;
28422872 internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator45;
28432873 internal System.Windows.Forms.ToolStripMenuItem LockListSortOrderToolStripMenuItem;
2874+ private System.Windows.Forms.ToolStripMenuItem NgEditMenuItem;
2875+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator46;
2876+ private System.Windows.Forms.ToolStripMenuItem NgEditTabMenuItem;
2877+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator47;
28442878
28452879 }
28462880 }
\ No newline at end of file
--- a/OpenTween/Tween.cs
+++ b/OpenTween/Tween.cs
@@ -8702,6 +8702,17 @@ namespace OpenTween
87028702 this.UnreadMngTbMenuItem.Checked = tb.UnreadManage;
87038703
87048704 TabMenuControl(_rclickTabName);
8705+ // TODO:TabMenuControl(string) で同じ事をやってるのでスマートじゃない。
8706+ if (tb.TabType == MyCommon.TabUsageType.PublicSearch)
8707+ {
8708+ NgEditMenuItem.Enabled = true;
8709+ NgEditTabMenuItem.Enabled = true;
8710+ }
8711+ else
8712+ {
8713+ NgEditMenuItem.Enabled = false;
8714+ NgEditTabMenuItem.Enabled = false;
8715+ }
87058716 }
87068717
87078718 private void TabMenuControl(string tabName)
@@ -13289,5 +13300,46 @@ namespace OpenTween
1328913300
1329013301 _modifySettingCommon = true;
1329113302 }
13303+
13304+ private void NgEditMenuItem_Click(object sender, EventArgs e)
13305+ {
13306+ // TODO: TabClass 取得したかったから ContextMenuTabProperty_Opening から一部コピペ。汚い。
13307+ if (string.IsNullOrEmpty(_rclickTabName))
13308+ {
13309+ if (ListTab != null && ListTab.SelectedTab != null)
13310+ _rclickTabName = ListTab.SelectedTab.Text;
13311+ else
13312+ return;
13313+ }
13314+
13315+ if (_statuses == null) return;
13316+ if (_statuses.Tabs == null) return;
13317+
13318+ TabClass tb = _statuses.Tabs[_rclickTabName];
13319+ if (tb == null) return;
13320+
13321+ // TODO: めんどいのでここで new
13322+ using (EditNgDialog dialog = new EditNgDialog())
13323+ {
13324+ dialog.TabClass = tb;
13325+ if (dialog.ShowDialog(this) == DialogResult.OK)
13326+ {
13327+ // 保存
13328+ SaveConfigsTabs();
13329+
13330+ // 選択されたタブをアクティブにする。
13331+ foreach (TabPage tab in ListTab.TabPages)
13332+ {
13333+ if (tab.Text == tb.TabName)
13334+ {
13335+ ListTab.SelectedTab = tab;
13336+ // TODO: 再度検索をかける。API消費しちゃう。でもNG解除の事とか考えると妥当か。
13337+ SearchButton_Click(ListTab.SelectedTab.Controls["panelSearch"].Controls["comboSearch"], null);
13338+ break;
13339+ }
13340+ }
13341+ }
13342+ }
13343+ }
1329213344 }
1329313345 }
--- a/OpenTween/Tween.resx
+++ b/OpenTween/Tween.resx
@@ -429,6 +429,18 @@
429429 <data name="&gt;&gt;ToolStripSeparator19.Type" xml:space="preserve">
430430 <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
431431 </data>
432+ <data name="&gt;&gt;NgEditMenuItem.Name" xml:space="preserve">
433+ <value>NgEditMenuItem</value>
434+ </data>
435+ <data name="&gt;&gt;NgEditMenuItem.Type" xml:space="preserve">
436+ <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
437+ </data>
438+ <data name="&gt;&gt;toolStripSeparator46.Name" xml:space="preserve">
439+ <value>toolStripSeparator46</value>
440+ </data>
441+ <data name="&gt;&gt;toolStripSeparator46.Type" xml:space="preserve">
442+ <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
443+ </data>
432444 <data name="DeleteTbMenuItem.ShortcutKeys" type="System.Windows.Forms.Keys, System.Windows.Forms">
433445 <value>Ctrl+W</value>
434446 </data>
@@ -2337,6 +2349,12 @@
23372349 <data name="ToolStripSeparator30.Size" type="System.Drawing.Size, System.Drawing">
23382350 <value>230, 6</value>
23392351 </data>
2352+ <data name="NgEditTabMenuItem.Size" type="System.Drawing.Size, System.Drawing">
2353+ <value>226, 22</value>
2354+ </data>
2355+ <data name="NgEditTabMenuItem.Text" xml:space="preserve">
2356+ <value>NG設定...</value>
2357+ </data>
23402358 <data name="&gt;&gt;ProfilePanel.ZOrder" xml:space="preserve">
23412359 <value>2</value>
23422360 </data>
@@ -2373,6 +2391,15 @@
23732391 <data name="ToolStripSeparator19.Size" type="System.Drawing.Size, System.Drawing">
23742392 <value>230, 6</value>
23752393 </data>
2394+ <data name="NgEditMenuItem.Size" type="System.Drawing.Size, System.Drawing">
2395+ <value>226, 22</value>
2396+ </data>
2397+ <data name="NgEditMenuItem.Text" xml:space="preserve">
2398+ <value>NG設定...</value>
2399+ </data>
2400+ <data name="toolStripSeparator46.Size" type="System.Drawing.Size, System.Drawing">
2401+ <value>223, 6</value>
2402+ </data>
23762403 <data name="&gt;&gt;CacheInfoMenuItem.Type" xml:space="preserve">
23772404 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
23782405 </data>
@@ -3359,6 +3386,12 @@
33593386 <data name="&gt;&gt;ToolStripSeparator30.Type" xml:space="preserve">
33603387 <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
33613388 </data>
3389+ <data name="&gt;&gt;NgEditTabMenuItem.Name" xml:space="preserve">
3390+ <value>NgEditTabMenuItem</value>
3391+ </data>
3392+ <data name="&gt;&gt;NgEditTabMenuItem.Type" xml:space="preserve">
3393+ <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
3394+ </data>
33623395 <data name="&gt;&gt;UndoRemoveTabMenuItem.Type" xml:space="preserve">
33633396 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
33643397 </data>
Show on old repository browser