void Musec::on_btnNext_clicked() { fPlayer->stop(); resetForm(); evaluate(); loadNext(); }
void SnippetsConfigWidget::enableEditMode(bool enable) { bool has_snippets=(snippets_cmb->count() > 0); cancel_tb->setVisible(enable); new_tb->setVisible(!enable); snippets_cmb->setEnabled(!enable); filter_cmb->setEnabled(!enable); add_tb->setVisible(!enable); update_tb->setVisible(enable); edit_tb->setEnabled(!enable && has_snippets); remove_tb->setEnabled(!enable && has_snippets); remove_all_tb->setEnabled(!enable && has_snippets); if(!enable) resetForm(); }
void SnippetsConfigWidget::handleSnippet(void) { QString orig_id=snippets_cmb->currentData().toString(); attribs_map snippet; snippet=getSnippetAttributes(); if(isSnippetValid(snippet, orig_id)) { config_params[id_edt->text()]=snippet; //If the operation is update and the snippet id changed, remove the original one if(sender()==update_tb && id_edt->text() != orig_id) config_params.erase(orig_id); filterSnippets(filter_cmb->currentIndex()); resetForm(); setConfigurationChanged(true); } }
Qtwitter::Qtwitter( QWidget *parent ) : MainWindow( parent ) { connect( this, SIGNAL(switchModel(QString)), SLOT(setCurrentModel(QString)) ); connect( this, SIGNAL(switchToPublicTimelineModel()), SLOT(setPublicTimelineModel()) ); core = new Core( this ); connect( this, SIGNAL(updateTweets()), core, SLOT(forceGet()) ); connect( this, SIGNAL(openBrowser(QUrl)), core, SLOT(openBrowser(QUrl)) ); connect( this, SIGNAL(post(QString,QString,int)), core, SLOT(post(QString,QString,int)) ); connect( this, SIGNAL(resizeView(int,int)), core, SIGNAL(resizeData(int,int))); connect( this, SIGNAL(shortenUrl(QString)), core, SLOT(shortenUrl(QString))); connect( core, SIGNAL(twitterAccountsChanged(QList<TwitterAccount>,bool)), this, SLOT(setupTwitterAccounts(QList<TwitterAccount>,bool)) ); connect( core, SIGNAL(urlShortened(QString)), this, SLOT(replaceUrl(QString))); connect( core, SIGNAL(about()), this, SLOT(about()) ); connect( core, SIGNAL(addReplyString(QString,int)), this, SIGNAL(addReplyString(QString,int)) ); connect( core, SIGNAL(addRetweetString(QString)), this, SIGNAL(addRetweetString(QString)) ); connect( core, SIGNAL(errorMessage(QString)), this, SLOT(popupError(QString)) ); connect( core, SIGNAL(resetUi()), this, SLOT(resetStatusEdit()) ); connect( core, SIGNAL(requestStarted()), this, SLOT(showProgressIcon()) ); if ( QSystemTrayIcon::supportsMessages() ) connect( core, SIGNAL(sendNewsReport(QString)), this, SLOT(popupMessage(QString)) ); twitpic = new TwitPicView( this ); connect( twitpic, SIGNAL(uploadPhoto(QString,QString,QString)), core, SLOT(uploadPhoto(QString,QString,QString)) ); connect( twitpic, SIGNAL(abortUpload()), core, SLOT(abortUploadPhoto()) ); connect( this, SIGNAL(openTwitPicDialog()), twitpic, SLOT(show()) ); connect( core, SIGNAL(twitPicResponseReceived()), twitpic, SLOT(resetForm()) ); connect( core, SIGNAL(twitPicDataSendProgress(int,int)), twitpic, SLOT(showUploadProgress(int,int)) ); settingsDialog = new Settings( this, core, twitpic, this ); connect( this, SIGNAL(settingsDialogRequested()), settingsDialog, SLOT( show() ) ); QSignalMapper *mapper = new QSignalMapper( this ); mapper->setMapping( qApp, 1 ); connect( qApp, SIGNAL(aboutToQuit()), mapper, SLOT(map()) ); connect( mapper, SIGNAL(mapped(int)), settingsDialog, SLOT(saveConfig(int)) ); }
void Musec::on_actClear_triggered() { fPlayer->stop(); fPlaylist->clear(); resetForm(); }
void TwitPicView::reject() { emit abortUpload(); resetForm(); QDialog::reject(); }
//------------------------------------------------------------------------------ void CaptureForm::rejectForm(bool) { reject(); resetForm(); }
SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget(parent) { QPixmap ico; QString gen_purpose=trUtf8("General purpose"); map<QString, ObjectType> types_map; vector<ObjectType> types=BaseObject::getObjectTypes(true, {OBJ_RELATIONSHIP, OBJ_TAG, OBJ_TEXTBOX, OBJ_PERMISSION, BASE_RELATIONSHIP }); setupUi(this); for(ObjectType type : types) types_map[BaseObject::getTypeName(type)]=type; //Creates a combo with the accepted object type for(auto itr : types_map) { ico.load(QString(":/icones/icones/%1.png").arg(BaseObject::getSchemaName(itr.second))); applies_to_cmb->addItem(ico, itr.first, itr.second); filter_cmb->addItem(ico, itr.first, itr.second); } applies_to_cmb->insertItem(0, gen_purpose, BASE_OBJECT); applies_to_cmb->setCurrentIndex(0); filter_cmb->insertItem(0, gen_purpose, BASE_OBJECT); filter_cmb->insertItem(0, trUtf8("All snippets")); filter_cmb->setCurrentIndex(0); parsable_ht=new HintTextWidget(parsable_hint, this); parsable_ht->setText(parsable_chk->statusTip()); placeholders_ht=new HintTextWidget(placeholders_hint, this); placeholders_ht->setText(placeholders_chk->statusTip()); try { snippet_hl=new SyntaxHighlighter(snippet_txt, false); snippet_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); } catch(Exception &e) { throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } enableEditMode(false); connect(new_tb, SIGNAL(clicked()), this, SLOT(resetForm())); connect(edit_tb, SIGNAL(clicked()), this, SLOT(editSnippet())); connect(remove_tb, SIGNAL(clicked()), this, SLOT(removeSnippet())); connect(remove_all_tb, SIGNAL(clicked()), this, SLOT(removeAllSnippets())); connect(cancel_tb, &QToolButton::clicked, [=](){ enableEditMode(false); }); connect(snippets_cmb, &QComboBox::currentTextChanged, [=](){ enableEditMode(false); }); connect(id_edt, SIGNAL(textChanged(QString)), this, SLOT(enableSaveButtons())); connect(label_edt, SIGNAL(textChanged(QString)), this, SLOT(enableSaveButtons())); connect(snippet_txt, SIGNAL(textChanged()), this, SLOT(enableSaveButtons())); connect(parsable_chk, SIGNAL(toggled(bool)), this, SLOT(enableSaveButtons())); connect(filter_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(filterSnippets(int))); connect(update_tb, SIGNAL(clicked()), this, SLOT(handleSnippet())); connect(add_tb, SIGNAL(clicked()), this, SLOT(handleSnippet())); connect(parse_tb, SIGNAL(clicked()), this, SLOT(parseSnippet())); connect(parsable_chk, SIGNAL(toggled(bool)), placeholders_chk, SLOT(setEnabled(bool))); }