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
|
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** TQt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
*****************************************************************************/
/*
* SQ_PluginsInfo shows all found by SQ_LibraryListener libraries.
*/
void SQ_PluginsInfo::init()
{
tableLib->setColumnText (5, SQ_IconLoader::instance()->loadIcon("fileopen", KIcon::Desktop, KIcon::SizeSmall), "");
tableLib->setColumnText (6, SQ_IconLoader::instance()->loadIcon("filesave", KIcon::Desktop, KIcon::SizeSmall), "");
showLibs();
}
void SQ_PluginsInfo::showLibs()
{
int cnt = SQ_LibraryHandler::instance()->count();
textLibs->setText(SQ_KLIBS);
textCount->setNum(cnt);
if(!cnt) return;
TQPixmap ok = SQ_IconLoader::instance()->loadIcon("ok", KIcon::Desktop, KIcon::SizeSmall);
TQPixmap configure = SQ_IconLoader::instance()->loadIcon("configure", KIcon::Desktop, KIcon::SizeSmall);
SQ_LibraryHandler::iterator itEnd = SQ_LibraryHandler::instance()->end();
TQListViewItem *item;
for(SQ_LibraryHandler::iterator it = SQ_LibraryHandler::instance()->begin();it != itEnd;++it)
{
item = new TQListViewItem(tableLib, TQString(), TQString(),
(*it).quickinfo, (*it).version,
KStringHandler::rsqueeze((*it).mimetype, 20));
if(!(*it).config.isEmpty())
item->setPixmap(0, configure);
if((*it).readable)
item->setPixmap(5, ok);
if((*it).writestatic)
item->setPixmap(6, ok);
item->setPixmap(1, (*it).mime);
tableLib->insertItem(item);
}
item = tableLib->firstChild();
tableLib->setCurrentItem(item);
tableLib->setSelected(item, true);
}
void SQ_PluginsInfo::slotDoubleClicked(TQListViewItem *i)
{
if(!i)
return;
SQ_LIBRARY *lib = SQ_LibraryHandler::instance()->libraryByName(i->text(2));
if(!lib || lib->config.isEmpty())
return;
SQ_CodecSettingsSkeleton skel(this);
skel.addSettingsWidget(lib->config);
skel.setCodecInfo(*i->pixmap(1), i->text(2));
skel.adjustSize();
skel.exec(lib->settings);
}
void SQ_PluginsInfo::slotMouseButtonClicked(int button, TQListViewItem *i, const TQPoint &, int c)
{
if(button == Qt::LeftButton && i && !c)
slotDoubleClicked(i);
}
|