Advertisement
Guest User

PluginUI.cs.patch

a guest
Jun 7th, 2011
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 5.96 KB | None | 0 0
  1. # This patch file was generated by NetBeans IDE
  2. # Following Index: paths are relative to: \FD3\External\Plugins\TaskListPanel
  3. # This patch can be applied using context Tools: Patch action on respective folder.
  4. # It uses platform neutral UTF-8 encoding and \n newlines.
  5. # Above lines and this line are ignored by the patching process.
  6. Index: PluginUI.cs
  7. --- PluginUI.cs Base (BASE)
  8. +++ PluginUI.cs Locally Modified (Based On LOCAL)
  9. @@ -33,10 +33,12 @@
  10.          private Regex todoParser = null;
  11.          private Boolean isEnabled = false;
  12.          private Boolean refreshEnabled = false;
  13. +        private Boolean copyEnabled = false;
  14.          private Boolean firstExecutionCompleted = false;
  15.          private Dictionary<String, DateTime> filesCache;
  16.          private ContextMenuStrip contextMenu;
  17.          private ToolStripMenuItem refreshButton;
  18. +        private ToolStripMenuItem copyButton;
  19.          private ToolStripLabel toolStripLabel;
  20.          private ListViewSorter columnSorter;
  21.          private StatusStrip statusStrip;
  22. @@ -68,7 +70,7 @@
  23.                  {
  24.                      this.groups.AddRange(settings.GroupValues);
  25.                      String pattern = String.Join("|", settings.GroupValues);
  26. -                    this.todoParser = new Regex(@"(//|/\*\*?|\*)[\t ]*(" + pattern + @")[:|\t ]*([^\r|\n|\*\*/]*)", RegexOptions.Multiline);
  27. +                    this.todoParser = new Regex(@"(//|/\*\*?|\*)[\t ]*(" + pattern + @")[:|\t ]*(.*?)(?:\r|\n|\**\*/)", RegexOptions.Multiline);
  28.                      this.isEnabled = true;
  29.                      this.InitGraphics();
  30.                  }
  31. @@ -201,10 +203,17 @@
  32.              this.contextMenu = new ContextMenuStrip();
  33.              this.contextMenu.Font = PluginBase.Settings.DefaultFont;
  34.              this.statusStrip.Font = PluginBase.Settings.DefaultFont;
  35. +            
  36.              Image image = PluginBase.MainForm.FindImage("66");
  37.              String label = TextHelper.GetString("FlashDevelop.Label.Refresh");
  38.              this.refreshButton = new ToolStripMenuItem(label, image, new EventHandler(this.RefreshButtonClick));
  39.              this.contextMenu.Items.Add(this.refreshButton);
  40. +            
  41. +            image = PluginBase.MainForm.FindImage("278");
  42. +            label = TextHelper.GetString("FlashDevelop.Label.Copy");
  43. +            this.copyButton = new ToolStripMenuItem(label, image, new EventHandler(this.CopyButtonClick));
  44. +            this.contextMenu.Items.Add(this.copyButton);
  45. +            
  46.              this.listView.ContextMenuStrip = this.contextMenu;
  47.          }
  48.  
  49. @@ -237,7 +246,7 @@
  50.                  {
  51.                      this.groups.AddRange(settings.GroupValues);
  52.                      String pattern = String.Join("|", settings.GroupValues);
  53. -                    this.todoParser = new Regex(@"(//|/\*\*?|\*)[\t ]*(" + pattern + @")[:|\t ]*([^\r|\n|\*\*/]*)", RegexOptions.Multiline);
  54. +                    this.todoParser = new Regex(@"(//|/\*\*?|\*)[\t ]*(" + pattern + @")[:|\t ]*(.*?)(?:\r|\n|\**\*/)", RegexOptions.Multiline);
  55.                      this.isEnabled = true;
  56.                      this.InitGraphics();
  57.                  }
  58. @@ -266,6 +275,19 @@
  59.          }
  60.  
  61.          /// <summary>
  62. +        /// While parsing project files we need to disable the copy button
  63. +        /// </summary>
  64. +        public Boolean CopyEnabled
  65. +        {
  66. +            get { return this.copyEnabled; }
  67. +            set
  68. +            {
  69. +                this.copyEnabled = value;
  70. +                this.copyButton.Enabled = value;
  71. +            }
  72. +        }
  73. +        
  74. +        /// <summary>
  75.          /// Stops the parse timer if not enabled.
  76.          /// </summary>
  77.          public void Terminate()
  78. @@ -376,6 +398,7 @@
  79.              if (this.isEnabled && PluginBase.CurrentProject != null)
  80.              {
  81.                  this.RefreshEnabled = false;
  82. +                this.CopyEnabled = false;
  83.  
  84.                  // stop current exploration
  85.                  if (this.parseTimer.Enabled) this.parseTimer.Stop();
  86. @@ -428,6 +451,37 @@
  87.          }
  88.  
  89.          /// <summary>
  90. +        /// Copies the list view contents to the clipboard.
  91. +        /// </summary>
  92. +        public void CopyToClipboard()
  93. +        {
  94. +           StringBuilder content = new StringBuilder();
  95. +          
  96. +           foreach(ColumnHeader header in this.listView.Columns)
  97. +           {
  98. +               content.Append(header.Text.Trim() + "\t");
  99. +           }
  100. +          
  101. +           foreach(ListViewGroup group in this.listView.Groups)
  102. +           {
  103. +               content.AppendLine();
  104. +              
  105. +               foreach(ListViewItem item in group.Items)
  106. +               {
  107. +                   content.AppendLine();
  108. +                   content.Append(item.Text.Trim());
  109. +                  
  110. +                   for(int i = 1; i < item.SubItems.Count; i ++)
  111. +                   {
  112. +                       content.Append("\t" + item.SubItems[i].Text.Trim());
  113. +                   }
  114. +               }
  115. +           }
  116. +          
  117. +           Clipboard.SetText(content.ToString());
  118. +        }
  119. +
  120. +        /// <summary>
  121.          /// At startup parse all opened files
  122.          /// </summary>
  123.          private void ParseNextFile()
  124. @@ -482,7 +536,10 @@
  125.          {
  126.              this.parseTimer.Enabled = false;
  127.              this.parseTimer.Stop();
  128. +            
  129.              this.RefreshEnabled = true;
  130. +            this.CopyEnabled = true;
  131. +            
  132.              this.toolStripLabel.Text = "";
  133.              if (this.firstExecutionCompleted == false)
  134.              {
  135. @@ -685,6 +742,17 @@
  136.          }
  137.  
  138.          /// <summary>
  139. +        /// Clicked on "Copy" button. This will copy the list view contents to the cliboard
  140. +        /// </summary>
  141. +        private void CopyButtonClick(Object sender, EventArgs e)
  142. +        {
  143. +            if (this.isEnabled)
  144. +            {
  145. +               CopyToClipboard();
  146. +            }
  147. +        }
  148. +        
  149. +        /// <summary>
  150.          /// When user stop mouse movement parse again this file
  151.          /// </summary>
  152.          private void SciControlDwellStart(ScintillaControl sci, int position)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement