diff options
author | rowanbeentje <rowan@beent.je> | 2009-10-27 01:24:00 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-10-27 01:24:00 +0000 |
commit | a99b0940d264ffbc4c525c5f17049f64e391ccc3 (patch) | |
tree | 2a8c20d71f0d15ff66bf464805542cf1f0e8b9cd | |
parent | 9e6adb426de189704f0d0fe09b926b286dbb813e (diff) | |
download | sequelpro-a99b0940d264ffbc4c525c5f17049f64e391ccc3.tar.gz sequelpro-a99b0940d264ffbc4c525c5f17049f64e391ccc3.tar.bz2 sequelpro-a99b0940d264ffbc4c525c5f17049f64e391ccc3.zip |
- Set up TableSource to respond to task notifications to prepare for threaded queries
- Alter task notifications to pass the TableDocument as the notification object so that only the current window responds to the notification, allowing other windows to be fully used while a window is performing a task
-rw-r--r-- | Interfaces/English.lproj/DBView.xib | 125 | ||||
-rw-r--r-- | Source/CustomQuery.m | 14 | ||||
-rw-r--r-- | Source/TableContent.m | 14 | ||||
-rw-r--r-- | Source/TableDocument.h | 1 | ||||
-rw-r--r-- | Source/TableDocument.m | 12 | ||||
-rw-r--r-- | Source/TableSource.h | 7 | ||||
-rw-r--r-- | Source/TableSource.m | 78 | ||||
-rw-r--r-- | Source/TablesList.m | 6 |
8 files changed, 206 insertions, 51 deletions
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index f31b505c..13bca4da 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -3,7 +3,7 @@ <data> <int key="IBDocument.SystemTarget">1050</int> <string key="IBDocument.SystemVersion">10B504</string> - <string key="IBDocument.InterfaceBuilderVersion">740</string> + <string key="IBDocument.InterfaceBuilderVersion">732</string> <string key="IBDocument.AppKitVersion">1038.2</string> <string key="IBDocument.HIToolboxVersion">437.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> @@ -16,20 +16,20 @@ </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> - <string>740</string> - <string>740</string> + <string>732</string> + <string>732</string> <string>1.2.1</string> </object> </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="557"/> + <integer value="672"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> <string>com.brandonwalkin.BWToolkit</string> - <string>com.apple.WebKitIBPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.WebKitIBPlugin</string> </object> <object class="NSMutableDictionary" key="IBDocument.Metadata"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -59,10 +59,10 @@ <string key="NSWindowTitle">Connecting...</string> <string key="NSWindowClass">NSWindow</string> <string key="NSViewClass">View</string> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSWindowContentMinSize">{780, 480}</string> <object class="NSView" key="NSWindowView" id="579726586"> - <nil key="NSNextResponder"/> + <reference key="NSNextResponder"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -237,7 +237,7 @@ <string key="NSColorName">controlColor</string> <object class="NSColor" key="NSColor" id="1001122760"> <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MC42NjY2NjY2ODY1AA</bytes> + <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes> </object> </object> <reference key="NSTextColor" ref="454249633"/> @@ -281,6 +281,7 @@ </object> <string key="NSFrameSize">{212, 26}</string> <reference key="NSSuperview" ref="299440250"/> + <reference key="NSNextKeyView" ref="687169829"/> <reference key="NSDocView" ref="687169829"/> <object class="NSColor" key="NSBGColor" id="1024678221"> <int key="NSColorSpace">6</int> @@ -313,6 +314,7 @@ </object> <string key="NSFrameSize">{212, 26}</string> <reference key="NSSuperview" ref="801427893"/> + <reference key="NSNextKeyView" ref="965350222"/> <int key="NSsFlags">0</int> <reference key="NSVScroller" ref="622721581"/> <reference key="NSHScroller" ref="367421094"/> @@ -410,6 +412,7 @@ </object> <string key="NSFrameSize">{212, 354}</string> <reference key="NSSuperview" ref="233472824"/> + <reference key="NSNextKeyView" ref="251040077"/> <reference key="NSDocView" ref="251040077"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">4</int> @@ -436,6 +439,7 @@ </object> <string key="NSFrameSize">{212, 354}</string> <reference key="NSSuperview" ref="1017775084"/> + <reference key="NSNextKeyView" ref="73685676"/> <int key="NSsFlags">528</int> <reference key="NSVScroller" ref="693168867"/> <reference key="NSHScroller" ref="656188692"/> @@ -571,6 +575,7 @@ </object> <string key="NSFrameSize">{212, 145}</string> <reference key="NSSuperview" ref="298226231"/> + <reference key="NSNextKeyView" ref="347093764"/> <reference key="NSDocView" ref="347093764"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">6</int> @@ -597,6 +602,7 @@ </object> <string key="NSFrameSize">{212, 145}</string> <reference key="NSSuperview" ref="192579410"/> + <reference key="NSNextKeyView" ref="685057119"/> <int key="NSsFlags">512</int> <reference key="NSVScroller" ref="245346414"/> <reference key="NSHScroller" ref="353686052"/> @@ -865,7 +871,7 @@ <object class="NSTabViewItem" id="831053945"> <string key="NSIdentifier">source</string> <object class="NSView" key="NSView" id="461236772"> - <nil key="NSNextResponder"/> + <reference key="NSNextResponder" ref="714795046"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -2126,6 +2132,7 @@ </object> </object> <string key="NSFrame">{{10, 7}, {700, 544}}</string> + <reference key="NSSuperview" ref="714795046"/> </object> <string key="NSLabel">Structure</string> <reference key="NSColor" ref="62854682"/> @@ -2920,7 +2927,7 @@ <object class="NSTabViewItem" id="105987292"> <string key="NSIdentifier">customQuery</string> <object class="NSView" key="NSView" id="746504912"> - <reference key="NSNextResponder" ref="714795046"/> + <nil key="NSNextResponder"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -3008,6 +3015,7 @@ </object> <string key="NSFrame">{{1, 1}, {688, 155}}</string> <reference key="NSSuperview" ref="71560786"/> + <reference key="NSNextKeyView" ref="1055190999"/> <reference key="NSDocView" ref="1055190999"/> <reference key="NSBGColor" ref="449903125"/> <object class="NSCursor" key="NSCursor" id="32917531"> @@ -3039,6 +3047,7 @@ </object> <string key="NSFrameSize">{690, 157}</string> <reference key="NSSuperview" ref="873437769"/> + <reference key="NSNextKeyView" ref="1072692119"/> <int key="NSsFlags">530</int> <reference key="NSVScroller" ref="413233170"/> <reference key="NSHScroller" ref="783638826"/> @@ -3128,6 +3137,7 @@ </object> <string key="NSFrame">{{1, 17}, {688, 228}}</string> <reference key="NSSuperview" ref="678281118"/> + <reference key="NSNextKeyView" ref="581095761"/> <reference key="NSDocView" ref="581095761"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">4</int> @@ -3160,6 +3170,7 @@ </object> <string key="NSFrame">{{1, 0}, {688, 17}}</string> <reference key="NSSuperview" ref="678281118"/> + <reference key="NSNextKeyView" ref="1038415606"/> <reference key="NSDocView" ref="1038415606"/> <reference key="NSBGColor" ref="1024678221"/> <int key="NScvFlags">4</int> @@ -3168,6 +3179,7 @@ </object> <string key="NSFrameSize">{690, 246}</string> <reference key="NSSuperview" ref="345834048"/> + <reference key="NSNextKeyView" ref="90844306"/> <int key="NSsFlags">562</int> <reference key="NSVScroller" ref="472831765"/> <reference key="NSHScroller" ref="851610321"/> @@ -3764,7 +3776,6 @@ </object> </object> <string key="NSFrame">{{10, 7}, {700, 544}}</string> - <reference key="NSSuperview" ref="714795046"/> </object> <string key="NSLabel">Custom Query</string> <reference key="NSColor" ref="62854682"/> @@ -4809,14 +4820,14 @@ <reference key="NSTabView" ref="714795046"/> </object> </object> - <reference key="NSSelectedTabViewItem" ref="105987292"/> + <reference key="NSSelectedTabViewItem" ref="831053945"/> <reference key="NSFont" ref="26"/> <int key="NSTvFlags">134217731</int> <bool key="NSAllowTruncatedLabels">YES</bool> <bool key="NSDrawsBackground">YES</bool> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="746504912"/> + <reference ref="461236772"/> </object> </object> </object> @@ -4832,10 +4843,11 @@ </object> </object> <string key="NSFrameSize">{944, 550}</string> + <reference key="NSSuperview"/> </object> <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string> <string key="NSMinSize">{780, 502}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSFrameAutosaveName"/> </object> <object class="NSWindowTemplate" id="554105051"> @@ -4860,6 +4872,7 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{36, 75}, {91, 14}}</string> <reference key="NSSuperview" ref="70075497"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="45988560"> <int key="NSCellFlags">68288064</int> @@ -4876,6 +4889,7 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{17, 50}, {110, 14}}</string> <reference key="NSSuperview" ref="70075497"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="410467805"> <int key="NSCellFlags">68288064</int> @@ -4892,6 +4906,7 @@ <int key="NSvFlags">258</int> <string key="NSFrame">{{135, 74}, {137, 18}}</string> <reference key="NSSuperview" ref="70075497"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="212969926"> <int key="NSCellFlags">-1804468671</int> @@ -4909,6 +4924,7 @@ <int key="NSvFlags">259</int> <string key="NSFrame">{{207, 13}, {70, 28}}</string> <reference key="NSSuperview" ref="70075497"/> + <reference key="NSWindow"/> <int key="NSTag">1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="169260261"> @@ -4936,6 +4952,7 @@ <int key="NSvFlags">259</int> <string key="NSFrame">{{139, 13}, {70, 28}}</string> <reference key="NSSuperview" ref="70075497"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="994559297"> <int key="NSCellFlags">67239424</int> @@ -4957,6 +4974,7 @@ <int key="NSvFlags">258</int> <string key="NSFrame">{{132, 45}, {143, 22}}</string> <reference key="NSSuperview" ref="70075497"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="1000126742"> <int key="NSCellFlags">-2076049856</int> @@ -5278,6 +5296,7 @@ </object> <string key="NSFrameSize">{292, 112}</string> <reference key="NSSuperview"/> + <reference key="NSWindow"/> </object> <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> <string key="NSMinSize">{292, 134}</string> @@ -6007,7 +6026,7 @@ <object class="NSMutableString" key="NSViewClass"> <characters key="NS.bytes">View</characters> </object> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSWindowContentMinSize">{213, 107}</string> <object class="NSView" key="NSWindowView" id="329225443"> <nil key="NSNextResponder"/> @@ -6286,7 +6305,7 @@ </object> <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> <string key="NSMinSize">{213, 129}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> <object class="NSWindowTemplate" id="734744289"> <int key="NSWindowStyleMask">1</int> @@ -6298,7 +6317,7 @@ <object class="NSMutableString" key="NSViewClass"> <characters key="NS.bytes">View</characters> </object> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSWindowContentMinSize">{213, 107}</string> <object class="NSView" key="NSWindowView" id="234287744"> <nil key="NSNextResponder"/> @@ -6454,7 +6473,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> </object> <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> <string key="NSMinSize">{213, 129}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> <object class="NSWindowTemplate" id="787219800"> <int key="NSWindowStyleMask">1</int> @@ -6464,7 +6483,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <string key="NSWindowTitle">New Relation</string> <string key="NSWindowClass">NSPanel</string> <nil key="NSViewClass"/> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <object class="NSView" key="NSWindowView" id="842408319"> <nil key="NSNextResponder"/> <int key="NSvFlags">256</int> @@ -7065,7 +7084,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <string key="NSFrameSize">{302, 307}</string> </object> <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> <object class="NSWindowTemplate" id="1066802919"> <int key="NSWindowStyleMask">3</int> @@ -7077,7 +7096,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <object class="NSMutableString" key="NSViewClass"> <characters key="NS.bytes">View</characters> </object> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSWindowContentMinSize">{213, 50}</string> <object class="NSView" key="NSWindowView" id="525490268"> <nil key="NSNextResponder"/> @@ -7197,7 +7216,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> </object> <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string> <string key="NSMinSize">{213, 72}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> <object class="NSWindowTemplate" id="553728448"> <int key="NSWindowStyleMask">9</int> @@ -7209,7 +7228,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <object class="NSMutableString" key="NSViewClass"> <characters key="NS.bytes">View</characters> </object> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSWindowContentMinSize">{213, 107}</string> <object class="NSView" key="NSWindowView" id="1052076676"> <nil key="NSNextResponder"/> @@ -7344,7 +7363,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> </object> <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> <string key="NSMinSize">{213, 129}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> <object class="NSWindowTemplate" id="202784209"> <int key="NSWindowStyleMask">15</int> @@ -7356,7 +7375,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <object class="NSMutableString" key="NSViewClass"> <characters key="NS.bytes">View</characters> </object> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSWindowContentMinSize">{350, 200}</string> <object class="NSView" key="NSWindowView" id="226131408"> <nil key="NSNextResponder"/> @@ -7660,7 +7679,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> </object> <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> <string key="NSMinSize">{350, 222}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> <object class="NSWindowTemplate" id="828950706"> <int key="NSWindowStyleMask">15</int> @@ -7672,7 +7691,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <object class="NSMutableString" key="NSViewClass"> <characters key="NS.bytes">View</characters> </object> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSWindowContentMinSize">{350, 200}</string> <object class="NSView" key="NSWindowView" id="749598685"> <nil key="NSNextResponder"/> @@ -7874,7 +7893,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> </object> <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string> <string key="NSMinSize">{350, 222}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> <object class="NSWindowTemplate" id="466147946"> <int key="NSWindowStyleMask">9</int> @@ -7886,7 +7905,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <object class="NSMutableString" key="NSViewClass"> <characters key="NS.bytes">View</characters> </object> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSWindowContentMinSize">{213, 107}</string> <object class="NSView" key="NSWindowView" id="860968037"> <nil key="NSNextResponder"/> @@ -8035,7 +8054,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> </object> <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> <string key="NSMinSize">{213, 129}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> <object class="NSWindowTemplate" id="78186995"> <int key="NSWindowStyleMask">31</int> @@ -8045,7 +8064,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <string key="NSWindowTitle">MySQL Help</string> <string key="NSWindowClass">NSPanel</string> <nil key="NSViewClass"/> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSWindowContentMinSize">{351, 120}</string> <object class="NSView" key="NSWindowView" id="539508428"> <nil key="NSNextResponder"/> @@ -8439,7 +8458,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> </object> <string key="NSScreenRect">{{0, 0}, {1280, 1002}}</string> <string key="NSMinSize">{351, 136}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSFrameAutosaveName">MYSQL_HELP_WINDOW</string> </object> <object class="NSWindowTemplate" id="176945499"> @@ -8452,7 +8471,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <object class="NSMutableString" key="NSViewClass"> <characters key="NS.bytes">View</characters> </object> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSWindowContentMinSize">{350, 250}</string> <object class="NSView" key="NSWindowView" id="1024486775"> <nil key="NSNextResponder"/> @@ -8843,7 +8862,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> </object> <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string> <string key="NSMinSize">{350, 272}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> <object class="NSWindowTemplate" id="434046103"> <int key="NSWindowStyleMask">9</int> @@ -8976,7 +8995,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <string key="NSWindowTitle">Secure Text Input Sheet</string> <string key="NSWindowClass">NSPanel</string> <nil key="NSViewClass"/> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <object class="NSView" key="NSWindowView" id="978976687"> <nil key="NSNextResponder"/> <int key="NSvFlags">256</int> @@ -9080,7 +9099,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <string key="NSFrameSize">{338, 138}</string> </object> <string key="NSScreenRect">{{0, 0}, {1280, 778}}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> <object class="NSCustomView" id="139279766"> <nil key="NSNextResponder"/> @@ -10946,7 +10965,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <string key="NSColorName">disabledControlTextColor</string> <object class="NSColor" key="NSColor"> <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MC4zMzMzMzMzNDMzAA</bytes> + <bytes key="NSWhite">MC4zMzMzMzMzMzMzAA</bytes> </object> </object> </object> @@ -15177,6 +15196,30 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> </object> <int key="connectionID">6634</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">reloadFieldsButton</string> + <reference key="source" ref="103234030"/> + <reference key="destination" ref="338296668"/> + </object> + <int key="connectionID">6635</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">reloadIndexesButton</string> + <reference key="source" ref="103234030"/> + <reference key="destination" ref="939835509"/> + </object> + <int key="connectionID">6636</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">tableDocumentInstance</string> + <reference key="source" ref="103234030"/> + <reference key="destination" ref="427689665"/> + </object> + <int key="connectionID">6637</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -24764,7 +24807,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> </object> </object> <nil key="sourceID"/> - <int key="maxID">6634</int> + <int key="maxID">6637</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -26001,10 +26044,13 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string> <string>indexView</string> <string>indexedColumnsField</string> <string>keySheet</string> + <string>reloadFieldsButton</string> + <string>reloadIndexesButton</string> <string>removeFieldButton</string> <string>removeIndexButton</string> <string>structureGrabber</string> <string>tableDataInstance</string> + <string>tableDocumentInstance</string> <string>tableSourceView</string> <string>tableWindow</string> <string>tablesListInstance</string> @@ -26029,6 +26075,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</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"> diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 108d360e..2df3227e 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -2548,8 +2548,11 @@ - (void) startDocumentTaskForTab:(NSNotification *)aNotification { - // Only disable elements if the current tab is the content view - if (![[aNotification object] isEqualToString:@"SwitchToRunQueryToolbarItemIdentifier"]) return; + // Only proceed if the current document is the notifying document, and only if + // this view is selected. + if ([aNotification object] != tableDocumentInstance + || ![[[aNotification object] selectedToolbarItemIdentifier] isEqualToString:@"SwitchToRunQueryToolbarItemIdentifier"]) + return; [customQueryView setEnabled:NO]; [runSelectionButton setEnabled:NO]; @@ -2564,8 +2567,11 @@ - (void) endDocumentTaskForTab:(NSNotification *)aNotification { - // Only enable elements if the current tab is the content view - if (![[aNotification object] isEqualToString:@"SwitchToRunQueryToolbarItemIdentifier"]) return; + // Only proceed if the current document is the notifying document, and only if + // this view is selected. + if ([aNotification object] != tableDocumentInstance + || ![[[aNotification object] selectedToolbarItemIdentifier] isEqualToString:@"SwitchToRunQueryToolbarItemIdentifier"]) + return; if (selectionButtonCanBeEnabled) { [runSelectionButton setEnabled:YES]; diff --git a/Source/TableContent.m b/Source/TableContent.m index 4286723a..156b46ab 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -2657,8 +2657,11 @@ - (void) startDocumentTaskForTab:(NSNotification *)aNotification { - // Only disable elements if the current tab is the content view - if (![[aNotification object] isEqualToString:@"SwitchToTableContentToolbarItemIdentifier"]) return; + // Only proceed if the current document is the notifying document, and only if + // this view is selected. + if ([aNotification object] != tableDocumentInstance + || ![[[aNotification object] selectedToolbarItemIdentifier] isEqualToString:@"SwitchToTableContentToolbarItemIdentifier"]) + return; [tableContentView setEnabled:NO]; [addButton setEnabled:NO]; @@ -2674,8 +2677,11 @@ - (void) endDocumentTaskForTab:(NSNotification *)aNotification { - // Only enable elements if the current tab is the content view - if (![[aNotification object] isEqualToString:@"SwitchToTableContentToolbarItemIdentifier"]) return; + // Only proceed if the current document is the notifying document, and only if + // this view is selected. + if ([aNotification object] != tableDocumentInstance + || ![[[aNotification object] selectedToolbarItemIdentifier] isEqualToString:@"SwitchToTableContentToolbarItemIdentifier"]) + return; if ( ![[[tableDataInstance statusValues] objectForKey:@"Rows"] isNSNull] && selectedTable && [selectedTable length] && [tableDataInstance tableEncoding]) [addButton setEnabled:YES]; if ([tableContentView numberOfSelectedRows] > 0) { diff --git a/Source/TableDocument.h b/Source/TableDocument.h index ef941f60..30d44084 100644 --- a/Source/TableDocument.h +++ b/Source/TableDocument.h @@ -273,6 +273,7 @@ enum sp_current_query_mode // Toolbar methods - (void)setupToolbar; +- (NSString *)selectedToolbarItemIdentifier; - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag; - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar; - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar; diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 2515dde2..40428e53 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -1132,7 +1132,7 @@ _isWorking = YES; [dbTablesTableView setEnabled:NO]; [historyControl setEnabled:NO]; - [[NSNotificationCenter defaultCenter] postNotificationName:SPDocumentTaskStartNotification object:[mainToolbar selectedItemIdentifier]]; + [[NSNotificationCenter defaultCenter] postNotificationName:SPDocumentTaskStartNotification object:self]; // Reset the progress indicator taskDisplayIsIndeterminate = YES; @@ -1209,7 +1209,7 @@ _isWorking = NO; [dbTablesTableView setEnabled:YES]; [historyControl setEnabled:YES]; - [[NSNotificationCenter defaultCenter] postNotificationName:SPDocumentTaskEndNotification object:[mainToolbar selectedItemIdentifier]]; + [[NSNotificationCenter defaultCenter] postNotificationName:SPDocumentTaskEndNotification object:self]; } /** @@ -3002,6 +3002,14 @@ } /** + * Return the identifier for the currently selected toolbar item, or nil if none is selected. + */ +- (NSString *)selectedToolbarItemIdentifier; +{ + return [mainToolbar selectedItemIdentifier]; +} + +/** * toolbar delegate method */ - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)willBeInsertedIntoToolbar diff --git a/Source/TableSource.h b/Source/TableSource.h index 4d10a5c9..c30a70bd 100644 --- a/Source/TableSource.h +++ b/Source/TableSource.h @@ -30,6 +30,7 @@ { IBOutlet id tablesListInstance; IBOutlet id tableDataInstance; + IBOutlet id tableDocumentInstance; IBOutlet id tableWindow; IBOutlet id indexSheet; @@ -39,8 +40,10 @@ IBOutlet id addFieldButton; IBOutlet id copyFieldButton; IBOutlet id removeFieldButton; + IBOutlet id reloadFieldsButton; IBOutlet id addIndexButton; IBOutlet id removeIndexButton; + IBOutlet id reloadIndexesButton; IBOutlet id indexTypeField; IBOutlet id indexNameField; IBOutlet id indexedColumnsField; @@ -93,4 +96,8 @@ - (NSDictionary *)enumFields; - (NSArray *)tableStructureForPrint; +// Task interaction +- (void) startDocumentTaskForTab:(NSNotification *)aNotification; +- (void) endDocumentTaskForTab:(NSNotification *)aNotification; + @end diff --git a/Source/TableSource.m b/Source/TableSource.m index 48ae859f..77e05efb 100644 --- a/Source/TableSource.m +++ b/Source/TableSource.m @@ -24,6 +24,7 @@ // More info at <http://code.google.com/p/sequel-pro/> #import "TableSource.h" +#import "TableDocument.h" #import "TablesList.h" #import "SPTableData.h" #import "SPSQLParser.h" @@ -46,6 +47,7 @@ loads aTable, put it in an array, update the tableViewColumns and reload the tab id extra; int i; SPSQLParser *fieldParser; + BOOL enableInteraction = ![tableDocumentInstance isWorking]; // Check whether a save of the current row is required. if ( ![self saveRowOnDeselect] ) return; @@ -81,7 +83,7 @@ loads aTable, put it in an array, update the tableViewColumns and reload the tab } // Enable edit table button - [editTableButton setEnabled:YES]; + [editTableButton setEnabled:enableInteraction]; //query started [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:self]; @@ -185,7 +187,7 @@ loads aTable, put it in an array, update the tableViewColumns and reload the tab } // If a view is selected, disable the buttons; otherwise enable. - BOOL editingEnabled = ([tablesListInstance tableType] == SP_TABLETYPE_TABLE); + BOOL editingEnabled = ([tablesListInstance tableType] == SP_TABLETYPE_TABLE) && enableInteraction; [addFieldButton setEnabled:editingEnabled]; [addIndexButton setEnabled:editingEnabled]; @@ -238,7 +240,7 @@ loads aTable, put it in an array, update the tableViewColumns and reload the tab // if no field is selected 'Duplicate field' will copy the last field // Enable 'Duplicate field' only for tables! if([tablesListInstance tableType] == SP_TABLETYPE_TABLE) - [copyFieldButton setEnabled:([tableSourceView numberOfRows] > 0)]; + [copyFieldButton setEnabled:enableInteraction && ([tableSourceView numberOfRows] > 0)]; else [copyFieldButton setEnabled:NO]; @@ -1046,6 +1048,64 @@ returns a dictionary containing enum/set field names as key and possible values } #pragma mark - +#pragma mark Task interaction + +/** + * Disable all content interactive elements during an ongoing task. + */ +- (void) startDocumentTaskForTab:(NSNotification *)aNotification +{ + + // Only proceed if the current document is the notifying document, and only if + // this view is selected. + if ([aNotification object] != tableDocumentInstance + || ![[[aNotification object] selectedToolbarItemIdentifier] isEqualToString:@"SwitchToTableStructureToolbarItemIdentifier"]) + return; + + [tableSourceView setEnabled:NO]; + [addFieldButton setEnabled:NO]; + [removeFieldButton setEnabled:NO]; + [copyFieldButton setEnabled:NO]; + [reloadFieldsButton setEnabled:NO]; + [editTableButton setEnabled:NO]; + + [indexView setEnabled:NO]; + [addIndexButton setEnabled:NO]; + [removeIndexButton setEnabled:NO]; + [reloadIndexesButton setEnabled:NO]; +} + +/** + * Enable all content interactive elements after an ongoing task. + */ +- (void) endDocumentTaskForTab:(NSNotification *)aNotification +{ + + // Only re-enable elements if the current tab is the structure view + if ([aNotification object] != tableDocumentInstance + || ![[[aNotification object] selectedToolbarItemIdentifier] isEqualToString:@"SwitchToTableStructureToolbarItemIdentifier"]) + return; + + BOOL editingEnabled = ([tablesListInstance tableType] == SP_TABLETYPE_TABLE); + [tableSourceView setEnabled:YES]; + [tableSourceView displayIfNeeded]; + [addFieldButton setEnabled:editingEnabled]; + if (editingEnabled && [tableSourceView numberOfSelectedRows] > 0) { + [removeFieldButton setEnabled:YES]; + [copyFieldButton setEnabled:YES]; + } + [reloadFieldsButton setEnabled:YES]; + [editTableButton setEnabled:YES]; + + [indexView setEnabled:YES]; + [indexView displayIfNeeded]; + [addIndexButton setEnabled:editingEnabled]; + if (editingEnabled && [indexView numberOfSelectedRows] > 0) + [removeIndexButton setEnabled:YES]; + [reloadIndexesButton setEnabled:YES]; +} + +#pragma mark - #pragma mark TableView datasource methods - (int)numberOfRowsInTableView:(NSTableView *)aTableView @@ -1405,10 +1465,22 @@ would result in a position change. // Set the structure and index view's vertical gridlines if required [tableSourceView setGridStyleMask:([prefs boolForKey:SPDisplayTableViewVerticalGridlines]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone]; [indexView setGridStyleMask:([prefs boolForKey:SPDisplayTableViewVerticalGridlines]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone]; + + // Add observers for document task activity + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(startDocumentTaskForTab:) + name:SPDocumentTaskStartNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(endDocumentTaskForTab:) + name:SPDocumentTaskEndNotification + object:nil]; } - (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [tableFields release]; [indexes release]; [oldRow release]; diff --git a/Source/TablesList.m b/Source/TablesList.m index 2d56938d..5be863fd 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -1541,6 +1541,10 @@ */ - (void) startDocumentTaskForTab:(NSNotification *)aNotification { + + // Only proceed if the notification was received from the current document. + if ([aNotification object] != tableDocumentInstance) return; + [tablesListView setEnabled:NO]; [toolbarAddButton setEnabled:NO]; [toolbarActionsButton setEnabled:NO]; @@ -1552,6 +1556,8 @@ */ - (void) endDocumentTaskForTab:(NSNotification *)aNotification { + if ([aNotification object] != tableDocumentInstance) return; + [tablesListView setEnabled:YES]; [toolbarAddButton setEnabled:YES]; [toolbarActionsButton setEnabled:YES]; |