]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/sout/sout_widgets.cpp
Qt: Sout/Convert, display the input MRL.
[vlc] / modules / gui / qt4 / components / sout / sout_widgets.cpp
1 /*****************************************************************************
2  * profile_selector.cpp : A small profile selector and editor
3  ****************************************************************************
4  * Copyright (C) 2009 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #include "components/sout/sout_widgets.hpp"
25
26 #include <QGroupBox>
27 #include <QGridLayout>
28 #include <QLabel>
29 #include <QLineEdit>
30
31 SoutInputBox::SoutInputBox( QWidget *_parent, QString mrl ) : QGroupBox( _parent )
32 {
33     /**
34      * Source Block
35      **/
36     setTitle( qtr( "Source" ) );
37     QGridLayout *sourceLayout = new QGridLayout( this );
38
39     QLabel *sourceLabel = new QLabel( qtr( "Source:" ) );
40     sourceLayout->addWidget( sourceLabel, 0, 0 );
41
42     sourceLine = new QLineEdit;
43     sourceLine->setReadOnly( true );
44     sourceLine->setText( mrl );
45     sourceLabel->setBuddy( sourceLine );
46     sourceLayout->addWidget( sourceLine, 0, 1 );
47
48     QLabel *sourceTypeLabel = new QLabel( qtr( "Type:" ) );
49     sourceLayout->addWidget( sourceTypeLabel, 1, 0 );
50     sourceValueLabel = new QLabel;
51     sourceLayout->addWidget( sourceValueLabel, 1, 1 );
52
53     /* Line */
54     QFrame *line = new QFrame;
55     line->setFrameStyle( QFrame::HLine |QFrame::Sunken );
56     sourceLayout->addWidget( line, 2, 0, 1, -1 );
57 }
58
59 void SoutInputBox::setMRL( QString mrl )
60 {
61     sourceLine->setText( mrl );
62     QString type;
63     int i = mrl.indexOf( "://" );
64     if( i != -1 )
65     {
66         printf( "%i\n", i );
67         type = mrl.left( i );
68     }
69     else
70         type = qtr( "File/Directory" );
71     sourceValueLabel->setText( type );
72 }