Cleanup and ready for a beta release.

This commit is contained in:
Justin Aquadro 2012-11-10 23:21:09 -05:00
parent d7f5f3cf96
commit 70b810961f
25 changed files with 1160 additions and 68 deletions

View file

@ -7,17 +7,17 @@
<key>CFBundleIconFile</key>
<string>nbte.icns</string>
<key>CFBundleIdentifier</key>
<string>jaquadro.NBTExplorer</string>
<string>jaquadro.nbtexplorer</string>
<key>CFBundleName</key>
<string>NBTExplorer</string>
<key>CFBundleShortVersionString</key>
<string>2.0.3</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2012 Justin Aquadro</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>

View file

@ -12,10 +12,6 @@ namespace NBTExplorer.Mac
public class ImageAndTextCell : NSTextFieldCell
{
private NSImage _image;
private bool _copyCalled;
private bool _disposeCalled;
private bool _deallocCalled;
private bool _drawCalled;
public ImageAndTextCell ()
{
@ -51,7 +47,6 @@ namespace NBTExplorer.Mac
//if (_noDispose)
// Handle = IntPtr.Zero;
_disposeCalled = true;
base.Dispose (disposing);
}
@ -131,7 +126,6 @@ namespace NBTExplorer.Mac
return cell;
}*/
static IntPtr selRetain = Selector.GetHandle ("retain");
static IntPtr selRetainCount = Selector.GetHandle("retainCount");
public void PeriodicCleanup ()
@ -153,7 +147,6 @@ namespace NBTExplorer.Mac
// Method 5
static IntPtr selCopyWithZone = Selector.GetHandle("copyWithZone:");
static IntPtr selDealloc = Selector.GetHandle("dealloc");
[Export("copyWithZone:")]
public virtual NSObject CopyWithZone(IntPtr zone) {
@ -268,10 +261,9 @@ namespace NBTExplorer.Mac
public override void DrawWithFrame (RectangleF cellFrame, NSView inView)
{
Assert (!_deallocCalled, "DrawWithFrame: Dealloc was called on object");
Assert (!_disposeCalled, "DrawWithFrame: Dispose was called on object");
//Assert (!_deallocCalled, "DrawWithFrame: Dealloc was called on object");
//Assert (!_disposeCalled, "DrawWithFrame: Dispose was called on object");
_drawCalled = true;
if (_image != null) {
RectangleF imageFrame;
cellFrame.Divide (3 + _image.Size.Width, CGRectEdge.MinXEdge, out imageFrame, out cellFrame);

View file

@ -136,7 +136,7 @@ namespace NBTExplorer
{
TreeDataNode node = notification.UserInfo ["NSObject"] as TreeDataNode;
if (node != null) {
Console.WriteLine ("Preparing to expand: " + node.Data.NodeDisplay);
//Console.WriteLine ("Preparing to expand: " + node.Data.NodeDisplay);
_main.ExpandNode(node);
}
}
@ -145,7 +145,7 @@ namespace NBTExplorer
{
TreeDataNode node = notification.UserInfo ["NSObject"] as TreeDataNode;
if (node != null) {
Console.WriteLine("Finished Expanding: " + node.Data.NodeDisplay);
//Console.WriteLine("Finished Expanding: " + node.Data.NodeDisplay);
}
}
@ -153,9 +153,9 @@ namespace NBTExplorer
{
TreeDataNode node = notification.UserInfo ["NSObject"] as TreeDataNode;
if (node != null) {
if (node.Data.NodeDisplay == "saves") // The root node
Console.WriteLine ("Uh-oh...");
Console.WriteLine("Preparing to collapse: " + node.Data.NodeDisplay);
//if (node.Data.NodeDisplay == "saves") // The root node
//Console.WriteLine ("Uh-oh...");
//Console.WriteLine("Preparing to collapse: " + node.Data.NodeDisplay);
}
}
@ -191,6 +191,76 @@ namespace NBTExplorer
ActionSave ();
}
partial void ActionRename (MonoMac.Foundation.NSObject sender)
{
ActionRenameValue();
}
partial void ActionEdit (MonoMac.Foundation.NSObject sender)
{
ActionEditValue();
}
partial void ActionDelete (MonoMac.Foundation.NSObject sender)
{
ActionDeleteValue();
}
partial void ActionInsertByte (MonoMac.Foundation.NSObject sender)
{
ActionInsertByteTag();
}
partial void ActionInsertShort (MonoMac.Foundation.NSObject sender)
{
ActionInsertShortTag();
}
partial void ActionInsertInt (MonoMac.Foundation.NSObject sender)
{
ActionInsertIntTag();
}
partial void ActionInsertLong (MonoMac.Foundation.NSObject sender)
{
ActionInsertLongTag();
}
partial void ActionInsertFloat (MonoMac.Foundation.NSObject sender)
{
ActionInsertFloatTag();
}
partial void ActionInsertDouble (MonoMac.Foundation.NSObject sender)
{
ActionInsertDoubleTag();
}
partial void ActionInsertByteArray (MonoMac.Foundation.NSObject sender)
{
ActionInsertByteArrayTag();
}
partial void ActionInsertIntArray (MonoMac.Foundation.NSObject sender)
{
ActionInsertIntArrayTag();
}
partial void ActionInsertString (MonoMac.Foundation.NSObject sender)
{
ActionInsertStringTag();
}
partial void ActionInsertList (MonoMac.Foundation.NSObject sender)
{
ActionInsertListTag();
}
partial void ActionInsertCompound (MonoMac.Foundation.NSObject sender)
{
ActionInsertCompoundTag();
}
#endregion
private string _openFolderPath = null;
@ -272,6 +342,16 @@ namespace NBTExplorer
// AddPathToHistory(Settings.Default.RecentDirectories, path);
} else if (File.Exists (path)) {
DataNode node = null;
foreach (var item in FileTypeRegistry.RegisteredTypes) {
if (item.Value.NamePatternTest(path))
node = item.Value.NodeCreate(path);
}
if (node != null) {
_dataSource.Nodes.Add(new TreeDataNode(node));
//AddPathToHistory(Settings.Default.RecentFiles, path);
}
}
}
@ -289,7 +369,7 @@ namespace NBTExplorer
if (node == null || node.IsExpanded)
return;
Console.WriteLine ("Expand Node: " + node.Data.NodeDisplay);
//Console.WriteLine ("Expand Node: " + node.Data.NodeDisplay);
node.IsExpanded = true;
node.Nodes.Clear ();
@ -311,7 +391,7 @@ namespace NBTExplorer
if (node == null || !node.IsExpanded)
return;
Console.WriteLine("Collapse Node: " + node.Data.NodeDisplay);
//Console.WriteLine("Collapse Node: " + node.Data.NodeDisplay);
DataNode backNode = node.Data;
if (backNode.IsModified)
@ -859,7 +939,22 @@ namespace NBTExplorer
_appDelegate.MenuFind.Enabled = node.CanSearchNode;
_appDelegate.MenuFindNext.Enabled = _searchState != null;
_toolbarByte.Enabled = _appDelegate.MenuInsertByte.Enabled;
_toolbarShort.Enabled = _appDelegate.MenuInsertShort.Enabled;
_toolbarInt.Enabled = _appDelegate.MenuInsertInt.Enabled;
_toolbarLong.Enabled = _appDelegate.MenuInsertLong.Enabled;
_toolbarFloat.Enabled = _appDelegate.MenuInsertFloat.Enabled;
_toolbarDouble.Enabled = _appDelegate.MenuInsertDouble.Enabled;
_toolbarByteArray.Enabled = _appDelegate.MenuInsertByteArray.Enabled;
_toolbarIntArray.Enabled = _appDelegate.MenuInsertIntArray.Enabled;
_toolbarString.Enabled = _appDelegate.MenuInsertString.Enabled;
_toolbarList.Enabled = _appDelegate.MenuInsertList.Enabled;
_toolbarCompound.Enabled = _appDelegate.MenuInsertCompound.Enabled;
_toolbarSave.Enabled = _appDelegate.MenuSave.Enabled;
_toolbarDelete.Enabled = _appDelegate.MenuDelete.Enabled;
_toolbarEdit.Enabled = _appDelegate.MenuEditValue.Enabled;
_toolbarRename.Enabled = _appDelegate.MenuRename.Enabled;
}
/*private void UpdateOpenMenu ()

View file

@ -20,6 +20,48 @@ namespace NBTExplorer
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarSave { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarRename { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarEdit { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarDelete { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarByte { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarShort { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarInt { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarLong { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarFloat { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarDouble { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarByteArray { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarIntArray { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarString { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarList { get; set; }
[Outlet]
MonoMac.AppKit.NSToolbarItem _toolbarCompound { get; set; }
[Outlet]
MonoMac.AppKit.NSScrollView _mainScrollView { get; set; }
@ -31,6 +73,48 @@ namespace NBTExplorer
[Action ("ActionSave:")]
partial void ActionSave (MonoMac.Foundation.NSObject sender);
[Action ("ActionRename:")]
partial void ActionRename (MonoMac.Foundation.NSObject sender);
[Action ("ActionEdit:")]
partial void ActionEdit (MonoMac.Foundation.NSObject sender);
[Action ("ActionDelete:")]
partial void ActionDelete (MonoMac.Foundation.NSObject sender);
[Action ("ActionInsertByte:")]
partial void ActionInsertByte (MonoMac.Foundation.NSObject sender);
[Action ("ActionInsertShort:")]
partial void ActionInsertShort (MonoMac.Foundation.NSObject sender);
[Action ("ActionInsertInt:")]
partial void ActionInsertInt (MonoMac.Foundation.NSObject sender);
[Action ("ActionInsertLong:")]
partial void ActionInsertLong (MonoMac.Foundation.NSObject sender);
[Action ("ActionInsertFloat:")]
partial void ActionInsertFloat (MonoMac.Foundation.NSObject sender);
[Action ("ActionInsertDouble:")]
partial void ActionInsertDouble (MonoMac.Foundation.NSObject sender);
[Action ("ActionInsertByteArray:")]
partial void ActionInsertByteArray (MonoMac.Foundation.NSObject sender);
[Action ("ActionInsertIntArray:")]
partial void ActionInsertIntArray (MonoMac.Foundation.NSObject sender);
[Action ("ActionInsertString:")]
partial void ActionInsertString (MonoMac.Foundation.NSObject sender);
[Action ("ActionInsertList:")]
partial void ActionInsertList (MonoMac.Foundation.NSObject sender);
[Action ("ActionInsertCompound:")]
partial void ActionInsertCompound (MonoMac.Foundation.NSObject sender);
void ReleaseDesignerOutlets ()
{
@ -49,6 +133,76 @@ namespace NBTExplorer
_toolbarSave = null;
}
if (_toolbarRename != null) {
_toolbarRename.Dispose ();
_toolbarRename = null;
}
if (_toolbarEdit != null) {
_toolbarEdit.Dispose ();
_toolbarEdit = null;
}
if (_toolbarDelete != null) {
_toolbarDelete.Dispose ();
_toolbarDelete = null;
}
if (_toolbarByte != null) {
_toolbarByte.Dispose ();
_toolbarByte = null;
}
if (_toolbarShort != null) {
_toolbarShort.Dispose ();
_toolbarShort = null;
}
if (_toolbarInt != null) {
_toolbarInt.Dispose ();
_toolbarInt = null;
}
if (_toolbarLong != null) {
_toolbarLong.Dispose ();
_toolbarLong = null;
}
if (_toolbarFloat != null) {
_toolbarFloat.Dispose ();
_toolbarFloat = null;
}
if (_toolbarDouble != null) {
_toolbarDouble.Dispose ();
_toolbarDouble = null;
}
if (_toolbarByteArray != null) {
_toolbarByteArray.Dispose ();
_toolbarByteArray = null;
}
if (_toolbarIntArray != null) {
_toolbarIntArray.Dispose ();
_toolbarIntArray = null;
}
if (_toolbarString != null) {
_toolbarString.Dispose ();
_toolbarString = null;
}
if (_toolbarList != null) {
_toolbarList.Dispose ();
_toolbarList = null;
}
if (_toolbarCompound != null) {
_toolbarCompound.Dispose ();
_toolbarCompound = null;
}
if (_mainScrollView != null) {
_mainScrollView.Dispose ();
_mainScrollView = null;

File diff suppressed because it is too large Load diff

View file

@ -163,6 +163,15 @@ namespace NBTExplorer.Mac
return 0;
}
public override NSObject InitWithPasteboardPropertyList (NSObject propertyList, string type)
{
if (type == _pasteboardItemName) {
return null;
}
else
return null;
}
// XXX: This is a hack. Not sure how to properly implement, but it's required either by pasteboard reading,
// or is a side-effect of our protocol conformance hack.
[Export("isSubclassOfClass:")]

View file

@ -61,7 +61,7 @@ namespace NBTExplorer.Model
NodeCreate = CubicRegionDataNode.TryCreateFrom,
});
}
catch (Exception e) {
catch (Exception) {
//Program.StaticInitFailure(e);
}
}

View file

@ -36,7 +36,7 @@
<WarningLevel>4</WarningLevel>
<EnablePackageSigning>False</EnablePackageSigning>
<IncludeMonoRuntime>True</IncludeMonoRuntime>
<LinkMode>Full</LinkMode>
<LinkMode>SdkOnly</LinkMode>
<ConsolePause>False</ConsolePause>
<EnableCodeSigning>False</EnableCodeSigning>
<CreatePackage>False</CreatePackage>
@ -69,8 +69,8 @@
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Data" />
<Reference Include="MonoMac">
<HintPath>..\monomac\src\MonoMac.dll</HintPath>
<Reference Include="MonoMac, Version=0.0.0.0, Culture=neutral">
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
@ -79,10 +79,6 @@
<None Include="Properties\Resources.resources" />
<None Include="Properties\Resources.resx" />
<None Include="Properties\Settings.settings" />
<None Include="Vendor\Be.Windows.Forms.HexBox\HexBox.bmp" />
<None Include="Vendor\Be.Windows.Forms.HexBox\HexBox.resources" />
<None Include="Vendor\Be.Windows.Forms.HexBox\HexBox.resx" />
<None Include="Vendor\Be.Windows.Forms.HexBox\Properties\Resources.resx" />
<None Include="LICENSE.txt" />
<None Include="dead_bush.icns" />
<None Include="Mac\Scratch.cs" />
@ -93,7 +89,6 @@
<Folder Include="Model\" />
<Folder Include="Properties\" />
<Folder Include="Resources\" />
<Folder Include="Vendor\" />
<Folder Include="Mac\" />
<Folder Include="Resources\24\" />
</ItemGroup>
@ -126,23 +121,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs" />
<Compile Include="Properties\Settings.Designer.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\BuiltInContextMenu.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\ByteCharConverters.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\ByteCollection.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\BytePositionInfo.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\DataBlock.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\DataMap.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\DynamicByteProvider.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\DynamicFileByteProvider.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\FileByteProvider.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\FileDataBlock.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\HexBox.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\HexCasing.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\IByteProvider.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\MemoryDataBlock.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\NativeMethods.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\Util.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\Properties\Resources.Designer.cs" />
<Compile Include="NbtClipboardData.cs" />
<Compile Include="SearchWorker.cs" />
<Compile Include="Mac\MainWindow.cs" />
@ -233,21 +211,22 @@
<BundleResource Include="Resources\edit-list.png" />
<BundleResource Include="Resources\edit-small-caps.png" />
<BundleResource Include="Resources\wooden-box.png" />
<BundleResource Include="Resources\24\edit-code-24.png" />
<BundleResource Include="Resources\24\edit-code-i-24.png" />
<BundleResource Include="Resources\24\edit-list-24.png" />
<BundleResource Include="Resources\24\edit-small-caps-24.png" />
<BundleResource Include="Resources\24\pencil-24.png" />
<BundleResource Include="Resources\24\scissors-24.png" />
<BundleResource Include="Resources\24\selection-input-24.png" />
<BundleResource Include="Resources\24\document-s-24.png" />
<BundleResource Include="Resources\24\document-l-24.png" />
<BundleResource Include="Resources\24\document-i-24.png" />
<BundleResource Include="Resources\24\document-f-24.png" />
<BundleResource Include="Resources\24\document-d-24.png" />
<BundleResource Include="Resources\24\document-b-24.png" />
<BundleResource Include="Resources\24\document-24.png" />
<BundleResource Include="Resources\24\cross-24.png" />
<BundleResource Include="Resources\box-24.png" />
<BundleResource Include="Resources\cross-24.png" />
<BundleResource Include="Resources\document-24.png" />
<BundleResource Include="Resources\document-b-24.png" />
<BundleResource Include="Resources\document-d-24.png" />
<BundleResource Include="Resources\document-f-24.png" />
<BundleResource Include="Resources\document-i-24.png" />
<BundleResource Include="Resources\document-l-24.png" />
<BundleResource Include="Resources\document-s-24.png" />
<BundleResource Include="Resources\edit-code-24.png" />
<BundleResource Include="Resources\edit-code-i-24.png" />
<BundleResource Include="Resources\edit-list-24.png" />
<BundleResource Include="Resources\edit-small-caps-24.png" />
<BundleResource Include="Resources\pencil-24.png" />
<BundleResource Include="Resources\scissors-24.png" />
<BundleResource Include="Resources\selection-input-24.png" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Mac\MainWindow.xib" />

View file

Before

Width:  |  Height:  |  Size: 654 B

After

Width:  |  Height:  |  Size: 654 B

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 624 B

After

Width:  |  Height:  |  Size: 624 B

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

Before

Width:  |  Height:  |  Size: 603 B

After

Width:  |  Height:  |  Size: 603 B

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
nbte.icns

Binary file not shown.