53 #include "ui_dialogexporttocsv.h"
55 #include "../vmisc/vcommonsettings.h"
56 #include "../vabstractapplication.h"
58 #include <QPushButton>
70 ui->checkBoxWithHeader->setChecked(
qApp->Settings()->GetCSVWithHeader());
72 foreach (
int mib, QTextCodec::availableMibs())
74 ui->comboBoxCodec->addItem(QTextCodec::codecForMib(mib)->name(), mib);
77 ui->comboBoxCodec->setCurrentIndex(
ui->comboBoxCodec->findData(
qApp->Settings()->GetCSVCodec()));
81 QPushButton *bDefaults =
ui->buttonBox->button(QDialogButtonBox::RestoreDefaults);
83 connect(bDefaults, &QPushButton::clicked,
this, [
this]()
85 ui->checkBoxWithHeader->setChecked(
qApp->Settings()->GetDefCSVWithHeader());
86 ui->comboBoxCodec->setCurrentIndex(
ui->comboBoxCodec->findData(
qApp->Settings()->GetDefCSVCodec()));
101 return ui->checkBoxWithHeader->isChecked();
107 return ui->comboBoxCodec->currentData().toInt();
113 if (
ui->radioButtonTab->isChecked())
117 else if (
ui->radioButtonSemicolon->isChecked())
121 else if (
ui->radioButtonSpace->isChecked())
134 if (event->type() == QEvent::LanguageChange)
137 ui->retranslateUi(
this);
141 QDialog::changeEvent(event);
147 QDialog::showEvent( event );
148 if ( event->spontaneous() )
159 setMaximumSize(size());
160 setMinimumSize(size());
168 switch(separator.toLatin1())
171 ui->radioButtonTab->setChecked(
true);
174 ui->radioButtonSemicolon->setChecked(
true);
177 ui->radioButtonSpace->setChecked(
true);
181 ui->radioButtonComma->setChecked(
true);
virtual ~DialogExportToCSV()
void SetSeparator(const QChar &separator)
Ui::DialogExportToCSV * ui
virtual void changeEvent(QEvent *event) Q_DECL_OVERRIDE
DialogExportToCSV(QWidget *parent=nullptr)
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE