"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Pinta/Dialogs/VersionInformationTabPage.cs" between
pinta-1.7.tar.gz and pinta-1.7.1.tar.gz

About: Pinta is a powerful image drawing and editing program (modeled after Paint.NET).

VersionInformationTabPage.cs  (pinta-1.7):VersionInformationTabPage.cs  (pinta-1.7.1)
skipping to change at line 32 skipping to change at line 32
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
// //
// //
using System; using System;
using Gtk; using Gtk;
using System.Reflection; using System.Reflection;
using Mono.Unix; using Mono.Unix;
using System.Text;
using System.Diagnostics;
namespace Pinta namespace Pinta
{ {
internal class VersionInformationTabPage : VBox internal class VersionInformationTabPage : VBox
{ {
private ListStore data = null; private ListStore data = null;
private CellRenderer cellRenderer = new CellRendererText (); private CellRenderer cellRenderer = new CellRendererText ();
TreeView treeView = null;
public VersionInformationTabPage () public VersionInformationTabPage ()
{ {
TreeView treeView = new TreeView (); treeView = new TreeView ();
TreeViewColumn treeViewColumnTitle = new TreeViewColumn ( Catalog.GetString ("Title"), cellRenderer, "text", 0); TreeViewColumn treeViewColumnTitle = new TreeViewColumn ( Catalog.GetString ("Title"), cellRenderer, "text", 0);
treeViewColumnTitle.FixedWidth = 200; treeViewColumnTitle.FixedWidth = 200;
treeViewColumnTitle.Sizing = TreeViewColumnSizing.Fixed; treeViewColumnTitle.Sizing = TreeViewColumnSizing.Fixed;
treeViewColumnTitle.Resizable = true; treeViewColumnTitle.Resizable = true;
treeView.AppendColumn (treeViewColumnTitle); treeView.AppendColumn (treeViewColumnTitle);
TreeViewColumn treeViewColumnVersion = new TreeViewColumn (Catalog.GetString ("Version"), cellRenderer, "text", 1); TreeViewColumn treeViewColumnVersion = new TreeViewColumn (Catalog.GetString ("Version"), cellRenderer, "text", 1);
treeView.AppendColumn (treeViewColumnVersion); treeView.AppendColumn (treeViewColumnVersion);
skipping to change at line 67 skipping to change at line 70
data = new ListStore (typeof (string), typeof (string), t ypeof (string)); data = new ListStore (typeof (string), typeof (string), t ypeof (string));
treeView.Model = data; treeView.Model = data;
ScrolledWindow scrolledWindow = new ScrolledWindow (); ScrolledWindow scrolledWindow = new ScrolledWindow ();
scrolledWindow.Add (treeView); scrolledWindow.Add (treeView);
scrolledWindow.ShadowType = ShadowType.In; scrolledWindow.ShadowType = ShadowType.In;
BorderWidth = 6; BorderWidth = 6;
PackStart (scrolledWindow, true, true, 0); var toplayout = new VBox();
var copyButton = new Button (Catalog.GetString ("Copy Ver
sion Info"));
copyButton.Clicked += CopyButton_Clicked;
toplayout.Add (copyButton);
toplayout.Add (scrolledWindow);
toplayout.Homogeneous = false;
toplayout.SetChildPacking (copyButton, false, false, 0, P
ackType.Start);
toplayout.SetChildPacking (scrolledWindow, true, true, 0,
PackType.End);
PackStart (toplayout, true, true, 0);
foreach (Assembly assembly in AppDomain.CurrentDomain.Get Assemblies ()) { foreach (Assembly assembly in AppDomain.CurrentDomain.Get Assemblies ()) {
try { try {
AssemblyName assemblyName = assembly.GetN ame (); AssemblyName assemblyName = assembly.GetN ame ();
data.AppendValues (assemblyName.Name, ass emblyName.Version.ToString (), System.IO.Path.GetFullPath (assembly.Location)); data.AppendValues (assemblyName.Name, ass emblyName.Version.ToString (), System.IO.Path.GetFullPath (assembly.Location));
} catch { } } catch { }
} }
data.SetSortColumnId (0, SortType.Ascending); data.SetSortColumnId (0, SortType.Ascending);
} }
skipping to change at line 93 skipping to change at line 106
cellRenderer = null; cellRenderer = null;
} }
if (data != null) { if (data != null) {
data.Dispose (); data.Dispose ();
data = null; data = null;
} }
base.OnDestroyed (); base.OnDestroyed ();
} }
void CopyButton_Clicked (object sender, EventArgs e)
{
String delimeter = ",";
String linesep = Environment.NewLine;
StringBuilder vinfo = new StringBuilder ();
//copy the version information is 'csv style'
TreeIter iter;
if (!treeView.Model.GetIterFirst (out iter)) {
return;
}
//do headers
for (int col = 0; col < treeView.Model.NColumns; col++) {
if (col != 0) {
vinfo.Append (delimeter);
}
vinfo.Append (treeView.GetColumn (col).Title);
}
vinfo.Append (linesep);
do {
for (int col = 0; col < treeView.Model.NColumns;
col++) {
String val = (string) treeView.Model.GetV
alue (iter, col);
if (col != 0) {
vinfo.Append (delimeter);
}
vinfo.Append (val);
}
vinfo.Append (linesep);
} while (treeView.Model.IterNext (ref iter));
if (vinfo.Length > 0) {
Gtk.Clipboard clipboard = Gtk.Clipboard.Get (Gdk.
Atom.Intern ("CLIPBOARD", false));
clipboard.Text = vinfo.ToString ();
}
}
} }
} }
 End of changes. 5 change blocks. 
2 lines changed or deleted 67 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)