Пример #1
0
void YouTube::addComment(const QString &videoId, const QString &comment) {
    QUrl url("http://gdata.youtube.com/feeds/api/videos/" + videoId + "/comments");
    QByteArray xml("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" \
                   "<entry xmlns=\"http://www.w3.org/2005/Atom\"\n" \
                   "xmlns:yt=\"http://gdata.youtube.com/schemas/2007\">\n" \
                   "<content>" + comment.toAscii().toPercentEncoding(" \n\t#[]{}=+$&*()<>@|',/!\":;?") + "</content>\n" \
                   "</entry>");
    postRequest(url, xml);
    connect(this, SIGNAL(postSuccessful()), this, SIGNAL(commentAdded()));
}
Пример #2
0
void Comments::sNew()
{ 
  ParameterList params;
  params.append("mode", "new");
  params.append("sourceType", _source);
  params.append("source_id", _sourceid);

  comment newdlg(this, "", TRUE);
  newdlg.set(params);

  if (newdlg.exec() != QDialog::Rejected)
  {
    emit commentAdded();
    refresh();
  }
}
Пример #3
0
void CommentsModel::setContact(Vreen::Contact *contact)
{
    if (contact == m_contact.data())
        return;
    if (!m_session.isNull()) {
        clear();
        m_session.data()->deleteLater();
    }
    if (!contact)
        return;
    auto session = new Vreen::CommentSession(contact);
    connect(session, SIGNAL(commentAdded(QVariantMap)), SLOT(addComment(QVariantMap)));
    connect(session, SIGNAL(commentDeleted(int)), SLOT(deleteComment(int)));
    session->setPostId(m_postId);

    m_contact = contact;
    m_session = session;
    emit contactChanged(contact);
}
Пример #4
0
/*
 *  Constructs a incident as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
incident::incident(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  _statusCodes << "N" << "F" << "C" << "A" << "R" << "L";
  setupUi(this);

  if(!_privileges->check("EditOwner")) _owner->setEnabled(false);

  // signals and slots connections
  connect(_cancel,        SIGNAL(clicked()),        this,	SLOT(sCancel()));
  connect(_crmacct,       SIGNAL(newId(int)),       this,	SLOT(sCRMAcctChanged(int)));
  connect(_deleteTodoItem, SIGNAL(clicked()),       this,	SLOT(sDeleteTodoItem()));
  connect(_editTodoItem,  SIGNAL(clicked()),        this,	SLOT(sEditTodoItem()));
  connect(_item,          SIGNAL(newId(int)),     _lotserial,   SLOT(setItemId(int)));
  connect(_newTodoItem,   SIGNAL(clicked()),        this,	SLOT(sNewTodoItem()));
  connect(_save,          SIGNAL(clicked()),        this,	SLOT(sSave()));
  connect(_todoList,      SIGNAL(itemSelected(int)), _editTodoItem, SLOT(animateClick()));
  connect(_todoList,      SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*, int)),
	    this,         SLOT(sPopulateTodoMenu(QMenu*)));
  connect(_todoList,      SIGNAL(valid(bool)),      this, SLOT(sHandleTodoPrivs()));
  connect(_viewTodoItem,  SIGNAL(clicked()),        this,	SLOT(sViewTodoItem()));
  //connect(_return,      SIGNAL(clicked()),        this, SLOT(sReturn()));
  connect(_viewAR,        SIGNAL(clicked()),        this, SLOT(sViewAR()));
  connect(_cntct,         SIGNAL(changed()),        this, SLOT(sContactChanged()));
  connect(this,           SIGNAL(prepareMail()),    this, SLOT(sPrepareMail()));
  connect(_assignedTo,    SIGNAL(newId(int)),       this, SLOT(sAssigned()));
  connect(_comments,      SIGNAL(commentAdded()),   this, SLOT(sCommentAdded()));
  
  //Note changes for e-mail notification
  connect(_category,      SIGNAL(textChanged(QString)), this, SLOT(sChanged()));
  connect(_description,   SIGNAL(textChanged(QString)), this, SLOT(sChanged()));
  connect(_crmacct,       SIGNAL(newId(int))          , this, SLOT(sChanged()));
  connect(_owner,         SIGNAL(newId(int))          , this, SLOT(sChanged()));
  connect(_assignedTo,    SIGNAL(newId(int))          , this, SLOT(sChanged()));
  connect(_severity,      SIGNAL(currentIndexChanged(int)), this, SLOT(sChanged()));
  connect(_status,        SIGNAL(currentIndexChanged(int)), this, SLOT(sChanged()));
  connect(_resolution,    SIGNAL(currentIndexChanged(int)), this, SLOT(sChanged()));
  connect(_priority,      SIGNAL(currentIndexChanged(int)), this, SLOT(sChanged()));
  connect(_resolution,    SIGNAL(currentIndexChanged(int)), this, SLOT(sChanged()));
  connect(_cntct,         SIGNAL(changed())           , this, SLOT(sChanged()));
  connect(_notes,         SIGNAL(textChanged())       , this, SLOT(sChanged()));
  connect(_item,          SIGNAL(newId(int))          , this, SLOT(sChanged()));
  connect(_lotserial,     SIGNAL(newId(int))          , this, SLOT(sChanged()));
  
  _incdtid = -1;
  _commentAdded = false;
  _updated = false;

  _severity->setType(XComboBox::IncidentSeverity);
  _priority->setType(XComboBox::IncidentPriority);
  _resolution->setType(XComboBox::IncidentResolution);
  _category->setType(XComboBox::IncidentCategory);
  _lotserial->setStrict(false);

  _incdthist->addColumn(tr("Username"),     _userColumn, Qt::AlignLeft, true, "incdthist_username");
  _incdthist->addColumn(tr("Date/Time"),_timeDateColumn, Qt::AlignLeft, true, "incdthist_timestamp");
  _incdthist->addColumn(tr("Description"),           -1, Qt::AlignLeft, true, "incdthist_descrip");

  _todoList->addColumn(tr("Priority"),      _userColumn, Qt::AlignRight, true, "incdtpriority_name");
  _todoList->addColumn(tr("User"),          _userColumn, Qt::AlignLeft,  true, "usr_username");
  _todoList->addColumn(tr("Name"),                  100, Qt::AlignLeft,  true, "todoitem_name");
  _todoList->addColumn(tr("Description"),            -1, Qt::AlignLeft,  true, "todoitem_description");
  _todoList->addColumn(tr("Status"),      _statusColumn, Qt::AlignLeft,  true, "todoitem_status");
  _todoList->addColumn(tr("Due Date"),      _dateColumn, Qt::AlignLeft,  true, "todoitem_due_date");

  q.prepare("SELECT usr_id "
	    "FROM usr "
	    "WHERE (usr_username=CURRENT_USER);");
  q.exec();
  if (q.first())
  {
    _myUsrId = q.value("usr_id").toInt();
    _owner->setId(_myUsrId);
  }
  else if (q.lastError().type() != QSqlError::NoError)
  {
    systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
    close();
  }
  
  if (_metrics->boolean("LotSerialControl"))
  {
    connect(_item, SIGNAL(valid(bool)), _lotserial, SLOT(setEnabled(bool)));
    connect(_item, SIGNAL(newId(int)),  _lotserial, SLOT(setItemId(int)));
  }
  else
    _lotserial->setVisible(false);

  // because this causes a pop-behind situation we are hiding for now.
  //_return->hide();

  _saved = false;
  _aropenid = -1;
}