diff --git a/app/scanner/Scanner_zh_CN.qm b/app/scanner/Scanner_zh_CN.qm
index 1ee20ce3..834bc54a 100644
Binary files a/app/scanner/Scanner_zh_CN.qm and b/app/scanner/Scanner_zh_CN.qm differ
diff --git a/app/scanner/Scanner_zh_CN.ts b/app/scanner/Scanner_zh_CN.ts
index 956a81f4..63136dc2 100644
--- a/app/scanner/Scanner_zh_CN.ts
+++ b/app/scanner/Scanner_zh_CN.ts
@@ -1398,33 +1398,59 @@ Please make sure the two passwords are the same.
HGImgThumb
-
+
提示
-
拖拽仅支持jpg、bmp、png、tif/tiff、pdf和ofd格式
-
+
+
+ 文件已经加载!
+
+
+
+
+ 文件已经加载,是否将其移动到末尾?
+
+
+
+
+ 文件已经加载,是否将其移动到指定位置?
+
+
+
+
提示
-
-
- 有图片已经被打开,是否移动这些图片的位置?
+
+
+ 有文件已经加载,是否将其移动到末尾?
-
+
+
+ 有文件已经加载,是否将其移动到指定位置?
+
+
+
+ 有图片已经被打开,是否移动这些图片的位置?
+
+
+
+
是
-
+
+
否
@@ -1432,14 +1458,12 @@ Please make sure the two passwords are the same.
HGImgView
-
- 提示
+ 提示
-
- 拖拽仅支持jpg、bmp、png、tif/tiff、pdf和ofd格式
+ 拖拽仅支持jpg、bmp、png、tif/tiff、pdf和ofd格式
@@ -1761,46 +1785,46 @@ Please make sure the two passwords are the same.
华高扫描软件
-
+
多列显示
-
+
移动到...
-
+
插入文件
-
+
没有发现扫描仪
-
-
-
-
-
-
+
+
+
+
+
+
警告
-
-
+
+
图像已被修改。
是否保存修改?
-
+
文件已丢失,是否删除?
@@ -1809,7 +1833,7 @@ Please make sure the two passwords are the same.
已连接
-
+
已断开连接
@@ -1826,161 +1850,161 @@ Please make sure the two passwords are the same.
扫描完成
-
+
清空并启动扫描
-
+
不清空并启动扫描
-
+
图像列表中已存在图像。
是否清空?
-
+
消息
-
+
磁盘空间不足,请删除不需要的文件,以保证有足够的空间
-
+
打开图片
-
+
插入图片
-
-
-
-
-
+
+
+
+
+
信息
-
-
-
+
+
+
保存失败
-
-
+
+
图片名在列表中已存在
-
+
文件名
-
+
文件路径
-
+
文件大小
-
+
创建时间
-
+
修改时间
-
+
访问时间
-
+
格式
-
+
宽度
-
+
高度
-
+
深度
-
+
色彩模式
-
+
每英寸像素点
-
+
打印尺寸
-
+
帧
-
+
无
-
+
黑白
-
+
灰度
-
+
彩色
-
+
警告
-
+
设备正在运行!
@@ -1993,166 +2017,166 @@ Continue to close?
是否继续关闭?
-
+
是否确定登出管理员账户?
-
+
-
+
-
+
打开扫描仪
-
-
+
+
华高扫描软件
-
-
+
+
成功
-
+
应用配置
-
+
成功
-
+
失败
-
-
+
+
失败
-
+
配置丢失
-
+
应用配置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
启动失败
-
-
-
-
-
-
-
+
+
+
+
+
+
+
确定
-
-
-
-
-
-
+
+
+
+
+
+
取消
-
+
发现设备
-
+
重新连接
-
-
+
+
%1%2%3.%4
-
+
有图像未保存,确定关闭?
-
+
提示
-
+
确定关闭?
-
-
-
+
+
+
提示
-
-
+
+
辊轴计数已置零
-
-
+
+
重置辊轴计数失败
-
+
错误
-
+
文档丢失!文档可能已被删除或被重命名。
@@ -2185,28 +2209,28 @@ Are you sure to close?
<br>导航地址: <a href='https://j.map.baidu.com/7e/1TO'>百度地图访问</a>
-
+
关于 %1
-
+
<p>%1</p><p>版本: %2<br>版权: © %3</p><p>%4%5%6%7%8%9</p>
-
+
关于 %1
-
+
<p>版本: %1</p>
<p>版本: %1</p>
-
+
<p>版权: © %1</p>
<p>版权: © %1</p>
diff --git a/app/scanner/mainwindow.cpp b/app/scanner/mainwindow.cpp
index 9c775ac9..dd4950c0 100644
--- a/app/scanner/mainwindow.cpp
+++ b/app/scanner/mainwindow.cpp
@@ -111,13 +111,14 @@ MainWindow::MainWindow(QWidget *parent)
connect(m_view, SIGNAL(scaleChanged(double)), this, SLOT(on_viewerScale(double)));
connect(m_view, SIGNAL(mousePos(int, int)), this, SLOT(on_viewerMousePos(int, int)));
- connect(m_view, SIGNAL(drop(const QStringList &)), this, SLOT(on_viewerDrop(const QStringList &)));
+ connect(m_view, SIGNAL(drop(const QObject*, const QStringList &)), this, SLOT(on_viewerDrop(const QObject*, const QStringList &)));
connect(m_view, SIGNAL(doubleClicked()), this, SLOT(on_viewerDblClick()));
connect(m_thumb, SIGNAL(itemCountChanged(int)), this, SLOT(on_itemCountChanged(int)));
connect(m_thumb, SIGNAL(itemSelectingChanged()), this, SLOT(on_itemSelectingChanged()));
connect(m_thumb, SIGNAL(currItemChanged(int)), this, SLOT(on_currItemChanged(int)));
connect(m_thumb, SIGNAL(itemDoubleClicked(int)), this, SLOT(on_itemDoubleClicked(int)));
connect(m_thumb, SIGNAL(contextMenuEvent(int)), this, SLOT(on_thumbContextMenu(int)));
+ connect(m_thumb, SIGNAL(drop(const QObject*, const QStringList &, int)), this, SLOT(on_thumbDrop(const QObject*, const QStringList &, int)));
connect(m_multiPageLineEdit, SIGNAL(editingFinished()), this, SLOT(on_multiPageLineEditFinished()));
@@ -482,9 +483,18 @@ void MainWindow::on_viewerMousePos(int x, int y)
m_wndStatusBar->setMousePosInfo(x, y);
}
-void MainWindow::on_viewerDrop(const QStringList &fileNames)
+void MainWindow::on_thumbDrop(const QObject *source, const QStringList &fileNames, int pos)
{
- m_thumb->addItems(fileNames);
+ if (source != m_thumb)
+ m_thumb->insertItems(fileNames, pos);
+ else
+ m_thumb->moveItems(fileNames, pos);
+}
+
+void MainWindow::on_viewerDrop(const QObject *source, const QStringList &fileNames)
+{
+ if (source != m_thumb)
+ m_thumb->addItems(fileNames);
}
void MainWindow::on_viewerDblClick()
diff --git a/app/scanner/mainwindow.h b/app/scanner/mainwindow.h
index 6ff447ae..8f559bc5 100644
--- a/app/scanner/mainwindow.h
+++ b/app/scanner/mainwindow.h
@@ -98,7 +98,8 @@ private slots:
void on_thumbContextMenu(int index);
void on_viewerScale(double scale);
void on_viewerMousePos(int x, int y);
- void on_viewerDrop(const QStringList &fileNames);
+ void on_thumbDrop(const QObject *source, const QStringList &fileNames, int pos);
+ void on_viewerDrop(const QObject *source, const QStringList &fileNames);
void on_viewerDblClick();
void on_act_moveTo_triggered();
void on_act_thumbGrid_triggered(bool checked);
diff --git a/app/scanner/qt_zh_CN.ts b/app/scanner/qt_zh_CN.ts
index 04153b34..52d6309e 100644
--- a/app/scanner/qt_zh_CN.ts
+++ b/app/scanner/qt_zh_CN.ts
@@ -1131,10 +1131,6 @@ Please make sure the two passwords are the same.
-
-
-
-
@@ -1143,15 +1139,24 @@ Please make sure the two passwords are the same.
-
-
- HGImgView
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/HGImgThumb.cpp b/ui/HGImgThumb.cpp
index 0aadff5c..93c6a930 100644
--- a/ui/HGImgThumb.cpp
+++ b/ui/HGImgThumb.cpp
@@ -1146,7 +1146,7 @@ HGResult HGImgThumb::addItem(const QString &fileName)
HGResult HGImgThumb::addItems(const QStringList &fileNames)
{
- return insertItems(fileNames, (int)m_frontItems.size());
+ return insertItems(fileNames, (int)m_frontItems.size(), true);
}
HGResult HGImgThumb::insertItem(const QString &fileName, int pos)
@@ -1156,7 +1156,7 @@ HGResult HGImgThumb::insertItem(const QString &fileName, int pos)
return insertItems(fileNames, pos);
}
-HGResult HGImgThumb::insertItems(const QStringList &fileNames, int pos)
+HGResult HGImgThumb::insertItems(const QStringList &fileNames, int pos, bool append)
{
if (pos < 0 || pos > (int)m_frontItems.size())
{
@@ -1220,15 +1220,45 @@ HGResult HGImgThumb::insertItems(const QStringList &fileNames, int pos)
bool isMove = false;
if (findInThumb)
{
- QMessageBox msg(QMessageBox::Question, tr("Question"),
- tr("some files have been loaded, do you want to move?"),
- QMessageBox::Yes | QMessageBox::No, this);
- msg.setButtonText(QMessageBox::Yes, tr("yes"));
- msg.setButtonText(QMessageBox::No, tr("no"));
- msg.exec();
- if (msg.clickedButton() == msg.button(QMessageBox::Yes))
+ if (1 == stdFileNames.size())
{
- isMove = true;
+ int index = findIndex(stdFileNames[0]);
+ assert(-1 != index);
+
+ if (pos == index || pos == index + 1)
+ {
+ QMessageBox::information(this, tr("tips"), tr("file have been loaded"));
+ }
+ else
+ {
+ QString info = append ? tr("file have been loaded, do you want to move to end?")
+ : tr("file have been loaded, do you want to move to specified location?");
+ QMessageBox msg(QMessageBox::Question, tr("Question"),
+ info,
+ QMessageBox::Yes | QMessageBox::No, this);
+ msg.setButtonText(QMessageBox::Yes, tr("yes"));
+ msg.setButtonText(QMessageBox::No, tr("no"));
+ msg.exec();
+ if (msg.clickedButton() == msg.button(QMessageBox::Yes))
+ {
+ isMove = true;
+ }
+ }
+ }
+ else
+ {
+ QString info = append ? tr("some files have been loaded, do you want to move to end?")
+ : tr("some files have been loaded, do you want to move to specified location?");
+ QMessageBox msg(QMessageBox::Question, tr("Question"),
+ info,
+ QMessageBox::Yes | QMessageBox::No, this);
+ msg.setButtonText(QMessageBox::Yes, tr("yes"));
+ msg.setButtonText(QMessageBox::No, tr("no"));
+ msg.exec();
+ if (msg.clickedButton() == msg.button(QMessageBox::Yes))
+ {
+ isMove = true;
+ }
}
}
@@ -3238,117 +3268,14 @@ void HGImgThumb::dragLeaveEvent(QDragLeaveEvent *e)
void HGImgThumb::dropEvent(QDropEvent *e)
{
- int oldItemCount = (int)m_frontItems.size();
- int oldCurrItemIndex = m_curItemIndex;
- QString oldCurrItemFilePath;
- if (-1 != oldCurrItemIndex)
- oldCurrItemFilePath = m_frontItems[oldCurrItemIndex]->fileName;
-
- std::vector oldSelectedIndexs;
- for (int i = 0; i < (int)m_frontItems.size(); ++i)
- {
- if (m_frontItems[i]->selected)
- oldSelectedIndexs.push_back(i);
- }
-
+ QStringList fileNames;
QList urls = e->mimeData()->urls();
-
- std::vector stdFileNames;
for (QUrl url : urls)
{
- QString stdFileName = getStdFileName(url.toLocalFile());
- QFileInfo fileInfo(stdFileName);
- if (!fileInfo.isFile())
- {
- continue;
- }
-
- HGUInt fmtType = 0;
- HGImgFmt_GetImgFmtTypeFromFileName(getStdString(stdFileName).c_str(), &fmtType);
- if (0 != fmtType)
- {
- stdFileNames.push_back(stdFileName);
- }
+ fileNames.append(url.toLocalFile());
}
- if (-1 != m_curInsertPos && !stdFileNames.empty())
- {
- for (int i = 0; i < (int)m_frontItems.size(); ++i)
- {
- m_frontItems[i]->selected = false;
- }
-
- int pos = m_curInsertPos;
- int posEx = pos;
-
- for (int i = 0; i < (int)stdFileNames.size(); ++i)
- {
- const QString& stdFileName = stdFileNames[i];
- int oldIndex = findIndex(stdFileName);
- if (-1 == oldIndex)
- {
- HGImgThumbItem *item = new HGImgThumbItem;
- item->fileName = stdFileName;
- item->selected = true;
-
- HGBase_EnterLock(m_lockFront);
- item->selected = true;
- if (posEx != (int)m_frontItems.size())
- m_frontItems.insert(m_frontItems.begin() + posEx, item);
- else
- m_frontItems.push_back(item);
- HGBase_LeaveLock(m_lockFront);
-
- HGBase_EnterLock(m_lockBack);
- m_backList.push_back(stdFileName);
- HGBase_LeaveLock(m_lockBack);
- HGBase_SetEvent(m_event);
-
- ++posEx;
- }
- else
- {
- HGImgThumbItem *item = m_frontItems[oldIndex];
- item->selected = true;
-
- if (oldIndex < posEx)
- {
- if (pos == posEx)
- {
- --pos;
- }
-
- --posEx;
- }
-
- HGBase_EnterLock(m_lockFront);
- m_frontItems.erase(m_frontItems.begin() + oldIndex);
- if (posEx != (int)m_frontItems.size())
- m_frontItems.insert(m_frontItems.begin() + posEx, item);
- else
- m_frontItems.push_back(item);
- HGBase_LeaveLock(m_lockFront);
-
- ++posEx;
- }
- }
-
- if (pos != posEx)
- {
- m_curItemIndex = posEx - 1;
- m_signItemIndex = posEx - 1;
-
- int showWidth = 0, showHeight = 0;
- calcShowSize(this->width(), this->height(), m_gapSize, m_scrollSize, m_itemSize, m_itemTextHeight, m_type, (int)m_frontItems.size(),
- showWidth, showHeight, m_hScroll, m_vScroll);
- assert(showWidth > 0 && showHeight > 0);
- m_showThumb = true;
- m_thumbRect.right = m_thumbRect.left + (double)showWidth;
- m_thumbRect.bottom = m_thumbRect.top + (double)showHeight;
- locateItem(posEx - 1);
- recalcShowRect(this->width(), this->height(), m_scrollSize, m_type, m_hScroll, m_vScroll, m_showThumb, m_thumbRect);
- }
- }
+ int pos = m_curInsertPos;
m_curInsertPos = -1;
m_insertPtValid = false;
@@ -3357,30 +3284,7 @@ void HGImgThumb::dropEvent(QDropEvent *e)
m_hotItemIndex = getItemIndex(mapFromGlobal(QCursor::pos()), m_mouseMoveStatus);
Show();
- int newItemCount = (int)m_frontItems.size();
- int newCurrItemIndex = m_curItemIndex;
- QString newCurrItemFilePath;
- if (-1 != newCurrItemIndex)
- newCurrItemFilePath = m_frontItems[newCurrItemIndex]->fileName;
-
- std::vector newSelectedIndexs;
- for (int i = 0; i < (int)m_frontItems.size(); ++i)
- {
- if (m_frontItems[i]->selected)
- newSelectedIndexs.push_back(i);
- }
-
- if (newItemCount != oldItemCount)
- emit itemCountChanged((int)m_frontItems.size());
- if (newCurrItemIndex != oldCurrItemIndex || newCurrItemFilePath != oldCurrItemFilePath)
- emit currItemChanged(m_curItemIndex);
- if (newSelectedIndexs != oldSelectedIndexs)
- emit itemSelectingChanged();
-
- if (stdFileNames.empty() && urls.size() > 0)
- {
- QMessageBox::information(this, tr("tips"), tr("unsupported file format"));
- }
+ emit drop(e->source(), fileNames, pos);
}
void HGImgThumb::mouseDoubleClickEvent(QMouseEvent *e)
diff --git a/ui/HGImgThumb.h b/ui/HGImgThumb.h
index 00b2ee5e..e9067203 100644
--- a/ui/HGImgThumb.h
+++ b/ui/HGImgThumb.h
@@ -56,7 +56,7 @@ public:
HGResult addItem(const QString &fileName);
HGResult addItems(const QStringList &fileNames);
HGResult insertItem(const QString &fileName, int pos);
- HGResult insertItems(const QStringList &fileNames, int pos);
+ HGResult insertItems(const QStringList &fileNames, int pos, bool append = false);
HGResult moveItems(const QStringList &fileNames, int pos);
HGResult getItemFileName(int index, QString &fileName);
HGResult getCurrItem(int *index);
@@ -78,6 +78,7 @@ signals:
void itemCountChanged(int count);
void itemSelectingChanged();
void contextMenuEvent(int index);
+ void drop(const QObject *source, const QStringList &fileNames, int pos);
private:
diff --git a/ui/HGImgView.cpp b/ui/HGImgView.cpp
index 723e273e..960438f8 100644
--- a/ui/HGImgView.cpp
+++ b/ui/HGImgView.cpp
@@ -1716,37 +1716,15 @@ void HGImgView::dropEvent(QDropEvent *e)
{
Q_UNUSED(e);
- QList urls = e->mimeData()->urls();
-
QStringList fileNames;
+ QList urls = e->mimeData()->urls();
for (QUrl url : urls)
{
- QString fileName = getStdFileName(url.toLocalFile());
- QFileInfo fileInfo(fileName);
- if (!fileInfo.isFile())
- {
- continue;
- }
-
- HGUInt fmtType = 0;
- HGImgFmt_GetImgFmtTypeFromFileName(getStdString(fileName).c_str(), &fmtType);
- if (0 != fmtType)
- {
- fileNames.append(fileName);
- }
+ fileNames.append(url.toLocalFile());
}
m_draging = false;
-
- if (!fileNames.empty())
- {
- emit drop(fileNames);
- }
-
- if (fileNames.empty() && urls.size() > 0)
- {
- QMessageBox::information(this, tr("tips"), tr("unsupported file format"));
- }
+ emit drop(e->source(), fileNames);
}
void HGImgView::mouseDoubleClickEvent(QMouseEvent* e)
diff --git a/ui/HGImgView.h b/ui/HGImgView.h
index 822752a0..589c84c6 100644
--- a/ui/HGImgView.h
+++ b/ui/HGImgView.h
@@ -49,7 +49,7 @@ signals:
void doubleClicked();
void mousePos(int x, int y);
void scaleChanged(double scale);
- void drop(const QStringList &fileNames);
+ void drop(const QObject *source, const QStringList &fileNames);
private: