mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
Add cell symbol limit preference
This commit is contained in:
@@ -88,6 +88,7 @@ void PreferencesDialog::loadSettings()
|
||||
loadColorSetting(ui->fr_bin_fg, "bin_fg");
|
||||
loadColorSetting(ui->fr_bin_bg, "bin_bg");
|
||||
|
||||
ui->spinSymbolLimit->setValue(getSettingsValue("databrowser", "symbol_limit").toInt());
|
||||
ui->txtNull->setText(getSettingsValue("databrowser", "null_text").toString());
|
||||
ui->editFilterEscape->setText(getSettingsValue("databrowser", "filter_escape").toString());
|
||||
ui->spinFilterDelay->setValue(getSettingsValue("databrowser", "filter_delay").toInt());
|
||||
@@ -147,6 +148,7 @@ void PreferencesDialog::saveSettings()
|
||||
saveColorSetting(ui->fr_reg_bg, "reg_bg");
|
||||
saveColorSetting(ui->fr_bin_fg, "bin_fg");
|
||||
saveColorSetting(ui->fr_bin_bg, "bin_bg");
|
||||
setSettingsValue("databrowser", "symbol_limit", ui->spinSymbolLimit->value());
|
||||
setSettingsValue("databrowser", "null_text", ui->txtNull->text());
|
||||
setSettingsValue("databrowser", "filter_escape", ui->editFilterEscape->text());
|
||||
setSettingsValue("databrowser", "filter_delay", ui->spinFilterDelay->value());
|
||||
@@ -300,6 +302,8 @@ QVariant PreferencesDialog::getSettingsDefaultValue(const QString& group, const
|
||||
return QFont().defaultFamily();
|
||||
if(name == "fontsize")
|
||||
return 10;
|
||||
if(name == "symbol_limit")
|
||||
return 5000;
|
||||
if(name == "null_text")
|
||||
return "NULL";
|
||||
if(name == "filter_escape")
|
||||
|
||||
@@ -339,6 +339,38 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_5">
|
||||
<property name="title">
|
||||
<string>Content</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_symbol_limit">
|
||||
<property name="text">
|
||||
<string>Symbol limit in cell</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="spinSymbolLimit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1000</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>20000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
|
||||
@@ -224,8 +224,10 @@ QVariant SqliteTableModel::data(const QModelIndex &index, int role) const
|
||||
return PreferencesDialog::getSettingsValue("databrowser", "null_text").toString();
|
||||
else if(role == Qt::DisplayRole && isBinary(index))
|
||||
return "BLOB";
|
||||
else
|
||||
return decode(m_data.at(index.row()).at(index.column()));
|
||||
else {
|
||||
int limit = PreferencesDialog::getSettingsValue("databrowser", "symbol_limit").toInt();
|
||||
return decode(m_data.at(index.row()).at(index.column()).left(limit));
|
||||
}
|
||||
} else if(role == Qt::FontRole) {
|
||||
QFont font;
|
||||
if(m_data.at(index.row()).at(index.column()).isNull() || isBinary(index))
|
||||
|
||||
Reference in New Issue
Block a user