增加刷新设备列表功能
This commit is contained in:
parent
4572fc445f
commit
254a54d159
Binary file not shown.
|
@ -746,7 +746,7 @@
|
|||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="139"/>
|
||||
<location filename="form_maininterface.cpp" line="494"/>
|
||||
<location filename="form_maininterface.cpp" line="497"/>
|
||||
<source>tips</source>
|
||||
<translation>提示</translation>
|
||||
</message>
|
||||
|
@ -796,7 +796,7 @@
|
|||
<translation>通过</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="494"/>
|
||||
<location filename="form_maininterface.cpp" line="497"/>
|
||||
<source>no image</source>
|
||||
<translation>无图</translation>
|
||||
</message>
|
||||
|
@ -822,45 +822,50 @@
|
|||
<translation>设备</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.ui" line="35"/>
|
||||
<location filename="mainwindow.ui" line="36"/>
|
||||
<source>menu_user</source>
|
||||
<translation>用户</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.ui" line="51"/>
|
||||
<location filename="mainwindow.ui" line="52"/>
|
||||
<source>act_newDevice</source>
|
||||
<translation>新建项目</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.ui" line="56"/>
|
||||
<location filename="mainwindow.ui" line="57"/>
|
||||
<source>act_manage</source>
|
||||
<translation>账户管理</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.ui" line="61"/>
|
||||
<location filename="mainwindow.ui" line="62"/>
|
||||
<source>act_changePwd</source>
|
||||
<translation>修改密码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.ui" line="66"/>
|
||||
<location filename="mainwindow.ui" line="67"/>
|
||||
<source>act_export</source>
|
||||
<translation>导出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.ui" line="71"/>
|
||||
<location filename="mainwindow.ui" line="72"/>
|
||||
<source>act_logOut</source>
|
||||
<translation>登出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.ui" line="76"/>
|
||||
<location filename="mainwindow.ui" line="77"/>
|
||||
<source>act_close</source>
|
||||
<translation>关闭</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.ui" line="81"/>
|
||||
<location filename="mainwindow.ui" line="82"/>
|
||||
<source>act_upload</source>
|
||||
<translation>上传配置文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.ui" line="87"/>
|
||||
<source>act_refreshDevice</source>
|
||||
<translation>刷新设备列表</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="476"/>
|
||||
<source>Account login elsewhere</source>
|
||||
|
@ -891,6 +896,7 @@
|
|||
<location filename="mainwindow.cpp" line="539"/>
|
||||
<location filename="mainwindow.cpp" line="548"/>
|
||||
<location filename="mainwindow.cpp" line="560"/>
|
||||
<location filename="mainwindow.cpp" line="620"/>
|
||||
<source>tips</source>
|
||||
<translation>提示</translation>
|
||||
</message>
|
||||
|
@ -919,6 +925,7 @@
|
|||
<message>
|
||||
<location filename="mainwindow.cpp" line="430"/>
|
||||
<location filename="mainwindow.cpp" line="510"/>
|
||||
<location filename="mainwindow.cpp" line="620"/>
|
||||
<source>cannot create more table</source>
|
||||
<translation>不能创建更多项目</translation>
|
||||
</message>
|
||||
|
|
|
@ -341,8 +341,8 @@ void Form_BurnMode::on_pbtn_close_clicked()
|
|||
return;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
while(ui->tableWidget->rowCount() > i)
|
||||
int rowCount = ui->tableWidget->rowCount();
|
||||
for (int i = rowCount - 1; i >= 0; --i)
|
||||
{
|
||||
QTableWidgetItem *item = ui->tableWidget->item(i, 1);
|
||||
if (item != nullptr && Qt::Checked == item->checkState())
|
||||
|
|
|
@ -596,3 +596,35 @@ void MainWindow::on_act_upload_triggered()
|
|||
Dialog_uploadCfgFile dlg(m_pdtToolDbuserMgr, this);
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
void MainWindow::on_act_refreshDevice_triggered()
|
||||
{
|
||||
std::vector<std::string> name;
|
||||
name = getDevices();
|
||||
for (int i = 0; i < name.size(); ++i)
|
||||
{
|
||||
SANE_Handle devHandle = nullptr;
|
||||
sane_open(name[i].c_str(), &devHandle);
|
||||
if (nullptr != devHandle)
|
||||
{
|
||||
Dialog_InputSerialNum dlg(this, devHandle, getDevSn(devHandle), getDevType(devHandle));
|
||||
if (dlg.exec())
|
||||
{
|
||||
HGPdtToolDbDevice pdtToolDbDevice = nullptr;
|
||||
HGPdtToolDb_OpenDevice(m_pdtToolDbuserMgr, dlg.GetSn().toStdString().c_str(), &pdtToolDbDevice);
|
||||
|
||||
Form_mainInterface *mainInterface = new Form_mainInterface(this, m_loginType, devHandle, m_pdtToolDbuserMgr, pdtToolDbDevice,
|
||||
dlg.GetSn(), dlg.GetDevType(), name[i].c_str(), getDevFwNum(devHandle));
|
||||
if (!AddInterface(mainInterface))
|
||||
{
|
||||
QMessageBox::information(this, tr("tips"), tr("cannot create more table"));
|
||||
delete mainInterface;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sane_close(devHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,6 +70,8 @@ private slots:
|
|||
|
||||
void on_act_upload_triggered();
|
||||
|
||||
void on_act_refreshDevice_triggered();
|
||||
|
||||
private:
|
||||
QSplitter *m_top_splitter;
|
||||
QSplitter *m_bot_splitter;
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
<string>menu_device</string>
|
||||
</property>
|
||||
<addaction name="act_newDevice"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="act_refreshDevice"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="act_close"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_user">
|
||||
|
@ -81,6 +84,11 @@
|
|||
<string>act_upload</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="act_refreshDevice">
|
||||
<property name="text">
|
||||
<string>act_refreshDevice</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
Loading…
Reference in New Issue