mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-21 11:31:00 -06:00
The new editor mode shares the same Scintilla widget as the JSON mode. The JsonTextEdit class has been generalised. Future modes supported by Scintilla could be added with the current pattern. As a consequence, the EditMode is not always equal to the current stacked widget. Some code in EditDialog has been refactored, so it is easier to understand and modified with so many modes. textNullSet has been replaced by the use of dataType as Null. SVG is promoted to a new recognised data type, so it can be edited in the XML mode. The XML data is formatted and validated following the pattern established by the JSON mode. New modules are needed by the XML mode: the Qt XML module and some new Scintilla files required by the HTML/XML lexer. The indent_compact was incorrectly named in Setting::getDefaultValue. See issue #1253.
402 lines
10 KiB
XML
402 lines
10 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<ui version="4.0">
|
|
<class>EditDialog</class>
|
|
<widget class="QDialog" name="EditDialog">
|
|
<property name="geometry">
|
|
<rect>
|
|
<x>0</x>
|
|
<y>0</y>
|
|
<width>618</width>
|
|
<height>382</height>
|
|
</rect>
|
|
</property>
|
|
<property name="windowTitle">
|
|
<string>Edit database cell</string>
|
|
</property>
|
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
|
<item>
|
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
<item>
|
|
<widget class="QLabel" name="labelMode">
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>0</width>
|
|
<height>0</height>
|
|
</size>
|
|
</property>
|
|
<property name="text">
|
|
<string>Mode:</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QComboBox" name="comboMode">
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>0</width>
|
|
<height>0</height>
|
|
</size>
|
|
</property>
|
|
<item>
|
|
<property name="text">
|
|
<string>Text</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>Binary</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>Image</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>JSON</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>XML</string>
|
|
</property>
|
|
</item>
|
|
</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>
|
|
<item>
|
|
<widget class="QToolButton" name="buttonIndent">
|
|
<property name="enabled">
|
|
<bool>false</bool>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Auto-format: pretty print on loading, compact on saving.</string>
|
|
</property>
|
|
<property name="statusTip">
|
|
<string>Auto-format: pretty print on loading, compact on saving.</string>
|
|
</property>
|
|
<property name="whatsThis">
|
|
<string>When enabled, the auto-format feature formats the data on loading, breaking the text in lines and indenting it for maximum readability. On data saving, the auto-format feature compacts the data removing end of lines, and unnecessary whitespace.</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>Autoformat</string>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset resource="icons/icons.qrc">
|
|
<normaloff>:/icons/text_indent</normaloff>:/icons/text_indent</iconset>
|
|
</property>
|
|
<property name="checkable">
|
|
<bool>true</bool>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QPushButton" name="buttonImport">
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>0</width>
|
|
<height>0</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Import from file</string>
|
|
</property>
|
|
<property name="whatsThis">
|
|
<string>Opens a file dialog used to import any kind of data to this database cell.</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>&Import</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QPushButton" name="buttonExport">
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>0</width>
|
|
<height>0</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Export to file</string>
|
|
</property>
|
|
<property name="whatsThis">
|
|
<string>Opens a file dialog used to export the contents of this database cell to a file.</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>&Export</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QPushButton" name="buttonNull">
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>0</width>
|
|
<height>0</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Set this cell to NULL</string>
|
|
</property>
|
|
<property name="whatsThis">
|
|
<string>Erases the contents of the cell</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>Set as &NULL</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
<item>
|
|
<widget class="QStackedWidget" name="editorStack">
|
|
<property name="currentIndex">
|
|
<number>0</number>
|
|
</property>
|
|
<widget class="QWidget" name="verticalLayout_4">
|
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
|
<item>
|
|
<widget class="QTextEdit" name="editorText">
|
|
<property name="font">
|
|
<font>
|
|
<family>Monospace</family>
|
|
</font>
|
|
</property>
|
|
<property name="whatsThis">
|
|
<string>This area displays information about the data present in this database cell</string>
|
|
</property>
|
|
<property name="acceptRichText">
|
|
<bool>false</bool>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
<widget class="QWidget" name="editorBinary"/>
|
|
<widget class="QScrollArea" name="editorImageScrollArea">
|
|
<property name="widgetResizable">
|
|
<bool>true</bool>
|
|
</property>
|
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
|
<property name="geometry">
|
|
<rect>
|
|
<x>0</x>
|
|
<y>0</y>
|
|
<width>98</width>
|
|
<height>35</height>
|
|
</rect>
|
|
</property>
|
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
<item>
|
|
<widget class="QLabel" name="editorImage">
|
|
<property name="text">
|
|
<string/>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
</widget>
|
|
<widget class="QWidget" name="editorSci">
|
|
<property name="whatsThis">
|
|
<string>This editor mode lets you edit JSON or XML data with syntax highlighting, automatic formatting and validation before saving.
|
|
|
|
Errors are indicated with a red squiggle underline.</string>
|
|
</property>
|
|
</widget>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
<item>
|
|
<layout class="QVBoxLayout" name="verticalLayout">
|
|
<item>
|
|
<widget class="QLabel" name="labelType">
|
|
<property name="text">
|
|
<string>Type of data currently in cell</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QLabel" name="labelSize">
|
|
<property name="text">
|
|
<string>Size of data currently in table</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</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>
|
|
<item>
|
|
<widget class="QPushButton" name="buttonApply">
|
|
<property name="toolTip">
|
|
<string>Apply data to cell [Ctrl+Return]</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>Apply</string>
|
|
</property>
|
|
<property name="default">
|
|
<bool>true</bool>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
<tabstops>
|
|
<tabstop>buttonExport</tabstop>
|
|
<tabstop>buttonNull</tabstop>
|
|
</tabstops>
|
|
<resources>
|
|
<include location="icons/icons.qrc"/>
|
|
</resources>
|
|
<connections>
|
|
<connection>
|
|
<sender>buttonImport</sender>
|
|
<signal>clicked()</signal>
|
|
<receiver>EditDialog</receiver>
|
|
<slot>importData()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>400</x>
|
|
<y>28</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>60</x>
|
|
<y>0</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>buttonExport</sender>
|
|
<signal>clicked()</signal>
|
|
<receiver>EditDialog</receiver>
|
|
<slot>exportData()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>488</x>
|
|
<y>51</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>162</x>
|
|
<y>17</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>buttonApply</sender>
|
|
<signal>clicked()</signal>
|
|
<receiver>EditDialog</receiver>
|
|
<slot>accept()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>605</x>
|
|
<y>358</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>241</x>
|
|
<y>406</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>comboMode</sender>
|
|
<signal>currentIndexChanged(int)</signal>
|
|
<receiver>EditDialog</receiver>
|
|
<slot>editModeChanged(int)</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>71</x>
|
|
<y>27</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>201</x>
|
|
<y>431</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>buttonNull</sender>
|
|
<signal>clicked()</signal>
|
|
<receiver>EditDialog</receiver>
|
|
<slot>setNull()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>528</x>
|
|
<y>28</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>723</x>
|
|
<y>58</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>editorText</sender>
|
|
<signal>textChanged()</signal>
|
|
<receiver>EditDialog</receiver>
|
|
<slot>editTextChanged()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>279</x>
|
|
<y>191</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>339</x>
|
|
<y>335</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>buttonIndent</sender>
|
|
<signal>toggled(bool)</signal>
|
|
<receiver>EditDialog</receiver>
|
|
<slot>setMustIndentAndCompact(bool)</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>309</x>
|
|
<y>22</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>308</x>
|
|
<y>190</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
</connections>
|
|
<slots>
|
|
<slot>importData()</slot>
|
|
<slot>exportData()</slot>
|
|
<slot>editTextChanged()</slot>
|
|
<slot>editModeChanged(int)</slot>
|
|
<slot>setNull()</slot>
|
|
</slots>
|
|
</ui>
|