1212#include < QComboBox>
1313#include < QDateEdit>
1414#include < QSpinBox>
15+ #include < QCoreApplication>
1516#include " FrmHistory.h"
17+ #include " RabbitCommonDir.h"
1618#include " ui_FrmHistory.h"
1719
1820static Q_LOGGING_CATEGORY (log, " WebBrowser.History" )
@@ -451,10 +453,13 @@ void CFrmHistory::onDeleteSelectedItems(const QModelIndexList &indexes)
451453void CFrmHistory::slotImport ()
452454{
453455 QString filename = QFileDialog::getOpenFileName (
454- this , tr (" Import histories" ), QString (), tr (" CSV file (*.csv);; All files (*.*)" ));
456+ this , tr (" Import histories" ),
457+ RabbitCommon::CDir::Instance ()->GetDirDocument (QCoreApplication::applicationName ()),
458+ tr (" CSV file (*.csv);; All files (*.*)" ));
455459
456460 if (!filename.isEmpty ()) {
457461 if (m_pModelHistory->importFromCSV (filename)) {
462+ slotRefresh ();
458463 QMessageBox::information (this , tr (" Success" ), tr (" Histories import from csv file successfully" ));
459464 } else {
460465 QMessageBox::warning (this , tr (" Failure" ), tr (" Failed to import histories from csv file" ));
@@ -465,7 +470,9 @@ void CFrmHistory::slotImport()
465470void CFrmHistory::slotExport ()
466471{
467472 QString filename = QFileDialog::getSaveFileName (
468- this , tr (" Export histories" ), QString (), tr (" CSV (*.csv);; All files (*.*)" ));
473+ this , tr (" Export histories" ),
474+ RabbitCommon::CDir::Instance ()->GetDirDocument (QCoreApplication::applicationName ()),
475+ tr (" CSV (*.csv);; All files (*.*)" ));
469476
470477 if (!filename.isEmpty ()) {
471478 if (m_pModelHistory->exportToCSV (filename)) {
0 commit comments