]> git.sesse.net Git - vlc/blob - plugins/kde/kde_net.cpp
* ./BUGS: added a list of known bugs. Please add your findings!
[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,
25                          QString::null, Ok|Cancel, Ok, true )
26 {
27     QVBox *pageVBox = makeVBoxMainWidget();
28
29     QHBox *layout = new QHBox( pageVBox );
30     layout->setSpacing( 5 );
31     fButtonGroup = new QVButtonGroup( "Protocol", layout );
32     fTSButton = new QRadioButton( "TS", fButtonGroup);
33     fTSButton->setChecked( true );
34     fRTPButton = new QRadioButton( "RTP", fButtonGroup);
35     fRTPButton->setEnabled( false );
36     fHTTPButton = new QRadioButton( "HTTP", fButtonGroup);
37     fHTTPButton->setEnabled( false );
38
39     QVGroupBox *serverVBox = new QVGroupBox( "Starting position", layout );
40
41     QHBox *titleHBox = new QHBox( serverVBox );
42     QLabel *titleLabel = new QLabel( "Address ", titleHBox );
43     fAddress = new KLineEdit( "vls", titleHBox );
44     QHBox *portHBox = new QHBox( serverVBox );
45     QLabel *portLabel = new QLabel( "Port ", portHBox );
46     fPort = new QSpinBox( 0, 65535, 1, portHBox );
47 }
48
49 KNetDialog::~KNetDialog()
50 {
51 }
52
53 QString KNetDialog::protocol() const
54 {
55     if ( fTSButton->isChecked() )
56     {
57         return ( QString( "ts" ) );
58     }
59     else if ( fRTPButton->isChecked() )
60     {
61         return ( QString( "rtp" ) );
62     }
63     else
64     {
65         return ( QString( "http" ) );
66     }
67 }
68
69 QString KNetDialog::server() const
70 {
71     return ( fAddress->text() );
72 }
73
74 int KNetDialog::port() const
75 {
76     return ( fPort->value() );
77 }