aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-06-14 20:30:52 +0000
committerrowanbeentje <rowan@beent.je>2009-06-14 20:30:52 +0000
commit3502af9a810b51116cd93358c608722e3714f4c0 (patch)
treedd17f7d4ff32b0346c03deaaac36da761a3ae56b
parent8f880b82a86b2bfe6bbf70ff934096b8a720bb20 (diff)
downloadsequelpro-3502af9a810b51116cd93358c608722e3714f4c0.tar.gz
sequelpro-3502af9a810b51116cd93358c608722e3714f4c0.tar.bz2
sequelpro-3502af9a810b51116cd93358c608722e3714f4c0.zip
Add support for titlebar connection status images, and use for SSH tunnels.
- Add view and code to support drawing a connection status icon at the left of the titlebar - Use for SSH tunnels; completes Issue #114. - Remove reference to an image resource "j" in the DBView - fixes console log errors.
-rw-r--r--Interfaces/English.lproj/DBView.xib357
-rw-r--r--Resources/Images/ssh-connected.pngbin0 -> 254 bytes
-rw-r--r--Resources/Images/ssh-connecting.pngbin0 -> 342 bytes
-rw-r--r--Resources/Images/ssh-disconnected.pngbin0 -> 342 bytes
-rw-r--r--Source/CMMCPConnection.h1
-rw-r--r--Source/CMMCPConnection.m24
-rw-r--r--Source/TableDocument.h6
-rw-r--r--Source/TableDocument.m38
-rw-r--r--sequel-pro.xcodeproj/project.pbxproj12
9 files changed, 193 insertions, 245 deletions
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib
index 52a9fe0c..3373c38c 100644
--- a/Interfaces/English.lproj/DBView.xib
+++ b/Interfaces/English.lproj/DBView.xib
@@ -2,13 +2,12 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
<data>
<int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">9J61</string>
+ <string key="IBDocument.SystemVersion">9G55</string>
<string key="IBDocument.InterfaceBuilderVersion">677</string>
- <string key="IBDocument.AppKitVersion">949.46</string>
+ <string key="IBDocument.AppKitVersion">949.43</string>
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="5945"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -372,7 +371,7 @@
<reference key="NSControlView" ref="1029554648"/>
<int key="NSButtonFlags">-2042609409</int>
<int key="NSButtonFlags2">35</int>
- <object class="NSCustomResource" key="NSNormalImage" id="738720219">
+ <object class="NSCustomResource" key="NSNormalImage" id="197220008">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">button_action</string>
</object>
@@ -387,7 +386,7 @@
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSImage" ref="738720219"/>
+ <reference key="NSImage" ref="197220008"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="753352469"/>
</object>
@@ -2274,8 +2273,8 @@
<bool key="NS.raise.underflow">YES</bool>
<bool key="NS.raise.dividebyzero">YES</bool>
</object>
- <string key="NS.decimal">,</string>
- <string key="NS.thousand">.</string>
+ <string key="NS.decimal">.</string>
+ <string key="NS.thousand">,</string>
<bool key="NS.hasthousands">NO</bool>
<bool key="NS.localized">YES</bool>
<bool key="NS.allowsfloats">NO</bool>
@@ -2939,7 +2938,7 @@
<reference key="NSControlView" ref="363916571"/>
<int key="NSButtonFlags">-2042609409</int>
<int key="NSButtonFlags2">35</int>
- <reference key="NSNormalImage" ref="738720219"/>
+ <reference key="NSNormalImage" ref="197220008"/>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
@@ -2951,7 +2950,7 @@
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSImage" ref="738720219"/>
+ <reference key="NSImage" ref="197220008"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="984501775"/>
</object>
@@ -6167,7 +6166,7 @@
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
<string key="NSWindowContentMinSize">{560, 200}</string>
<object class="NSView" key="NSWindowView" id="999543752">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">4370</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -6292,10 +6291,6 @@
<reference key="NSControlView" ref="620882358"/>
<int key="NSButtonFlags">-2031075073</int>
<int key="NSButtonFlags2">33554467</int>
- <object class="NSCustomResource" key="NSNormalImage">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">j</string>
- </object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
@@ -6418,7 +6413,6 @@
</object>
</object>
</object>
- <int key="NSSelectedIndex">9</int>
<bool key="NSPullDown">YES</bool>
<int key="NSPreferredEdge">1</int>
<bool key="NSUsesItemFromMenu">YES</bool>
@@ -6621,29 +6615,6 @@
<object class="NSTextView" id="1011820278">
<reference key="NSNextResponder" ref="134546146"/>
<int key="NSvFlags">2322</int>
- <object class="NSMutableSet" key="NSDragTypes">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMutableArray" key="set.sortedObjects">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>Apple HTML pasteboard type</string>
- <string>Apple PDF pasteboard type</string>
- <string>Apple PICT pasteboard type</string>
- <string>Apple PNG pasteboard type</string>
- <string>Apple URL pasteboard type</string>
- <string>CorePasteboardFlavorType 0x6D6F6F76</string>
- <string>CorePasteboardFlavorType 0x75726C20</string>
- <string>NSColor pasteboard type</string>
- <string>NSFilenamesPboardType</string>
- <string>NSStringPboardType</string>
- <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
- <string>NeXT RTFD pasteboard type</string>
- <string>NeXT Rich Text Format v1.0 pasteboard type</string>
- <string>NeXT TIFF v4.0 pasteboard type</string>
- <string>NeXT font pasteboard type</string>
- <string>NeXT ruler pasteboard type</string>
- <string>WebURLsWithTitlesPboardType</string>
- </object>
- </object>
<string key="NSFrameSize">{667, 14}</string>
<reference key="NSSuperview" ref="134546146"/>
<object class="NSTextContainer" key="NSTextContainer" id="609699272">
@@ -6781,7 +6752,6 @@
</object>
</object>
<string key="NSFrameSize">{667, 416}</string>
- <reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMinSize">{560, 222}</string>
@@ -12318,6 +12288,46 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string key="NSFrameSize">{200, 32}</string>
<string key="NSClassName">NSView</string>
</object>
+ <object class="NSCustomView" id="730777562">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">265</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSImageView" id="346676398">
+ <reference key="NSNextResponder" ref="730777562"/>
+ <int key="NSvFlags">265</int>
+ <object class="NSMutableSet" key="NSDragTypes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="set.sortedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>Apple PDF pasteboard type</string>
+ <string>Apple PICT pasteboard type</string>
+ <string>Apple PNG pasteboard type</string>
+ <string>NSFilenamesPboardType</string>
+ <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
+ <string>NeXT TIFF v4.0 pasteboard type</string>
+ </object>
+ </object>
+ <string key="NSFrame">{{14, 0}, {22, 22}}</string>
+ <reference key="NSSuperview" ref="730777562"/>
+ <reference key="NSWindow"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSImageCell" key="NSCell" id="1052485434">
+ <int key="NSCellFlags">130560</int>
+ <int key="NSCellFlags2">33554432</int>
+ <int key="NSAlign">0</int>
+ <int key="NSScale">0</int>
+ <int key="NSStyle">0</int>
+ <bool key="NSAnimates">YES</bool>
+ </object>
+ <bool key="NSEditable">YES</bool>
+ </object>
+ </object>
+ <string key="NSFrameSize">{50, 22}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <string key="NSClassName">NSView</string>
+ </object>
<object class="NSUserDefaultsController" id="461189245">
<bool key="NSSharedInstance">YES</bool>
</object>
@@ -16083,6 +16093,22 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<int key="connectionID">5998</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">titleAccessoryView</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="730777562"/>
+ </object>
+ <int key="connectionID">6002</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">titleImageView</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="346676398"/>
+ </object>
+ <int key="connectionID">6003</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -22744,6 +22770,30 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="object" ref="1064737236"/>
<reference key="parent" ref="999543752"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5999</int>
+ <reference key="object" ref="730777562"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="346676398"/>
+ </object>
+ <reference key="parent" ref="1043842561"/>
+ <string key="objectName">Title Icon View</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6000</int>
+ <reference key="object" ref="346676398"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1052485434"/>
+ </object>
+ <reference key="parent" ref="730777562"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6001</int>
+ <reference key="object" ref="1052485434"/>
+ <reference key="parent" ref="346676398"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -24102,8 +24152,12 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>5984.IBPluginDependency</string>
<string>5986.IBPluginDependency</string>
<string>5989.IBPluginDependency</string>
+ <string>5999.IBEditorWindowLastContentRect</string>
+ <string>5999.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
<string>6.ImportedFromIB2</string>
+ <string>6000.IBPluginDependency</string>
+ <string>6001.IBPluginDependency</string>
<string>604.IBEditorWindowLastContentRect</string>
<string>604.IBWindowTemplateEditedContentRect</string>
<string>604.ImportedFromIB2</string>
@@ -26011,8 +26065,12 @@ aGUgYWN0aXZlIHNlbGVjdGlvbiAo4oyl4oyYUik</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{528, 162}, {50, 22}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{67, 340}, {667, 416}}</string>
<string>{{67, 340}, {667, 416}}</string>
<reference ref="9"/>
@@ -26265,7 +26323,7 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">5998</int>
+ <int key="maxID">6003</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -26884,10 +26942,12 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<string>dropImage:</string>
<string>filterTable:</string>
<string>openEditSheet:</string>
+ <string>quickLookFormatButton:</string>
<string>reloadTable:</string>
<string>reloadTableValues:</string>
<string>removeRow:</string>
<string>saveEditSheet:</string>
+ <string>segmentControllerChanged:</string>
<string>setCompareTypes:</string>
<string>showAll:</string>
<string>stepLimitRows:</string>
@@ -26909,6 +26969,8 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
@@ -26923,10 +26985,14 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<string>editData</string>
<string>editImage</string>
<string>editSheet</string>
- <string>editSheetTabView</string>
+ <string>editSheetProgressBar</string>
+ <string>editSheetQuickLookButton</string>
+ <string>editSheetSegmentControl</string>
+ <string>editTextScrollView</string>
<string>editTextView</string>
<string>fieldField</string>
<string>filterButton</string>
+ <string>hexTextScrollView</string>
<string>hexTextView</string>
<string>limitRowsButton</string>
<string>limitRowsField</string>
@@ -26961,6 +27027,10 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
<string>CMCopyTable</string>
<string>id</string>
<string>id</string>
@@ -27116,6 +27186,8 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<string>tableTabView</string>
<string>tableWindow</string>
<string>tablesListInstance</string>
+ <string>titleAccessoryView</string>
+ <string>titleImageView</string>
<string>userField</string>
<string>variablesSheet</string>
<string>variablesTableView</string>
@@ -27170,6 +27242,8 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
+ <string>id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -27548,207 +27622,6 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
</object>
</object>
</object>
- <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBPartialClassDescription">
- <string key="className">TableContent</string>
- <string key="superclassName">NSObject</string>
- <object class="NSMutableDictionary" key="actions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMutableArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>addRow:</string>
- <string>closeEditSheet:</string>
- <string>copyRow:</string>
- <string>dropImage:</string>
- <string>filterTable:</string>
- <string>openEditSheet:</string>
- <string>quickLookFormatButton:</string>
- <string>reloadTable:</string>
- <string>reloadTableValues:</string>
- <string>removeRow:</string>
- <string>saveEditSheet:</string>
- <string>segmentControllerChanged:</string>
- <string>setCompareTypes:</string>
- <string>showAll:</string>
- <string>stepLimitRows:</string>
- <string>toggleFilterField:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMutableArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>addButton</string>
- <string>argumentField</string>
- <string>compareField</string>
- <string>copyButton</string>
- <string>countText</string>
- <string>editData</string>
- <string>editImage</string>
- <string>editSheet</string>
- <string>editSheetProgressBar</string>
- <string>editSheetQuickLookButton</string>
- <string>editSheetSegmentControl</string>
- <string>editTextScrollView</string>
- <string>editTextView</string>
- <string>fieldField</string>
- <string>filterButton</string>
- <string>hexTextScrollView</string>
- <string>hexTextView</string>
- <string>limitRowsButton</string>
- <string>limitRowsField</string>
- <string>limitRowsStepper</string>
- <string>limitRowsText</string>
- <string>multipleLineEditingButton</string>
- <string>removeButton</string>
- <string>tableContentView</string>
- <string>tableDataInstance</string>
- <string>tableDocumentInstance</string>
- <string>tableWindow</string>
- <string>tablesListInstance</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>CMCopyTable</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBDocumentRelativeSource</string>
- <string key="minorKey">../../Source/TableContent.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">TableSource</string>
- <string key="superclassName">NSObject</string>
- <object class="NSMutableDictionary" key="actions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMutableArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>addField:</string>
- <string>addIndex:</string>
- <string>chooseIndexType:</string>
- <string>closeIndexSheet:</string>
- <string>closeKeySheet:</string>
- <string>copyField:</string>
- <string>openIndexSheet:</string>
- <string>reloadTable:</string>
- <string>removeField:</string>
- <string>removeIndex:</string>
- <string>typeChanged:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMutableArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>addFieldButton</string>
- <string>addIndexButton</string>
- <string>chooseKeyButton</string>
- <string>copyFieldButton</string>
- <string>indexNameField</string>
- <string>indexSheet</string>
- <string>indexTypeField</string>
- <string>indexView</string>
- <string>indexedColumnsField</string>
- <string>keySheet</string>
- <string>removeFieldButton</string>
- <string>removeIndexButton</string>
- <string>structureGrabber</string>
- <string>tableDataInstance</string>
- <string>tableSourceView</string>
- <string>tableTypeButton</string>
- <string>tableWindow</string>
- <string>tablesListInstance</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBDocumentRelativeSource</string>
- <string key="minorKey">../../Source/TableSource.h</string>
- </object>
- </object>
- </object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.LastKnownRelativeProjectPath">../../sequel-pro.xcodeproj</string>
diff --git a/Resources/Images/ssh-connected.png b/Resources/Images/ssh-connected.png
new file mode 100644
index 00000000..2ba841b5
--- /dev/null
+++ b/Resources/Images/ssh-connected.png
Binary files differ
diff --git a/Resources/Images/ssh-connecting.png b/Resources/Images/ssh-connecting.png
new file mode 100644
index 00000000..f1e11e59
--- /dev/null
+++ b/Resources/Images/ssh-connecting.png
Binary files differ
diff --git a/Resources/Images/ssh-disconnected.png b/Resources/Images/ssh-disconnected.png
new file mode 100644
index 00000000..f8e7c83c
--- /dev/null
+++ b/Resources/Images/ssh-disconnected.png
Binary files differ
diff --git a/Source/CMMCPConnection.h b/Source/CMMCPConnection.h
index 7c892ead..814738bf 100644
--- a/Source/CMMCPConnection.h
+++ b/Source/CMMCPConnection.h
@@ -33,6 +33,7 @@
- (void)willQueryString:(NSString *)query;
- (void)queryGaveError:(NSString *)error;
+- (void)setStatusIconToImageWithName:(NSString *)imagePath;
- (BOOL)connectionEncodingViaLatin1;
@end
diff --git a/Source/CMMCPConnection.m b/Source/CMMCPConnection.m
index db45a3d8..6654948b 100644
--- a/Source/CMMCPConnection.m
+++ b/Source/CMMCPConnection.m
@@ -239,7 +239,10 @@ static void forcePingTimeout(int signalNumber);
theRet = mysql_real_connect(mConnection, theHost, theLogin, thePass, NULL, connectionPort, theSocket, mConnectionFlags);
thePass = NULL;
if (theRet != mConnection) {
- if (connectionTunnel) [connectionTunnel disconnect];
+ if (connectionTunnel) {
+ [connectionTunnel disconnect];
+ [delegate setStatusIconToImageWithName:@"ssh-disconnected"];
+ }
return mConnected = NO;
}
@@ -260,7 +263,10 @@ static void forcePingTimeout(int signalNumber);
{
[super disconnect];
- if (connectionTunnel) [connectionTunnel disconnect];
+ if (connectionTunnel) {
+ [connectionTunnel disconnect];
+ [delegate setStatusIconToImageWithName:@"ssh-disconnected"];
+ }
if( serverVersionString != nil ) {
[serverVersionString release];
@@ -358,16 +364,19 @@ static void forcePingTimeout(int signalNumber);
[connectionTunnel setConnectionStateChangeSelector:nil delegate:nil];
if ([connectionTunnel state] != SPSSH_STATE_IDLE) [connectionTunnel disconnect];
[connectionTunnel connect];
+ [delegate setStatusIconToImageWithName:@"ssh-connecting"];
NSDate *tunnelStartDate = [NSDate date], *interfaceInteractionTimer;
// Allow the tunnel to attempt to connect in a loop
while (1) {
if ([connectionTunnel state] == SPSSH_STATE_CONNECTED) {
+ [delegate setStatusIconToImageWithName:@"ssh-connected"];
connectionPort = [connectionTunnel localPort];
break;
}
if ([[NSDate date] timeIntervalSinceDate:tunnelStartDate] > (connectionTimeout + 1)) {
[connectionTunnel disconnect];
+ [delegate setStatusIconToImageWithName:@"ssh-disconnected"];
break;
}
@@ -449,6 +458,12 @@ static void forcePingTimeout(int signalNumber);
{
int newState = [theTunnel state];
+ if (delegate && [delegate respondsToSelector:@selector(setStatusIconToImageWithName:)]) {
+ if (newState == SPSSH_STATE_IDLE) [delegate setStatusIconToImageWithName:@"ssh-disconnected"];
+ else if (newState == SPSSH_STATE_CONNECTED) [delegate setStatusIconToImageWithName:@"ssh-connected"];
+ else [delegate setStatusIconToImageWithName:@"ssh-connecting"];
+ }
+
// Restart the tunnel if it dies
if (mConnected && newState == SPSSH_STATE_IDLE && currentSSHTunnelState == SPSSH_STATE_CONNECTED) {
currentSSHTunnelState = newState;
@@ -614,7 +629,10 @@ static void forcePingTimeout(int signalNumber);
[self startKeepAliveTimerResettingState:YES];
return YES;
}
- if (connectionTunnel) [connectionTunnel disconnect];
+ if (connectionTunnel) {
+ [connectionTunnel disconnect];
+ [delegate setStatusIconToImageWithName:@"ssh-disconnected"];
+ }
return NO;
}
diff --git a/Source/TableDocument.h b/Source/TableDocument.h
index a7ba9d01..946b2492 100644
--- a/Source/TableDocument.h
+++ b/Source/TableDocument.h
@@ -51,6 +51,8 @@
IBOutlet id spExportControllerInstance;
IBOutlet id tableWindow;
+ IBOutlet id titleAccessoryView;
+ IBOutlet id titleImageView;
IBOutlet id connectSheet;
IBOutlet id databaseSheet;
IBOutlet id variablesSheet;
@@ -215,6 +217,10 @@
- (IBAction)viewRelations:(id)sender;
- (IBAction)addConnectionToFavorites:(id)sender;
+// titlebar methods
+- (void)setStatusIconToImageWithName:(NSString *)imagePath;
+- (void)clearStatusIcon;
+
//toolbar methods
- (void)setupToolbar;
- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag;
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index c797b530..e9ad5322 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -113,6 +113,17 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
// Hide the tabs in the tab view (we only show them to allow switching tabs in interface builder)
[tableTabView setTabViewType:NSNoTabsNoBorder];
[tableListSplitter setDividerStyle:NSSplitViewDividerStyleThin];
+
+ // Add the icon accessory view to the title bar
+ NSView *windowFrame = [[tableWindow contentView] superview];
+ NSRect av = [titleAccessoryView frame];
+ NSRect initialAccessoryViewFrame = NSMakeRect(
+ [windowFrame frame].size.width - av.size.width - 20,
+ [windowFrame frame].size.height - av.size.height,
+ av.size.width,
+ av.size.height);
+ [titleAccessoryView setFrame:initialAccessoryViewFrame];
+ [windowFrame addSubview:titleAccessoryView];
}
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
@@ -383,9 +394,13 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
int newState = [theTunnel state];
if (newState == SPSSH_STATE_IDLE) {
+ [self setStatusIconToImageWithName:@"ssh-disconnected"];
[self failConnectionWithErrorMessage:[theTunnel lastError]];
} else if (newState == SPSSH_STATE_CONNECTED) {
+ [self setStatusIconToImageWithName:@"ssh-connected"];
[self initiateMySQLConnection];
+ } else {
+ [self setStatusIconToImageWithName:@"ssh-connecting"];
}
}
@@ -1991,6 +2006,29 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
}
#pragma mark -
+#pragma mark Titlebar Methods
+
+/**
+ * Set the connection status icon in the titlebar
+ */
+- (void)setStatusIconToImageWithName:(NSString *)imageName
+{
+ NSString *imagePath = [[NSBundle mainBundle] pathForResource:imageName ofType:@"png"];
+ if (!imagePath) return;
+
+ NSImage *image = [[NSImage alloc] initByReferencingFile:imagePath];
+ [titleImageView setImage:image];
+}
+
+/**
+ * Clear the connection status icon in the titlebar
+ */
+- (void)clearStatusIcon
+{
+ [titleImageView setImage:nil];
+}
+
+#pragma mark -
#pragma mark Toolbar Methods
/**
diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj
index 4a7fdf16..2cbab6a7 100644
--- a/sequel-pro.xcodeproj/project.pbxproj
+++ b/sequel-pro.xcodeproj/project.pbxproj
@@ -91,6 +91,9 @@
586F457B0FDB269E00B428D7 /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = 296DC8AB0F909194002A3258 /* RegexKitLite.m */; };
586F457E0FDB280100B428D7 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 296DC8BE0F9091DF002A3258 /* libicucore.dylib */; };
5885940F0F7AEE6000ED0E67 /* sparkle-public-key.pem in Resources */ = {isa = PBXBuildFile; fileRef = 5885940E0F7AEE6000ED0E67 /* sparkle-public-key.pem */; };
+ 588B2CC80FE5641E00EC5FC0 /* ssh-connected.png in Resources */ = {isa = PBXBuildFile; fileRef = 588B2CC50FE5641E00EC5FC0 /* ssh-connected.png */; };
+ 588B2CC90FE5641E00EC5FC0 /* ssh-connecting.png in Resources */ = {isa = PBXBuildFile; fileRef = 588B2CC60FE5641E00EC5FC0 /* ssh-connecting.png */; };
+ 588B2CCA0FE5641E00EC5FC0 /* ssh-disconnected.png in Resources */ = {isa = PBXBuildFile; fileRef = 588B2CC70FE5641E00EC5FC0 /* ssh-disconnected.png */; };
58C56EF50F438E120035701E /* SPDataCellFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 58C56EF40F438E120035701E /* SPDataCellFormatter.m */; };
58CB20ED0F79A75D005EA204 /* button_edit_mode_selected.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 58CB20EC0F79A75D005EA204 /* button_edit_mode_selected.tiff */; };
58CDB3300FCE138D00F8ACA3 /* SPSSHTunnel.m in Sources */ = {isa = PBXBuildFile; fileRef = 58CDB32F0FCE138D00F8ACA3 /* SPSSHTunnel.m */; };
@@ -330,6 +333,9 @@
586F432A0FD74CFC00B428D7 /* SSHQuestionDialog.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SSHQuestionDialog.xib; sourceTree = "<group>"; };
588593F30F7AEC9500ED0E67 /* package-application.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "package-application.sh"; sourceTree = "<group>"; };
5885940E0F7AEE6000ED0E67 /* sparkle-public-key.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "sparkle-public-key.pem"; sourceTree = "<group>"; };
+ 588B2CC50FE5641E00EC5FC0 /* ssh-connected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ssh-connected.png"; sourceTree = "<group>"; };
+ 588B2CC60FE5641E00EC5FC0 /* ssh-connecting.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ssh-connecting.png"; sourceTree = "<group>"; };
+ 588B2CC70FE5641E00EC5FC0 /* ssh-disconnected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ssh-disconnected.png"; sourceTree = "<group>"; };
58C56EF30F438E120035701E /* SPDataCellFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDataCellFormatter.h; sourceTree = "<group>"; };
58C56EF40F438E120035701E /* SPDataCellFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDataCellFormatter.m; sourceTree = "<group>"; };
58CB20EC0F79A75D005EA204 /* button_edit_mode_selected.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = button_edit_mode_selected.tiff; sourceTree = "<group>"; };
@@ -722,6 +728,9 @@
17E641B10EF02036001BC333 /* showconsole.tiff */,
17E641B20EF02036001BC333 /* showvariables.tiff */,
17E641B30EF02036001BC333 /* spyglass.tiff */,
+ 588B2CC50FE5641E00EC5FC0 /* ssh-connected.png */,
+ 588B2CC60FE5641E00EC5FC0 /* ssh-connecting.png */,
+ 588B2CC70FE5641E00EC5FC0 /* ssh-disconnected.png */,
B5E2C5F90F2353B5007446E0 /* table-property.png */,
17E641B40EF02036001BC333 /* table-small.tiff */,
584F5F8E0F50ACD800036517 /* table-view-small.tiff */,
@@ -1029,6 +1038,9 @@
29A1B7EB0FD12E55000B88E8 /* printAccessory.xib in Resources */,
586F432B0FD74CFC00B428D7 /* SSHQuestionDialog.xib in Resources */,
B54F25E60FD909C400E2CF36 /* toolbar-switch-to-table-relations.png in Resources */,
+ 588B2CC80FE5641E00EC5FC0 /* ssh-connected.png in Resources */,
+ 588B2CC90FE5641E00EC5FC0 /* ssh-connecting.png in Resources */,
+ 588B2CCA0FE5641E00EC5FC0 /* ssh-disconnected.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
> 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531