Skip to content

Commit 508215d

Browse files
committed
Code 08/2014
1 parent 975ea81 commit 508215d

File tree

668 files changed

+9471
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

668 files changed

+9471
-0
lines changed

AboutDialog.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include "AboutDialog.h"
2+
#include "ui_AboutDialog.h"
3+
4+
AboutDialog::AboutDialog(QWidget *parent) :
5+
QDialog(parent),
6+
ui(new Ui::AboutDialog)
7+
{
8+
ui->setupUi(this);
9+
}
10+
11+
AboutDialog::~AboutDialog()
12+
{
13+
delete ui;
14+
}

AboutDialog.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef ABOUTDIALOG_H
2+
#define ABOUTDIALOG_H
3+
4+
#include <QDialog>
5+
6+
namespace Ui {
7+
class AboutDialog;
8+
}
9+
10+
class AboutDialog : public QDialog
11+
{
12+
Q_OBJECT
13+
14+
public:
15+
explicit AboutDialog(QWidget *parent = 0);
16+
~AboutDialog();
17+
18+
private:
19+
Ui::AboutDialog *ui;
20+
};
21+
22+
#endif // ABOUTDIALOG_H

AboutDialog.ui

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>AboutDialog</class>
4+
<widget class="QDialog" name="AboutDialog">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>411</width>
10+
<height>161</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>关于软件</string>
15+
</property>
16+
<property name="windowIcon">
17+
<iconset resource="rc.qrc">
18+
<normaloff>:/new/prefix1/rc/Copyright.ico</normaloff>:/new/prefix1/rc/Copyright.ico</iconset>
19+
</property>
20+
<widget class="QGroupBox" name="groupBox">
21+
<property name="geometry">
22+
<rect>
23+
<x>190</x>
24+
<y>10</y>
25+
<width>211</width>
26+
<height>141</height>
27+
</rect>
28+
</property>
29+
<property name="title">
30+
<string>关于软件</string>
31+
</property>
32+
<widget class="QLabel" name="textLabel">
33+
<property name="geometry">
34+
<rect>
35+
<x>10</x>
36+
<y>20</y>
37+
<width>191</width>
38+
<height>81</height>
39+
</rect>
40+
</property>
41+
<property name="text">
42+
<string>德语电子词典 -- AnsleDict
43+
作者:刘慧军
44+
西安电子科技大学
45+
通信工程学院
46+
时间:28/08/2014</string>
47+
</property>
48+
</widget>
49+
<widget class="QLabel" name="label">
50+
<property name="geometry">
51+
<rect>
52+
<x>130</x>
53+
<y>110</y>
54+
<width>71</width>
55+
<height>21</height>
56+
</rect>
57+
</property>
58+
<property name="text">
59+
<string>Beta: 4.2.0</string>
60+
</property>
61+
</widget>
62+
</widget>
63+
<widget class="QLabel" name="icoLabel">
64+
<property name="geometry">
65+
<rect>
66+
<x>10</x>
67+
<y>10</y>
68+
<width>171</width>
69+
<height>141</height>
70+
</rect>
71+
</property>
72+
<property name="text">
73+
<string/>
74+
</property>
75+
<property name="pixmap">
76+
<pixmap resource="rc.qrc">:/new/prefix1/rc/pic.png</pixmap>
77+
</property>
78+
<property name="scaledContents">
79+
<bool>true</bool>
80+
</property>
81+
<property name="alignment">
82+
<set>Qt::AlignCenter</set>
83+
</property>
84+
<property name="wordWrap">
85+
<bool>false</bool>
86+
</property>
87+
</widget>
88+
</widget>
89+
<resources>
90+
<include location="rc.qrc"/>
91+
</resources>
92+
<connections/>
93+
</ui>

AddDictDialog.cpp

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#include "AddDictDialog.h"
2+
#include "ui_AddDictDialog.h"
3+
#include "QFileInfo"
4+
#include "QFileDialog"
5+
#include "PathMgr.h"
6+
#include "QMessageBox"
7+
8+
AddDictDialog::AddDictDialog(QWidget *parent) :
9+
QDialog(parent),
10+
ui(new Ui::AddDictDialog)
11+
{
12+
ui->setupUi(this);
13+
ui->OKButton->setEnabled(false);
14+
}
15+
16+
AddDictDialog::~AddDictDialog()
17+
{
18+
delete ui;
19+
}
20+
21+
void AddDictDialog::on_OKButton_clicked()
22+
{
23+
accept();
24+
}
25+
26+
void AddDictDialog::on_QuitButton_clicked()
27+
{
28+
reject();
29+
}
30+
31+
void AddDictDialog::on_ImportButton_clicked()
32+
{
33+
dictPath = PathManage::makePathStr("/AnsleDict/MyDict/Dict/");
34+
QString filename = QFileDialog::getOpenFileName(this,
35+
tr("添加新词典"), dictPath, tr("数据库文件(*.db)"));
36+
if (filename.isEmpty())
37+
return;
38+
else if(!filename.contains(".db", Qt::CaseInsensitive))
39+
{
40+
QMessageBox::warning(this, tr("出错了"),
41+
(QString("请把词典文件放到%1目录下并将其打开!").arg(dictPath)));
42+
return;
43+
}
44+
else
45+
{
46+
QFileInfo fd(filename);
47+
dictName = fd.baseName();
48+
dictPath = fd.filePath();
49+
ui->DictNameLineEdit->setText(dictName);
50+
ui->DictPathLineEdit->setText(dictPath);
51+
ui->OKButton->setEnabled(true);
52+
}
53+
}
54+
55+
QString AddDictDialog::getDictName()
56+
{
57+
return ui->DictNameLineEdit->text();
58+
}
59+
60+
QString AddDictDialog::getDictPath()
61+
{
62+
return dictPath;
63+
}

AddDictDialog.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#ifndef ADDDICTDIALOG_H
2+
#define ADDDICTDIALOG_H
3+
4+
#include <QDialog>
5+
6+
namespace Ui {
7+
class AddDictDialog;
8+
}
9+
10+
class AddDictDialog : public QDialog
11+
{
12+
Q_OBJECT
13+
14+
public:
15+
explicit AddDictDialog(QWidget *parent = 0);
16+
~AddDictDialog();
17+
18+
private slots:
19+
void on_OKButton_clicked();
20+
21+
void on_QuitButton_clicked();
22+
23+
void on_ImportButton_clicked();
24+
25+
public:
26+
QString getDictName();
27+
QString getDictPath();
28+
29+
private:
30+
Ui::AddDictDialog *ui;
31+
QString dictName;
32+
QString dictPath;
33+
};
34+
35+
#endif // ADDDICTDIALOG_H

AddDictDialog.ui

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>AddDictDialog</class>
4+
<widget class="QDialog" name="AddDictDialog">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>331</width>
10+
<height>160</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>添加词典</string>
15+
</property>
16+
<property name="windowIcon">
17+
<iconset resource="rc.qrc">
18+
<normaloff>:/new/prefix1/rc/Plus.ico</normaloff>:/new/prefix1/rc/Plus.ico</iconset>
19+
</property>
20+
<widget class="QPushButton" name="QuitButton">
21+
<property name="geometry">
22+
<rect>
23+
<x>210</x>
24+
<y>120</y>
25+
<width>71</width>
26+
<height>31</height>
27+
</rect>
28+
</property>
29+
<property name="text">
30+
<string>取消</string>
31+
</property>
32+
<property name="icon">
33+
<iconset resource="rc.qrc">
34+
<normaloff>:/new/prefix1/rc/Cancel.ico</normaloff>:/new/prefix1/rc/Cancel.ico</iconset>
35+
</property>
36+
</widget>
37+
<widget class="QPushButton" name="OKButton">
38+
<property name="geometry">
39+
<rect>
40+
<x>50</x>
41+
<y>120</y>
42+
<width>71</width>
43+
<height>31</height>
44+
</rect>
45+
</property>
46+
<property name="text">
47+
<string>确定</string>
48+
</property>
49+
<property name="icon">
50+
<iconset resource="rc.qrc">
51+
<normaloff>:/new/prefix1/rc/Ok (2).ico</normaloff>:/new/prefix1/rc/Ok (2).ico</iconset>
52+
</property>
53+
</widget>
54+
<widget class="QGroupBox" name="groupBox">
55+
<property name="geometry">
56+
<rect>
57+
<x>10</x>
58+
<y>10</y>
59+
<width>311</width>
60+
<height>101</height>
61+
</rect>
62+
</property>
63+
<property name="title">
64+
<string>请输入要添加的词典的名称</string>
65+
</property>
66+
<widget class="QLabel" name="DictLabel">
67+
<property name="geometry">
68+
<rect>
69+
<x>10</x>
70+
<y>60</y>
71+
<width>61</width>
72+
<height>21</height>
73+
</rect>
74+
</property>
75+
<property name="text">
76+
<string>词典名称:</string>
77+
</property>
78+
</widget>
79+
<widget class="QLineEdit" name="DictNameLineEdit">
80+
<property name="geometry">
81+
<rect>
82+
<x>70</x>
83+
<y>61</y>
84+
<width>231</width>
85+
<height>20</height>
86+
</rect>
87+
</property>
88+
</widget>
89+
<widget class="QLabel" name="DictPathLabel">
90+
<property name="geometry">
91+
<rect>
92+
<x>10</x>
93+
<y>30</y>
94+
<width>61</width>
95+
<height>21</height>
96+
</rect>
97+
</property>
98+
<property name="text">
99+
<string>词 典:</string>
100+
</property>
101+
</widget>
102+
<widget class="QLineEdit" name="DictPathLineEdit">
103+
<property name="geometry">
104+
<rect>
105+
<x>70</x>
106+
<y>31</y>
107+
<width>161</width>
108+
<height>20</height>
109+
</rect>
110+
</property>
111+
<property name="readOnly">
112+
<bool>true</bool>
113+
</property>
114+
</widget>
115+
<widget class="QPushButton" name="ImportButton">
116+
<property name="geometry">
117+
<rect>
118+
<x>240</x>
119+
<y>30</y>
120+
<width>61</width>
121+
<height>22</height>
122+
</rect>
123+
</property>
124+
<property name="text">
125+
<string>导入</string>
126+
</property>
127+
<property name="icon">
128+
<iconset resource="rc.qrc">
129+
<normaloff>:/new/prefix1/rc/Go In.ico</normaloff>:/new/prefix1/rc/Go In.ico</iconset>
130+
</property>
131+
<property name="autoRepeat">
132+
<bool>false</bool>
133+
</property>
134+
<property name="autoExclusive">
135+
<bool>false</bool>
136+
</property>
137+
</widget>
138+
</widget>
139+
</widget>
140+
<resources>
141+
<include location="rc.qrc"/>
142+
</resources>
143+
<connections/>
144+
</ui>

0 commit comments

Comments
 (0)