summaryrefslogtreecommitdiffstats
path: root/src/sq_pluginsinfo.ui.h
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-02-10 15:10:13 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-02-13 11:44:42 +0900
commit8f8f84410cc591c85c5e83e0b3efdcda5fdbe42e (patch)
treef273a932ce048ef22ea9d9888b77ea8a2b8f3e33 /src/sq_pluginsinfo.ui.h
parent424635023ee423826de12514b2fec7834b8deb7b (diff)
downloadksquirrel-8f8f8441.tar.gz
ksquirrel-8f8f8441.zip
Rename 'ksquirrel' folder to 'src'
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 203fcb8d90752b546c672c625927a136b959fcfb)
Diffstat (limited to 'src/sq_pluginsinfo.ui.h')
-rw-r--r--src/sq_pluginsinfo.ui.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/sq_pluginsinfo.ui.h b/src/sq_pluginsinfo.ui.h
new file mode 100644
index 0000000..bc8f05a
--- /dev/null
+++ b/src/sq_pluginsinfo.ui.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+** 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.
+*****************************************************************************/
+
+#if !defined(QT_STRINGIFY)
+# define QT_STRINGIFY2(x) #x
+# define QT_STRINGIFY(x) QT_STRINGIFY2(x)
+#endif
+
+/*
+ * SQ_PluginsInfo shows all found by SQ_LibraryListener libraries.
+ */
+
+void SQ_PluginsInfo::init()
+{
+ tableLib->setColumnText (5, SQ_IconLoader::instance()->loadIcon("document-open", TDEIcon::Desktop, TDEIcon::SizeSmall), "");
+ tableLib->setColumnText (6, SQ_IconLoader::instance()->loadIcon("document-save", TDEIcon::Desktop, TDEIcon::SizeSmall), "");
+
+ showLibs();
+}
+
+void SQ_PluginsInfo::showLibs()
+{
+ int cnt = SQ_LibraryHandler::instance()->count();
+
+ textLibs->setText(QT_STRINGIFY(SQ_KLIBS));
+ textCount->setNum(cnt);
+
+ if(!cnt) return;
+
+ TQPixmap ok = SQ_IconLoader::instance()->loadIcon("ok", TDEIcon::Desktop, TDEIcon::SizeSmall);
+ TQPixmap configure = SQ_IconLoader::instance()->loadIcon("configure", TDEIcon::Desktop, TDEIcon::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 == TQt::LeftButton && i && !c)
+ slotDoubleClicked(i);
+}