Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AddRecordDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class NullLineEdit: public QLineEdit {
{
QMenu* editContextMenu = createStandardContextMenu();

QAction* nullAction = new QAction(tr("Set to NULL"), editContextMenu);
QAction* nullAction = new QAction(QIcon(":/icons/set_to_null"), tr("Set to NULL"), editContextMenu);
connect(nullAction, &QAction::triggered, [&]() {
setNull(true);
});
Expand Down
21 changes: 15 additions & 6 deletions src/EditDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ EditDialog::EditDialog(QWidget* parent)
connect(sciEdit, SIGNAL(textChanged()), this, SLOT(editTextChanged()));

// Create shortcuts for the widgets that doesn't have its own print action or printing mechanism.
QShortcut* shortcutPrintText = new QShortcut(QKeySequence::Print, ui->editorText, nullptr, nullptr, Qt::WidgetShortcut);
connect(shortcutPrintText, &QShortcut::activated, this, &EditDialog::openPrintDialog);
QShortcut* shortcutPrint = new QShortcut(QKeySequence::Print, this, nullptr, nullptr, Qt::WidgetShortcut);
connect(shortcutPrint, &QShortcut::activated, this, &EditDialog::openPrintDialog);

// Add actions to editors that have a context menu based on actions. This also activates the shortcuts.
ui->editorImage->addAction(ui->actionPrintImage);
ui->editorBinary->addAction(ui->actionPrint);
ui->editorBinary->addAction(ui->actionCopyHexAscii);

mustIndentAndCompact = Settings::getValue("databrowser", "indent_compact").toBool();
ui->buttonIndent->setChecked(mustIndentAndCompact);
ui->actionIndent->setChecked(mustIndentAndCompact);

ui->buttonAutoSwitchMode->setChecked(Settings::getValue("databrowser", "auto_switch_mode").toBool());

Expand Down Expand Up @@ -661,7 +661,7 @@ void EditDialog::setDataInBuffer(const QByteArray& data, DataSources source)
// Called when the user manually changes the "Mode" drop down combobox
void EditDialog::editModeChanged(int newMode)
{
ui->buttonIndent->setEnabled(newMode == JsonEditor || newMode == XmlEditor);
ui->actionIndent->setEnabled(newMode == JsonEditor || newMode == XmlEditor);
setStackCurrentIndex(newMode);

// * If the dataSource is the text buffer, the data is always text *
Expand Down Expand Up @@ -861,8 +861,8 @@ void EditDialog::setReadOnly(bool ro)
QPalette textEditPalette = ui->editorText->palette();

ui->buttonApply->setEnabled(!ro);
ui->buttonNull->setEnabled(!ro);
ui->buttonImport->setEnabled(!ro);
ui->actionNull->setEnabled(!ro);
ui->actionImport->setEnabled(!ro);

ui->editorText->setReadOnly(ro);
sciEdit->setReadOnly(ro);
Expand Down Expand Up @@ -1014,6 +1014,9 @@ void EditDialog::reloadSettings()
hexFont.setPointSize(Settings::getValue("databrowser", "fontsize").toInt());
hexEdit->setFont(hexFont);

ui->editCellToolbar->setToolButtonStyle(static_cast<Qt::ToolButtonStyle>
(Settings::getValue("General", "toolbarStyleEditCell").toInt()));

sciEdit->reloadSettings();
}

Expand Down Expand Up @@ -1041,6 +1044,12 @@ void EditDialog::setStackCurrentIndex(int editMode)

void EditDialog::openPrintDialog()
{
int editMode = ui->editorStack->currentIndex();
if (editMode == ImageViewer) {
openPrintImageDialog();
return;
}

QPrinter printer;
QPrintPreviewDialog *dialog = new QPrintPreviewDialog(&printer);

Expand Down
Loading