OSDN Git Service

AppliStation-All,インストール関連設定を追加。
authorttp <ttp@users.sourceforge.jp>
Sat, 3 Oct 2009 09:52:02 +0000 (18:52 +0900)
committerttp <ttp@users.sourceforge.jp>
Sat, 3 Oct 2009 09:52:02 +0000 (18:52 +0900)
 * EnableScanInstallerFileとInstallProcessOnBackgroundの追加
 * およびそれのGUI設定

AppliStation/UserPrefForm.Designer.cs
AppliStation/UserPrefForm.cs
na-get-lib/NaGet.SubCommands/NaGetInstall.cs
na-get-lib/NaGet/Env.cs
na-get-lib/NaGet/NaGetLibPref.cs

index dea19b9..c3fca45 100644 (file)
                        this.proxyURLTextBox = new System.Windows.Forms.TextBox();\r
                        this.openInternetOptionLinkLabel = new System.Windows.Forms.LinkLabel();\r
                        this.openInternetOptionLinkAdminLabel = new System.Windows.Forms.LinkLabel();\r
+                       this.installTabPage = new System.Windows.Forms.TabPage();\r
+                       this.installFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();\r
+                       this.installScanInstallerFileCheckbox = new System.Windows.Forms.CheckBox();\r
+                       this.installOnBackgroundCheckBox = new System.Windows.Forms.CheckBox();\r
                        this.toolTip = new System.Windows.Forms.ToolTip(this.components);\r
                        this.repoUrlTextBoxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);\r
                        this.tableLayoutPanel.SuspendLayout();\r
@@ -67,6 +71,8 @@
                        this.networkTabPage.SuspendLayout();\r
                        this.proxyGroupBox.SuspendLayout();\r
                        this.proxyTableLayoutPanel.SuspendLayout();\r
+                       this.installTabPage.SuspendLayout();\r
+                       this.installFlowLayoutPanel.SuspendLayout();\r
                        ((System.ComponentModel.ISupportInitialize)(this.repoUrlTextBoxErrorProvider)).BeginInit();\r
                        this.SuspendLayout();\r
                        // \r
                        // \r
                        this.tabControl.Controls.Add(this.reposListTabPage);\r
                        this.tabControl.Controls.Add(this.networkTabPage);\r
+                       this.tabControl.Controls.Add(this.installTabPage);\r
                        this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;\r
                        this.tabControl.Location = new System.Drawing.Point(5, 5);\r
                        this.tabControl.Margin = new System.Windows.Forms.Padding(5);\r
                        this.openInternetOptionLinkAdminLabel.VisitedLinkColor = System.Drawing.SystemColors.HotTrack;\r
                        this.openInternetOptionLinkAdminLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OpenInternetOptionLinkLabelLinkClicked);\r
                        // \r
+                       // installTabPage\r
+                       // \r
+                       this.installTabPage.Controls.Add(this.installFlowLayoutPanel);\r
+                       this.installTabPage.Location = new System.Drawing.Point(4, 21);\r
+                       this.installTabPage.Name = "installTabPage";\r
+                       this.installTabPage.Padding = new System.Windows.Forms.Padding(3);\r
+                       this.installTabPage.Size = new System.Drawing.Size(446, 215);\r
+                       this.installTabPage.TabIndex = 2;\r
+                       this.installTabPage.Text = "インストール";\r
+                       this.installTabPage.UseVisualStyleBackColor = true;\r
+                       // \r
+                       // installFlowLayoutPanel\r
+                       // \r
+                       this.installFlowLayoutPanel.Controls.Add(this.installScanInstallerFileCheckbox);\r
+                       this.installFlowLayoutPanel.Controls.Add(this.installOnBackgroundCheckBox);\r
+                       this.installFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;\r
+                       this.installFlowLayoutPanel.Location = new System.Drawing.Point(3, 3);\r
+                       this.installFlowLayoutPanel.Name = "installFlowLayoutPanel";\r
+                       this.installFlowLayoutPanel.Padding = new System.Windows.Forms.Padding(10);\r
+                       this.installFlowLayoutPanel.Size = new System.Drawing.Size(440, 209);\r
+                       this.installFlowLayoutPanel.TabIndex = 0;\r
+                       // \r
+                       // installScanInstallerFileCheckbox\r
+                       // \r
+                       this.installScanInstallerFileCheckbox.AutoSize = true;\r
+                       this.installFlowLayoutPanel.SetFlowBreak(this.installScanInstallerFileCheckbox, true);\r
+                       this.installScanInstallerFileCheckbox.Location = new System.Drawing.Point(13, 13);\r
+                       this.installScanInstallerFileCheckbox.Name = "installScanInstallerFileCheckbox";\r
+                       this.installScanInstallerFileCheckbox.Size = new System.Drawing.Size(227, 16);\r
+                       this.installScanInstallerFileCheckbox.TabIndex = 0;\r
+                       this.installScanInstallerFileCheckbox.Text = "インストーラファイルをウイルススキャンする(&S)";\r
+                       this.toolTip.SetToolTip(this.installScanInstallerFileCheckbox, "インストーラファイルをダウンロードしたら直ちにウイルススキャンを行い、PCへの脅威を取り除きます。");\r
+                       this.installScanInstallerFileCheckbox.UseVisualStyleBackColor = true;\r
+                       // \r
+                       // installOnBackgroundCheckBox\r
+                       // \r
+                       this.installOnBackgroundCheckBox.AutoSize = true;\r
+                       this.installFlowLayoutPanel.SetFlowBreak(this.installOnBackgroundCheckBox, true);\r
+                       this.installOnBackgroundCheckBox.Location = new System.Drawing.Point(13, 35);\r
+                       this.installOnBackgroundCheckBox.Name = "installOnBackgroundCheckBox";\r
+                       this.installOnBackgroundCheckBox.Size = new System.Drawing.Size(306, 16);\r
+                       this.installOnBackgroundCheckBox.TabIndex = 1;\r
+                       this.installOnBackgroundCheckBox.Text = "インストール・アンインストール処理を優先度を下げて実行(&P)";\r
+                       this.toolTip.SetToolTip(this.installOnBackgroundCheckBox, "ロースペックなPCであっても、インストール・アンインストール処理中に快適に他の作業を行えるよう優先度を下げることができます。");\r
+                       this.installOnBackgroundCheckBox.UseVisualStyleBackColor = true;\r
+                       // \r
                        // repoUrlTextBoxErrorProvider\r
                        // \r
                        this.repoUrlTextBoxErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;\r
                        this.proxyGroupBox.ResumeLayout(false);\r
                        this.proxyTableLayoutPanel.ResumeLayout(false);\r
                        this.proxyTableLayoutPanel.PerformLayout();\r
+                       this.installTabPage.ResumeLayout(false);\r
+                       this.installFlowLayoutPanel.ResumeLayout(false);\r
+                       this.installFlowLayoutPanel.PerformLayout();\r
                        ((System.ComponentModel.ISupportInitialize)(this.repoUrlTextBoxErrorProvider)).EndInit();\r
                        this.ResumeLayout(false);\r
                }\r
+               private System.Windows.Forms.CheckBox installOnBackgroundCheckBox;\r
+               private System.Windows.Forms.CheckBox installScanInstallerFileCheckbox;\r
+               private System.Windows.Forms.FlowLayoutPanel installFlowLayoutPanel;\r
+               private System.Windows.Forms.TabPage installTabPage;\r
                private System.Windows.Forms.ErrorProvider repoUrlTextBoxErrorProvider;\r
                private System.Windows.Forms.ToolTip toolTip;\r
                private System.Windows.Forms.LinkLabel openInternetOptionLinkAdminLabel;\r
index 43e5b76..7342303 100644 (file)
@@ -40,6 +40,8 @@ namespace AppliStation
                        \r
                        NaGet.NaGetLibPref userPref = NaGet.Env.Pref;\r
                        this.ProxyAddress = userPref.ProxyAddress;\r
+                       this.EnableScanInstallerFile = userPref.EnableScanInstallerFile;\r
+                       this.InstallOnBackground = userPref.InstallOnBackground;\r
                }\r
                \r
                #region レポジトリリスト設定関連\r
@@ -276,6 +278,36 @@ namespace AppliStation
                \r
                #endregion\r
                \r
+               #region インストール設定関連\r
+               \r
+               /// <summary>\r
+               /// インストーラファイルをウイルススキャンするかを設定あるいは取得する\r
+               /// </summary>\r
+               public bool EnableScanInstallerFile {\r
+                       set {   this.installScanInstallerFileCheckbox.Checked = value;  }\r
+                       get {   return this.installScanInstallerFileCheckbox.Checked;   }\r
+               }\r
+               \r
+               /// <summary>\r
+               /// インストール・アンインストールを優先度を下げて実行するかを設定あるいは取得する\r
+               /// </summary>\r
+               public bool InstallOnBackground {\r
+                       set {   this.installOnBackgroundCheckBox.Checked = value;       }\r
+                       get {   return this.installOnBackgroundCheckBox.Checked;        }\r
+               }\r
+               \r
+               /// <summary>\r
+               /// インストール関連設定を、指定された設定オブジェクトに設定する。\r
+               /// </summary>\r
+               /// <param name="pref">設定オブジェクト</param>\r
+               private void commitInstallSetting(NaGet.NaGetLibPref pref)\r
+               {\r
+                       pref.EnableScanInstallerFile = this.EnableScanInstallerFile;\r
+                       pref.InstallOnBackground = this.InstallOnBackground;\r
+               }\r
+               \r
+               #endregion\r
+               \r
                /// <summary>\r
                /// 指定された設定オブジェクトをファイルとして保存する\r
                /// </summary>\r
@@ -296,6 +328,7 @@ namespace AppliStation
                        \r
                        commitRepositoryListSetting();\r
                        commitProxySetting(pref);\r
+                       commitInstallSetting(pref);\r
                        \r
                        commitNaGetLibPref(pref);\r
                }\r
index 24be984..037242c 100644 (file)
@@ -238,7 +238,11 @@ namespace NaGet.SubCommands
                                        }\r
                                        \r
                                        RaiseTaskSetEvent(NaGetTaskSetEventType.STARTED_TASKSET, TaskSetNames[currentTaskSetIndex]);\r
-                                       if (scanner.HasScanner) {\r
+                                       if (! NaGet.Env.EnableScanInstallerFile) {\r
+                                               RaiseTaskSetEvent(NaGetTaskSetEventType.INFO, string.Format("ウイルススキャンを行わない設定のため、ダウンロードしたファイルはウイルススキャンされませんでした"));\r
+                                       } else if (!scanner.HasScanner) {\r
+                                               RaiseTaskSetEvent(NaGetTaskSetEventType.INFO, string.Format("ダウンロードしたファイルはウイルススキャンされませんでした(ウイルススキャンソフトが検出できませんでした)"));\r
+                                       } else {\r
                                                try {\r
                                                        inst.ScanInstallerFile(scanner);\r
                                                } catch (System.Runtime.InteropServices.COMException ex) {\r
@@ -253,8 +257,6 @@ namespace NaGet.SubCommands
                                                        done = true;\r
                                                        return;\r
                                                }\r
-                                       } else {\r
-                                               RaiseTaskSetEvent(NaGetTaskSetEventType.INFO, string.Format("ダウンロードしたファイルはウイルススキャンされませんでした(ウイルススキャンソフトが検出できませんでした)"));\r
                                        }\r
                                        currentTaskSetIndex ++;\r
                                        RaiseTaskSetEvent(NaGetTaskSetEventType.COMPLETED_TASKSET, TaskSetNames[currentTaskSetIndex-1]);\r
index f470b93..fc3fc5d 100644 (file)
@@ -179,14 +179,32 @@ namespace NaGet
                \r
                #region インストールプロセス\r
                \r
-               static bool installOnBackground = true;\r
+               /// <summary>\r
+               /// インストーラをウイルススキャンするか?\r
+               /// </summary>\r
+               public static bool EnableScanInstallerFile {\r
+                       get {\r
+                               if (pref == null) LoadPref();\r
+                               return pref.EnableScanInstallerFile;\r
+                       }\r
+                       set {\r
+                               if (pref == null) LoadPref();\r
+                               pref.EnableScanInstallerFile = value;\r
+                       }\r
+               }\r
 \r
                /// <summary>\r
                /// インストールプロセスをバックグラウンドで行うか?\r
                /// </summary>\r
                public static bool InstallProcessOnBackground {\r
-                       get { return installOnBackground; }\r
-                       set { installOnBackground = value; }\r
+                       get {\r
+                               if (pref == null) LoadPref();\r
+                               return pref.InstallOnBackground;\r
+                       }\r
+                       set {\r
+                               if (pref == null) LoadPref();\r
+                               pref.EnableScanInstallerFile = value;\r
+                       }\r
                }\r
                \r
                \r
index b87dde5..6f42c5e 100644 (file)
@@ -25,5 +25,19 @@ namespace NaGet
                /// <remarks>デフォルトではシステムの設定を使用する</remarks>\r
                [XmlElement]\r
                public string ProxyAddress = null;\r
+               \r
+               /// <summary>\r
+               /// ウイルススキャンをする。\r
+               /// </summary>\r
+               [XmlElement]\r
+               [DefaultValue(true)]\r
+               public bool EnableScanInstallerFile = true;\r
+               \r
+               /// <summary>\r
+               /// インストールをバックグラウンドで実行する。\r
+               /// </summary>\r
+               [XmlElement]\r
+               [DefaultValue(true)]\r
+               public bool InstallOnBackground = true;\r
        }\r
 }\r