Skip to content

Commit

Permalink
Fix: 2023-08-10
Browse files Browse the repository at this point in the history
  • Loading branch information
horsicq committed Aug 10, 2023
1 parent 1f4d7c8 commit 7962f10
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion XTranslation
10 changes: 8 additions & 2 deletions gui_source/guimainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ GuiMainWindow::GuiMainWindow(QWidget *pParent) : QMainWindow(pParent), ui(new Ui
g_xOptions.load();

connect(&g_xOptions, SIGNAL(openFile(QString)), this, SLOT(_scan(QString)));
connect(&g_xOptions, SIGNAL(errorMessage(QString)), this, SLOT(errorMessageSlot(QString)));

g_pRecentFilesMenu = g_xOptions.createRecentFilesMenu(this);

Expand All @@ -70,7 +71,7 @@ GuiMainWindow::~GuiMainWindow()
delete ui;
}

void GuiMainWindow::scanFile(QString sFileName)
void GuiMainWindow::scanFile(const QString &sFileName)
{
if (sFileName != "") {
SpecAbstract::SCAN_RESULT scanResult = {0};
Expand Down Expand Up @@ -111,7 +112,7 @@ void GuiMainWindow::scanFile(QString sFileName)
}
}

void GuiMainWindow::_scan(QString sName)
void GuiMainWindow::_scan(const QString &sName)
{
QFileInfo fi(sName);

Expand All @@ -129,6 +130,11 @@ void GuiMainWindow::_scan(QString sName)
}
}

void GuiMainWindow::errorMessageSlot(const QString &sText)
{
QMessageBox::critical(this, tr("Error"), sText);
}

void GuiMainWindow::on_pushButtonExit_clicked()
{
this->close();
Expand Down
5 changes: 3 additions & 2 deletions gui_source/guimainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ class GuiMainWindow : public QMainWindow {
~GuiMainWindow() override;

private slots:
void scanFile(QString sFileName);
void _scan(QString sName);
void scanFile(const QString &sFileName);
void _scan(const QString &sName);
void errorMessageSlot(const QString &sText);
void on_pushButtonScan_clicked();
void on_pushButtonExit_clicked();
void on_pushButtonOpenFile_clicked();
Expand Down

0 comments on commit 7962f10

Please sign in to comment.