void AdvancedDialog::on_pushButton_2_clicked() { auto json = QJsonDocument::fromJson(ui->plainTextEdit->toPlainText().toUtf8()).toVariant(); if(json.isValid()){ emit configSaved(json.toMap()); QMessageBox::information(this, "Saved", "The json config is saved"); }else{ QMessageBox::critical(this, "Saving fail", "The config is not valid"); } }
/** \fn GalleryView::MenuSettings(MythMenu *) * \brief Adds a new settings menu entry into the main menu * \param mainMenu Parent that will hold the menu entry * \return void */ void GalleryView::MenuSettings() { GalleryConfig *config = new GalleryConfig(m_mainStack, "galleryconfig"); connect(config, SIGNAL(configSaved()), this, SLOT(LoadData())); if (config->Create()) { m_mainStack->AddScreen(config); } else delete config; }
/*! * Deletes any old instance of IConfig and creates a new one\n * This function does not show the dialog. */ void IdealIRC::recreateConfDlg() { if (confDlg != NULL) { disconnect(confDlg, SIGNAL(connectToServer(bool))); disconnect(confDlg, SIGNAL(configSaved())); delete confDlg; } IConnection *c = conlist.value(activeConn, NULL); confDlg = new IConfig(&conf, c, this); connect(confDlg, SIGNAL(connectToServer(bool)), this, SLOT(extConnectServer(bool))); connect(confDlg, SIGNAL(configSaved()), this, SLOT(configSaved())); subwindow_t sw = winlist.value(activeWid); if (sw.type >= WT_GRAPHIC) // Custom window confDlg->setConnectionEnabled(false); else confDlg->setConnectionEnabled(true); }