void Prueba::setUri(QString &uri){ if (_uri != uri){ _watcher.removePath(_uri); _watcher.addPath(uri); _uri = uri; emit uriChanged(); } }
/** * @brief QEjdbClient::setUri set uri to connect database. * * @param uri connection uri * * @return void * * @see QEjdbDatabase::addDatabase(QString,QString) */ void QEjdbClient::setUri(QString uri) { Q_D(QEjdbClient); if (d->m_uri == uri) return; d->m_uri = uri; emit uriChanged(uri); }
void QDeclarativeNdefUriRecord::setUri(const QString &uri) { QNdefNfcUriRecord uriRecord(record()); if (uriRecord.uri() == uri) return; uriRecord.setUri(uri); setRecord(uriRecord); emit uriChanged(); }
void fsirc::newTab(QString uri) { FsIrcView * ircView = new FsIrcView(); connect(ircView, SIGNAL(uriChanged()), this, SLOT(refreshTabNames())); connect(ircView, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl))); connect(ircView, SIGNAL(gotSomeMsg()), this, SLOT(gotSomeMsg())); connect(ircView, SIGNAL(gotHlite()), this, SLOT(gotHlite())); ircList << ircView; if(!uri.isEmpty()) { ircView->proposeUri(uri); ircView->openIrc(uri); } else ircView->pickAction(); ircTabHolder->setCurrentIndex(ircTabHolder->addTab(ircView,"newtab")); refreshTabNames(); if(ircTabHolder->count()>1) closeTabButton->setDisabled(false); }
void fsirc::newTab(QString uri) { // if (uri.isEmpty()) { // QStringList items; // items << "irc://irc.freenode.net/#fsirc" // << "irc://irc.freenode.net/#qt-ru"; // // bool ok = false; // uri = QInputDialog::getItem (this, tr ("IRC URI"), tr ("IRC URI"), // items, -1, true, &ok); // // if (!ok) // return; // } // // if (uri.isEmpty ()) { // QMessageBox::critical (this, "", tr ("SRC URI is empty")); // return; // } // // if (!IrcLayer::isIrcUri (uri)) { // QMessageBox::critical (this, "", tr ("Incorrect SRC URI")); // return; // } FsIrcView *ircView = new FsIrcView (); connect(ircView, SIGNAL(uriChanged()), this, SLOT(refreshTabNames())); connect(ircView, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl))); connect(ircView, SIGNAL(gotSomeMsg()), this, SLOT(gotSomeMsg())); connect(ircView, SIGNAL(gotHlite()), this, SLOT(gotHlite())); ircList << ircView; // ircView->proposeUri(uri); // ircView->openIrc(uri); ircTabHolder->setCurrentIndex(ircTabHolder->addTab(ircView, uri)); refreshTabNames(); actionCloseTab->setEnabled (ircTabHolder->count () > 0); }
ConnectionDialog::ConnectionDialog (QWidget *parent) : QDialog (parent) { fSettings settings; uriLabel = new QLabel (tr ("IRC URI"), this); uriLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); uriEdit = new QLineEdit (this); connect (uriEdit, SIGNAL (textChanged (QString)), this, SLOT (uriChanged (QString))); serverLabel = new QLabel (tr ("IRC server"), this); serverLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); serverEdit = new QComboBox (this); serverEdit->setEditable (true); serverEdit->addItems(settings.value("Connection/Servers", QStringList()).toStringList()); serverEdit->setCurrentIndex (-1); connect (serverEdit, SIGNAL (editTextChanged (QString)), this, SLOT (serverChanged ())); connect (serverEdit, SIGNAL (editTextChanged (QString)), this, SLOT (updateUri ())); roomLabel = new QLabel (tr ("Room"), this); roomLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); roomEdit = new QComboBox (this); roomEdit->setEditable (true); roomEdit->setEnabled (false); connect (roomEdit, SIGNAL (editTextChanged (QString)), this, SLOT (updateUri ())); nickLabel = new QLabel (tr ("Nick"), this); nickLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); nickEdit = new QComboBox (this); nickEdit->setEditable (true); nickEdit->setEnabled (false); encodingLabel = new QLabel (tr ("Encoding"), this); encodingLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); encodingEdit = new QComboBox (this); encodingEdit->setEditable (false); { QList<int> textCodecs = QTextCodec::availableMibs(); for (QList<int>::iterator it = textCodecs.begin (), end = textCodecs.end (); it != end; it++) { encodingEdit->addItem (QTextCodec::codecForMib(*it)->name()); } encodingEdit->setCurrentIndex (encodingEdit->findText ("UTF-8")); } QGridLayout *layout = new QGridLayout (); layout->addWidget (uriLabel, 0, 0); layout->addWidget (uriEdit, 0, 1); layout->addWidget (serverLabel, 1, 0); layout->addWidget (serverEdit, 1, 1); layout->addWidget (roomLabel, 2, 0); layout->addWidget (roomEdit, 2, 1); layout->addWidget (nickLabel, 3, 0); layout->addWidget (nickEdit, 3, 1); layout->addWidget (encodingLabel, 4, 0); layout->addWidget (encodingEdit, 4, 1); QDialogButtonBox *buttonBox = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); connect (buttonBox, SIGNAL (accepted ()), this, SLOT (saveAndAccept ())); connect (buttonBox, SIGNAL (rejected ()), this, SLOT (reject ())); QVBoxLayout *mainLayout = new QVBoxLayout (); mainLayout->addLayout (layout); mainLayout->addWidget (buttonBox); setLayout (mainLayout); serverEdit->setCurrentIndex(settings.value("Connection/LastServer", -1).toInt ()); }