]> git.sesse.net Git - vlc/blob - plugins/kde/kde_net.cpp
d348ac6193b61c7d7e4c7d63392f2179681c2a02
[vlc] / plugins / kde / kde_net.cpp
1 /***************************************************************************
2                           kde_net.cpp  -  description
3                              -------------------
4     begin                : Mon Apr 9 2001
5     copyright            : (C) 2001 by andres
6     email                : dae@chez.com
7  ***************************************************************************/
8
9 #include "kde_net.h"
10
11 #include <kdialogbase.h>
12 #include <klineedit.h>
13 #include <qhbox.h>
14 #include <qlabel.h>
15 #include <qradiobutton.h>
16 #include <qspinbox.h>
17 #include <qstring.h>
18 #include <qvbox.h>
19 #include <qvbuttongroup.h>
20 #include <qvgroupbox.h>
21 #include <qwidget.h>
22
23 KNetDialog::KNetDialog( QWidget *parent, const char *name ) :
24                 KDialogBase( parent, name, true, QString::null, Ok|Cancel, Ok, true )
25 {
26         QVBox *pageVBox = makeVBoxMainWidget();
27
28         QHBox *layout = new QHBox( pageVBox );
29         layout->setSpacing( 5 );
30         fButtonGroup = new QVButtonGroup( "Protocol", layout );
31         fTSButton = new QRadioButton( "TS", fButtonGroup);
32         fTSButton->setChecked( true );
33         fRTPButton = new QRadioButton( "RTP", fButtonGroup);
34         fRTPButton->setEnabled( false );
35         fHTTPButton = new QRadioButton( "HTTP", fButtonGroup);
36         fHTTPButton->setEnabled( false );
37
38         QVGroupBox *serverVBox = new QVGroupBox( "Starting position", layout );
39
40         QHBox *titleHBox = new QHBox( serverVBox );
41         QLabel *titleLabel = new QLabel( "Address ", titleHBox );
42         fAddress = new KLineEdit( "vls", titleHBox );
43         QHBox *portHBox = new QHBox( serverVBox );
44         QLabel *portLabel = new QLabel( "Port ", portHBox );
45         fPort = new QSpinBox( 0, 65535, 1, portHBox );
46 }
47
48 KNetDialog::~KNetDialog()
49 {
50 }
51
52 QString KNetDialog::protocol() const
53 {
54         if ( fTSButton->isChecked() )
55         {
56                 return ( QString( "ts" ) );
57         }
58         else if ( fRTPButton->isChecked() )
59         {
60                 return ( QString( "rtp" ) );
61         }
62         else
63         {
64                 return ( QString( "http" ) );
65         }
66 }
67
68 QString KNetDialog::server() const
69 {
70         return ( fAddress->text() );
71 }
72
73 int KNetDialog::port() const
74 {
75         return ( fPort->value() );
76 }