57 #include "../vpropertyexplorer/checkablemessagebox.h"
58 #include "../vmisc/vabstractapplication.h"
63 #include <QFileDialog>
66 : QMainWindow(parent),
67 m_curFileFormatVersion(0x0),
68 m_curFileFormatVersionStr(QLatin1String(
"0.0.0"))
73 const QString &maxFormatVersion)
75 if (
qApp->Settings()->getConfirmFormatRewriting())
78 msgBox.setWindowTitle(tr(
"Confirm format rewriting"));
79 msgBox.
setText(tr(
"This file is using previous format version v%1. The current is v%2. "
80 "Saving the file with this app version will update the format version for this "
81 "file. This may prevent you from be able to open the file with older app versions. "
82 "Do you really want to continue?").arg(currentFormatVersion).arg(maxFormatVersion));
85 msgBox.
setIconPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(32, 32));
87 int dialogResult = msgBox.exec();
89 if (dialogResult == QDialog::Accepted)
91 qApp->Settings()->setConfirmFormatRewriting(not msgBox.
isChecked());
106 if (
qApp->Settings()->getToolBarStyle())
108 bar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
112 bar->setToolButtonStyle(Qt::ToolButtonIconOnly);
119 qApp->Settings()->GetOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c());
125 const QString filters = tr(
"Comma-Separated Values") + QLatin1String(
" (*.csv)");
126 const QString suffix(
"csv");
127 const QString path = QDir::homePath() + QLatin1String(
"/") + file + QLatin1String(
".") + suffix;
129 QString fileName = QFileDialog::getSaveFileName(
this, tr(
"Export to CSV"), path, filters,
nullptr,
130 QFileDialog::DontUseNativeDialog);
132 if (fileName.isEmpty())
137 QFileInfo f( fileName );
138 if (f.suffix().isEmpty() && f.suffix() != suffix)
140 fileName += QLatin1String(
".") + suffix;
144 if (dialog.exec() == QDialog::Accepted)
The CheckableMessageBox class implements a message box suitable for questions with a "Do not ask me a...
void setStandardButtons(QDialogButtonBox::StandardButtons s)
void setText(const QString &)
void setIconPixmap(const QPixmap &p)
void setDefaultButton(QDialogButtonBox::StandardButton s)
virtual void exportToCSVData(const QString &fileName, const DialogExportToCSV &dialog)=0
virtual void zoomToSelected()=0
void exportToCSV(QString &file)
void ToolBarStyle(QToolBar *bar)
VAbstractMainWindow(QWidget *parent=nullptr)
bool ContinueFormatRewrite(const QString ¤tFormatVersion, const QString &maxFormatVersion)