-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeletebookdialog.cpp
61 lines (51 loc) · 1.1 KB
/
deletebookdialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "deletebookdialog.h"
#include "ui_deletebookdialog.h"
DeleteBookDialog::DeleteBookDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::DeleteBookDialog)
{
ui->setupUi(this);
bookName = "";
bookPath = "";
}
DeleteBookDialog::~DeleteBookDialog()
{
delete ui;
}
QString DeleteBookDialog::getClassName()
{
return ui->classLineEdit->text();
}
QString DeleteBookDialog::getBookName()
{
return ui->bookLineEdit->text();
}
QString DeleteBookDialog::getBookPath()
{
return bookPath;
}
void DeleteBookDialog::setClassName(const QString &bookclass)
{
ui->classLineEdit->setText(bookclass);
}
void DeleteBookDialog::setBookName(const QString &bookname)
{
ui->bookLineEdit->setText(bookname);
}
void DeleteBookDialog::on_OKButton_clicked()
{
if(getClassName().isEmpty() || getBookName().isEmpty())
{
QMessageBox::warning(this, tr("错误"),
tr("\n类名和词库名都不能为空!"),
QMessageBox::Ok);
}
else
{
accept();
}
}
void DeleteBookDialog::on_QuitButton_clicked()
{
close();
}