Files
sqlitebrowser/src/ImportCsvDialog.ui
Martin Kleusberg 3995ad2442 Add option to disable automatic type detection in CSV import
Because there are some circumstances under which the automatic type
detection can cause problems with the imported data and because it is
not accurate when the data changes a lot after the first couple of rows,
we need an option to disable it.

See issue #1382.
2018-05-25 22:11:43 +02:00

694 lines
18 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ImportCsvDialog</class>
<widget class="QDialog" name="ImportCsvDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>788</width>
<height>717</height>
</rect>
</property>
<property name="windowTitle">
<string>Import CSV file</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="labelName">
<property name="text">
<string>Table na&amp;me</string>
</property>
<property name="buddy">
<cstring>editName</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="editName"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelHeader">
<property name="text">
<string>&amp;Column names in first line</string>
</property>
<property name="buddy">
<cstring>checkboxHeader</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="checkboxHeader">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelSeparator">
<property name="text">
<string>Field &amp;separator</string>
</property>
<property name="buddy">
<cstring>comboSeparator</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="comboSeparator">
<item>
<property name="text">
<string>,</string>
</property>
</item>
<item>
<property name="text">
<string>;</string>
</property>
</item>
<item>
<property name="text">
<string>Tab</string>
</property>
</item>
<item>
<property name="text">
<string>|</string>
</property>
</item>
<item>
<property name="text">
<string>Other</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editCustomSeparator">
<property name="maxLength">
<number>1</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelQuote">
<property name="text">
<string>&amp;Quote character</string>
</property>
<property name="buddy">
<cstring>comboQuote</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QComboBox" name="comboQuote">
<item>
<property name="text">
<string>&quot;</string>
</property>
</item>
<item>
<property name="text">
<string>'</string>
</property>
</item>
<item>
<property name="text">
<string/>
</property>
</item>
<item>
<property name="text">
<string>Other</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editCustomQuote">
<property name="maxLength">
<number>1</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelEncoding">
<property name="text">
<string>&amp;Encoding</string>
</property>
<property name="buddy">
<cstring>comboEncoding</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QComboBox" name="comboEncoding">
<item>
<property name="text">
<string>UTF-8</string>
</property>
</item>
<item>
<property name="text">
<string>UTF-16</string>
</property>
</item>
<item>
<property name="text">
<string>ISO-8859-1</string>
</property>
</item>
<item>
<property name="text">
<string>Other</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editCustomEncoding"/>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="QLabel" name="labelTrim">
<property name="text">
<string>Trim fields?</string>
</property>
<property name="buddy">
<cstring>checkBoxTrimFields</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="checkBoxTrimFields">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="separateTables">
<property name="text">
<string>Separate tables</string>
</property>
<property name="buddy">
<cstring>checkBoxSeparateTables</cstring>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="checkBoxSeparateTables">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QPushButton" name="buttonAdvanced">
<property name="text">
<string>Advanced</string>
</property>
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/down</normaloff>:/icons/down</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="checkIgnoreDefaults">
<property name="toolTip">
<string>When importing an empty value from the CSV file into an existing table with a default value for this column, that default value is inserted. Activate this option to insert an empty value instead.</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="labelIgnoreDefaults">
<property name="text">
<string>Ignore default &amp;values</string>
</property>
<property name="buddy">
<cstring>checkIgnoreDefaults</cstring>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="checkFailOnMissing">
<property name="toolTip">
<string>Activate this option to stop the import when trying to import an empty value into a NOT NULL column without a default value.</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="labelFailOnMissing">
<property name="text">
<string>Fail on missing values </string>
</property>
<property name="buddy">
<cstring>checkFailOnMissing</cstring>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="labelNoTypeDetection">
<property name="text">
<string>Disable data type detection</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="checkNoTypeDetection">
<property name="toolTip">
<string>Disable the automatic data type detection when creating a new table.</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="QWidget" name="filePickerBlock" native="true">
<property name="enabled">
<bool>true</bool>
</property>
<layout class="QHBoxLayout" name="filePickerLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QListWidget" name="filePicker"/>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>7</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="toggleSelected">
<property name="text">
<string>Deselect All</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="matchSimilar">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Match Similar</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QTableWidget" name="tablePreview"/>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>editName</tabstop>
<tabstop>checkboxHeader</tabstop>
<tabstop>comboSeparator</tabstop>
<tabstop>editCustomSeparator</tabstop>
<tabstop>comboQuote</tabstop>
<tabstop>editCustomQuote</tabstop>
<tabstop>comboEncoding</tabstop>
<tabstop>editCustomEncoding</tabstop>
<tabstop>checkBoxTrimFields</tabstop>
<tabstop>checkBoxSeparateTables</tabstop>
<tabstop>buttonAdvanced</tabstop>
<tabstop>checkIgnoreDefaults</tabstop>
<tabstop>checkFailOnMissing</tabstop>
<tabstop>filePicker</tabstop>
<tabstop>toggleSelected</tabstop>
<tabstop>matchSimilar</tabstop>
<tabstop>tablePreview</tabstop>
</tabstops>
<resources>
<include location="icons/icons.qrc"/>
</resources>
<connections>
<connection>
<sender>comboSeparator</sender>
<signal>currentIndexChanged(int)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>updatePreview()</slot>
<hints>
<hint type="sourcelabel">
<x>232</x>
<y>99</y>
</hint>
<hint type="destinationlabel">
<x>445</x>
<y>64</y>
</hint>
</hints>
</connection>
<connection>
<sender>editName</sender>
<signal>textChanged(QString)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>checkInput()</slot>
<hints>
<hint type="sourcelabel">
<x>609</x>
<y>13</y>
</hint>
<hint type="destinationlabel">
<x>631</x>
<y>45</y>
</hint>
</hints>
</connection>
<connection>
<sender>editCustomSeparator</sender>
<signal>textChanged(QString)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>updatePreview()</slot>
<hints>
<hint type="sourcelabel">
<x>478</x>
<y>99</y>
</hint>
<hint type="destinationlabel">
<x>577</x>
<y>76</y>
</hint>
</hints>
</connection>
<connection>
<sender>editCustomQuote</sender>
<signal>textChanged(QString)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>updatePreview()</slot>
<hints>
<hint type="sourcelabel">
<x>478</x>
<y>132</y>
</hint>
<hint type="destinationlabel">
<x>530</x>
<y>90</y>
</hint>
</hints>
</connection>
<connection>
<sender>editCustomEncoding</sender>
<signal>textChanged(QString)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>updatePreview()</slot>
<hints>
<hint type="sourcelabel">
<x>495</x>
<y>165</y>
</hint>
<hint type="destinationlabel">
<x>540</x>
<y>133</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkBoxTrimFields</sender>
<signal>toggled(bool)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>updatePreview()</slot>
<hints>
<hint type="sourcelabel">
<x>184</x>
<y>191</y>
</hint>
<hint type="destinationlabel">
<x>368</x>
<y>244</y>
</hint>
</hints>
</connection>
<connection>
<sender>comboEncoding</sender>
<signal>currentIndexChanged(int)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>updatePreview()</slot>
<hints>
<hint type="sourcelabel">
<x>263</x>
<y>183</y>
</hint>
<hint type="destinationlabel">
<x>572</x>
<y>121</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkboxHeader</sender>
<signal>toggled(bool)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>updatePreview()</slot>
<hints>
<hint type="sourcelabel">
<x>184</x>
<y>60</y>
</hint>
<hint type="destinationlabel">
<x>354</x>
<y>45</y>
</hint>
</hints>
</connection>
<connection>
<sender>toggleSelected</sender>
<signal>toggled(bool)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>updateSelection(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>780</x>
<y>337</y>
</hint>
<hint type="destinationlabel">
<x>368</x>
<y>244</y>
</hint>
</hints>
</connection>
<connection>
<sender>comboQuote</sender>
<signal>currentIndexChanged(int)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>updatePreview()</slot>
<hints>
<hint type="sourcelabel">
<x>232</x>
<y>132</y>
</hint>
<hint type="destinationlabel">
<x>350</x>
<y>88</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ImportCsvDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>272</x>
<y>677</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ImportCsvDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>340</x>
<y>677</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkBoxSeparateTables</sender>
<signal>toggled(bool)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>checkInput()</slot>
<hints>
<hint type="sourcelabel">
<x>194</x>
<y>236</y>
</hint>
<hint type="destinationlabel">
<x>368</x>
<y>244</y>
</hint>
</hints>
</connection>
<connection>
<sender>matchSimilar</sender>
<signal>pressed()</signal>
<receiver>ImportCsvDialog</receiver>
<slot>matchSimilar()</slot>
<hints>
<hint type="sourcelabel">
<x>780</x>
<y>378</y>
</hint>
<hint type="destinationlabel">
<x>368</x>
<y>244</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonAdvanced</sender>
<signal>toggled(bool)</signal>
<receiver>ImportCsvDialog</receiver>
<slot>toggleAdvancedSection(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>214</x>
<y>259</y>
</hint>
<hint type="destinationlabel">
<x>393</x>
<y>358</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>updatePreview()</slot>
<slot>checkInput()</slot>
<slot>updateSelection(bool)</slot>
<slot>matchSimilar()</slot>
<slot>toggleAdvancedSection(bool)</slot>
</slots>
</ui>