OSDN Git Service

AppliStation-GUI,無人インストールのGUIの可変。アイコン表示の試作。
authorttp <ttp@users.sourceforge.jp>
Thu, 17 Jul 2008 11:49:37 +0000 (11:49 +0000)
committerttp <ttp@users.sourceforge.jp>
Thu, 17 Jul 2008 11:49:37 +0000 (11:49 +0000)
git-svn-id: http://localhost/svn/AppliStation/trunk@936 34ed2c89-c49f-4a4b-abdb-c318350108cf

AppliStation/AppliStation.Util/GUIUtils.cs [new file with mode: 0644]
AppliStation/AppliStation.Util/PackageUtils.cs [deleted file]
AppliStation/AppliStation.csproj
AppliStation/InstallationConfirmForm.Designer.cs
AppliStation/InstallationConfirmForm.cs
AppliStation/InstallationConfirmForm.resx
AppliStation/PackageInfoForm.cs
AppliStation/PackageUninstallConfirmForm.cs

diff --git a/AppliStation/AppliStation.Util/GUIUtils.cs b/AppliStation/AppliStation.Util/GUIUtils.cs
new file mode 100644 (file)
index 0000000..7e235d6
--- /dev/null
@@ -0,0 +1,83 @@
+using System;\r
+using System.IO;\r
+using System.Drawing;\r
+using System.Drawing.Imaging;\r
+using NaGet.Packages;\r
+using NaGet.Packages.Install;\r
+\r
+namespace AppliStation.Util\r
+{\r
+       /// <summary>\r
+       /// GUIに関する雑多な関数\r
+       /// </summary>\r
+       public sealed class GUIUtils\r
+       {\r
+               /// <summary>\r
+               /// パッケージに対応するアイコンを返す\r
+               /// </summary>\r
+               /// <param name="pkg">パッケージ</param>\r
+               /// <returns>対応するアイコン。検出できなかった場合はnull。</returns>\r
+               public static Icon GetIconForPackage(InstalledPackage pkg)\r
+               {\r
+                       string iconPath = pkg.UninstallInfo.IconPath;\r
+                       if (! string.IsNullOrEmpty(iconPath)) {\r
+                               if (iconPath.EndsWith(",0") || iconPath.EndsWith(",-0")) {\r
+                                       iconPath = iconPath.Substring(0, iconPath.LastIndexOf(','));\r
+                               }\r
+                               if (File.Exists(iconPath)) {\r
+                                       return Icon.ExtractAssociatedIcon(iconPath);\r
+                               }\r
+                       } else if (pkg.Type == InstallerType.ARCHIVE) {\r
+                               string progGrp = Path.Combine(NaGet.Env.ArchiveProgramGroup, pkg.Name);\r
+                               if (Directory.Exists(progGrp)) {\r
+                                       string[] lnkFiles = Directory.GetFiles(progGrp, "*.lnk");\r
+                                       \r
+                                       if (lnkFiles.Length >= 1) {\r
+                                               using (NaGet.InteropServices.ShellLink link = new NaGet.InteropServices.ShellLink(lnkFiles[0])) {\r
+                                                       if (File.Exists(link.GetPath(0))) {\r
+                                                               return Icon.ExtractAssociatedIcon(link.GetPath(0));\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+                       return null;\r
+               }\r
+               \r
+               /// <summary>\r
+               /// グレーアウトアイコンを作るための ImageAttributes を作って返す。\r
+               /// </summary>\r
+               /// <param name="alpha">透明度。(1.0が不透明、0.0が完全透明)</param>\r
+               /// <returns>生成されたImageAttributes</returns>\r
+               public static ImageAttributes GetImageAttributeToGrayOut(float alpha)\r
+               {\r
+                       // RGB比率として、YIQカラーモデルの値を採用する\r
+                       const float r = 0.298912f;\r
+                       const float g = 0.586611f;\r
+                       const float b = 0.114478f;\r
+                       \r
+                       ColorMatrix cm = new ColorMatrix(new float[][]{\r
+                               new float[]{r, r, r, 0, 0},\r
+                               new float[]{g, g, g, 0, 0},\r
+                               new float[]{b, b, b, 0, 0},\r
+                               new float[]{0, 0, 0, alpha, 0},\r
+                               new float[]{0, 0, 0, 0, 1},\r
+                        });\r
+                       ImageAttributes ia = new ImageAttributes();\r
+                       ia.SetColorMatrix(cm);\r
+                       \r
+                       return ia;\r
+               }\r
+               \r
+               public static void Graphics_DrawCenterImage(Graphics g, Image img, Rectangle b, ImageAttributes ia)\r
+               {\r
+                       int x = b.Left + (b.Width  - img.Width ) / 2;\r
+                       int y = b.Top  + (b.Height - img.Height) / 2;\r
+                       \r
+                       g.DrawImage(img,\r
+                                   new Rectangle(x, y, img.Width, img.Height),\r
+                                   0, 0, img.Width, img.Height,\r
+                                   GraphicsUnit.Pixel, ia);\r
+               }\r
+       }\r
+}\r
diff --git a/AppliStation/AppliStation.Util/PackageUtils.cs b/AppliStation/AppliStation.Util/PackageUtils.cs
deleted file mode 100644 (file)
index dc46626..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;\r
-using System.IO;\r
-using System.Drawing;\r
-using NaGet.Packages;\r
-using NaGet.Packages.Install;\r
-\r
-namespace AppliStation.Util\r
-{\r
-       public sealed class PackageUtils\r
-       {\r
-               \r
-               public static Icon GetIconForPackage(InstalledPackage pkg)\r
-               {\r
-                       string iconPath = pkg.UninstallInfo.IconPath;\r
-                       if (! string.IsNullOrEmpty(iconPath)) {\r
-                               if (iconPath.EndsWith(",0") || iconPath.EndsWith(",-0")) {\r
-                                       iconPath = iconPath.Substring(0, iconPath.LastIndexOf(','));\r
-                               }\r
-                               if (File.Exists(iconPath)) {\r
-                                       return Icon.ExtractAssociatedIcon(iconPath);\r
-                               }\r
-                       } else if (pkg.Type == InstallerType.ARCHIVE) {\r
-                               string progGrp = Path.Combine(NaGet.Env.ArchiveProgramGroup, pkg.Name);\r
-                               if (Directory.Exists(progGrp)) {\r
-                                       string[] lnkFiles = Directory.GetFiles(progGrp, "*.lnk");\r
-                                       \r
-                                       if (lnkFiles.Length >= 1) {\r
-                                               using (NaGet.InteropServices.ShellLink link = new NaGet.InteropServices.ShellLink(lnkFiles[0])) {\r
-                                                       if (File.Exists(link.GetPath(0))) {\r
-                                                               return Icon.ExtractAssociatedIcon(link.GetPath(0));\r
-                                                       }\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-                       return null;\r
-               }\r
-               \r
-       }\r
-}\r
index f0979b9..319fb8f 100644 (file)
@@ -67,7 +67,7 @@
     </Compile>\r
     <Compile Include="AppliStation.Util\ListViewItemSortComparer.cs" />\r
     <Compile Include="AppliStation.Util\NativeMethods.cs" />\r
-    <Compile Include="AppliStation.Util\PackageUtils.cs" />\r
+    <Compile Include="AppliStation.Util\GUIUtils.cs" />\r
     <Compile Include="AppliStation.Util\ToolStripWeb2LikeTextBox.cs" />\r
     <Compile Include="AssemblyInfo.cs" />\r
     <Compile Include="InstallerInfoForm.cs" />\r
index a0bc4f5..9f57717 100644 (file)
@@ -1,4 +1,4 @@
-\r
+\r
 namespace AppliStation\r
 {\r
        partial class InstallationConfirmForm\r
@@ -41,12 +41,13 @@ namespace AppliStation
                        this.nameColumnHeader = new System.Windows.Forms.ColumnHeader();\r
                        this.versionColumnHeader = new System.Windows.Forms.ColumnHeader();\r
                        this.currentVersionColumnHeader = new System.Windows.Forms.ColumnHeader();\r
-                       this.instOptsColumnHeader = new System.Windows.Forms.ColumnHeader();\r
+                       this.silentInstColumnHeader = new System.Windows.Forms.ColumnHeader();\r
                        this.instListViewContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);\r
                        this.silentInstallStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.instListToolStripSeparator = new System.Windows.Forms.ToolStripSeparator();\r
                        this.selectAllInstsStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.unselectAllInstsStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
+                       this.instListViewSilentInstallImageList = new System.Windows.Forms.ImageList(this.components);\r
                        this.tableLayoutPanel1.SuspendLayout();\r
                        this.btnPanel.SuspendLayout();\r
                        this.instListViewContextMenuStrip.SuspendLayout();\r
@@ -134,20 +135,23 @@ namespace AppliStation
                                                                        this.nameColumnHeader,\r
                                                                        this.versionColumnHeader,\r
                                                                        this.currentVersionColumnHeader,\r
-                                                                       this.instOptsColumnHeader});\r
+                                                                       this.silentInstColumnHeader});\r
                        this.instsListView.ContextMenuStrip = this.instListViewContextMenuStrip;\r
                        this.instsListView.Dock = System.Windows.Forms.DockStyle.Fill;\r
                        this.instsListView.GridLines = true;\r
                        this.instsListView.Location = new System.Drawing.Point(5, 53);\r
                        this.instsListView.Margin = new System.Windows.Forms.Padding(5, 3, 5, 5);\r
                        this.instsListView.Name = "instsListView";\r
+                       this.instsListView.OwnerDraw = true;\r
                        this.instsListView.ShowItemToolTips = true;\r
                        this.instsListView.Size = new System.Drawing.Size(382, 173);\r
                        this.instsListView.TabIndex = 2;\r
                        this.instsListView.UseCompatibleStateImageBehavior = false;\r
                        this.instsListView.View = System.Windows.Forms.View.Details;\r
                        this.instsListView.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.InstsListViewItemChecked);\r
+                       this.instsListView.DrawSubItem += new System.Windows.Forms.DrawListViewSubItemEventHandler(this.InstsListViewDrawSubItem);\r
                        this.instsListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.InstsListViewColumnClick);\r
+                       this.instsListView.DrawColumnHeader += new System.Windows.Forms.DrawListViewColumnHeaderEventHandler(this.InstsListViewDrawColumnHeader);\r
                        // \r
                        // nameColumnHeader\r
                        // \r
@@ -164,10 +168,10 @@ namespace AppliStation
                        this.currentVersionColumnHeader.Text = "現バージョン";\r
                        this.currentVersionColumnHeader.Width = 64;\r
                        // \r
-                       // instOptsColumnHeader\r
+                       // silentInstColumnHeader\r
                        // \r
-                       this.instOptsColumnHeader.Text = "";\r
-                       this.instOptsColumnHeader.Width = 48;\r
+                       this.silentInstColumnHeader.Text = "自動インストール";\r
+                       this.silentInstColumnHeader.Width = 28;\r
                        // \r
                        // instListViewContextMenuStrip\r
                        // \r
@@ -177,7 +181,7 @@ namespace AppliStation
                                                                        this.selectAllInstsStripMenuItem,\r
                                                                        this.unselectAllInstsStripMenuItem});\r
                        this.instListViewContextMenuStrip.Name = "packageListViewContextMenuStrip";\r
-                       this.instListViewContextMenuStrip.Size = new System.Drawing.Size(220, 98);\r
+                       this.instListViewContextMenuStrip.Size = new System.Drawing.Size(220, 76);\r
                        this.instListViewContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.InstsListViewContextMenuStripOpening);\r
                        // \r
                        // silentInstallStripMenuItem\r
@@ -206,6 +210,12 @@ namespace AppliStation
                        this.unselectAllInstsStripMenuItem.Text = "全ての選択を解除(&U)";\r
                        this.unselectAllInstsStripMenuItem.Click += new System.EventHandler(this.UnselectAllInstsStripMenuItemClick);\r
                        // \r
+                       // instListViewSilentInstallImageList\r
+                       // \r
+                       this.instListViewSilentInstallImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("instListViewSilentInstallImageList.ImageStream")));\r
+                       this.instListViewSilentInstallImageList.TransparentColor = System.Drawing.Color.Transparent;\r
+                       this.instListViewSilentInstallImageList.Images.SetKeyName(0, "automatic-install.png");\r
+                       // \r
                        // InstallationConfirmForm\r
                        // \r
                        this.AcceptButton = this.okButton;\r
@@ -227,9 +237,10 @@ namespace AppliStation
                        this.instListViewContextMenuStrip.ResumeLayout(false);\r
                        this.ResumeLayout(false);\r
                }\r
+               private System.Windows.Forms.ImageList instListViewSilentInstallImageList;\r
+               private System.Windows.Forms.ColumnHeader silentInstColumnHeader;\r
                private System.Windows.Forms.ToolStripSeparator instListToolStripSeparator;\r
                private System.Windows.Forms.ToolStripMenuItem silentInstallStripMenuItem;\r
-               private System.Windows.Forms.ColumnHeader instOptsColumnHeader;\r
                private System.Windows.Forms.ToolStripMenuItem unselectAllInstsStripMenuItem;\r
                private System.Windows.Forms.ToolStripMenuItem selectAllInstsStripMenuItem;\r
                private System.Windows.Forms.ContextMenuStrip instListViewContextMenuStrip;\r
index 13f812f..f8a6356 100644 (file)
@@ -1,4 +1,4 @@
-using System;\r
+using System;\r
 using System.Drawing;\r
 using System.Windows.Forms;\r
 using NaGet.Packages;\r
@@ -16,7 +16,7 @@ namespace AppliStation
                private PackageListsManager pkgListMan;\r
                \r
                /// <summary>\r
-               /// \83p\83b\83P\81[\83W\83C\83\93\83X\83g\81[\83\8b\8f\88\97\9d\82Ì\8fW\8d\87\r
+               /// パッケージインストール処理の集合\r
                /// </summary>\r
                public Installation[] Installations {\r
                        get { return installations; }\r
@@ -43,7 +43,7 @@ namespace AppliStation
                        //\r
                        InitializeComponent();\r
                        \r
-                       // \8aÇ\97\9d\8eÒ\8c \8cÀ\82Å\93®\82¢\82Ä\82¢\82é\82È\82ç\82Îrunas\82ª\95K\97v\82É\82Í\82È\82ç\82È\82¢\82Ì\82Å\95\\8e¦\82µ\82È\82¢\r
+                       // 管理者権限で動いているならばrunasが必要にはならないので表示しない\r
                        if (NaGet.Utils.IsAdministrators()) {\r
                                runasCheckBox.Checked = false;\r
                                runasCheckBox.Visible = false;\r
@@ -69,7 +69,11 @@ namespace AppliStation
                                        itemData[versionColumnHeader.Index]        = pkg.Version;\r
                                        itemData[currentVersionColumnHeader.Index] = (curPkg != null)? curPkg.Version : "-";\r
                                        \r
-                                       itemData[instOptsColumnHeader.Index] = inst.Silent? "\83T\83C\83\8c\83\93\83g" : string.Empty;\r
+                                       itemData[silentInstColumnHeader.Index]     = \r
+                                               (inst.SupportsSilentOnly)? "無人インストールのみサポート" :\r
+                                               (inst.Silent)? "無人インストール" :\r
+                                               (inst.IsSupportsSilent)? "マニュアルでインストール" :\r
+                                               "マニュアルでしかインストールできません";\r
                                        \r
                                        ListViewItem item = new ListViewItem(itemData);\r
                                        item.Tag = inst;\r
@@ -84,6 +88,49 @@ namespace AppliStation
                        instsListView.Refresh();\r
                }\r
                \r
+               #region instsListViewのオーナードドロー関連\r
+               \r
+               void InstsListViewDrawSubItem(object sender, DrawListViewSubItemEventArgs e)\r
+               {\r
+                       if (e.Header == silentInstColumnHeader) {\r
+                               Installation inst = ((Installation) e.Item.Tag);\r
+                               \r
+                               //e.DrawBackground();\r
+                               e.Graphics.Clip.Intersect(e.Bounds);\r
+                               \r
+                               if (inst.Silent) {\r
+                                       AppliStation.Util.GUIUtils.Graphics_DrawCenterImage(\r
+                                               e.Graphics,\r
+                                               instListViewSilentInstallImageList.Images[0],\r
+                                               e.Bounds, null);\r
+                               } else if (inst.IsSupportsSilent) {\r
+                                       AppliStation.Util.GUIUtils.Graphics_DrawCenterImage(\r
+                                               e.Graphics,\r
+                                               instListViewSilentInstallImageList.Images[0],\r
+                                               e.Bounds,\r
+                                               AppliStation.Util.GUIUtils.GetImageAttributeToGrayOut(0.5f));\r
+                               }\r
+                       } else {\r
+                               e.DrawDefault = true;\r
+                       }\r
+               }\r
+               \r
+               void InstsListViewDrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)\r
+               {\r
+                       if (e.Header == silentInstColumnHeader) {\r
+                               e.DrawBackground();\r
+                               e.Graphics.Clip.Intersect(e.Bounds);\r
+                               AppliStation.Util.GUIUtils.Graphics_DrawCenterImage(\r
+                                       e.Graphics,\r
+                                       instListViewSilentInstallImageList.Images[0],\r
+                                       e.Bounds, null);\r
+                       } else {\r
+                               e.DrawDefault = true;\r
+                       }\r
+               }\r
+               \r
+               #endregion\r
+               \r
                void InstsListViewItemChecked(object sender, ItemCheckedEventArgs e)\r
                {\r
                        System.Windows.Forms.ListView.CheckedListViewItemCollection checkeds = instsListView.CheckedItems;\r
@@ -115,7 +162,7 @@ namespace AppliStation
                        }\r
                        AppliStation.Util.NativeMethods.ColumnHeader_SetSortState(instsListView, e.Column, order);\r
                        \r
-                       // \83\\81[\83g\91Î\8fÛ\97ñ\82Ì\90F\95t\82¯\r
+                       // ソート対象列の色付け\r
                        try {\r
                                // SendMessage(hWnd, LVM_SETSELECTEDCOLUMN, column, NULL);\r
                                AppliStation.Util.NativeMethods.SendMessage(instsListView.Handle, 0x1000+140, (uint) e.Column, 0);\r
@@ -181,7 +228,7 @@ namespace AppliStation
                }\r
                \r
                /// <summary>\r
-               /// \83C\83\93\83X\83g\81[\83\8b\82·\82é\82æ\82¤\91I\91ð\82³\82ê\82½\83p\83b\83P\81[\83W\82Ì\94z\97ñ\r
+               /// インストールするよう選択されたパッケージの配列\r
                /// </summary>\r
                public Installation[] CheckedInstallations {\r
                        get {\r
@@ -193,10 +240,10 @@ namespace AppliStation
                        }\r
                }\r
                \r
-               #region runas\8aÖ\98A\r
+               #region runas関連\r
                \r
                /// <summary>\r
-               /// runas\82Å\8eÀ\8ds\82·\82é\82©\94Û\82©\r
+               /// runasで実行するか否か\r
                /// </summary>\r
                public bool UseRunas {\r
                        set {\r
@@ -210,23 +257,23 @@ namespace AppliStation
                }\r
                \r
                /// <summary>\r
-               /// \91I\91ð\82³\82ê\82½\83p\83b\83P\81[\83W\82ð\92²\8d¸\82µ\82Ä\81ARunas\82ð\8eg\82¤\82×\82«\82©\82¢\82È\82©\82ð\95Ô\82·\r
+               /// 選択されたパッケージを調査して、Runasを使うべきかいなかを返す\r
                /// </summary>\r
                public bool GetShouldUseRunas()\r
                {\r
                        if (NaGet.Utils.IsAdministrators()) {\r
-                               // \8aÇ\97\9d\8eÒ\8c \8cÀ\82Å\93®\82¢\82Ä\82¢\82é\8fê\8d\87\82Í\95s\97v\r
+                               // 管理者権限で動いている場合は不要\r
                                return false;   \r
                        } else if (NaGet.Utils.IsUACEnabled()) {\r
-                               // UAC\82ª\93K\97p\82³\82ê\82Ä\82¢\82é\8fê\8d\87\82Í\95W\8f\80\82Å\82Í\95s\97v\82Æ\82·\82é\r
+                               // UACが適用されている場合は標準では不要とする\r
                                return false;   \r
                        }\r
                        \r
-                       // \82Ð\82Æ\82Â\82Å\82àPC\83^\81[\83Q\83b\83g\82È\83C\83\93\83X\83g\81[\83\89\82ª\82 \82ê\82Î\95K\97v\82Æ\82·\82é\r
+                       // ひとつでもPCターゲットなインストーラがあれば必要とする\r
                        foreach (Installation inst in CheckedInstallations) {\r
                                if (inst.TargetPC) return true;\r
                        }\r
-                       // \82»\82ê\88È\8aO\82Í\95s\97v\r
+                       // それ以外は不要\r
                        return false;\r
                }\r
                \r
@@ -246,5 +293,6 @@ namespace AppliStation
                }\r
                \r
                #endregion\r
+               \r
        }\r
 }\r
index 4b5ab9b..e4165ce 100644 (file)
   <metadata name="instListViewContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>17, 17</value>\r
   </metadata>\r
+  <metadata name="instListViewSilentInstallImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>225, 17</value>\r
+  </metadata>\r
+  <data name="instListViewSilentInstallImageList.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">\r
+    <value>\r
+        AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w\r
+        LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0\r
+        ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADW\r
+        BAAAAk1TRnQBSQFMAwEBAAEEAQABBAEAAQ4BAAEOAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABOAMA\r
+        AQ4DAAEBAQABIAUAAUABDB4AAdMCAAEDAdMCAAEZAdICAAExAdMCAAFEAc4CAQGwAZQBEAFJAekBmwEP\r
+        AUUB6AGhAQ4BOgHkAaoBDAEzAeIBpgEMATsB4wHTAgEBobAAAdMCAAETAdMCAQGWAcwCAgHCAcUBCQEG\r
+        AdYBvgENAQgB3AFUASQBlwH7AkkB8QH/AlYB8gH/AikB7wH/AksB8gH/AlIB8gH/AaYBDAE7AeOsAAHT\r
+        AgABAgHQAgEBrQGdAWcBPQH/AZsBYgE0Af8BmwFgATAB/wGcAWABMAH/AUUBPQG7Af8CRAHxAf8C2AH8\r
+        Af8CcwH1Af8C2AH8Af8CSwHyAf8BqgEMATMB4qwAAdICAAExAaABVwEnAfsBnwFiATEB/wGiAWQBMgH/\r
+        AaQBZQEzAf8BqAFtAT0B/wFHAUEBwgH/AikB7wH/AmMB9AH/AvgB/gH/AnMB9QH/AikB7wH/AaoBDAEz\r
+        AeKsAAHTAgABWgGlAWsBPwH/AZ8BYgExAf8BqgFpATUB/wGtAWsBNgH/AboBiAFiAf8BSwFGAccB/wJN\r
+        AfIB/wLbAfwB/wJjAfQB/wLYAfwB/wJWAfIB/wGqAQwBMwHirAAB0wIAARwBtQE9ASAB8wGpAWgBNQH/\r
+        Aa8BbAE3Af8BtQFwATgB/wHSAbMBmwH/AU4BTAHPAf8CQAHxAf8CTQHyAf8CKQHvAf8CRAHxAf8CSQHx\r
+        Af8BqgEMATMB4rAAAdMCAQGhAa0BbwE+Af8BsAFtATgB/wGlAXUBTAH/AZoCnAH/AVQBWQGrAf8BQgE8\r
+        AbwB/wFGAT0BuwH/AUcBPwG8Af8BjgEWAVUB7QG5AQgBJgHaAdICAQGRsAAB0wIAAQ8B0AEEAQIBwwGR\r
+        AXgBXwH/AT0BhQGvAf8BMQGUAdIB/wEvAZQB0wH/ATABfgGtAf8BcQFjAVsB/gHTAgEBoQHTAgABArwA\r
+        AdMCAAENAZEBMgFIAeoBOwGhAeIB/wFEAaYB4wH/AUEBpAHjAf8BMQGcAeAB/wFpAVEBdwH0AdMCAAEk\r
+        wAAB0wIAAWgBPgGjAeIB/wFZAa8B5gH/AXQBvAHqAf8BbwG5AeoB/wFNAaoB5QH/ATMBngHhAf8B0gIB\r
+        AYLAAAHTAgEBgwFIAagB5AH/AW4BuQHpAf8BnQHPAfEB/wGQAckB7wH/AV8BsgHnAf8BNwGgAeEB/wHT\r
+        AgEBlsAAAdICAAFZAUMBpAHiAf8BYwG0AegB/wGFAcQB7QH/AX0BwAHsAf8BVgGuAeYB/wE2AZ8B4QH/\r
+        AdICAAF1wAAB0wIAAQEBzQEEAQcBvgFMAakB5QH/AVcBrwHmAf8BUwGsAeUB/wFDAaUB4wH/AcIBCwEU\r
+        Ac4B0wIAAQjEAAHTAgABDQHTAgEBmgHAAQ8BFQHQAb8BEQEbAdQB0wIBAaEB0wIAARe4AAFCAU0BPgcA\r
+        AT4DAAEoAwABOAMAAQ4DAAEBAQABAQUAAXAXAAP/AQAB4AcAAcAHAAGABwABgAcAAYAHAAGABwABwAcA\r
+        AcABDAYAAeABHAYAAeABHAYAAeABHAYAAeABHAYAAeABHAYAAfABPAYACw==\r
+</value>\r
+  </data>\r
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
+    <value>45</value>\r
+  </metadata>\r
 </root>
\ No newline at end of file
index c2321dd..1f18a43 100644 (file)
@@ -1,4 +1,4 @@
-using System;\r
+using System;\r
 using System.Drawing;\r
 using System.Windows.Forms;\r
 using NaGet.Packages.Install;\r
@@ -34,7 +34,7 @@ namespace AppliStation
                        iconLabel.Image = null;\r
                        iconLabel.Size = Size.Empty;\r
                        if (isInstalledPackage) {\r
-                               Icon icon = AppliStation.Util.PackageUtils.GetIconForPackage((InstalledPackage) pkg);\r
+                               Icon icon = AppliStation.Util.GUIUtils.GetIconForPackage((InstalledPackage) pkg);\r
                                if (icon != null) {\r
                                        iconLabel.Image = icon.ToBitmap();\r
                                        iconLabel.Size = icon.Size;\r
@@ -57,7 +57,7 @@ namespace AppliStation
                                \r
                                statusLinkLabel.Links.Clear();\r
                                if (string.IsNullOrEmpty(instPath)) {\r
-                                       statusLinkLabel.Text = "\8fî\95ñ\82ª\92ñ\8b\9f\82³\82ê\82Ä\82¢\82Ü\82¹\82ñ";\r
+                                       statusLinkLabel.Text = "情報が提供されていません";\r
                                        statusLinkLabel.Enabled = false;\r
                                } else {\r
                                        statusLinkLabel.Text = instPath;\r
@@ -85,7 +85,7 @@ namespace AppliStation
                        } else {\r
                                tabControl1.Visible = true;\r
                                foreach (Installer inst in pkg.Installer) {\r
-                                       TabPage page = new TabPage(string.Format("\83C\83\93\83X\83g\81[\83\89 \82»\82Ì{0}", tabControl1.TabCount+1));\r
+                                       TabPage page = new TabPage(string.Format("インストーラ その{0}", tabControl1.TabCount+1));\r
                                        page.Dock = DockStyle.Fill;\r
                                        \r
                                        InstallerInfoForm instForm = new InstallerInfoForm();\r
@@ -106,73 +106,73 @@ namespace AppliStation
                        switch (license ?? string.Empty) {\r
                                case "":\r
                                        if (string.IsNullOrEmpty(publicSiteUrl)) {\r
-                                               linklabel.Text = "\83t\83\8a\81[\83\\83t\83g\83E\83F\83A (\96³\8f\9e)";\r
+                                               linklabel.Text = "フリーソフトウェア (無償)";\r
                                                linklabel.Enabled = false;\r
                                        } else {\r
-                                               linklabel.Text = "\83t\83\8a\81[\83\\83t\83g\83E\83F\83A (\8fÚ\8d×\82Í\8cö\8e®\83T\83C\83g\82È\82Ç\82Å\8am\94F\82µ\82Ä\82­\82¾\82³\82¢)";\r
-                                               addLinkToLinkLabel(linklabel, "\8cö\8e®\83T\83C\83g", publicSiteUrl);\r
+                                               linklabel.Text = "フリーソフトウェア (詳細は公式サイトなどで確認してください)";\r
+                                               addLinkToLinkLabel(linklabel, "公式サイト", publicSiteUrl);\r
                                        }\r
                                        break;\r
-                               #region \83I\81[\83v\83\93\83\\81[\83X\82©\82Â\83R\83s\81[\83\8c\83t\83g\r
+                               #region オープンソースかつコピーレフト\r
                                case "GPL":\r
-                                       linklabel.Text = "GPL (\83I\81[\83v\83\93\83\\81[\83X)";\r
+                                       linklabel.Text = "GPL (オープンソース)";\r
                                        addLinkToLinkLabel(linklabel, "GPL", @"http://www.gnu.org/licenses/gpl.ja.html");\r
-                                       addLinkToLinkLabel(linklabel, "\83I\81[\83v\83\93\83\\81[\83X", @"http://creativecommons.org/licenses/GPL/2.0/deed.ja");\r
+                                       addLinkToLinkLabel(linklabel, "オープンソース", @"http://creativecommons.org/licenses/GPL/2.0/deed.ja");\r
                                        break;\r
                                case "GPLv2":\r
                                case "GPLv2+":\r
-                                       linklabel.Text = "GPLv2 (\83I\81[\83v\83\93\83\\81[\83X)";\r
+                                       linklabel.Text = "GPLv2 (オープンソース)";\r
                                        addLinkToLinkLabel(linklabel, "GPLv2", @"http://www.gnu.org/licenses/gpl-2.0.html");\r
                                        break;\r
                                case "GPLv3":\r
                                case "GPLv3+":\r
-                                       linklabel.Text = "GPLv3 (\83I\81[\83v\83\93\83\\81[\83X)";\r
+                                       linklabel.Text = "GPLv3 (オープンソース)";\r
                                        addLinkToLinkLabel(linklabel, "GPLv3", @"http://www.gnu.org/licenses/gpl-3.0.html");\r
                                        break;\r
                                case "LGPL":\r
-                                       linklabel.Text = "LGPL (\83I\81[\83v\83\93\83\\81[\83X)";\r
+                                       linklabel.Text = "LGPL (オープンソース)";\r
                                        addLinkToLinkLabel(linklabel, "LGPL", @"http://www.gnu.org/licenses/lgpl.ja.html");\r
-                                       addLinkToLinkLabel(linklabel, "\83I\81[\83v\83\93\83\\81[\83X", @"http://creativecommons.org/licenses/LGPL/2.1/deed.ja");\r
+                                       addLinkToLinkLabel(linklabel, "オープンソース", @"http://creativecommons.org/licenses/LGPL/2.1/deed.ja");\r
                                        break;\r
                                case "LGPLv2":\r
                                case "LGPLv2+":\r
-                                       linklabel.Text = "LGPLv2 (\83I\81[\83v\83\93\83\\81[\83X)";\r
+                                       linklabel.Text = "LGPLv2 (オープンソース)";\r
                                        addLinkToLinkLabel(linklabel, "LGPLv2", @"http://www.gnu.org/licenses/lgpl-2.1.html");\r
                                        break;\r
                                case "LGPLv3":\r
                                case "LGPLv3+":\r
-                                       linklabel.Text = "LGPLv3 (\83I\81[\83v\83\93\83\\81[\83X)";\r
+                                       linklabel.Text = "LGPLv3 (オープンソース)";\r
                                        addLinkToLinkLabel(linklabel, "LGPLv3", @"http://www.gnu.org/licenses/lgpl-3.0.html");\r
                                        break;\r
                                case "MPL":\r
-                                       linklabel.Text = "MPL (\83I\81[\83v\83\93\83\\81[\83X)";\r
+                                       linklabel.Text = "MPL (オープンソース)";\r
                                        addLinkToLinkLabel(linklabel, "MPL", @"http://www.mozilla.org/MPL/MPL-1.1.html");\r
                                        break;\r
                                case "CPL":\r
-                                       linklabel.Text = "CPL (\83I\81[\83v\83\93\83\\81[\83X)";\r
+                                       linklabel.Text = "CPL (オープンソース)";\r
                                        linklabel.Links.Add(0, linklabel.Text.Length, @"http://sourceforge.jp/projects/opensource/wiki/licenses%2FCommon_Public_License");\r
                                        break;\r
                                #endregion\r
-                               #region \83I\81[\83v\83\93\83\\81[\83X\82¾\82ª\81A\83R\83s\81[\83\8c\83t\83g\82Å\82È\82¢\r
+                               #region オープンソースだが、コピーレフトでない\r
                                case "MIT":\r
-                                       linklabel.Text = "MIT\83\89\83C\83Z\83\93\83X (\83I\81[\83v\83\93\83\\81[\83X)";\r
-                                       addLinkToLinkLabel(linklabel, "MIT\83\89\83C\83Z\83\93\83X", @"http://www.opensource.org/licenses/mit-license.php");\r
+                                       linklabel.Text = "MITライセンス (オープンソース)";\r
+                                       addLinkToLinkLabel(linklabel, "MITライセンス", @"http://www.opensource.org/licenses/mit-license.php");\r
                                        break;\r
                                case "BSD":\r
-                                       linklabel.Text = "\8fC\90³\8dÏBSD\83\89\83C\83Z\83\93\83X (\83I\81[\83v\83\93\83\\81[\83X)";\r
-                                       addLinkToLinkLabel(linklabel, "BSD\83\89\83C\83Z\83\93\83X", @"http://www.opensource.org/licenses/bsd-license.php");\r
+                                       linklabel.Text = "修正済BSDライセンス (オープンソース)";\r
+                                       addLinkToLinkLabel(linklabel, "BSDライセンス", @"http://www.opensource.org/licenses/bsd-license.php");\r
                                        break;\r
                                case "Artistic":\r
-                                       linklabel.Text = "Artistic\83\89\83C\83Z\83\93\83X (\83I\81[\83v\83\93\83\\81[\83X)";\r
-                                       addLinkToLinkLabel(linklabel, "Artistic\83\89\83C\83Z\83\93\83X", @"http://www.perlfoundation.org/artistic_license_2_0");\r
+                                       linklabel.Text = "Artisticライセンス (オープンソース)";\r
+                                       addLinkToLinkLabel(linklabel, "Artisticライセンス", @"http://www.perlfoundation.org/artistic_license_2_0");\r
                                        break;\r
                                #endregion\r
                                case "NYSL":\r
-                                       linklabel.Text = "\8eÏ\82é\82È\82è\8fÄ\82­\82È\82è\8dD\82«\82É\82µ\82ë\83\89\83C\83Z\83\93\83X";\r
+                                       linklabel.Text = "煮るなり焼くなり好きにしろライセンス";\r
                                        linklabel.Links.Add(0, linklabel.Text.Length, @"http://www.kmonos.net/nysl/");\r
                                        break;\r
                                case "Public Domain":\r
-                                       linklabel.Text = "\83p\83u\83\8a\83b\83N\83h\83\81\83C\83\93 (\92\98\8dì\8c \8bA\91®\82È\82µ)";\r
+                                       linklabel.Text = "パブリックドメイン (著作権帰属なし)";\r
                                        linklabel.Links.Add(0, linklabel.Text.Length, @"http://e-words.jp/w/E38391E38396E383AAE38383E382AFE38389E383A1E382A4E383B3.html");\r
                                        break;\r
                                default:\r
@@ -192,26 +192,26 @@ namespace AppliStation
                {\r
                        switch (instType) {\r
                                case InstallerType.ARCHIVE:\r
-                                       typeValueLabel.Text = "\8e©\8cÈ\89ð\93\80\8f\91\8cÉ\82Ü\82½\82Í\8f\91\8cÉ";\r
+                                       typeValueLabel.Text = "自己解凍書庫または書庫";\r
                                        break;\r
                                case InstallerType.EXEC_INSTALLER:\r
-                                       typeValueLabel.Text = "\83C\83\93\83X\83g\81[\83\89\8c`\8e®";\r
+                                       typeValueLabel.Text = "インストーラ形式";\r
                                        break;\r
                                case InstallerType.MSI_PACKAGE:\r
-                                       typeValueLabel.Text = "MSI\83t\83@\83C\83\8b\8c`\8e®";\r
+                                       typeValueLabel.Text = "MSIファイル形式";\r
                                        break;\r
                                default:\r
-                                       typeValueLabel.Text = "\95s\96¾\82È\83C\83\93\83X\83g\81[\83\8b\8c`\8e®(\83C\83\93\83X\83g\81[\83\8b\95s\94\)";\r
+                                       typeValueLabel.Text = "不明なインストール形式(インストール不能)";\r
                                        break;\r
                        }\r
                }\r
                \r
                /// <summary>\r
-               /// \83\8a\83\93\83N\83\89\83x\83\8b\82Ì\83\8a\83\93\83N\91}\93ü\95Ö\97\98\83\81\83\\83b\83h\r
+               /// リンクラベルのリンク挿入便利メソッド\r
                /// </summary>\r
-               /// <param name="linkLabel">\91Î\8fÛ\83\8a\83\93\83N\83\89\83x\83\8b</param>\r
-               /// <param name="word">\83\8a\83\93\83N\91Î\8fÛ\95\8e\9a\97ñ</param>\r
-               /// <param name="link">\83\8a\83\93\83N\83I\83u\83W\83F\83N\83g</param>\r
+               /// <param name="linkLabel">対象リンクラベル</param>\r
+               /// <param name="word">リンク対象文字列</param>\r
+               /// <param name="link">リンクオブジェクト</param>\r
                private static void addLinkToLinkLabel(LinkLabel linkLabel, string word, string link)\r
                {\r
                        int pos = linkLabel.Text.IndexOf(word, 0);\r
index b1b9cd8..2cc85fe 100644 (file)
@@ -1,4 +1,4 @@
-using System;\r
+using System;\r
 using System.IO;\r
 using System.Drawing;\r
 using System.Windows.Forms;\r
@@ -22,7 +22,7 @@ namespace AppliStation
                                label2.Text = string.Format("{0}({1})", uninstallPackage.Name, uninstallPackage.Version);\r
                                label2.Font = new Font(SystemFonts.DefaultFont.FontFamily, SystemFonts.DefaultFont.Size*1.5f);\r
                                \r
-                               Icon icon = AppliStation.Util.PackageUtils.GetIconForPackage(uninstallPackage);\r
+                               Icon icon = AppliStation.Util.GUIUtils.GetIconForPackage(uninstallPackage);\r
                                if (icon != null) {\r
                                        iconLabel.Image = icon.ToBitmap();\r
                                        iconLabel.Size = icon.Size;\r
@@ -37,17 +37,17 @@ namespace AppliStation
                        //\r
                        InitializeComponent();\r
                        \r
-                       // \8aÇ\97\9d\8eÒ\8c \8cÀ\82Å\93®\82¢\82Ä\82¢\82é\82È\82ç\82Îrunas\82ª\95K\97v\82É\82Í\82È\82ç\82È\82¢\82Ì\82Å\95\\8e¦\82µ\82È\82¢\r
+                       // 管理者権限で動いているならばrunasが必要にはならないので表示しない\r
                        if (NaGet.Utils.IsAdministrators()) {\r
                                runasCheckBox.Checked = false;\r
                                runasCheckBox.Visible = false;\r
                        }\r
                }\r
                \r
-               #region runas\8aÖ\98A\r
+               #region runas関連\r
                \r
                /// <summary>\r
-               /// runas\82Å\8eÀ\8ds\82·\82é\82©\94Û\82©\r
+               /// runasで実行するか否か\r
                /// </summary>\r
                public bool UseRunas {\r
                        set {\r
@@ -61,12 +61,12 @@ namespace AppliStation
                }\r
                \r
                /// <summary>\r
-               /// \91I\91ð\82³\82ê\82½\83p\83b\83P\81[\83W\82ð\92²\8d¸\82µ\82Ä\81ARunas\82ð\8eg\82¤\82×\82«\82©\82¢\82È\82©\82ð\95Ô\82·\r
+               /// 選択されたパッケージを調査して、Runasを使うべきかいなかを返す\r
                /// </summary>\r
                public bool GetShouldUseRunas()\r
                {\r
                        if (NaGet.Utils.IsAdministrators()) {\r
-                               // \8aÇ\97\9d\8eÒ\8c \8cÀ\82Å\93®\82¢\82Ä\82¢\82é\8fê\8d\87\82Í\95s\97v\r
+                               // 管理者権限で動いている場合は不要\r
                                return false;   \r
                        }\r
                        \r