~ubuntu-branches/debian/experimental/smplayer/experimental

« back to all changes in this revision

Viewing changes to src/inputurl.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2009-01-03 17:08:06 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090103170806-eodntb2slv6g2pb6
Tags: 0.6.6-0ubuntu1
* The "just before FF" release.
* New upstream release.
* debian/control: Bumped Standards-Version to 3.8.0.
* debian/copyright: Changed (C) to © to fix Lintian warning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        : QDialog(parent, f)
24
24
{
25
25
        setupUi(this);
 
26
 
26
27
        url_icon->setPixmap( Images::icon("url_big") );
27
28
        url_edit->setFocus();
28
29
 
29
30
        playlist_check->setWhatsThis( 
30
31
                tr("If this option is checked, the URL will be treated as a playlist: "
31
32
        "it will be opened as text and will play the URLs in it.") );
 
33
 
 
34
        connect(url_edit, SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged()));
 
35
        connect(playlist_check, SIGNAL(stateChanged(int)), this, SLOT(playlistChanged(int)));
32
36
}
33
37
 
34
38
InputURL::~InputURL() {
35
39
}
36
40
 
37
 
void InputURL::setURL(QString url) {
38
 
        url_edit->setText(url);
39
 
        url_edit->selectAll();
 
41
void InputURL::setURL(QString url, bool is_playlist) {
 
42
        url_edit->addItem(url, is_playlist);
40
43
}
41
44
 
42
45
QString InputURL::url() {
43
 
        return url_edit->text();
 
46
        return url_edit->currentText();
44
47
}
45
48
 
46
49
void InputURL::setPlaylist(bool b) {
47
50
        playlist_check->setChecked(b);
 
51
        /*
 
52
        int pos = url_edit->currentIndex();
 
53
        url_edit->setItemData(pos, b);
 
54
        */
48
55
}
49
56
 
50
57
bool InputURL::isPlaylist() {
51
58
        return playlist_check->isChecked();
52
59
}
53
60
 
 
61
void InputURL::indexChanged(void) {
 
62
        int pos = url_edit->currentIndex();
 
63
        if (url_edit->itemText(pos) == url_edit->currentText()) {
 
64
                playlist_check->setChecked( url_edit->itemData(pos).toBool() );
 
65
        }
 
66
}
 
67
 
 
68
void InputURL::playlistChanged(int state) {
 
69
        /*
 
70
        int pos = url_edit->currentIndex();
 
71
        if (url_edit->itemText(pos) == url_edit->currentText()) {
 
72
                bool is_playlist = (state == Qt::Checked);
 
73
                url_edit->setItemIcon( pos, is_playlist ? Images::icon("playlist") : QIcon() );
 
74
        }
 
75
        */
 
76
}
 
77
 
54
78
#include "moc_inputurl.cpp"