Ignore:
Timestamp:
Mar 15, 2012, 5:14:10 PM (13 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer 0.7.1: vendor update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • smplayer/vendor/current/src/inputurl.cpp

    r118 r121  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2011 Ricardo Villalba <rvm@escomposlinux.org>
     2    Copyright (C) 2006-2012 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    1919#include "inputurl.h"
    2020#include "images.h"
     21#include "mylineedit.h"
    2122
    2223InputURL::InputURL( QWidget* parent, Qt::WindowFlags f )
     
    2526        setupUi(this);
    2627
    27         url_icon->setPixmap( Images::icon("url_big") );
     28        setMinimumSize( QSize(500,140) );
     29        setMaximumSize( QSize(600,170) );
     30        //layout()->setSizeConstraint(QLayout::SetFixedSize);
     31
     32        url_icon->setPixmap( Images::icon("url_big", 48) );
    2833        url_edit->setFocus();
    2934
    30         playlist_check->setWhatsThis(
    31                 tr("If this option is checked, the URL will be treated as a playlist: "
    32         "it will be opened as text and will play the URLs in it.") );
    33 
    34         connect(url_edit, SIGNAL(editTextChanged(const QString &)), this, SLOT(textChanged(const QString &)));
    35         connect(url_edit, SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int)));
    36         connect(playlist_check, SIGNAL(stateChanged(int)), this, SLOT(playlistChanged(int)));
     35        MyLineEdit * edit = new MyLineEdit(this);
     36        url_edit->setLineEdit(edit);
    3737}
    3838
     
    4040}
    4141
    42 void InputURL::setURL(QString url, bool is_playlist) {
    43         url_edit->addItem(url, is_playlist);
     42void InputURL::setURL(QString url) {
     43        url_edit->addItem(url);
    4444}
    4545
     
    4848}
    4949
    50 void InputURL::setPlaylist(bool b) {
    51         playlist_check->setChecked(b);
    52         /*
    53         int pos = url_edit->currentIndex();
    54         url_edit->setItemData(pos, b);
    55         */
    56 }
    57 
    58 bool InputURL::isPlaylist() {
    59         return playlist_check->isChecked();
    60 }
    61 
    62 void InputURL::indexChanged(int) {
    63         qDebug("InputURL::indexChanged");
    64         int pos = url_edit->currentIndex();
    65         if (url_edit->itemText(pos) == url_edit->currentText()) {
    66                 playlist_check->setChecked( url_edit->itemData(pos).toBool() );
    67         }
    68 }
    69 
    70 void InputURL::textChanged(const QString & new_text) {
    71         qDebug("InputURL::textChanged");
    72         QString s = new_text.trimmed();
    73         /*
    74         if (s != new_text) {
    75                 url_edit->setEditText(s);
    76                 return;
    77         }
    78         */
    79         QRegExp rx("\\.ram$|\\.asx$|\\.m3u$|\\.pls$", Qt::CaseInsensitive);
    80         setPlaylist( (rx.indexIn(s) != -1) );
    81 }
    82 
    83 void InputURL::playlistChanged(int state) {
    84         /*
    85         int pos = url_edit->currentIndex();
    86         if (url_edit->itemText(pos) == url_edit->currentText()) {
    87                 bool is_playlist = (state == Qt::Checked);
    88                 url_edit->setItemIcon( pos, is_playlist ? Images::icon("playlist") : QIcon() );
    89         }
    90         */
    91 }
    92 
    9350#include "moc_inputurl.cpp"
Note: See TracChangeset for help on using the changeset viewer.