Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Member Functions | Private Slots | Private Member Functions | Private Attributes
AboutPlugins Class Reference

Displays info about pligins. More...

#include <aboutplugins.h>

List of all members.

Public Member Functions

 AboutPlugins (QWidget *parent)
 ~AboutPlugins ()

Private Slots

void displayPlugin (int sel)
 Update the info on a new selection.

Private Member Functions

QString htmlize (QString s)
 Convert string into its HTML safe representation.

Private Attributes

QValueList< QCString > pluginNames
 Map list entry IDs to plugin names.

Detailed Description

Displays info about pligins.

This class implements only the non-GUI parts of the About Plug-ins dialog. Please use Qt Designer on aboutpluginsbase.ui if you need to modify the layout, widget properties, etc.

Definition at line 18 of file aboutplugins.h.

Constructor & Destructor Documentation

AboutPlugins::AboutPlugins ( QWidget *  parent)

Definition at line 22 of file aboutplugins.cpp.

       : AboutPluginsBase( parent, "AboutPlugins" ),
       // Get a list of plugins, enabled or not
       // Populate the list with translated human-readable plugin names
       QValueList<QCString>::const_iterator it(pluginNames.begin());
       QValueList<QCString>::const_iterator itEnd(pluginNames.end());
       for ( ; it != itEnd; ++it )
              ScPlugin* plugin = PluginManager::instance().getPlugin(*it, true);
       // Hook up a connection to update the plugin info when
       // the selection changes
       connect(pluginList, SIGNAL(highlighted(int)),
       // and select the first plugin, if any
       if (pluginList->count())

Here is the call graph for this function:

Definition at line 45 of file aboutplugins.cpp.


Member Function Documentation

void AboutPlugins::displayPlugin ( int  sel) [private, slot]

Update the info on a new selection.

Definition at line 49 of file aboutplugins.cpp.

       // Look up the list entry to get the plugin name and use
       // it to grab the plugin instance and get its about data.
       PluginManager& pluginManager = PluginManager::instance();
       const QCString& name(pluginNames[sel]);
       ScPlugin* plugin = pluginManager.getPlugin(name, true);
       const ScPlugin::AboutData* about = plugin->getAboutData();
       // Now set the text into the html "template"
       // Set the filename using the basename of the path
       QFileInfo fi(pluginManager.getPluginPath(name));
       QString html;
       html = QString("<html><body><h1>%1</h1>").arg(plugin->fullTrName());
       html += "<table>";
       html += QString("<tr><th>%1</th><td>%2</td></tr>").arg( tr("Filename:")).arg(fi.baseName(true));
       html += QString("<tr><th>%1</th><td>%2</td></tr>").arg( tr("Version:")).arg(about->version);
       QString ena;
       ena = pluginManager.enabled(name) ? CommonStrings::trYes : CommonStrings::trNo;
       html += QString("<tr><th>%1</th><td>%2</td></tr>").arg( tr("Enabled:")).arg(ena);
       html += QString("<tr><th>%1</th><td>%2</td></tr>").arg( tr("Release Date:")).arg(about->releaseDate.toString());
       html += "</table>";
       QString desc;
       if (!about->shortDescription.isNull())
              desc += QString("<p>%1</p>").arg(about->shortDescription);
       if (!about->description.isNull())
              desc += QString("<p>%1</p>").arg(about->description);
       html += QString("<h2>%1</h2>%2").arg( tr("Description:")).arg(desc);
       html += QString("<h2>%1</h2><p>%2</p>").arg( tr("Author(s):")).arg(htmlize(about->authors));
       html += QString("<h2>%1</h2><p>%2</p>").arg( tr("Copyright:")).arg(htmlize(about->copyright));
       html += QString("<h2>%1</h2><p>%2</p>").arg( tr("License:")).arg(htmlize(about->license));
       html += "</html>";
       // Use the plugin to delete the about info, so we don't
       // confuse win32's segmented memory.

Here is the call graph for this function:

Here is the caller graph for this function:

QString AboutPlugins::htmlize ( QString  s) [private]

Convert string into its HTML safe representation.

sstring to process
Return values:
QStringa string with changed lt/gt

Definition at line 88 of file aboutplugins.cpp.

       QString ret = s.replace('<', "&lt;");
       ret = ret.replace('>', "&gt;");
       return ret;

Here is the caller graph for this function:

Member Data Documentation

QValueList<QCString> AboutPlugins::pluginNames [private]

Map list entry IDs to plugin names.

Definition at line 32 of file aboutplugins.h.

The documentation for this class was generated from the following files: