Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/plugingenerator.py: return false to load page #1651

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 1 addition & 30 deletions plugins/datalogger/src/dataloggerplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,36 +39,7 @@ bool DataLoggerPlugin::compatible(QString m_param, QString category)
return true;
}

bool DataLoggerPlugin::loadPage()
{
// Here you must write the code for the plugin info page
// Below is an example for an iio device
/*m_page = new QWidget();
m_page->setLayout(new QVBoxLayout(m_page));
m_page->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_infoPage = new InfoPage(m_page);
m_infoPage->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
m_page->layout()->addWidget(m_infoPage);
m_page->layout()->addItem(new QSpacerItem(0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding));

auto cp = ContextProvider::GetInstance();
struct iio_context *context = cp->open(m_param);
ssize_t attributeCount = iio_context_get_attrs_count(context);
for(int i = 0; i < attributeCount; ++i) {
const char *name;
const char *value;
int ret = iio_context_get_attr(context, i, &name, &value);
if(ret < 0) {
qWarning(CAT_DATALOGGERLUGIN) << "Could not read attribute with index:" << i;
continue;
}

m_infoPage->update(name, value);
}
cp->close(m_param);
m_page->ensurePolished();*/
return true;
}
bool DataLoggerPlugin::loadPage() { return false; }

bool DataLoggerPlugin::loadIcon()
{
Expand Down
31 changes: 1 addition & 30 deletions plugins/iiodebug/src/iiodebugplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,7 @@ bool IIODebugPlugin::compatible(QString m_param, QString category)
return ret;
}

bool IIODebugPlugin::loadPage()
{
// Here you must write the code for the plugin info page
// Below is an example for an iio device
/*m_page = new QWidget();
m_page->setLayout(new QVBoxLayout(m_page));
m_page->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_infoPage = new InfoPage(m_page);
m_infoPage->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
m_page->layout()->addWidget(m_infoPage);
m_page->layout()->addItem(new QSpacerItem(0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding));

auto cp = ContextProvider::GetInstance();
struct iio_context *context = cp->open(m_param);
ssize_t attributeCount = iio_context_get_attrs_count(context);
for(int i = 0; i < attributeCount; ++i) {
const char *name;
const char *value;
int ret = iio_context_get_attr(context, i, &name, &value);
if(ret < 0) {
qWarning(CAT_IIODEBUGPLUGIN) << "Could not read attribute with index:" << i;
continue;
}

m_infoPage->update(name, value);
}
cp->close(m_param);
m_page->ensurePolished();*/
return true;
}
bool IIODebugPlugin::loadPage() { return false; }

bool IIODebugPlugin::loadIcon()
{
Expand Down
6 changes: 4 additions & 2 deletions tools/plugingenerator/templates/plugin_src_template.mako
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ bool ${config['class_name']}::loadPage()
m_infoPage->update(name, value);
}
cp->close(m_param);
m_page->ensurePolished();*/
m_page->ensurePolished();
return true;
*/
return false;
}

bool ${config['class_name']}::loadIcon()
Expand Down Expand Up @@ -129,4 +131,4 @@ void ${config['class_name']}::initMetadata()
}
% endif
% endif
% endif
% endif
Loading