| 989 | } |
| 990 | |
| 991 | void |
| 992 | GuiApplicationManager::onPluginLoaded(Plugin* plugin) |
| 993 | { |
| 994 | QString shortcutGrouping = QString::fromUtf8(kShortcutGroupNodes); |
| 995 | const QStringList & groups = plugin->getGrouping(); |
| 996 | const QString & pluginID = plugin->getPluginID(); |
| 997 | const QString pluginLabel = plugin->getLabelWithoutSuffix(); |
| 998 | const QString & pluginIconPath = plugin->getIconFilePath(); |
| 999 | const QStringList & groupIconPath = plugin->getGroupIconFilePath(); |
| 1000 | QStringList groupingWithID = groups; |
| 1001 | |
| 1002 | groupingWithID.push_back(pluginID); |
| 1003 | PluginGroupNodePtr child = findPluginToolButtonOrCreate( groupingWithID, |
| 1004 | pluginLabel, |
| 1005 | groupIconPath, |
| 1006 | pluginIconPath, |
| 1007 | plugin->getMajorVersion(), |
| 1008 | plugin->getMinorVersion(), |
| 1009 | plugin->getIsUserCreatable() ); |
| 1010 | for (int i = 0; i < groups.size(); ++i) { |
| 1011 | shortcutGrouping.push_back( QLatin1Char('/') ); |
| 1012 | shortcutGrouping.push_back(groups[i]); |
| 1013 | } |
| 1014 | |
| 1015 | Qt::Key symbol = (Qt::Key)0; |
| 1016 | bool hasShortcut = true; |
| 1017 | |
| 1018 | /*These are the plug-ins which have a default shortcut. Other plug-ins can have a user-assigned shortcut.*/ |
| 1019 | if ( pluginID == QString::fromUtf8(PLUGINID_OFX_TRANSFORM) ) { |
| 1020 | symbol = Qt::Key_T; |
| 1021 | } else if ( pluginID == QString::fromUtf8(PLUGINID_NATRON_ROTO) ) { |
| 1022 | symbol = Qt::Key_O; |
| 1023 | } else if ( pluginID == QString::fromUtf8(PLUGINID_NATRON_ROTOPAINT) ) { |
| 1024 | symbol = Qt::Key_P; |
| 1025 | } else if ( pluginID == QString::fromUtf8(PLUGINID_OFX_MERGE) ) { |
| 1026 | symbol = Qt::Key_M; |
| 1027 | } else if ( pluginID == QString::fromUtf8(PLUGINID_OFX_GRADE) ) { |
| 1028 | symbol = Qt::Key_G; |
| 1029 | } else if ( pluginID == QString::fromUtf8(PLUGINID_OFX_COLORCORRECT) ) { |
| 1030 | symbol = Qt::Key_C; |
| 1031 | } else if ( pluginID == QString::fromUtf8(PLUGINID_OFX_BLURCIMG) ) { |
| 1032 | symbol = Qt::Key_B; |
| 1033 | } else if ( pluginID == QString::fromUtf8(PLUGINID_NATRON_DOT) ) { |
| 1034 | symbol = Qt::Key_Period; |
| 1035 | } |
| 1036 | #ifdef NATRON_ENABLE_IO_META_NODES |
| 1037 | else if ( pluginID == QString::fromUtf8(PLUGINID_NATRON_READ) ) { |
| 1038 | symbol = Qt::Key_R; |
| 1039 | } else if ( pluginID == QString::fromUtf8(PLUGINID_NATRON_WRITE) ) { |
| 1040 | symbol = Qt::Key_W; |
| 1041 | } |
| 1042 | #endif |
| 1043 | else { |
| 1044 | hasShortcut = false; |
| 1045 | } |
| 1046 | plugin->setHasShortcut(hasShortcut); |
| 1047 | |
| 1048 | if ( hasShortcut && plugin->getIsUserCreatable() ) { |
nothing calls this directly
no test coverage detected