|
|
@ -520,6 +520,8 @@ void UBTGMediaWidget::mousePressEvent(QMouseEvent *event) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
/***************************************************************************
|
|
|
|
* class UBTGUrlWidget * |
|
|
|
* class UBTGUrlWidget * |
|
|
|
***************************************************************************/ |
|
|
|
***************************************************************************/ |
|
|
@ -531,10 +533,12 @@ UBTGUrlWidget::UBTGUrlWidget(QWidget* parent, const char* name ):QWidget(parent) |
|
|
|
setObjectName(name); |
|
|
|
setObjectName(name); |
|
|
|
SET_STYLE_SHEET(); |
|
|
|
SET_STYLE_SHEET(); |
|
|
|
mpLayout = new QVBoxLayout(this); |
|
|
|
mpLayout = new QVBoxLayout(this); |
|
|
|
|
|
|
|
setLayout(mpLayout); |
|
|
|
mpTitle = new QLineEdit(this); |
|
|
|
mpTitle = new QLineEdit(this); |
|
|
|
mpTitle->setObjectName("UBTGLineEdit"); |
|
|
|
mpTitle->setObjectName("UBTGLineEdit"); |
|
|
|
mpTitle->setPlaceholderText(tr("Insert link title here...")); |
|
|
|
mpTitle->setPlaceholderText(tr("Insert link title here...")); |
|
|
|
mpUrl = new QLineEdit(this); |
|
|
|
mpUrl = new QLineEdit(this); |
|
|
|
|
|
|
|
connect(mpUrl,SIGNAL(editingFinished()),this,SLOT(onUrlEditionFinished())); |
|
|
|
mpUrl->setObjectName("UBTGLineEdit"); |
|
|
|
mpUrl->setObjectName("UBTGLineEdit"); |
|
|
|
mpUrl->setPlaceholderText("http://"); |
|
|
|
mpUrl->setPlaceholderText("http://"); |
|
|
|
mpLayout->addWidget(mpTitle); |
|
|
|
mpLayout->addWidget(mpTitle); |
|
|
@ -548,6 +552,15 @@ UBTGUrlWidget::~UBTGUrlWidget() |
|
|
|
DELETEPTR(mpLayout); |
|
|
|
DELETEPTR(mpLayout); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTGUrlWidget::onUrlEditionFinished() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QString url = mpUrl->text(); |
|
|
|
|
|
|
|
if(url.length() && !url.startsWith("http://") && !url.startsWith("https://") && !url.startsWith("ftp://") && !url.startsWith("sftp://") && !url.startsWith("http://")){ |
|
|
|
|
|
|
|
mpUrl->setText("http://" + mpUrl->text()); |
|
|
|
|
|
|
|
setFocus(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTGUrlWidget::initializeWithDom(QDomElement element) |
|
|
|
void UBTGUrlWidget::initializeWithDom(QDomElement element) |
|
|
|
{ |
|
|
|
{ |
|
|
|
mpTitle->setText(element.attribute("title")); |
|
|
|
mpTitle->setText(element.attribute("title")); |
|
|
|