SVN Commit by dpage: r4887 - in trunk/pgadmin3: . docs/en_US src/ctl src/frm src/include src/ui src/utils
SVN Commit by dpage: r4887 - in trunk/pgadmin3: . docs/en_US src/ctl src/frm src/include src/ui src/utils
От:
svn@pgadmin.org
Дата:
Author: dpage Date: 2006-01-11 09:19:12 +0000 (Wed, 11 Jan 2006) New Revision: 4887 Modified: trunk/pgadmin3/CHANGELOG.txt trunk/pgadmin3/docs/en_US/options-tab3.html trunk/pgadmin3/src/ctl/ctlSQLResult.cpp trunk/pgadmin3/src/frm/frmOptions.cpp trunk/pgadmin3/src/include/sysSettings.h trunk/pgadmin3/src/ui/frmOptions.xrc trunk/pgadmin3/src/utils/sysSettings.cpp Log: Allow result copy quoting configuration to be set explicitly rather than using the result export settings [Magnus Hagander] Modified: trunk/pgadmin3/CHANGELOG.txt =================================================================== --- trunk/pgadmin3/CHANGELOG.txt 2006-01-09 15:43:07 UTC (rev 4886) +++ trunk/pgadmin3/CHANGELOG.txt 2006-01-11 09:19:12 UTC (rev 4887) @@ -18,6 +18,7 @@
-
+
- 2006-01-11 DP Allow result copy quoting configuration to be set explicitly rather than using the result export settings [Magnus Hagander]
- 2006-01-09 DP Add -a and -q command line options to auto connect to a server and open a query window respectively [Magnus Hagander]
- 2006-01-09 DP 1.4.2 Honour the copy quoting setting properly in the SQL results pane [Magnus Hagander]
- 2006-01-09 DP Use Ctrl-A to select all results in the query results pane. [Magnus Hagander] Modified: trunk/pgadmin3/docs/en_US/options-tab3.html =================================================================== --- trunk/pgadmin3/docs/en_US/options-tab3.html 2006-01-09 15:43:07 UTC (rev 4886) +++ trunk/pgadmin3/docs/en_US/options-tab3.html 2006-01-11 09:19:12 UTC (rev 4887) @@ -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 Modified: trunk/pgadmin3/src/ctl/ctlSQLResult.cpp =================================================================== --- trunk/pgadmin3/src/ctl/ctlSQLResult.cpp 2006-01-09 15:43:07 UTC (rev 4886) +++ trunk/pgadmin3/src/ctl/ctlSQLResult.cpp 2006-01-11 09:19:12 UTC (rev 4887) @@ -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; } Modified: trunk/pgadmin3/src/frm/frmOptions.cpp =================================================================== --- trunk/pgadmin3/src/frm/frmOptions.cpp 2006-01-09 15:43:07 UTC (rev 4886) +++ trunk/pgadmin3/src/frm/frmOptions.cpp 2006-01-11 09:19:12 UTC (rev 4887) @@ -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()); Modified: trunk/pgadmin3/src/include/sysSettings.h =================================================================== --- trunk/pgadmin3/src/include/sysSettings.h 2006-01-09 15:43:07 UTC (rev 4886) +++ trunk/pgadmin3/src/include/sysSettings.h 2006-01-11 09:19:12 UTC (rev 4887) @@ -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 Modified: trunk/pgadmin3/src/ui/frmOptions.xrc =================================================================== --- trunk/pgadmin3/src/ui/frmOptions.xrc 2006-01-09 15:43:07 UTC (rev 4886) +++ trunk/pgadmin3/src/ui/frmOptions.xrc 2006-01-11 09:19:12 UTC (rev 4887) @@ -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. Modified: trunk/pgadmin3/src/utils/sysSettings.cpp =================================================================== --- trunk/pgadmin3/src/utils/sysSettings.cpp 2006-01-09 15:43:07 UTC (rev 4886) +++ trunk/pgadmin3/src/utils/sysSettings.cpp 2006-01-11 09:19:12 UTC (rev 4887) @@ -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())