30 Commits

Author SHA1 Message Date
85faa5ffc3 Implement parser for connection parameters on commandline.
Code snippets by Nemanja, see discussion: http://www.heidisql.com/forum/viewtopic.php?t=252
2007-11-30 21:34:41 +00:00
f6d4e637e3 Replace TSMDBGrid in Data + Query tabs by TTntDBGrid.
- Implement an alternative solution for handling sorted columns without usage of SMDBGrid's sortcolumns. Move relevant structures and functions from data_sorting.pas to childwin.pas and use them in both units.
- Upgrade some code parts to use WideStrings instead of Strings so they don't break with the new grid.
- Use Grid.OnDrawDataCell as an alternative to Grid.OnGetCellParams as the latter one is a feature of SMDBGrid
- Cosmetic: enhance screen real estate in viewdata()
2007-11-26 20:58:08 +00:00
e7bcbdf293 * Bugfix: plug the most obvious memory leaks.
* Clear some unused code and wrong comments.
2007-11-09 09:51:31 +00:00
a706163966 Bugfix: regression introduced in revision 1104 - Abort()ing in popupTreeView causes various misbehaviours.
Also added three debug statements so the rest of you can test and see that things happen in the right order now; feel free to remove these.
2007-11-08 12:10:37 +00:00
5f86b11cad * Bugfix: The TTreeView component has a nasty habit of inserting a bad memory reference into TTreeView.Selected whenever TTreeView.ClearSelection() or TTreeView.Items.Clear() are called. The bad memory reference is in turn picked up by GetActiveDatabase and GetSelectedTable, which are used all over the place, making stuff like this fun to debug. Worked around by constructing a 'fake' db tree in memory, then prodding the TTreeNodes structure from that on top of the regular DB tree. Someone bothered to do a bit of serialization / deserialization magic in TTreeNodes.Assign, making this work beautifully.
* Bugfix: When methods are called recursively, they should push/pop altered event handlers on a LIFO stack instead of blindly setting and unsetting them.

* Cosmetic: Reclaim screen real estate in ReadDatabasesAndTables().
2007-11-07 07:02:10 +00:00
62eb57abf1 Follow-up to r1104: popup menu entry click event handlers are invoked via window messages, sigh. 2007-11-06 14:19:21 +00:00
f085be1ca8 Rename mysql.pas and it's helper file installer_function_list_generator.php so their purpose is more clearer to newbies. 2007-10-23 18:49:14 +00:00
29b951b843 * Add svnversion + envpipe + sed as part of build process, as a quick fix to get WC revision numbers into main.pas. 2007-10-09 16:39:57 +00:00
74074fe633 Bugfix: There is no thread safety mechanism in Zeos for the SQL log, so implement one in HeidiSQL. This should speed up async queries tremendously, as they no longer have to wait for the GUI to repaint before firing the actual query. Haven't bothered thinking about thread safety around the creation of the critical section protecting the TStringList, mainly because I'm infinitely annoyed by Delphi not providing a thread-safe list capable of holding lists OOTB.. 2007-10-08 21:29:16 +00:00
94f1d6035f Fix compiler error in Delphi 10: Copy CSIDL_* constants from [delphi11]\source\win32\rtl\win\ShlObj.pas to const.inc to make them available also in Delphi 10. 2007-10-04 20:04:58 +00:00
547b6161fa Fullfill feature request #1751455 "SQL log also in text-file".
- File logging can be activated in preferences dialog, by default of course NOT active.
- One file per session is written to [Documents and settings]\[username]\Application data\HeidiSQL\Sessionlogs\
- Filename pattern: "[session name] [zeropadded session nr].log"
- Fetch more descriptive CSIDL_* constants for system folders from ShlObj unit rather than hardcoded hex values
2007-10-03 12:35:32 +00:00
c6fff14ed0 Refactor DROP TABLE procedure:
- Give the user a prettier confirmation message with listed tables to drop.
- Add documentation
- Drop large WITH .. DO statement
- Correctly call refresh-procedures
2007-09-28 16:43:59 +00:00
d315e45885 Nuke various never called procedures and functions. Just readd them if you want to use them somewhere, especially the helpers-functions. 2007-09-26 23:13:18 +00:00
9409c798ab Remove ActualDatabase and ActualTable variables, plus various minor optimizations that ensued from said change. Fixes a problem where when:
- viewing data in a table
 - switching to query tab
 - pressing master refresh
some of the tabs would disappear.
2007-09-11 15:58:47 +00:00
25d6112666 Fix autobuild process which couldn't find compilers.inc. D10 + 11 IDE find it anyway because they have the path set in searchpaths. 2007-09-07 07:41:59 +00:00
6d72ead5dd Refactor logic in preferences dialog:
- Consistency:
  - Move all global preferences vars from mainform to childwin.
  - Get rid of unused legacy vars NativeFieldTypes + LanguageOffset
- Readability:
  - Add documentation
  - Prefix preferences vars with "pref"
  - Get rid of WITH .. DO statements
2007-09-03 15:44:18 +00:00
2dee4b326f Fix todo: Replace Ansgar's otherwise adorable icons with a couple of free ones from Mark James.
Scheme:
 * Green arrow means "current window"
 * Computer means "is connected"
 * Lightning means "connect"
 * Plug pull means "disconnect"
2007-08-29 16:09:09 +00:00
3f0b70c409 Switch ListColumns from TSortListView to TVirtualStringTree
Additionally/Sideeffects:
- Fix vstFreeNode to delete the item from the array, not only free the item itself
- Change/Rename GetSelectedNodesFromVT to GetVTCaptions and give it the ability to return all captions, not only the selected. This function is very useful now and saves writing much redundant code.

A table with 500 columns needed 3 seconds to display in the TSortListView, now that takes less than a half second.
2007-08-27 00:01:53 +00:00
9068f08609 Convert ListTables from TSortListview to TVirtualStringTree
Additionally/Side effects:
- TVTreeData structure moved to helpers.pas to be able to use it in new function GetSelectedNodesFromVT.
- ListTablesEditing dropped. We don't need to disable any shortcut there because there is none set.
- Avoid potential AVs when accessing not created items in TVTreeData.Captions
2007-08-25 00:08:31 +00:00
f39222fea5 Refresh table cache when one or more tables got renamed, created, dropped. 2007-07-14 12:59:25 +00:00
5207ec37a7 Move popupmenu main.SQLfunctions to childwin.popupQuery. So every new created MDI-child get its own instance of this popupmenu. 2007-07-06 19:10:04 +00:00
69e1abbf43 Implement an up-to-date list of MySQL functions in mysql.pas. Used for
- popupmenu in query memo
- query helpers
- SynCompletionProposal
Drops function.txt and parser for that file.

Pros:
- No dependency on this file anymore
- Much easier and safer coding
- File-parsing no longer needed

Notes:

The old function.txt was meant to be editable and extensible for users but I never saw or heard anyone who does that, most likely because it wasn't documented. Another problem was that the file resided in the programs-directory, where only administrators have write-access, so in these cases it couldn't be edited anyway.

The PHP file in /extras can be used for creating an up-to-date list for mysql.pas .

As not all functions of the new list are available in all mysql-versions, it would be the best if we would fetch the list by the use of HELP commands. Contra: Would result in poor performancing popupmenu and many servers don't have the help-tables filled.
2007-07-04 22:31:56 +00:00
6de920d8ec Move creation of CopyTableForm from application startup to a place where it's done on demand. 2007-07-03 19:35:09 +00:00
bf73dadbd3 Move creation of printlistForm from application startup to a place where it's done on demand. 2007-07-03 19:31:06 +00:00
fe6d534120 Move creation of loaddataform from application startup to a place where it's done on demand. 2007-07-03 19:26:17 +00:00
45d617c776 Move creation of tbl_properties_form from application startup to a place where it's done on demand.
Also removes a legacy procedure where that form was called, which is not linked to any control event.
2007-07-03 19:10:45 +00:00
aeb7be0a37 * Fix hint for SQL functions menuitems which have pipes in declarations (fx TRIM).
* Fix splitting of function descriptions by implementing + using LastPos()
2007-07-02 19:08:59 +00:00
5cbebfe42c Implement query helpers: Columns, SQL functions and SQL keywords, presented in a listbox where they can be doubleclicked or dragged to insert into query-memo.
As a benefit, function.txt is read into 3 stringlists at startup now: Names, Declarations and Descriptions. Used in SynCompletionProposal and to fill the above mentioned helpers-list.

Also fixes a minor issue in SynMemoQueryDragOver using an unset "Accept" var.
2007-07-01 23:29:42 +00:00
a3c48969d9 Fix repeated queries when navigating the tree view.
* Remove feature: columns listed in tree view (helps fix repeated queries; need to cache these and move to different GUI location)
 * Remove feature: SELECT COUNT(*) on all tables with MySQL < 3.23 (performance killer)
 * Add feature: Cache table lists for tree view (improves performance and fixes repeated queries)
 * Add feature: Master refresh button clears entire table list cache.
 * Add feature: Refresh button in table list view popup clear table list cache for database being viewed.
 * Add feature: Restore active database after user queries.
2007-06-29 16:13:42 +00:00
3c8f123a81 Move *.pas, *.dfm and *.inc files from root directory to a new "source" subdirectory. Leaving just the readme in the root to give all newbies a very clear and unique starting point. 2007-06-28 20:00:04 +00:00