-
Notifications
You must be signed in to change notification settings - Fork 88
/
feiqwin.cpp
75 lines (63 loc) · 1.26 KB
/
feiqwin.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
#include "feiqwin.h"
#include "mainwindow.h"
#include "plugin/iplugin.h"
FeiqWin::FeiqWin()
{
}
RecvTextEdit *FeiqWin::recvTextEdit()
{
return mMainWin->mRecvTextEdit;
}
SendTextEdit *FeiqWin::sendTextEdit()
{
return mMainWin->mSendTextEdit;
}
FellowListWidget *FeiqWin::fellowListWidget()
{
return &(mMainWin->mFellowList);
}
const FeiqModel *FeiqWin::feiqModel()
{
return &(mMainWin->mFeiq.getModel());
}
Settings *FeiqWin::settings()
{
return mMainWin->mSettings;
}
void FeiqWin::init(MainWindow *mainWin)
{
mMainWin = mainWin;
loadPlugins();
for (auto plugin : mPlugins)
{
plugin->setFeiqWin(this);
plugin->init();
}
}
void FeiqWin::unInit()
{
for (auto plugin : mPlugins)
{
plugin->unInit();
}
mPlugins.clear();
}
void FeiqWin::loadPlugins()
{
auto gAllPlugins = PluginManager::instance().allPlugins;
cout<<"listing all supported plugins:"<<endl;
for (auto iter : gAllPlugins)
{
cout<<iter.first;
if (mMainWin->mSettings->value(QString(iter.first)+"/enable", "1").toBool())
{
cout<<" enable";
mPlugins.append(iter.second);
}
else
{
cout<<" disable";
}
cout<<endl;
}
}