Use same order (URL, name) for both add stream-URL dialogs.

This commit is contained in:
craig.p.drummond
2014-02-14 20:07:32 +00:00
committed by craig.p.drummond
parent 0f09a2a55f
commit b832f9df4e
2 changed files with 7 additions and 16 deletions

View File

@@ -134,6 +134,7 @@
80. Move search fields back to the top of views.
81. Close temporary files after write, to ensure data is written. This fixes an
issue where sometimes 0 byte files were written from CoverDialog.
82. Use same order (URL, name) for both add stream-URL dialogs.
1.2.2
-----

View File

@@ -56,14 +56,12 @@ StreamDialog::StreamDialog(QWidget *parent, bool addToPlayQueue)
QFormLayout *layout = new QFormLayout(wid);
layout->setMargin(0);
urlEntry = new LineEdit(wid);
if (addToPlayQueue) {
urlEntry = new LineEdit(wid);
saveCombo=new QComboBox(wid);
nameEntry = new LineEdit(wid);
} else {
nameEntry = new LineEdit(wid);
urlEntry = new LineEdit(wid);
}
nameEntry = new LineEdit(wid);
nameEntry->setValidator(new NameValidator(this));
statusText = new QLabel(this);
@@ -72,23 +70,19 @@ StreamDialog::StreamDialog(QWidget *parent, bool addToPlayQueue)
BuddyLabel *urlLabel=new BuddyLabel(i18n("URL:"), wid, urlEntry);
int row=0;
layout->setWidget(row, QFormLayout::LabelRole, urlLabel);
layout->setWidget(row++, QFormLayout::FieldRole, urlEntry);
if (addToPlayQueue) {
saveCombo->addItem(i18n("Just add to play queue, do not save"));
saveCombo->addItem(i18n("Add to play queue, and save to favorites"));
saveCombo->setCurrentIndex(0);
saveCombo->setEnabled(StreamsModel::self()->isFavoritesWritable());
layout->setWidget(row, QFormLayout::LabelRole, urlLabel);
layout->setWidget(row++, QFormLayout::FieldRole, urlEntry);
layout->setWidget(row++, QFormLayout::FieldRole, saveCombo);
connect(saveCombo, SIGNAL(activated(int)), SLOT(saveComboChanged()));
setWidgetVisiblity();
}
layout->setWidget(row, QFormLayout::LabelRole, nameLabel);
layout->setWidget(row++, QFormLayout::FieldRole, nameEntry);
if (!addToPlayQueue) {
layout->setWidget(row, QFormLayout::LabelRole, urlLabel);
layout->setWidget(row++, QFormLayout::FieldRole, urlEntry);
}
layout->setWidget(row++, QFormLayout::SpanningRole, statusText);
setCaption(i18n("Add Stream"));
@@ -97,11 +91,7 @@ StreamDialog::StreamDialog(QWidget *parent, bool addToPlayQueue)
enableButton(Ok, false);
connect(nameEntry, SIGNAL(textChanged(const QString &)), SLOT(changed()));
connect(urlEntry, SIGNAL(textChanged(const QString &)), SLOT(changed()));
if (addToPlayQueue) {
urlEntry->setFocus();
} else {
nameEntry->setFocus();
}
urlEntry->setFocus();
resize(400, 100);
}