@@ -75,7 +75,7 @@ void VExportDialog::setupUI()
75
75
// Notes to export.
76
76
m_srcCB = VUtils::getComboBox ();
77
77
m_srcCB->setToolTip (tr (" Choose notes to export" ));
78
- m_srcCB->setSizeAdjustPolicy (QComboBox::AdjustToMinimumContentsLengthWithIcon );
78
+ m_srcCB->setSizeAdjustPolicy (QComboBox::AdjustToContents );
79
79
connect (m_srcCB, SIGNAL (currentIndexChanged (int )),
80
80
this , SLOT (handleCurrentSrcChanged (int )));
81
81
@@ -580,7 +580,7 @@ void VExportDialog::startExport()
580
580
581
581
if (opt.m_outputSuffix .isEmpty ()
582
582
|| opt.m_cmd .isEmpty ()
583
- || opt.m_allInOne && opt.m_folderSep .isEmpty ()) {
583
+ || ( opt.m_allInOne && opt.m_folderSep .isEmpty () )) {
584
584
appendLogLine (tr (" Invalid configurations for custom export." ));
585
585
m_inExport = false ;
586
586
m_exportBtn->setEnabled (true );
@@ -1274,11 +1274,11 @@ int VExportDialog::doExportCustomAllInOne(const QList<QString> &p_files,
1274
1274
QWidget *VExportDialog::setupCustomAdvancedSettings ()
1275
1275
{
1276
1276
// Source format.
1277
- m_customSrcFormatCB = VUtils::getComboBox ();
1277
+ m_customSrcFormatCB = VUtils::getComboBox (this );
1278
1278
m_customSrcFormatCB->setToolTip (tr (" Choose format of the input" ));
1279
1279
1280
1280
// Output suffix.
1281
- m_customSuffixEdit = new VLineEdit ();
1281
+ m_customSuffixEdit = new VLineEdit (this );
1282
1282
m_customSuffixEdit->setPlaceholderText (tr (" Without the preceding dot" ));
1283
1283
m_customSuffixEdit->setToolTip (tr (" Suffix of the output file without the preceding dot" ));
1284
1284
QValidator *validator = new QRegExpValidator (QRegExp (VUtils::c_fileNameRegExp),
@@ -1288,11 +1288,12 @@ QWidget *VExportDialog::setupCustomAdvancedSettings()
1288
1288
QLabel *tipsLabel = new QLabel (tr (" <span><span style=\" font-weight:bold;\" >%0</span> for the input file; "
1289
1289
" <span style=\" font-weight:bold;\" >%1</span> for the output file; "
1290
1290
" <span style=\" font-weight:bold;\" >%2</span> for the rendering CSS style file; "
1291
- " <span style=\" font-weight:bold;\" >%3</span> for the input file directory.</span>" ));
1291
+ " <span style=\" font-weight:bold;\" >%3</span> for the input file directory.</span>" ),
1292
+ this );
1292
1293
tipsLabel->setWordWrap (true );
1293
1294
1294
1295
// Enable All In One.
1295
- m_customAllInOneCB = new QCheckBox (tr (" Enable All In One" ));
1296
+ m_customAllInOneCB = new QCheckBox (tr (" Enable All In One" ), this );
1296
1297
m_customAllInOneCB->setToolTip (tr (" Pass a list of input files to the custom command" ));
1297
1298
connect (m_customAllInOneCB, &QCheckBox::stateChanged,
1298
1299
this , [this ](int p_state) {
@@ -1302,13 +1303,13 @@ QWidget *VExportDialog::setupCustomAdvancedSettings()
1302
1303
});
1303
1304
1304
1305
// Input directory separator.
1305
- m_customFolderSepEdit = new VLineEdit ();
1306
+ m_customFolderSepEdit = new VLineEdit (this );
1306
1307
m_customFolderSepEdit->setPlaceholderText (tr (" Separator to concatenate input files directories" ));
1307
1308
m_customFolderSepEdit->setToolTip (tr (" Separator to concatenate input files directories" ));
1308
1309
m_customFolderSepEdit->setEnabled (false );
1309
1310
1310
1311
// Target file name for all in one.
1311
- m_customTargetFileNameEdit = new VLineEdit ();
1312
+ m_customTargetFileNameEdit = new VLineEdit (this );
1312
1313
m_customTargetFileNameEdit->setPlaceholderText (tr (" Empty to use the name of the first source file" ));
1313
1314
m_customTargetFileNameEdit->setToolTip (tr (" Name of the generated All-In-One file" ));
1314
1315
validator = new QRegExpValidator (QRegExp (VUtils::c_fileNameRegExp),
@@ -1317,7 +1318,7 @@ QWidget *VExportDialog::setupCustomAdvancedSettings()
1317
1318
m_customTargetFileNameEdit->setEnabled (false );
1318
1319
1319
1320
// Cmd edit.
1320
- m_customCmdEdit = new QPlainTextEdit ();
1321
+ m_customCmdEdit = new QPlainTextEdit (this );
1321
1322
m_customCmdEdit->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Minimum);
1322
1323
QString cmdExamp (" pandoc --resource-path=.:\" %3\" --css=\" %2\" -s -o \" %1\" \" %0\" " );
1323
1324
m_customCmdEdit->setPlaceholderText (cmdExamp);
@@ -1348,12 +1349,12 @@ QWidget *VExportDialog::setupCustomAdvancedSettings()
1348
1349
QWidget *wid = new QWidget ();
1349
1350
wid->setLayout (advLayout);
1350
1351
1351
- m_customCmdEdit->setMaximumHeight (100 );
1352
+ m_customCmdEdit->setMaximumHeight (m_customSrcFormatCB-> height () * 3 );
1352
1353
1353
1354
return wid;
1354
1355
}
1355
1356
1356
- int VExportDialog::outputAsHTML (QString &p_outputFolder,
1357
+ int VExportDialog::outputAsHTML (const QString &p_outputFolder,
1357
1358
QString *p_errMsg,
1358
1359
QList<QString> *p_outputFiles)
1359
1360
{
0 commit comments