Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sudn0
qtcpp_demo
提交
2b81cbd9
qtcpp_demo
项目概览
sudn0
/
qtcpp_demo
与 Fork 源项目一致
Fork自
colorEagleStdio / qtcpp_demo
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
qtcpp_demo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2b81cbd9
编写于
12月 23, 2021
作者:
M
manjaro-xfce
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add file load control toolkit
上级
4f175d72
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
772 addition
and
0 deletion
+772
-0
fileLoadControl/dialogfileloadctrl.cpp
fileLoadControl/dialogfileloadctrl.cpp
+304
-0
fileLoadControl/dialogfileloadctrl.h
fileLoadControl/dialogfileloadctrl.h
+48
-0
fileLoadControl/dialogfileloadctrl.ui
fileLoadControl/dialogfileloadctrl.ui
+228
-0
fileLoadControl/fileLoadControl.ico
fileLoadControl/fileLoadControl.ico
+0
-0
fileLoadControl/fileLoadControl.png
fileLoadControl/fileLoadControl.png
+0
-0
fileLoadControl/fileLoadControl.pro
fileLoadControl/fileLoadControl.pro
+43
-0
fileLoadControl/fileLoadControl_zh_CN.qm
fileLoadControl/fileLoadControl_zh_CN.qm
+0
-0
fileLoadControl/fileLoadControl_zh_CN.ts
fileLoadControl/fileLoadControl_zh_CN.ts
+118
-0
fileLoadControl/main.cpp
fileLoadControl/main.cpp
+24
-0
fileLoadControl/resource.qrc
fileLoadControl/resource.qrc
+7
-0
未找到文件。
fileLoadControl/dialogfileloadctrl.cpp
0 → 100644
浏览文件 @
2b81cbd9
#include "dialogfileloadctrl.h"
#include "ui_dialogfileloadctrl.h"
#include <QFileDialog>
#include <QSettings>
#include <QFile>
#include <thread>
#include <QThread>
#include <atomic>
DialogFileLoadCtrl
::
DialogFileLoadCtrl
(
QWidget
*
parent
)
:
QDialog
(
parent
)
,
ui
(
new
Ui
::
DialogFileLoadCtrl
)
,
m_pMsgMd
(
new
QStandardItemModel
(
this
))
{
ui
->
setupUi
(
this
);
m_nTimer
=
startTimer
(
10000
);
loadSettings
();
ui
->
listView_msg
->
setModel
(
m_pMsgMd
);
slot_msg
(
tr
(
"Program Started"
));
setWindowFlag
(
Qt
::
WindowMinMaxButtonsHint
,
true
);
}
DialogFileLoadCtrl
::~
DialogFileLoadCtrl
()
{
delete
ui
;
}
void
DialogFileLoadCtrl
::
timerEvent
(
QTimerEvent
*
evt
)
{
if
(
evt
->
timerId
()
==
m_nTimer
&&
ui
->
checkBox_watch
->
isChecked
())
{
if
(
ui
->
lineEdit_src_dir
->
text
().
trimmed
().
length
()
<
2
)
return
;
slot_next_prg
(
-
1
);
slot_msg
(
tr
(
"Start maintaining."
));
killTimer
(
m_nTimer
);
m_nTimer
=
-
1
;
updateMap
();
cleanFile
();
m_nTimer
=
startTimer
(
10000
);
slot_msg
(
tr
(
"Completed."
));
slot_next_prg
(
0
);
}
}
void
DialogFileLoadCtrl
::
cleanFile
()
{
while
(
m_total_size
>
ui
->
doubleSpinBox_maxSz
->
value
()
*
1024ll
*
1024ll
*
1024ll
)
{
if
(
!
m_cache_files
.
size
())
break
;
time_t
tmf
=
m_cache_files
.
begin
()
->
first
;
QMap
<
QString
,
QFileInfo
>
&
mp
=
m_cache_files
[
tmf
];
if
(
!
mp
.
size
())
m_cache_files
.
erase
(
tmf
);
else
{
const
QString
fm
=
mp
.
begin
().
key
();
const
QFileInfo
ifi
=
mp
.
begin
().
value
();
assert
(
m_total_size
>=
ifi
.
size
());
QString
fmdel
=
QString
(
fm
);
if
(
false
==
QFile
::
remove
(
fm
))
{
QString
msg
=
tr
(
"Fail Deleting %1."
).
arg
(
fmdel
);
slot_msg
(
msg
);
}
else
{
m_total_size
-=
ifi
.
size
();
QString
msg
=
tr
(
"Succ Deleting %1."
).
arg
(
fmdel
);
slot_msg
(
msg
);
}
mp
.
remove
(
fmdel
);
if
(
!
mp
.
size
())
m_cache_files
.
erase
(
tmf
);
}
slot_next_prg
(
0
);
}
}
void
DialogFileLoadCtrl
::
updateMap
()
{
QFileInfoList
lst
=
enumFiles
(
ui
->
lineEdit_src_dir
->
text
());
m_total_size
=
0
;
m_total_files
=
0
;
const
qint64
bfMin
=
ui
->
doubleSpinBox_bkMinSz
->
value
()
*
1e6
+
.5
;
const
qint64
bfMax
=
ui
->
doubleSpinBox_bkMaxSz
->
value
()
*
1e6
+
.5
;
const
QStringList
FMLst
=
ui
->
lineEdit_dst_filetypes
->
text
().
split
(
"|"
,
Qt
::
SkipEmptyParts
);
QSet
<
QString
>
FMUpper
;
foreach
(
QString
ex
,
FMLst
)
{
QString
r
=
ex
.
toUpper
().
trimmed
();
if
(
r
.
length
())
FMUpper
<<
r
;
}
foreach
(
QFileInfo
i
,
lst
)
{
QString
fm
=
i
.
absoluteFilePath
();
QFile
ft
(
fm
);
if
(
ft
.
open
(
QIODevice
::
ReadOnly
))
{
ft
.
close
();
unsigned
long
long
sz
=
i
.
size
();
qint64
tm
=
i
.
fileTime
(
QFile
::
FileBirthTime
).
toMSecsSinceEpoch
();
//新文件
if
(
!
m_cache_files
[
tm
].
contains
(
fm
))
//判断大小
if
(
i
.
size
()
>=
bfMin
&&
i
.
size
()
<=
bfMax
)
{
//判断类型
QString
strExt
=
i
.
suffix
().
toUpper
().
trimmed
();
if
(
strExt
.
length
()
<
1
)
strExt
=
":"
;
if
(
FMUpper
.
contains
(
strExt
)
||
FMUpper
.
isEmpty
())
TransFile
(
i
);
}
m_cache_files
[
tm
][
fm
]
=
i
;
m_total_size
+=
sz
;
++
m_total_files
;
}
}
QString
msg
=
tr
(
"Enuming %1 Files %2 Bytes."
).
arg
(
m_total_files
).
arg
(
m_total_size
);
slot_next_prg
(
0
);
slot_msg
(
msg
);
}
void
DialogFileLoadCtrl
::
TransFile
(
QFileInfo
ifile
)
{
if
(
ui
->
lineEdit_dst_dir
->
text
().
length
()
<
2
)
return
;
QDir
dirSrc
(
ui
->
lineEdit_src_dir
->
text
());
//Relative Path
QString
srcFile
=
dirSrc
.
relativeFilePath
(
ifile
.
absoluteFilePath
());
QString
relDir
=
dirSrc
.
relativeFilePath
(
ifile
.
absolutePath
());
//Make destin path
QDir
dirDst
(
ui
->
lineEdit_dst_dir
->
text
());
QString
dstDir
=
dirDst
.
absoluteFilePath
(
relDir
);
QString
dstFile
=
dirDst
.
absoluteFilePath
(
srcFile
);
//mkpath
QFileInfo
info
(
dstDir
);
if
(
!
info
.
exists
())
dirDst
.
mkpath
(
dstDir
);
//File
QFileInfo
infof
(
dstFile
);
if
(
infof
.
size
()
!=
ifile
.
size
())
{
//Copy
QFile
::
remove
(
dstFile
);
//Copy thread in line
QString
msg
;
std
::
atomic
<
bool
>
bOk
(
false
);
std
::
thread
t
([
&
]()
->
void
{
if
(
true
==
QFile
::
copy
(
ifile
.
absoluteFilePath
(),
dstFile
))
msg
=
tr
(
"Succ Copy %1 to %2."
).
arg
(
ifile
.
absoluteFilePath
()).
arg
(
dstFile
);
else
msg
=
tr
(
"Fail Copy %1 to %2."
).
arg
(
ifile
.
absoluteFilePath
()).
arg
(
dstFile
);
bOk
=
true
;
});
//Hold and wait
while
(
!
bOk
)
{
QThread
::
msleep
(
100
);
slot_next_prg
(
0
);
}
t
.
join
();
slot_msg
(
msg
);
}
}
QFileInfoList
DialogFileLoadCtrl
::
enumFiles
(
QString
dirS
)
{
QStringList
lst
;
lst
<<
"*.*"
;
lst
<<
"*"
;
QDir
dir
(
dirS
);
dir
.
makeAbsolute
();
QFileInfoList
linfo
=
dir
.
entryInfoList
(
lst
);
QFileInfoList
lstRes
;
foreach
(
QFileInfo
i
,
linfo
)
{
if
(
i
.
isDir
())
{
QString
dn
=
i
.
fileName
();
if
(
dn
==
"."
||
dn
==
".."
)
continue
;
QFileInfoList
lst_sub
=
enumFiles
(
i
.
absoluteFilePath
());
std
::
copy
(
lst_sub
.
begin
(),
lst_sub
.
end
(),
std
::
back_inserter
(
lstRes
));
}
else
lstRes
<<
i
;
}
slot_next_prg
(
0
);
return
lstRes
;
}
void
DialogFileLoadCtrl
::
slot_msg
(
QString
s
)
{
QDateTime
dtm
=
QDateTime
::
currentDateTime
();
QString
dtms
=
dtm
.
toString
(
"yyyy-MM-dd HH:mm:ss"
);
QString
m
=
dtms
+
">"
+
s
;
m_pMsgMd
->
appendRow
(
new
QStandardItem
(
m
));
if
(
m_pMsgMd
->
rowCount
()
>
256
)
m_pMsgMd
->
removeRows
(
0
,
m_pMsgMd
->
rowCount
()
-
256
);
ui
->
listView_msg
->
scrollToBottom
();
QCoreApplication
::
processEvents
(
QEventLoop
::
ExcludeUserInputEvents
);
}
void
DialogFileLoadCtrl
::
on_pushButton_br_src_clicked
()
{
QString
dirS
=
QFileDialog
::
getExistingDirectory
(
this
,
tr
(
"Watching root"
),
ui
->
lineEdit_src_dir
->
text
());
if
(
dirS
.
length
()
<
2
)
return
;
QFileInfo
info
(
dirS
);
ui
->
lineEdit_src_dir
->
setText
(
info
.
absoluteFilePath
());
saveSettings
();
}
void
DialogFileLoadCtrl
::
on_pushButton_br_dst_clicked
()
{
QString
dirS
=
QFileDialog
::
getExistingDirectory
(
this
,
tr
(
"backup root"
),
ui
->
lineEdit_dst_dir
->
text
());
if
(
dirS
.
length
()
<
2
)
return
;
ui
->
lineEdit_dst_dir
->
setText
(
dirS
);
saveSettings
();
}
void
DialogFileLoadCtrl
::
loadSettings
()
{
QSettings
settings
(
QCoreApplication
::
applicationFilePath
()
+
".ini"
,
QSettings
::
IniFormat
);
const
QString
lineEdit_src_dir
=
settings
.
value
(
"ui/lineEdit_src_dir"
,
""
).
toString
();
ui
->
lineEdit_src_dir
->
setText
(
lineEdit_src_dir
);
const
QString
lineEdit_dst_dir
=
settings
.
value
(
"ui/lineEdit_dst_dir"
,
""
).
toString
();
ui
->
lineEdit_dst_dir
->
setText
(
lineEdit_dst_dir
);
const
QString
lineEdit_dst_filetypes
=
settings
.
value
(
"ui/lineEdit_dst_filetypes"
,
"bmp|Jpeg|Avi|Mpeg|Jpg|PNG|Tif|tiff"
).
toString
();
ui
->
lineEdit_dst_filetypes
->
setText
(
lineEdit_dst_filetypes
);
const
bool
checkBox_watch
=
settings
.
value
(
"ui/checkBox_watch"
,
false
).
toBool
();
ui
->
checkBox_watch
->
setChecked
(
checkBox_watch
);
const
double
doubleSpinBox_maxSz
=
settings
.
value
(
"ui/doubleSpinBox_maxSz"
,
16
).
toDouble
();
ui
->
doubleSpinBox_maxSz
->
setValue
(
doubleSpinBox_maxSz
);
const
double
doubleSpinBox_bkMaxSz
=
settings
.
value
(
"ui/doubleSpinBox_bkMaxSz"
,
2000000
).
toDouble
();
ui
->
doubleSpinBox_bkMaxSz
->
setValue
(
doubleSpinBox_bkMaxSz
);
const
double
doubleSpinBox_bkMinSz
=
settings
.
value
(
"ui/doubleSpinBox_bkMinSz"
,
0
).
toDouble
();
ui
->
doubleSpinBox_bkMinSz
->
setValue
(
doubleSpinBox_bkMinSz
);
}
void
DialogFileLoadCtrl
::
saveSettings
()
{
QSettings
settings
(
QCoreApplication
::
applicationFilePath
()
+
".ini"
,
QSettings
::
IniFormat
);
const
QString
lineEdit_src_dir
=
ui
->
lineEdit_src_dir
->
text
();
settings
.
setValue
(
"ui/lineEdit_src_dir"
,
lineEdit_src_dir
);
const
QString
lineEdit_dst_dir
=
ui
->
lineEdit_dst_dir
->
text
();
settings
.
setValue
(
"ui/lineEdit_dst_dir"
,
lineEdit_dst_dir
);
const
QString
lineEdit_dst_filetypes
=
ui
->
lineEdit_dst_filetypes
->
text
();
settings
.
setValue
(
"ui/lineEdit_dst_filetypes"
,
lineEdit_dst_filetypes
);
const
bool
checkBox_watch
=
ui
->
checkBox_watch
->
isChecked
();
settings
.
setValue
(
"ui/checkBox_watch"
,
checkBox_watch
);
const
double
doubleSpinBox_maxSz
=
ui
->
doubleSpinBox_maxSz
->
value
();
settings
.
setValue
(
"ui/doubleSpinBox_maxSz"
,
doubleSpinBox_maxSz
);
const
double
doubleSpinBox_bkMaxSz
=
ui
->
doubleSpinBox_bkMaxSz
->
value
();
settings
.
setValue
(
"ui/doubleSpinBox_bkMaxSz"
,
doubleSpinBox_bkMaxSz
);
const
double
doubleSpinBox_bkMinSz
=
ui
->
doubleSpinBox_bkMinSz
->
value
();
settings
.
setValue
(
"ui/doubleSpinBox_bkMinSz"
,
doubleSpinBox_bkMinSz
);
}
void
DialogFileLoadCtrl
::
on_doubleSpinBox_maxSz_valueChanged
(
double
/*arg1*/
)
{
saveSettings
();
}
void
DialogFileLoadCtrl
::
on_checkBox_watch_clicked
()
{
saveSettings
();
slot_next_prg
(
ui
->
checkBox_watch
->
isChecked
()
?
0
:-
1
);
}
void
DialogFileLoadCtrl
::
slot_next_prg
(
int
n
)
{
static
char
prg_val
[]
=
".-/|
\\
"
;
static
unsigned
char
ps
=
0
;
if
(
n
<
0
)
ui
->
label_prg
->
setText
(
QString
(
prg_val
[
0
]));
else
ui
->
label_prg
->
setText
(
QString
(
prg_val
[
++
ps
%
4
+
1
]));
QCoreApplication
::
processEvents
(
QEventLoop
::
ExcludeUserInputEvents
);
}
fileLoadControl/dialogfileloadctrl.h
0 → 100644
浏览文件 @
2b81cbd9
#ifndef DIALOGFILELOADCTRL_H
#define DIALOGFILELOADCTRL_H
#include <QDialog>
#include <QFileInfo>
#include <QFileInfoList>
#include <QDir>
#include <QStringList>
#include <map>
#include <QDateTime>
#include <QStandardItemModel>
QT_BEGIN_NAMESPACE
namespace
Ui
{
class
DialogFileLoadCtrl
;
}
QT_END_NAMESPACE
class
DialogFileLoadCtrl
:
public
QDialog
{
Q_OBJECT
public:
DialogFileLoadCtrl
(
QWidget
*
parent
=
nullptr
);
~
DialogFileLoadCtrl
();
protected:
void
timerEvent
(
QTimerEvent
*
evt
)
override
;
QFileInfoList
enumFiles
(
QString
dirS
);
void
updateMap
();
void
cleanFile
();
void
TransFile
(
QFileInfo
ifile
);
private
slots
:
void
slot_msg
(
QString
);
void
slot_next_prg
(
int
v
);
void
on_pushButton_br_src_clicked
();
void
on_pushButton_br_dst_clicked
();
void
on_doubleSpinBox_maxSz_valueChanged
(
double
arg1
);
void
on_checkBox_watch_clicked
();
private:
void
loadSettings
();
void
saveSettings
();
private:
Ui
::
DialogFileLoadCtrl
*
ui
=
0
;
QStandardItemModel
*
m_pMsgMd
=
0
;
int
m_nTimer
=
-
1
;
std
::
map
<
qint64
,
QMap
<
QString
,
QFileInfo
>
>
m_cache_files
;
qint64
m_total_size
=
0
;
qint64
m_total_files
=
0
;
};
#endif // DIALOGFILELOADCTRL_H
fileLoadControl/dialogfileloadctrl.ui
0 → 100644
浏览文件 @
2b81cbd9
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
DialogFileLoadCtrl
</class>
<widget
class=
"QDialog"
name=
"DialogFileLoadCtrl"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
719
</width>
<height>
411
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
File Load Ctrl
</string>
</property>
<property
name=
"windowIcon"
>
<iconset
resource=
"resource.qrc"
>
<normaloff>
:/fileLoadControl.png
</normaloff>
:/fileLoadControl.png
</iconset>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<property
name=
"spacing"
>
<number>
3
</number>
</property>
<property
name=
"leftMargin"
>
<number>
3
</number>
</property>
<property
name=
"topMargin"
>
<number>
3
</number>
</property>
<property
name=
"rightMargin"
>
<number>
3
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
3
</number>
</property>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_2"
>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Watching Folder
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_src_dir"
/>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_br_src"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_3"
>
<item>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Destin Folder
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_dst_dir"
/>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_br_dst"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
<item>
<widget
class=
"QLabel"
name=
"label_7"
>
<property
name=
"text"
>
<string>
Backup files with Size From
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QDoubleSpinBox"
name=
"doubleSpinBox_bkMinSz"
>
<property
name=
"decimals"
>
<number>
3
</number>
</property>
<property
name=
"minimum"
>
<double>
0.000000000000000
</double>
</property>
<property
name=
"maximum"
>
<double>
2000000.000000000000000
</double>
</property>
<property
name=
"singleStep"
>
<double>
1.000000000000000
</double>
</property>
<property
name=
"value"
>
<double>
0.000000000000000
</double>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_8"
>
<property
name=
"text"
>
<string>
MB To
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QDoubleSpinBox"
name=
"doubleSpinBox_bkMaxSz"
>
<property
name=
"decimals"
>
<number>
3
</number>
</property>
<property
name=
"minimum"
>
<double>
0.000000000000000
</double>
</property>
<property
name=
"maximum"
>
<double>
2000000.000000000000000
</double>
</property>
<property
name=
"singleStep"
>
<double>
1.000000000000000
</double>
</property>
<property
name=
"value"
>
<double>
2000000.000000000000000
</double>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_9"
>
<property
name=
"text"
>
<string>
MB
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
Total Keep Load
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QDoubleSpinBox"
name=
"doubleSpinBox_maxSz"
>
<property
name=
"decimals"
>
<number>
3
</number>
</property>
<property
name=
"minimum"
>
<double>
0.001000000000000
</double>
</property>
<property
name=
"maximum"
>
<double>
1024.000000000000000
</double>
</property>
<property
name=
"singleStep"
>
<double>
0.001000000000000
</double>
</property>
<property
name=
"value"
>
<double>
16.000000000000000
</double>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
GB
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_5"
>
<item>
<widget
class=
"QLabel"
name=
"label_6"
>
<property
name=
"text"
>
<string>
File Typs(| splitted, : mean empty)
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_dst_filetypes"
/>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"checkBox_watch"
>
<property
name=
"text"
>
<string>
Running
</string>
</property>
<property
name=
"icon"
>
<iconset
resource=
"resource.qrc"
>
<normaloff>
:/fileLoadControl.png
</normaloff>
:/fileLoadControl.png
</iconset>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_prg"
>
<property
name=
"text"
>
<string>
.
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget
class=
"QListView"
name=
"listView_msg"
/>
</item>
</layout>
</widget>
<resources>
<include
location=
"resource.qrc"
/>
</resources>
<connections/>
</ui>
fileLoadControl/fileLoadControl.ico
0 → 100644
浏览文件 @
2b81cbd9
97.3 KB
fileLoadControl/fileLoadControl.png
0 → 100644
浏览文件 @
2b81cbd9
107.2 KB
fileLoadControl/fileLoadControl.pro
0 → 100644
浏览文件 @
2b81cbd9
QT
+=
core
gui
greaterThan
(
QT_MAJOR_VERSION
,
4
)
:
QT
+=
widgets
CONFIG
+=
c
++
11
#
The
following
define
makes
your
compiler
emit
warnings
if
you
use
#
any
Qt
feature
that
has
been
marked
deprecated
(
the
exact
warnings
#
depend
on
your
compiler
).
Please
consult
the
documentation
of
the
#
deprecated
API
in
order
to
know
how
to
port
your
code
away
from
it
.
DEFINES
+=
QT_DEPRECATED_WARNINGS
#
You
can
also
make
your
code
fail
to
compile
if
it
uses
deprecated
APIs
.
#
In
order
to
do
so
,
uncomment
the
following
line
.
#
You
can
also
select
to
disable
deprecated
APIs
only
up
to
a
certain
version
of
Qt
.
#
DEFINES
+=
QT_DISABLE_DEPRECATED_BEFORE
=
0
x060000
#
disables
all
the
APIs
deprecated
before
Qt
6.0
.
0
SOURCES
+=
\
main
.
cpp
\
dialogfileloadctrl
.
cpp
HEADERS
+=
\
dialogfileloadctrl
.
h
FORMS
+=
\
dialogfileloadctrl
.
ui
#
Default
rules
for
deployment
.
qnx
:
target
.
path
=
/
tmp
/
$$
{
TARGET
}
/
bin
else
:
unix
:
!
android
:
target
.
path
=
/
opt
/
$$
{
TARGET
}
/
bin
!
isEmpty
(
target
.
path
)
:
INSTALLS
+=
target
RC_ICONS
=
fileLoadControl
.
ico
DISTFILES
+=
\
fileLoadControl
.
ico
\
fileLoadControl_zh_CN
.
qm
\
fileLoadControl_zh_CN
.
ts
TRANSLATIONS
+=
fileLoadControl_zh_CN
.
ts
RESOURCES
+=
\
resource
.
qrc
fileLoadControl/fileLoadControl_zh_CN.qm
0 → 100644
浏览文件 @
2b81cbd9
文件已添加
fileLoadControl/fileLoadControl_zh_CN.ts
0 → 100644
浏览文件 @
2b81cbd9
<
?
xml
version
=
"
1.0
"
encoding
=
"
utf-8
"
?
>
<!
DOCTYPE
TS
>
<
TS
version
=
"
2.1
"
language
=
"
zh_CN
"
>
<
context
>
<
name
>
DialogFileLoadCtrl
<
/name
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
14
"
/>
<
source
>
File
Load
Ctrl
<
/source
>
<
translation
>
文件拷贝与配额控制
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
22
"
/>
<
source
>
Watching
Folder
<
/source
>
<
translation
>
配额文件夹
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
32
"
/>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
53
"
/>
<
source
>
...
<
/source
>
<
translation
>
...
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
43
"
/>
<
source
>
Destin
Folder
<
/source
>
<
translation
>
目的文件夹
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
64
"
/>
<
source
>
Backup
files
with
Size
From
<
/source
>
<
translation
>
备份大小介于
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
90
"
/>
<
source
>
MB
To
<
/source
>
<
translation
>
MB
到
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
116
"
/>
<
source
>
MB
<
/source
>
<
translation
>
MB的文件
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
136
"
/>
<
source
>
Total
Keep
Load
<
/source
>
<
translation
>
配额空间
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
162
"
/>
<
source
>
GB
<
/source
>
<
translation
>
GB
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
173
"
/>
<
source
>
File
Typs
(
|
splitted
,
:
mean
empty
)
<
/source
>
<
translation
>
备份文件类型
(
|
分割
,:
表示空扩展名
)
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
183
"
/>
<
source
>
Running
<
/source
>
<
translation
>
运行开关
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.ui
"
line
=
"
190
"
/>
<
source
>
.
<
/source
>
<
translation
>
.
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.cpp
"
line
=
"
18
"
/>
<
source
>
Program
Started
<
/source
>
<
translation
>
程序启动
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.cpp
"
line
=
"
34
"
/>
<
source
>
Start
maintaining
.
<
/source
>
<
translation
>
开始维护
.
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.cpp
"
line
=
"
40
"
/>
<
source
>
Completed
.
<
/source
>
<
translation
>
完成
.
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.cpp
"
line
=
"
63
"
/>
<
source
>
Fail
Deleting
%
1
.
<
/source
>
<
translation
>
删除文件失败
:
%
1
.
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.cpp
"
line
=
"
69
"
/>
<
source
>
Succ
Deleting
%
1
.
<
/source
>
<
translation
>
删除文件成功
:
%
1
.
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.cpp
"
line
=
"
125
"
/>
<
source
>
Enuming
%
1
Files
%
2
Bytes
.
<
/source
>
<
translation
>
当前枚举到
%
1
个文件
,
占用
%
2
字节
.
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.cpp
"
line
=
"
158
"
/>
<
source
>
Succ
Copy
%
1
to
%
2
.
<
/source
>
<
translation
>
备份文件成功
:
%
1
到
%
2
.
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.cpp
"
line
=
"
160
"
/>
<
source
>
Fail
Copy
%
1
to
%
2
.
<
/source
>
<
translation
>
备份文件失败
:
%
1
到
%
2
.
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.cpp
"
line
=
"
215
"
/>
<
source
>
Watching
root
<
/source
>
<
translation
>
配额监视根文件夹
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
dialogfileloadctrl.cpp
"
line
=
"
225
"
/>
<
source
>
backup
root
<
/source
>
<
translation
>
备份目的根文件夹
<
/translation
>
<
/message
>
<
/context
>
<
/TS
>
fileLoadControl/main.cpp
0 → 100644
浏览文件 @
2b81cbd9
#include "dialogfileloadctrl.h"
#include <QApplication>
#include <QLibraryInfo>
#include <QTranslator>
int
main
(
int
argc
,
char
*
argv
[])
{
QApplication
a
(
argc
,
argv
);
QTranslator
qtTranslator
;
qtTranslator
.
load
(
"qt_"
+
QLocale
::
system
().
name
(),
QLibraryInfo
::
location
(
QLibraryInfo
::
TranslationsPath
));
a
.
installTranslator
(
&
qtTranslator
);
QTranslator
appTranslator
;
QString
strTransLocalFile
=
":/"
+
QCoreApplication
::
applicationName
()
+
"_"
+
QLocale
::
system
().
name
()
+
".qm"
;
appTranslator
.
load
(
strTransLocalFile
);
a
.
installTranslator
(
&
appTranslator
);
DialogFileLoadCtrl
w
;
w
.
show
();
return
a
.
exec
();
}
fileLoadControl/resource.qrc
0 → 100644
浏览文件 @
2b81cbd9
<RCC>
<qresource prefix="/">
<file>fileLoadControl.png</file>
<file>fileLoadControl.ico</file>
<file>fileLoadControl_zh_CN.qm</file>
</qresource>
</RCC>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录