aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPQueryController.h
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-09-04 08:45:47 +0000
committerBibiko <bibiko@eva.mpg.de>2009-09-04 08:45:47 +0000
commit931a46891ac3f0610363105419b01eb7b40b034f (patch)
tree26c68003589c07e2bdd8ebad53111e778c54f13d /Source/SPQueryController.h
parenta8bee6d7815cf9431cc53522f74bed648087a674 (diff)
downloadsequelpro-931a46891ac3f0610363105419b01eb7b40b034f.tar.gz
sequelpro-931a46891ac3f0610363105419b01eb7b40b034f.tar.bz2
sequelpro-931a46891ac3f0610363105419b01eb7b40b034f.zip
• implementation of a new history controller
- each history is doc-based even if you have opened not only one instance of the same spf file - for each SPF file identified by its file URL SP remembers each history item regardless from which doc instance it comes from internally ( to make sure that after closing the last instance of a doc all executed queries are saved in that file - if the user wants to change that s/he has to save that file under a different name ) - the history list for each Untitled doc will be initialized by the items stored in the global SP's prefs - the history list for each SPF doc will be initialized by the items stored in the SPF file unless an instance of the same file is already open - then the new instance inherits the history list from the opened one(s) - all history items executed in any Untitled docs will be added to SP's prefs - in other words SP's global prefs plist is the historyrepository for each new Untitled doc - if the user saves an untitled doc or rename an opened SPF file the _current_ history list for that doc will be saved to the chosen file unless an other doc instance is still open - all history lists are saved automatically if SP quits or the user closes a doc window Note: This should be tested for any logical pitfalls - each desired logic can be implemented :)
Diffstat (limited to 'Source/SPQueryController.h')
-rw-r--r--Source/SPQueryController.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/Source/SPQueryController.h b/Source/SPQueryController.h
index a06c2fd8..bce03109 100644
--- a/Source/SPQueryController.h
+++ b/Source/SPQueryController.h
@@ -27,6 +27,8 @@
@interface SPQueryController : NSWindowController
{
+
+ // QueryConsoleController
IBOutlet NSView *saveLogView;
IBOutlet NSTableView *consoleTableView;
IBOutlet NSSearchField *consoleSearchField;
@@ -43,9 +45,13 @@
NSMutableString *activeFilterString;
+ // DocumentsController
NSUInteger untitledDocumentCounter;
NSMutableDictionary *favoritesContainer;
NSMutableDictionary *historyContainer;
+ NSUInteger numberOfMaxAllowedHistory;
+
+ NSUserDefaults *prefs;
}
@@ -53,6 +59,9 @@
+ (SPQueryController *)sharedQueryController;
+#pragma mark ----------------------
+
+// QueryConsoleController
- (IBAction)copy:(id)sender;
- (IBAction)clearConsole:(id)sender;
- (IBAction)saveConsoleAs:(id)sender;
@@ -65,14 +74,18 @@
- (void)showMessageInConsole:(NSString *)message;
- (void)showErrorInConsole:(NSString *)error;
+- (NSUInteger)consoleMessageCount;
+
+#pragma mark ----------------------
+
+// DocumentsController
- (NSURL *)registerDocumentWithFileURL:(NSURL *)fileURL andContextInfo:(NSMutableDictionary *)contextInfo;
- (void)removeRegisteredDocumentWithFileURL:(NSURL *)fileURL;
-- (void)addFavorite:(NSString *)favorite forFileURL:(NSURL *)fileURL;
+- (void)addFavorite:(NSDictionary *)favorite forFileURL:(NSURL *)fileURL;
+- (void)replaceFavoritesByArray:(NSArray *)favoritesArray forFileURL:(NSURL *)fileURL;
- (void)addHistory:(NSString *)history forFileURL:(NSURL *)fileURL;
-- (void)favoritesForFileURL:(NSURL *)fileURL;
-- (void)historyForFileURL:(NSURL *)fileURL;
-
-
-- (NSUInteger)consoleMessageCount;
+- (void)replaceHistoryByArray:(NSArray *)historyArray forFileURL:(NSURL *)fileURL;
+- (NSMutableArray *)favoritesForFileURL:(NSURL *)fileURL;
+- (NSMutableArray *)historyForFileURL:(NSURL *)fileURL;
@end