Ejemplo n.º 1
0
void PersonView::slotLinkClicked( const QUrl &url )
{
  qDebug() << "CLICKED" << url;

  if ( url.scheme() == "polka" ) {
    QStringList path = url.path().split("/");
    QString action = path.first();
    qDebug() << "ACTION" << action;

    if ( action == "editName" ) editName();

    else if ( action == "addEmail" ) addEmail();
    else if ( action == "editEmail" ) editEmail( path.value( 1 ) );
    else if ( action == "removeEmail" ) removeEmail( path.value( 1 ) );
    else if ( action == "commentEmail" ) commentEmail( path.value( 1 ) );

    else if ( action == "addPhone" ) addPhone();
    else if ( action == "editPhone" ) editPhone( path.value( 1 ) );
    else if ( action == "removePhone" ) removePhone( path.value( 1 ) );
    else if ( action == "commentPhone" ) commentPhone( path.value( 1 ) );

    else if ( action == "addLink" ) addLink();
    else if ( action == "editLink" ) editLink( path.value( 1 ) );
    else if ( action == "removeLink" ) removeLink( path.value( 1 ) );
    else if ( action == "commentLink" ) commentLink( path.value( 1 ) );

    else if ( action == "addAddress" ) addAddress();
    else if ( action == "editAddress" ) editAddress( path.value( 1 ) );
    else if ( action == "removeAddress" ) removeAddress( path.value( 1 ) );
    else if ( action == "commentAddress" ) commentAddress( path.value( 1 ) );

    else if ( action == "addComment" ) addComment();
    else if ( action == "editComment" ) editComment( path.value( 1 ) );
    else if ( action == "removeComment" ) removeComment( path.value( 1 ) );

    else if ( action == "close" ) requestClose();
    else if ( action == "magic" ) debugHtml();

    else qDebug() << "unknown action" << action;
  } else {
    new KRun( QUrl( url ), this );
  }
}
Ejemplo n.º 2
0
MainInfo::MainInfo(QWidget *p, bool readOnly)
        : MainInfoBase(p)
{
    bReadOnly = readOnly;
    lblPict->setPixmap(Pict("main"));
    edtUin->setReadOnly(true);
    cmbDisplay->setEditable(true);
    connect(lstEmail, SIGNAL(highlighted(int)), this, SLOT(setButtons(int)));
    connect(btnAdd, SIGNAL(clicked()), this, SLOT(addEmail()));
    connect(btnEdit, SIGNAL(clicked()), this, SLOT(editEmail()));
    connect(btnRemove, SIGNAL(clicked()), this, SLOT(removeEmail()));
    connect(btnDefault, SIGNAL(clicked()), this, SLOT(defaultEmail()));
    if (!readOnly){
        lblNotes->hide();
        edtNotes->hide();
        load(pClient);
    }else{
        edtUin->hide();
        lblUin->hide();
        lineDiv->hide();
    }
}