Index: docs/en_US/options-tab3.html
===================================================================
--- docs/en_US/options-tab3.html (revision 4886)
+++ docs/en_US/options-tab3.html (working copy)
@@ -30,6 +30,20 @@
Count rows if estimated less than - In the object browser, if
the estimated number of rows in a table (as read from the table statistics) is
below this limit, a SELECT count(*) will be performed to find the exact value.
+
+ Indent characters - This option specifies the number of characters
+ to indent with.
+
+ Result copy quoting - This option specifies how the fields should be quoted when
+ copied to the clipboard from the result list. Quoting can be applied to string columns only
+ (i.e. numeric columns will not be quoted) or all columns regardless of data type.
+
+ Result copy quote character - This option specifies which character should be used
+ to quote the values when copied to the clipboard from the result list. It has no effect if
+ Result copy quoting is set to none.
+
+ Result copy field separator - This option specifies which character should be used
+ to separate the fields copied to the clipboard from the result list.
Copy SQL from main form to SQL dialogue - When opening the Query
Tool, with this option selected, any object definition being displayed in the
Index: src/ctl/ctlSQLResult.cpp
===================================================================
--- src/ctl/ctlSQLResult.cpp (revision 4886)
+++ src/ctl/ctlSQLResult.cpp (working copy)
@@ -74,12 +74,12 @@
for (col=1 ; col < GetColumnCount() ; col++)
{
if (col > 1)
- str.Append(settings->GetExportColSeparator());
+ str.Append(settings->GetCopyColSeparator());
wxString text=GetItemText(row, col);
bool needQuote = false;
- if (settings->GetExportQuoting() == 1)
+ if (settings->GetCopyQuoting() == 1)
{
/* Quote strings only */
switch (colTypClasses.Item(col))
@@ -92,15 +92,15 @@
break;
}
}
- else if (settings->GetExportQuoting() == 2)
+ else if (settings->GetCopyQuoting() == 2)
/* Quote everything */
needQuote = true;
if (needQuote)
- str.Append(settings->GetExportQuoteChar());
+ str.Append(settings->GetCopyQuoteChar());
str.Append(text);
if (needQuote)
- str.Append(settings->GetExportQuoteChar());
+ str.Append(settings->GetCopyQuoteChar());
}
return str;
}
Index: src/frm/frmOptions.cpp
===================================================================
--- src/frm/frmOptions.cpp (revision 4886)
+++ src/frm/frmOptions.cpp (working copy)
@@ -48,6 +48,9 @@
#define chkShowUsersForPrivileges CTRL_CHECKBOX("chkShowUsersForPrivileges")
#define txtAutoRowCount CTRL_TEXT("txtAutoRowCount")
#define txtIndent CTRL_TEXT("txtIndent")
+#define cbCopyQuote CTRL_COMBOBOX("cbCopyQuote")
+#define cbCopyQuoteChar CTRL_COMBOBOX("cbCopyQuoteChar")
+#define cbCopySeparator CTRL_COMBOBOX("cbCopySeparator")
#define chkStickySql CTRL_CHECKBOX("chkStickySql")
#define chkDoubleClickProperties CTRL_CHECKBOX("chkDoubleClickProperties")
#define cbLanguage CTRL_COMBOBOX("cbLanguage")
@@ -103,6 +106,9 @@
chkShowUsersForPrivileges->SetValue(settings->GetShowUsersForPrivileges());
txtAutoRowCount->SetValue(NumToStr(settings->GetAutoRowCountThreshold()));
txtIndent->SetValue(NumToStr(settings->GetIndentSpaces()));
+ cbCopyQuote->SetSelection(settings->GetCopyQuoting());
+ cbCopyQuoteChar->SetValue(settings->GetCopyQuoteChar());
+ cbCopySeparator->SetValue(settings->GetCopyColSeparator());
chkStickySql->SetValue(settings->GetStickySql());
chkDoubleClickProperties->SetValue(settings->GetDoubleClickProperties());
txtSqlHelpSite->SetValue(settings->GetSqlHelpSite());
@@ -218,6 +224,9 @@
settings->SetShowUsersForPrivileges(chkShowUsersForPrivileges->GetValue());
settings->SetAutoRowCountThreshold(StrToLong(txtAutoRowCount->GetValue()));
settings->SetIndentSpaces(StrToLong(txtIndent->GetValue()));
+ settings->SetCopyQuoting(cbCopyQuote->GetCurrentSelection());
+ settings->SetCopyQuoteChar(cbCopyQuoteChar->GetValue());
+ settings->SetCopyColSeparator(cbCopySeparator->GetValue());
settings->SetStickySql(chkStickySql->GetValue());
settings->SetDoubleClickProperties(chkDoubleClickProperties->GetValue());
settings->SetUnicodeFile(chkUnicodeFile->GetValue());
Index: src/include/sysSettings.h
===================================================================
--- src/include/sysSettings.h (revision 4886)
+++ src/include/sysSettings.h (working copy)
@@ -139,12 +139,20 @@
int GetExportQuoting() const { return exportQuoting; } // 0=none 1=string 2=all
bool GetExportUnicode() const { return exportUnicode; }
+ wxString GetCopyQuoteChar() const { return copyQuoteChar; }
+ wxString GetCopyColSeparator() const { return copyColSeparator; }
+ int GetCopyQuoting() const { return copyQuoting; } // 0=none 1=string 2=all
+
void SetExportQuoteChar(const wxString &s) { exportQuoteChar=s; }
void SetExportRowSeparator(const wxString &s) { exportRowSeparator=s; }
void SetExportColSeparator(const wxString &s) { exportColSeparator=s; }
void SetExportQuoting(const int i) { exportQuoting = i; }
void SetExportUnicode(const bool b) { exportUnicode=b; }
+ void SetCopyQuoteChar(const wxString &s) { copyQuoteChar=s; }
+ void SetCopyColSeparator(const wxString &s) { copyColSeparator=s; }
+ void SetCopyQuoting(const int i) { copyQuoting = i; }
+
void Save();
@@ -195,6 +203,11 @@
wxString exportQuoteChar;
int exportQuoting;
bool exportUnicode;
+
+ // copy options
+ wxString copyColSeparator;
+ wxString copyQuoteChar;
+ int copyQuoting;
};
#endif
Index: src/ui/frmOptions.xrc
===================================================================
--- src/ui/frmOptions.xrc (revision 4886)
+++ src/ui/frmOptions.xrc (working copy)
@@ -3,7 +3,7 @@
Options
0,0d
- 246,166d
+ 246,196d
@@ -283,7 +283,7 @@
175,20d
- 35,-1d
+ 55,-1d
Maximums rows to retrieve into output window; 0 = unlimited
@@ -305,7 +305,7 @@
175,35d
- 35,-1d
+ 55,-1d
@@ -321,7 +321,7 @@
175,50d
- 35,-1d
+ 55,-1d
Indent characters
@@ -329,8 +329,53 @@
175,65d
- 35,-1d
+ 55,-1d
+
+
+ Result copy quoting
+ 5,82d
+
+
+
+ - None
+ - Strings
+ - All
+
+ 175,80d
+ 55,-1d
+
+
+
+
+ Result copy quote character
+ 5,97d
+
+
+
+ - "
+ - '
+
+ 175,95d
+ 55,-1d
+
+
+
+
+ Result copy field separator
+ 5,112d
+
+
+
+ - ;
+ - ,
+ - |
+
+ 175,110d
+ 55,-1d
+
+
+
@@ -340,7 +385,7 @@
1
- 5,82d
+ 5,127d
226,12d
@@ -418,7 +463,7 @@
2,3d
- 240,141d
+ 240,171d
@@ -426,7 +471,7 @@
&Help
- 2,147d
+ 2,177d
Accept the current settings and close the dialogue.
@@ -440,7 +485,7 @@
1
- 140,147d
+ 140,177d
Accept the current settings and close the dialogue.
@@ -454,7 +499,7 @@
0
- 193,147d
+ 193,177d
Cancel any changes and close the dialogue.
Index: src/utils/sysSettings.cpp
===================================================================
--- src/utils/sysSettings.cpp (revision 4886)
+++ src/utils/sysSettings.cpp (working copy)
@@ -169,6 +169,15 @@
exportQuoting = 1;
else
exportQuoting = 0;
+ Read(wxT("Copy/ColSeparator"), ©ColSeparator, wxT(";"));
+ Read(wxT("Copy(QuoteChar"), ©QuoteChar, wxT("\""));
+ Read(wxT("Copy/Quote"), &val, wxT("Strings"));
+ if (val == wxT("All"))
+ copyQuoting = 2;
+ else if (val == wxT("Strings"))
+ copyQuoting = 1;
+ else
+ copyQuoting = 0;
@@ -310,6 +319,23 @@
break;
}
+ Write(wxT("Copy/QuoteChar"), copyQuoteChar);
+ Write(wxT("Copy/ColSeparator"), copyColSeparator);
+ switch (copyQuoting)
+ {
+ case 2:
+ Write(wxT("Copy/Quote"), wxT("All"));
+ break;
+ case 1:
+ Write(wxT("Copy/Quote"), wxT("Strings"));
+ break;
+ case 0:
+ Write(wxT("Copy/Quote"), wxT("None"));
+ break;
+ default:
+ break;
+ }
+
wxString fontName = systemFont.GetNativeFontInfoDesc();
if (fontName == wxSystemSettings::GetFont(wxSYS_ICONTITLE_FONT).GetNativeFontInfoDesc())