5 #include "../../../../plugin/PluginInfo.h"
6 #include "../../../../plugin/PluginManager.h"
67 header = QObject::tr(
"Enabling");
71 header = QObject::tr(
"Plugin");
75 header = QObject::tr(
"Version");
79 header = QObject::tr(
"License");
83 header = QObject::tr(
"Category");
87 header = QObject::tr(
"Site");
91 header = QObject::tr(
"Provider");
95 header = QObject::tr(
"Provider site");
99 header = QObject::tr(
"Provider email");
103 header = QObject::tr(
"Name");
112 QAbstractTableModel(parent)
122 return (
int) m_plugins.size();
137 case Qt::TextAlignmentRole:
138 return int(Qt::AlignVCenter | Qt::AlignLeft);
141 case Qt::DisplayRole:
142 return (index.column() > 0) ?
143 QString(
GetData(index.column(), *(m_plugins[index.row()])).c_str()) :
150 PluginsStatus st = m_pluginsStatus[index.row()];
152 if(st.testFlag(To_add) || st.testFlag(To_enable) || st.testFlag(To_disable))
154 else if(st.testFlag(To_remove))
161 case Qt::CheckStateRole:
163 PluginsStatus st = m_pluginsStatus[index.row()];
165 if(!st.testFlag(Broked) && index.column() == 0)
166 return ((st.testFlag(Loaded) && !(st.testFlag(To_disable))) || st.testFlag(To_enable)) ? Qt::Checked : Qt::Unchecked;
182 case Qt::DisplayRole:
183 return (orientation == Qt::Horizontal) ?
185 QVariant::fromValue<int>(section+1);
189 return QAbstractTableModel::headerData(section, orientation, role);
195 if (!index.isValid())
198 Qt::ItemFlags flags(0);
200 if(!m_pluginsStatus[index.row()].testFlag(To_remove))
202 flags = flags | Qt::ItemIsEnabled;
204 if(index.column() == 0)
205 flags = flags | Qt::ItemIsUserCheckable | Qt::ItemIsEditable;
207 flags = flags | Qt::ItemIsSelectable;
218 if(role == Qt::CheckStateRole && !m_pluginsStatus[index.row()].testFlag(Broked))
220 if(value.toInt() == Qt::Checked)
222 m_pluginsStatus[index.row()] &= ~To_disable;
223 m_pluginsStatus[index.row()] |= To_enable;
227 m_pluginsStatus[index.row()] &= ~To_enable;
228 m_pluginsStatus[index.row()] |= To_disable;
233 emit dataChanged (idx, idx);
242 m_pluginsStatus.push_back(status);
244 #if (QT_VERSION < 0x050000)
254 QModelIndexList::ConstIterator it;
256 for(it=plgs.constBegin(); it!=plgs.constEnd(); ++it)
257 m_pluginsStatus[(*it).row()] = To_remove;
259 #if (QT_VERSION < 0x050000)
271 status = m_pluginsStatus;
276 std::vector<te::plugin::PluginInfo*>::iterator it;
278 for(it = m_plugins.begin(); it != m_plugins.end(); ++it)
282 m_pluginsStatus.clear();
std::string m_name
The plugin name: an internal value used to identify the plugin in the system. Must be a unique value...
std::string m_site
The provider home page.
std::string m_licenseDescription
A brief description about the plugin license.
std::string m_displayName
The plugin name to be displayed in a graphical interface.
Provider m_provider
Information about the plugin provider.
std::string m_version
The plugin version.
std::string m_site
An URL pointing to the plugin site.
std::string GetData(const int &column, const te::plugin::PluginInfo &info)
QString GetHeader(const int §ion)
std::string m_email
The provider contact e-mail.
std::string m_name
Provider name: may be a person or a company.
The basic information about a plugin.
std::string m_category
The plugin category.