| 271 | } |
| 272 | |
| 273 | void |
| 274 | GuiAppInstance::loadInternal(const CLArgs& cl, |
| 275 | bool makeEmptyInstance) |
| 276 | { |
| 277 | if (getAppID() == 0) { |
| 278 | appPTR->setLoadingStatus( tr("Creating user interface...") ); |
| 279 | } |
| 280 | |
| 281 | try { |
| 282 | declareCurrentAppVariable_Python(); |
| 283 | } catch (const std::exception& e) { |
| 284 | throw std::runtime_error( e.what() ); |
| 285 | } |
| 286 | |
| 287 | GuiAppInstancePtr thisShared = std::dynamic_pointer_cast<GuiAppInstance>( shared_from_this() ); |
| 288 | assert(thisShared); |
| 289 | _imp->_gui = new Gui(thisShared); |
| 290 | _imp->_gui->createGui(); |
| 291 | |
| 292 | printAutoDeclaredVariable(_imp->declareAppAndParamsString); |
| 293 | |
| 294 | ///if the app is interactive, build the plugins toolbuttons from the groups we extracted off the plugins. |
| 295 | const std::list<PluginGroupNodePtr> & _toolButtons = appPTR->getTopLevelPluginsToolButtons(); |
| 296 | for (std::list<PluginGroupNodePtr >::const_iterator it = _toolButtons.begin(); it != _toolButtons.end(); ++it) { |
| 297 | _imp->findOrCreateToolButtonRecursive(*it); |
| 298 | } |
| 299 | _imp->_gui->sortAllPluginsToolButtons(); |
| 300 | |
| 301 | Q_EMIT pluginsPopulated(); |
| 302 | |
| 303 | ///show the gui |
| 304 | _imp->_gui->show(); |
| 305 | |
| 306 | |
| 307 | SettingsPtr nSettings = appPTR->getCurrentSettings(); |
| 308 | QObject::connect( getProject().get(), SIGNAL(formatChanged(Format)), this, SLOT(projectFormatChanged(Format)) ); |
| 309 | |
| 310 | { |
| 311 | QSettings settings( QString::fromUtf8(NATRON_ORGANIZATION_NAME), QString::fromUtf8(NATRON_APPLICATION_NAME) ); |
| 312 | if ( !settings.contains( QString::fromUtf8("checkForUpdates") ) ) { |
| 313 | StandardButtonEnum reply = Dialogs::questionDialog(tr("Updates").toStdString(), |
| 314 | tr("Do you want %1 to check for updates " |
| 315 | "on launch of the application?").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).toStdString(), false); |
| 316 | bool checkForUpdates = reply == eStandardButtonYes; |
| 317 | nSettings->setCheckUpdatesEnabled(checkForUpdates); |
| 318 | } |
| 319 | |
| 320 | if ( nSettings->isCheckForUpdatesEnabled() ) { |
| 321 | appPTR->setLoadingStatus( tr("Checking if updates are available...") ); |
| 322 | checkForNewVersion(); |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | if ( nSettings->isDefaultAppearanceOutdated() ) { |
| 327 | StandardButtonEnum reply = Dialogs::questionDialog(tr("Appearance").toStdString(), |
| 328 | tr("The default appearance of %1 changed since last version.\n" |
| 329 | "Would you like to use the new default appearance?").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).toStdString(), false); |
| 330 | if (reply == eStandardButtonYes) { |
nothing calls this directly
no test coverage detected