~ubuntu-branches/ubuntu/karmic/kid3/karmic

« back to all changes in this revision

Viewing changes to kid3/freedbdialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Sarah Hobbs
  • Date: 2006-07-14 12:25:16 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060714122516-p2wk0iyzumu6jx42
Tags: 0.7-1ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
        vlayout->setMargin(6);
83
83
 
84
84
        QHBoxLayout *findLayout = new QHBoxLayout(vlayout);
85
 
        findLineEdit = new QLineEdit(this);
 
85
        findLineEdit = new QComboBox(this);
86
86
        findButton = new QPushButton(i18n("&Find"), this);
87
87
        QPushButton *closeButton = new QPushButton(i18n("&Close"), this);
88
88
        if (findLayout && findLineEdit && findButton) {
 
89
                findLineEdit->setEditable(true);
 
90
                findLineEdit->setAutoCompletion(true);
 
91
                findLineEdit->setDuplicatesEnabled(false);
 
92
#if QT_VERSION >= 0x030100
 
93
                findLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
 
94
#else
 
95
                findLineEdit->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
 
96
#endif
89
97
                findButton->setDefault(true);
90
98
                findLayout->addWidget(findLineEdit);
91
99
                findLayout->addWidget(findButton);
162
170
}
163
171
 
164
172
/**
 
173
 * Clear dialog data.
 
174
 */
 
175
void FreedbDialog::clear()
 
176
{
 
177
        albumListBox->clear();
 
178
}
 
179
 
 
180
/**
165
181
 * Get string with server and port.
166
182
 *
167
183
 * @return "servername:port".
270
286
}
271
287
 
272
288
/**
 
289
 * Set a find string from artist and album information.
 
290
 *
 
291
 * @param artist artist
 
292
 * @param album  album
 
293
 */
 
294
void FreedbDialog::setArtistAlbum(const QString& artist, const QString& album)
 
295
{
 
296
        QString findStr(artist);
 
297
        if (!findStr.isEmpty()) {
 
298
                findStr += ' ';
 
299
        }
 
300
        findStr += album;
 
301
        if (!findStr.isEmpty()) {
 
302
                findLineEdit->setCurrentText(findStr);
 
303
                QLineEdit* lineEdit = findLineEdit->lineEdit();
 
304
                if (lineEdit) {
 
305
                        lineEdit->selectAll();
 
306
                }
 
307
                findLineEdit->setFocus();
 
308
        }
 
309
}
 
310
 
 
311
/**
273
312
 * Find keyword in freedb.
274
313
 */
275
314
void FreedbDialog::slotFind()
276
315
{
277
316
        FreedbConfig cfg;
278
317
        getFreedbConfig(&cfg);
279
 
        client->find(&cfg, findLineEdit->text());
 
318
        client->find(&cfg, findLineEdit->currentText());
280
319
}
281
320
 
282
321
/**
321
360
                                searchStr.mid(catStart, catEnd - catStart),
322
361
                                searchStr.mid(idStart, idEnd - idStart));
323
362
                }
 
363
                albumListBox->setFocus();
324
364
}
325
365
 
326
366
/**