-
Notifications
You must be signed in to change notification settings - Fork 8
/
livemainwin.cpp
105 lines (77 loc) · 2.72 KB
/
livemainwin.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#include "livemainwin.h"
#include "makeshell.h"
#include<QFile>
#include<QFileDialog>
#include<QMessageBox>
#include<memory>
Livemainwin::Livemainwin(QWidget *parent) : QMainWindow(parent)
{
setWindowTitle(tr("树莓派直播工具"));
setGeometry(500,100,400,200);
excutool =new Ceshi(this);
movie_excutool=new Moviemod(this);
setCentralWidget(movie_excutool);
setWindowIcon(QIcon(":icon/icon/live.png"));
createAction();
createMenu();
createToolBar();
}
void Livemainwin::createAction()
{
displayjindu = new QAction(QIcon("jindu.png"),tr("显示进度"),this);
displayjindu->setShortcut(tr("Ctrl+I"));
displayjindu->setStatusTip(tr("显示播放进度"));
displaynow_tvnum = new QAction(QIcon("png1.png"),tr("显示集数"),this);
turn_movie_mod = new QAction(QIcon(":/icon/icon/film.png"),tr("电影模式"),this);
turn_movie_mod->setStatusTip(tr("播放单个电影文件"));
connect(turn_movie_mod,SIGNAL(triggered(bool)),this,SLOT(turnmovie()));
turn_tv_mod = new QAction(QIcon(":/icon/icon/tv.png"),tr("电视剧模式"),this);
turn_movie_mod->setStatusTip(tr("播放多集电视剧"));
connect(turn_tv_mod,SIGNAL(triggered(bool)),this,SLOT(turntv()));
about_author = new QAction(tr("关于作者"),this);
about_author->setStatusTip(tr("关于作者"));
connect(about_author,SIGNAL(triggered(bool)),this,SLOT(showauthor()));
download_srt = new QAction(QIcon(":/icon/icon/down.png"),tr("下载字幕"),this);
download_srt->setStatusTip(tr("下载匹配的字幕文件"));
connect(download_srt,SIGNAL(triggered(bool)),movie_excutool,SLOT(downsrt()));
}
void Livemainwin::createMenu()
{
fileMenu = menuBar()->addMenu(tr("进度"));
fileMenu->addAction(displayjindu);
fileMenu->addAction(displaynow_tvnum);
subtitleMenu = menuBar()->addMenu(tr("字幕模式"));
subtitleMenu->addAction(turn_movie_mod);
subtitleMenu->addAction(turn_tv_mod);
subtitleMenu->addAction(download_srt);
aboutMenu = menuBar()->addMenu(tr("关于"));
aboutMenu->addAction(about_author);
}
void Livemainwin::createToolBar()
{
jinduToolBar = addToolBar("mod");
jinduToolBar->addAction(turn_movie_mod);
jinduToolBar->addAction(turn_tv_mod);
srtToolBar = addToolBar("zimu");
srtToolBar->addAction(download_srt);
}
void Livemainwin::turnmovie()
{
// movie_excutool =new Moviemod(this);
centralWidget()->setParent(0);
setCentralWidget(movie_excutool);
}
void Livemainwin::turntv()
{
// excutool =new Ceshi(this);
centralWidget()->setParent(0);
setCentralWidget(excutool);
}
void Livemainwin::showauthor()
{
QMessageBox::about(this,tr("作者"),tr("美国的华莱士"));
return;
}
Livemainwin::~Livemainwin()
{
}