80 Commits

Author SHA1 Message Date
a38c70b99e * Try a new approach in helpers.OpenTextFile(), helpers.ReadTextfile() and helpers.ReadTextfileChunk(): Based on TStreamReader instead of TFileStream now, so we can finally rely on Delphi internals for detecting a file's encoding. Also, this should fix read errors in some UTF-8 files, e.g. mentioned on http://www.heidisql.com/forum.php?t=13044
* Remove helpers.DetectEncoding(). Use a separate TStreamReader in the only caller to detect the encoding of a selected file
* Remove helpers.ScanNulChar()
* Remove helpers.RemoveNulChars()
2013-09-04 07:53:44 +00:00
58b2a66800 Get column names from VIEW per IS.COLUMNS, not per SHOW COLUMNS, to support MSSQL here. Fixes empty grid results for MSSQL VIEWs. See comment #46 of issue #3212. 2013-08-05 04:15:01 +00:00
6371ff5557 Issue #3212: Introduce TDBConnection.QuotedDbAndTableName(), callable with a db and table string. Internally calls TDBObject.QuotedDbAndTableName(), so we get the schema between db and table if required. 2013-06-22 04:45:53 +00:00
645a9f3c7f Make message strings from const.inc translatable 2012-11-29 06:15:44 +00:00
f96288fce9 Translate string variables and literals in .pas files. TODO: translate constants. 2012-11-26 05:44:01 +00:00
ca1d94c87b Issue #557: Include gnugettext.pas from https://dxgettext.svn.sourceforge.net/svnroot/dxgettext/trunk/dxgettext/sample/ . And add basic code to all FormCreate events to translate their components in the future. 2012-11-10 14:28:44 +00:00
4151f0d82a Text import: Uncheck critical "Truncate table" checkbox, to avoid accidental data removal. See http://www.heidisql.com/forum.php?t=11260 2012-09-30 12:20:19 +00:00
90ab0b6cf1 Refactor logic for reading and writing application and session settings:
* Introduce TAppSettings, created in dpr file
* Implement read and write methods, and replace callers of GetRegValue and MainReg.WriteInt/... with these
* Optimize read and write methods for avoiding redundant accesses to registry
* Auto-remove stored default settings from registry to avoid registry spam
* Replace synced MainForm.pref* variables with TAppSettings.Read* calls
* Move SetLocales call to dpr file
* Move MainForm.FDirname* variables to appropriate methods in helpers.pas
* Implement TQueryHistory.Create(SessionPath), reading its items within constructor
2012-08-19 10:55:08 +00:00
4e5783a510 Missing file for previous commit 2012-05-01 07:05:15 +00:00
ba14143238 Export whole CREATE VIEW code, not only the VIEW body. Fixes issue #2625. 2012-02-04 06:52:21 +00:00
cb4775c328 Fix memory leak 2011-11-10 22:18:42 +00:00
53444c700a Add "truncate table" feature to text import dialog. See http://www.heidisql.com/forum.php?t=9367 2011-11-10 22:15:42 +00:00
a69041d17d Add support for Windows 7 task button progress. Unify all callers of ProgressBarStatus in a set of 5 functions in main unit instead of helpers, as this is where the progress bar is placed and also we need the handle of the main window. 2011-11-08 22:27:52 +00:00
ef23060601 Suppress error dialog when user lacks privilege for SHOW CREATE DATABASE. See http://www.heidisql.com/forum.php?t=8862 2011-07-12 17:55:19 +00:00
14150b15be Disable move buttons as long as there is no movable column. Fixes issue #2488 2011-07-06 17:19:38 +00:00
e96fa77cbd Do not cache dialog instances any longer. OnCreate code is mostly very quick, and caching them adds quite some pitfalls into the code. Not to mention 30 lines less code in main.pas now :) 2011-06-26 20:01:42 +00:00
2d548b5ef6 Introduce some wrapper functions for message and error dialogs in order to have less code and to avoid hidden titles on Windows XP. Fixes issue #2425. 2011-05-27 04:48:21 +00:00
478c0306c7 Use modern TaskMessageDlg as a replacement for MessageDlg where appropriate. 2011-05-26 06:08:19 +00:00
4fbf2c23dd Introduce experimental MS SQL support 2011-03-29 23:20:21 +00:00
49a97584e6 Code preparation for non-MySQL connections: Extract abstract stuff into a new TDBConnection class, and let TMySQLConnection derive from that. Same with TDBQuery / TMySQLQuery. See issue #1008. 2011-03-17 23:03:54 +00:00
809236e534 Fix compiler warnings, newly deprecated stuff. 2011-02-01 23:05:46 +00:00
6f95a796e1 Modify identifier quoting logic:
- Move QuoteIdent() and DeQuoteIdent() out of TMySQLConnection, make them classless
- Remove TMainForm.mask(), instead always use QuoteIdent()
- Introduce a third parameter to QuoteIdent(): "AlwaysQuote" - setting this to false will quote only if required
- Set AlwaysQuote to false for all stuff which drops some code into the query editor, see http://www.heidisql.com/forum.php?t=6986
2010-11-24 23:12:13 +00:00
6c2a100945 Implement combo box for definer in routine + view + trigger editor. Fixes issue #2189. Some related changes here:
- Remove ensureValidIdentifier() and its partly uncatched exceptions. Instead, disable "OK" buttons for empty table/view/proc name.
- QuoteIdent and DeQuoteIdent now take the glue char instead of a "HasMultiSegments" boolean param, so they're more exact when "user@host" or "db.name" come in.
2010-10-12 22:13:08 +00:00
5d13d0677b The 3 procedures Parse(Table|View|Routine)Structure() already do some connection specific stuff, and now even more, so they're moved to TMySQLConnection now. In order to display the right collation even if only the character set was found in a CREATE TABLE code, the default collation per charset is detected via CollationTable. See http://www.heidisql.com/forum.php?t=6348 . 2010-10-08 20:16:53 +00:00
0fa6c15c9d Implement multiple connections per window. DBtree and friends now have their nodes bound to TDBObject instances. Fixes issue #2144. 2010-10-05 23:06:29 +00:00
f86a72dd36 Attempt to fix some weird effects on tree node selection and refreshing logic. Unhides "Data" tab after creating a new table. Fixes issue #2148. Details:
* Do process OnFocusChanged also while tree db refreshes, just avoid calling actEditObjectExecute.
* Make SelectedTable a property, rename to SelectedDbObj
* Remove calls to debug(), prefer LogSQL with lcDebug parameter
2010-09-15 23:09:43 +00:00
9a58fc526b Load text file: Fix usage of wrong indexed db object when selecting a table via drop down box. Fixes issue #2174. 2010-09-14 19:05:13 +00:00
6fa29605fd SHOW VIEW may be not allowed. Disable VIEW editor in that case, but do not run regular expression into a no-match AV. Fixes issue #2159. 2010-09-08 19:48:18 +00:00
f323420ef1 Enable TDBObject instances to return and cache their own CREATE code, and replace various manual SHOW CREATE xyz occurrences with this new function call. Additionally, modify ParseViewStructure so it takes the CREATE code instead of just the VIEWs name, so it works similar to ParseTableStructure and ParseRoutineStructure. Finally, take this CREATE code to detect all settings for a VIEW, instead of taking them from information_schema.VIEWS. Fixes issue #2131. 2010-09-07 20:58:48 +00:00
b16b7010a2 Issue #2134: More enhancements for text import dialog:
- Add option to unformat local numbers from file contents
- Add option "Low priority" again
- Fetch warnings and notes via SHOW WARNINGS, display them in log panel and leave dialog open if there are any
- Inform user if 0 rows were imported and display hint about what could be the cause
2010-09-05 10:33:39 +00:00
b51123ee2c Reorganize "import textfile" dialog, and implement an own CSV parser, selectable as an alternative to the LOAD DATA method. Fixes issue #2134. 2010-09-03 22:22:23 +00:00
b3b1710c35 Introduce EDatabaseError exception class, so we're able to handle only those and let others raise the exception up to MadExcept. Helps finding non-database related AVs as users are able to get the callstack now. Similar to r3292 but more consistent all over the code now. 2010-04-24 13:56:57 +00:00
97f01a175b Move database filter again from mainform to session manager, so people without privilege to run SHOW DATABASE are not stuck. Fixes issue #1485. Also, allow to see available databases when user does a dropdown. Also, simplify logic for refreshing database list in mainform. 2010-04-22 15:16:27 +00:00
8baeb35652 Fix stuff on "Import Textfile" dialog:
* Store settings in FormDestroy instead of btnImportClick
* Restore settings in FormCreate instead of FormShow
* Turn editFilename into a TButtonedEdit, including the file browse button
* Turn SpeedButtons for column moving into a TToolbar, to remove hackish code for assigning icons
* Increase dropdown items on charset pulldown, to decrease the need to scroll.
2010-03-08 23:07:17 +00:00
0e271ee7de Replace remaining loadXYZwindow() functions for dialogs by a more native way. 2010-02-21 10:44:55 +00:00
e045cb3d76 Delphi 2010 has PNG + alpha channel support in TImageList, so we don't need PNGcomponents any longer. 2010-02-08 00:36:17 +00:00
9080ad7607 No need to use the Wide* version of string functions any longer. 2010-01-15 20:28:48 +00:00
52ea8f410a Use Unicode enabled TStringList instead of TWideStringList in all places. Should have no visible effect, apart from a very minor performance optimization, as String reference pointers are handled by Delphi, WideString by Windows. 2010-01-14 19:41:58 +00:00
a4652d39a4 * Fix compiler warnings due to implicit AnsiString to (Unicode)String or vice versa
* Remove workaround for Unicode text to and from clipboard
* Fix writing/reading wrong encoded text into/from registry - no need to use Utf8Encode() any longer
* Implement TMySQLQuery.ColAsAnsi() for cases in which we read binary data.
2010-01-07 00:00:56 +00:00
7d401ffde8 Upgrade to Delphi 2010:
* Removes TNT Unicode controls, which are no longer required. All VCL controls now have native Unicode support.
* Remove Delphi 11 packages, otherwise we would either need to keep TNT or break Unicode
* PngComponents update from Uwe Raabe on http://cc.embarcadero.com/Item/26127
* Adjust auto build process
* Since Delphi 2009, Strings are now UnicodeStrings, not AnsiStrings any longer. Fix a bunch of compiler errors which came along with this change.
TODO: Project should compile but give tons of compiler warnings.
2010-01-05 23:14:33 +00:00
eff81d8e35 Code cosmetic: Let GetSelectedTable return a TDBObject which has the same properties as TListNode but even more. 2009-12-25 11:26:05 +00:00
e356cb7ed7 Sanitize all "uses" clauses from unneeded unit references. 2009-12-22 23:19:56 +00:00
35e8bbb304 Do not fetch database objects from information_schema, which has gotten extremely slow on servers with many databases and triggers, since we support triggers.
* Instead, use separate SHOW commands for tables, functions, procedures and triggers
* Catch this chance to move these methods from main unit to mysql_connection, so they're accessible in a more generic way
* Additionally, introduce new classes TDBObject and TDBObjectList which provide a more generic way than TMySQLQuery to access these database objects.
Fixes issue #1529
2009-12-19 11:40:28 +00:00
5f9a62de94 Use cached result of SHOW CHARSET in one more place. 2009-11-28 21:39:15 +00:00
3caf576eac Fix mixed up combo box item when generating LOAD DATA query. Fixes issue #1481 2009-11-24 18:11:43 +00:00
45fa64fe81 Wrap most queries in a try..except block which may fail with a SQL privilege error. So these places do not raise an exception at user level. Exceptions should only raise in unpredictable error situations. Important for reactivating the MadExcept dialog. 2009-11-22 18:07:53 +00:00
12a8e2ebc5 Implement a more lightweight connection layer, consisting of 2 units in source directory. Breaks threading and window to window communication, which should be reimplemented later. 2009-10-28 00:08:49 +00:00
f01893d08a Experimental: Reintroduce table tab, this time by placing the existing editors for tables, views and routines as TFrames onto that tab. Unfortunately a whole bunch of GUI changes involved here which makes the diff unreadable. Should solve issue #1149 . 2009-06-04 12:56:55 +00:00
dbb84e6df9 Integrate stored procedures and functions into the GUI flow, so they are visible like tables and editable from everywhere.
- FetchDbTableList now makes use of various tables in INFORMATION_SCHEMA if available - the only way of listing stored routines.
- If a routine is selected, Table + Data tab hide their grids and display a corresponding message instead. Seemed the only way to keep the normal flow of clicks, not changing too much click logic.
2009-03-02 21:40:44 +00:00
909d31fd64 Simplify writing settings to registry:
* Keep only one TRegistry object in memory instead of creating a new one in each routine.
* Move out relevant functions and TRegistry object from main to helpers to make them usable globally.
2009-01-03 17:16:11 +00:00