Hide about button and add better description for unloaded plugins

This commit is contained in:
electron128 2015-10-25 11:47:23 +01:00
parent b717d601f4
commit b340d8a37e
3 changed files with 1137 additions and 685 deletions

View File

@ -22,6 +22,7 @@
#include <iostream> #include <iostream>
#include <QDialog> #include <QDialog>
#include <QFileInfo>
#include "PluginsPage.h" #include "PluginsPage.h"
#include "PluginItem.h" #include "PluginItem.h"
@ -55,25 +56,32 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
rsPlugins->getPluginStatus(i,status,file_name,file_hash,svn_revision,error_string) ; rsPlugins->getPluginStatus(i,status,file_name,file_hash,svn_revision,error_string) ;
QString status_string ; QString status_string ;
QString short_status_string;
switch(status) switch(status)
{ {
case PLUGIN_STATUS_REJECTED_HASH: status_string = tr("Hash rejected. Enable it manually and restart, if you need.") ; case PLUGIN_STATUS_REJECTED_HASH: status_string = tr("Plugin disabled. Click the enable button and restart Retroshare") ;
short_status_string = tr("[disabled]");
break ; break ;
case PLUGIN_STATUS_MISSING_API: status_string = tr("No API number supplied. Please read plugin development manual.") ; case PLUGIN_STATUS_MISSING_API: status_string = tr("No API number supplied. Please read plugin development manual.") ;
short_status_string = tr("[loading problem]");
break ; break ;
case PLUGIN_STATUS_MISSING_SVN: status_string = tr("No SVN number supplied. Please read plugin development manual.") ; case PLUGIN_STATUS_MISSING_SVN: status_string = tr("No SVN number supplied. Please read plugin development manual.") ;
short_status_string = tr("[loading problem]");
break ; break ;
case PLUGIN_STATUS_DLOPEN_ERROR: status_string = tr("Loading error.") ; case PLUGIN_STATUS_DLOPEN_ERROR: status_string = tr("Loading error.") ;
short_status_string = tr("[loading problem]");
break ; break ;
case PLUGIN_STATUS_MISSING_SYMBOL:status_string = tr("Missing symbol. Wrong version?") ; case PLUGIN_STATUS_MISSING_SYMBOL:status_string = tr("Missing symbol. Wrong version?") ;
short_status_string = tr("[loading problem]");
break ; break ;
case PLUGIN_STATUS_NULL_PLUGIN: status_string = tr("No plugin object") ; case PLUGIN_STATUS_NULL_PLUGIN: status_string = tr("No plugin object") ;
short_status_string = tr("[loading problem]");
break ; break ;
case PLUGIN_STATUS_LOADED: status_string = tr("Plugins is loaded.") ; case PLUGIN_STATUS_LOADED: status_string = tr("Plugins is loaded.") ;
@ -84,9 +92,9 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
QIcon plugin_icon(":images/disabled_plugin_48.png") ; QIcon plugin_icon(":images/disabled_plugin_48.png") ;
RsPlugin *plugin = rsPlugins->plugin(i) ; RsPlugin *plugin = rsPlugins->plugin(i) ;
QString pluginTitle = tr("Title unavailable") ; QString pluginTitle = QFileInfo(QString::fromStdString(file_name)).fileName();
QString pluginDescription = tr("Description unavailable") ; QString pluginDescription = status_string;
QString pluginVersion = tr("Unknown version"); QString pluginVersion = short_status_string;
if(plugin!=NULL) if(plugin!=NULL)
{ {
@ -114,7 +122,7 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
if(plugin == NULL || plugin->qt_config_panel() == NULL) if(plugin == NULL || plugin->qt_config_panel() == NULL)
item->_configure_PB->setEnabled(false) ; item->_configure_PB->hide() ;
if(plugin != NULL){ if(plugin != NULL){
@ -123,6 +131,7 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
}else{ }else{
item->enableButton->show(); item->enableButton->show();
item->disableButton->hide(); item->disableButton->hide();
item->_about_PB->hide();
} }
//if(rsPlugins->getAllowAllPlugins()) //if(rsPlugins->getAllowAllPlugins())

View File

@ -24,7 +24,7 @@
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Loaded plugins</string> <string>Plugins</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<property name="margin"> <property name="margin">

File diff suppressed because it is too large Load Diff