ErrorsDialog::ErrorsDialog( intf_thread_t *_p_intf ) : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf ) { setWindowTitle( qtr( "Errors" ) ); setWindowRole( "vlc-errors" ); resize( 500 , 300 ); QGridLayout *layout = new QGridLayout( this ); QDialogButtonBox *buttonBox = new QDialogButtonBox( Qt::Horizontal, this ); QPushButton *clearButton = new QPushButton( qtr( "Cl&ear" ), this ); buttonBox->addButton( clearButton, QDialogButtonBox::ActionRole ); buttonBox->addButton( new QPushButton( qtr("&Close"), this ), QDialogButtonBox::RejectRole ); messages = new QTextEdit(); messages->setReadOnly( true ); messages->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); stopShowing = new QCheckBox( qtr( "Hide future errors" ) ); layout->addWidget( messages, 0, 0, 1, 3 ); layout->addWidget( stopShowing, 1, 0 ); layout->addWidget( buttonBox, 1, 2 ); CONNECT( buttonBox, rejected(), this, close() ); BUTTONACT( clearButton, clear() ); BUTTONACT( stopShowing, dontShow() ); }
VLCProfileSelector::VLCProfileSelector( QWidget *_parent ): QWidget( _parent ) { QHBoxLayout *layout = new QHBoxLayout( this ); QLabel *prLabel = new QLabel( qtr( "Profile"), this ); layout->addWidget( prLabel ); profileBox = new QComboBox( this ); layout->addWidget( profileBox ); QToolButton *editButton = new QToolButton( this ); editButton->setIcon( QIcon( ":/menu/preferences" ) ); editButton->setToolTip( qtr( "Edit selected profile" ) ); layout->addWidget( editButton ); QToolButton *deleteButton = new QToolButton( this ); deleteButton->setIcon( QIcon( ":/toolbar/clear" ) ); deleteButton->setToolTip( qtr( "Delete selected profile" ) ); layout->addWidget( deleteButton ); QToolButton *newButton = new QToolButton( this ); newButton->setIcon( QIcon( ":/new" ) ); newButton->setToolTip( qtr( "Create a new profile" ) ); layout->addWidget(newButton); BUTTONACT( newButton, newProfile() ); BUTTONACT( editButton, editProfile() ); BUTTONACT( deleteButton, deleteProfile() ); fillProfilesCombo(); CONNECT( profileBox, activated( int ), this, updateOptions( int ) ); updateOptions( 0 ); }
/**************** * VLMBroadcast ****************/ VLMBroadcast::VLMBroadcast( const QString& _name, const QString& _input, const QString& _inputOptions, const QString& _output, bool _enabled, bool _looped, VLMDialog *_parent ) : VLMAWidget( _name, _input, _inputOptions, _output, _enabled, _parent, QVLM_Broadcast ) { nameLabel->setText( qtr("Broadcast: ") + name ); type = QVLM_Broadcast; b_looped = _looped; playButton = new QToolButton; playButton->setIcon( QIcon( ":/menu/play" ) ); playButton->setToolTip( qtr("Play") ); objLayout->addWidget( playButton, 1, 0 ); b_playing = true; QToolButton *stopButton = new QToolButton; stopButton->setIcon( QIcon( ":/toolbar/stop_b" ) ); stopButton->setToolTip( qtr("Stop") ); objLayout->addWidget( stopButton, 1, 1 ); loopButton = new QToolButton; loopButton->setToolTip( qtr("Repeat") ); objLayout->addWidget( loopButton, 1, 2 ); BUTTONACT( playButton, togglePlayPause() ); BUTTONACT( stopButton, stop() ); BUTTONACT( loopButton, toggleLoop() ); update(); }
GotoTimeDialog::GotoTimeDialog( QWidget *parent, intf_thread_t *_p_intf) : QVLCDialog( parent, _p_intf ) { setWindowFlags( Qt::Tool ); setWindowTitle( qtr( "Go to Time" ) ); setWindowRole( "vlc-goto-time" ); QGridLayout *mainLayout = new QGridLayout( this ); mainLayout->setSizeConstraint( QLayout::SetFixedSize ); QPushButton *gotoButton = new QPushButton( qtr( "&Go" ) ); QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) ); QDialogButtonBox *buttonBox = new QDialogButtonBox; gotoButton->setDefault( true ); buttonBox->addButton( gotoButton, QDialogButtonBox::AcceptRole ); buttonBox->addButton( cancelButton, QDialogButtonBox::RejectRole ); QGroupBox *timeGroupBox = new QGroupBox; QGridLayout *boxLayout = new QGridLayout( timeGroupBox ); QLabel *timeIntro = new QLabel( qtr( "Go to time" ) + ":" ); timeIntro->setWordWrap( true ); timeIntro->setAlignment( Qt::AlignCenter ); timeEdit = new QTimeEdit(); timeEdit->setDisplayFormat( "hh : mm : ss" ); timeEdit->setAlignment( Qt::AlignRight ); timeEdit->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ); QLabel *helpFormat = new QLabel( timeEdit->displayFormat() ); helpFormat->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ); QSpacerItem *spacerBox = new QSpacerItem( 20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed ); QSpacerItem *spacerItem = new QSpacerItem( 20, 3, QSizePolicy::Minimum, QSizePolicy::Expanding ); boxLayout->addWidget( timeIntro, 0, 0, 1, 2 ); boxLayout->addItem( spacerBox, 1, 0, 1, 2 ); boxLayout->addWidget( timeEdit, 2, 0, 1, 1 ); boxLayout->addWidget( helpFormat, 2, 1, 1, 1 ); mainLayout->addWidget( timeGroupBox, 0, 0, 1, 4 ); mainLayout->addItem( spacerItem, 1, 0 ); mainLayout->addWidget( buttonBox, 2, 3 ); BUTTONACT( gotoButton, close() ); BUTTONACT( cancelButton, cancel() ); }
/************************************************************************** * Open Files and subtitles * **************************************************************************/ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : OpenPanel( _parent, _p_intf ), dialogBox( NULL ) { /* Classic UI Setup */ ui.setupUi( this ); /* Set Filters for file selection */ /* QString fileTypes = ""; ADD_FILTER_MEDIA( fileTypes ); ADD_FILTER_VIDEO( fileTypes ); ADD_FILTER_AUDIO( fileTypes ); ADD_FILTER_PLAYLIST( fileTypes ); ADD_FILTER_ALL( fileTypes ); fileTypes.replace( QString(";*"), QString(" *")); */ /* lineFileEdit = ui.fileEdit; //TODO later: fill the fileCompleteList with previous items played. QCompleter *fileCompleter = new QCompleter( fileCompleteList, this ); fileCompleter->setModel( new QDirModel( fileCompleter ) ); lineFileEdit->setCompleter( fileCompleter );*/ if( config_GetInt( p_intf, "qt-embedded-open" ) ) { ui.tempWidget->hide(); BuildOldPanel(); } /* Subtitles */ /* Deactivate the subtitles control by default. */ ui.subFrame->setEnabled( false ); /* Build the subs size combo box */ setfillVLCConfigCombo( "freetype-rel-fontsize" , p_intf, ui.sizeSubComboBox ); /* Build the subs align combo box */ setfillVLCConfigCombo( "subsdec-align", p_intf, ui.alignSubComboBox ); /* Connects */ BUTTONACT( ui.fileBrowseButton, browseFile() ); BUTTONACT( ui.removeFileButton, removeFile() ); BUTTONACT( ui.subBrowseButton, browseFileSub() ); CONNECT( ui.subCheckBox, toggled( bool ), this, toggleSubtitleFrame( bool ) ); CONNECT( ui.fileListWidg, itemChanged( QListWidgetItem * ), this, updateMRL() ); CONNECT( ui.subInput, textChanged( const QString& ), this, updateMRL() ); CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, updateMRL() ); CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this, updateMRL() ); updateButtons(); }
UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) { setWindowTitle( qtr( "VLC media player updates" ) ); QGridLayout *layout = new QGridLayout( this ); QPushButton *closeButton = new QPushButton( qtr( "&Cancel" ) ); updateButton = new QPushButton( qtr( "&Recheck version" ) ); updateButton->setDefault( true ); QDialogButtonBox *buttonBox = new QDialogButtonBox( Qt::Horizontal ); buttonBox->addButton( updateButton, QDialogButtonBox::ActionRole ); buttonBox->addButton( closeButton, QDialogButtonBox::AcceptRole ); updateLabelTop = new QLabel( qtr( "Checking for an update..." ) ); updateLabelTop->setWordWrap( true ); updateLabelTop->setMargin( 8 ); updateLabelDown = new QLabel( qtr( "\nDo you want to download it?\n" ) ); updateLabelDown->setWordWrap( true ); updateLabelDown->hide(); updateText = new QTextEdit( this ); updateText->setAcceptRichText(false); updateText->setTextInteractionFlags( Qt::TextSelectableByKeyboard| Qt::TextSelectableByMouse); updateText->setEnabled( false ); layout->addWidget( updateLabelTop, 0, 0 ); layout->addWidget( updateText, 1, 0 ); layout->addWidget( updateLabelDown, 2, 0 ); layout->addWidget( buttonBox, 3, 0 ); BUTTONACT( updateButton, UpdateOrDownload() ); BUTTONACT( closeButton, close() ); /* Create the update structure */ p_update = update_New( p_intf ); b_checked = false; setMinimumSize( 300, 300 ); setMaximumSize( 400, 300 ); readSettings( "Update", QSize( 300, 250 ) ); /* Check for updates */ UpdateOrDownload(); }
UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) { /* build Ui */ ui.setupUi( this ); ui.updateDialogButtonBox->addButton( new QPushButton( qtr("&Close"), this ), QDialogButtonBox::RejectRole ); QPushButton *recheckButton = new QPushButton( qtr("&Recheck version"), this ); ui.updateDialogButtonBox->addButton( recheckButton, QDialogButtonBox::ActionRole ); ui.updateNotifyButtonBox->addButton( new QPushButton( qtr("&Yes"), this ), QDialogButtonBox::AcceptRole ); ui.updateNotifyButtonBox->addButton( new QPushButton( qtr("&No"), this ), QDialogButtonBox::RejectRole ); setWindowTitle( qtr( "VLC media player updates" ) ); setWindowRole( "vlc-update" ); BUTTONACT( recheckButton, UpdateOrDownload() ); CONNECT( ui.updateDialogButtonBox, rejected(), this, close() ); CONNECT( ui.updateNotifyButtonBox, accepted(), this, UpdateOrDownload() ); CONNECT( ui.updateNotifyButtonBox, rejected(), this, close() ); /* Create the update structure */ p_update = update_New( p_intf ); b_checked = false; setMinimumSize( 300, 300 ); setMaximumSize( 400, 300 ); restoreWidgetPosition( "Update", QSize( 300, 250 ) ); /* Check for updates */ UpdateOrDownload(); }
/*********** File **************/ FileConfigControl::FileConfigControl( vlc_object_t *_p_this, module_config_t *_p_item, QWidget *_parent, QGridLayout *l, int &line ) : VStringConfigControl( _p_this, _p_item, _parent ) { label = new QLabel( qtr(p_item->psz_text) ); text = new QLineEdit( qfu(p_item->value.psz) ); browse = new QPushButton( qtr( "Browse..." ) ); QHBoxLayout *textAndButton = new QHBoxLayout(); textAndButton->setMargin( 0 ); textAndButton->addWidget( text, 2 ); textAndButton->addWidget( browse, 0 ); BUTTONACT( browse, updateField() ); finish(); if( !l ) { QHBoxLayout *layout = new QHBoxLayout(); layout->addWidget( label, 0 ); layout->insertSpacing( 1, 10 ); layout->addLayout( textAndButton, LAST_COLUMN ); widget->setLayout( layout ); } else { l->addWidget( label, line, 0 ); l->setColumnMinimumWidth( 1, 10 ); l->addLayout( textAndButton, line, LAST_COLUMN ); } }
/* FileDest Box */ FileDestBox::FileDestBox( QWidget *_parent, intf_thread_t * _p_intf ) : VirtualDestBox( _parent ) { p_intf = _p_intf; QPushButton *fileSelectButton; QGridLayout *layout = new QGridLayout( this ); QLabel *fileOutput = new QLabel( qtr( "This module writes the transcoded stream to a file."), this ); layout->addWidget(fileOutput, 0, 0, 1, -1); QLabel *fileLabel = new QLabel( qtr( "Filename"), this ); layout->addWidget(fileLabel, 1, 0, 1, 1); fileEdit = new QLineEdit(this); layout->addWidget(fileEdit, 1, 4, 1, 1); fileSelectButton = new QPushButton( qtr( "Browse..." ), this ); QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); fileSelectButton->setSizePolicy(sizePolicy); layout->addWidget(fileSelectButton, 1, 5, 1, 1); CT( fileEdit ); BUTTONACT( fileSelectButton, fileBrowse() ); }
SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& inputMRL ) : QWizard( parent ) { p_intf = _p_intf; setWindowTitle( qtr( "Stream Output" ) ); setWindowRole( "vlc-stream-output" ); /* UI stuff */ ui.setupUi( this ); ui.inputBox->setMRL( inputMRL ); ui.helpEdit->setPlainText( qtr("This wizard will allow you to stream or " "convert your media for use locally, on your private network, " "or on the Internet.\n" "You should start by checking that source matches what you want " "your input to be and then press the \"Next\" " "button to continue.\n") ); ui.mrlEdit->setToolTip ( qtr( "Stream output string.\n" "This is automatically generated " "when you change the above settings,\n" "but you can change it manually." ) ) ; ui.destTab->setTabsClosable( true ); QTabBar* tb = ui.destTab->findChild<QTabBar*>(); if( tb != NULL ) tb->tabButton(0, QTabBar::RightSide)->hide(); CONNECT( ui.destTab, tabCloseRequested( int ), this, closeTab( int ) ); ui.destTab->setTabIcon( 0, QIcon( ":/buttons/playlist/playlist_add" ) ); ui.destBox->addItem( qtr( "File" ) ); ui.destBox->addItem( "HTTP" ); ui.destBox->addItem( "MS-WMSP (MMSH)" ); ui.destBox->addItem( "RTSP" ); ui.destBox->addItem( "RTP / MPEG Transport Stream" ); ui.destBox->addItem( "RTP Audio/Video Profile" ); ui.destBox->addItem( "UDP (legacy)" ); ui.destBox->addItem( "IceCast" ); BUTTONACT( ui.addButton, addDest() ); // /* Connect everything to the updateMRL function */ #define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() ); #define CT( x ) CONNECT( ui.x, textChanged( const QString& ), this, updateMRL() ); #define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() ); #define CC( x ) CONNECT( ui.x, currentIndexChanged( int ), this, updateMRL() ); /* Misc */ CB( soutAll ); CB( localOutput ); CB( transcodeBox ); CONNECT( ui.profileSelect, optionsChanged(), this, updateMRL() ); setButtonText( QWizard::FinishButton, "Stream" ); #undef CC #undef CS #undef CT #undef CB }
EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) { setWindowTitle( qtr( "Program Guide" ) ); QVBoxLayout *layout = new QVBoxLayout( this ); layout->setMargin( 0 ); epg = new EPGWidget( this ); QGroupBox *descBox = new QGroupBox( qtr( "Description" ), this ); QVBoxLayout *boxLayout = new QVBoxLayout( descBox ); description = new QTextEdit( this ); description->setReadOnly( true ); description->setFrameStyle( QFrame::Sunken | QFrame::StyledPanel ); description->setAutoFillBackground( true ); description->setAlignment( Qt::AlignLeft | Qt::AlignTop ); description->setFixedHeight( 100 ); QPalette palette; palette.setBrush(QPalette::Active, QPalette::Window, palette.brush( QPalette::Base ) ); description->setPalette( palette ); title = new QLabel( qtr( "Title" ), this ); title->setWordWrap( true ); boxLayout->addWidget( title ); boxLayout->addWidget( description ); layout->addWidget( epg, 10 ); layout->addWidget( descBox ); CONNECT( epg, itemSelectionChanged( EPGItem *), this, displayEvent( EPGItem *) ); CONNECT( epg, programActivated(int), THEMIM->getIM(), changeProgram(int) ); CONNECT( THEMIM->getIM(), epgChanged(), this, scheduleUpdate() ); CONNECT( THEMIM, inputChanged( bool ), this, inputChanged() ); QDialogButtonBox *buttonsBox = new QDialogButtonBox( this ); #if 0 QPushButton *update = new QPushButton( qtr( "Update" ) ); // Temporary to test buttonsBox->addButton( update, QDialogButtonBox::ActionRole ); BUTTONACT( update, updateInfos() ); #endif buttonsBox->addButton( new QPushButton( qtr( "&Close" ) ), QDialogButtonBox::RejectRole ); boxLayout->addWidget( buttonsBox ); CONNECT( buttonsBox, rejected(), this, close() ); timer = new QTimer( this ); timer->setSingleShot( true ); timer->setInterval( 5000 ); CONNECT( timer, timeout(), this, timeout() ); updateInfos(); restoreWidgetPosition( "EPGDialog", QSize( 650, 450 ) ); }
/************************************************************************** * Open Files and subtitles * **************************************************************************/ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : OpenPanel( _parent, _p_intf ), dialogBox( NULL ) { /* Classic UI Setup */ ui.setupUi( this ); setAcceptDrops( true ); /* Set Filters for file selection */ /* QString fileTypes = ""; ADD_FILTER_MEDIA( fileTypes ); ADD_FILTER_VIDEO( fileTypes ); ADD_FILTER_AUDIO( fileTypes ); ADD_FILTER_PLAYLIST( fileTypes ); ADD_FILTER_ALL( fileTypes ); fileTypes.replace( QString(";*"), QString(" *")); */ /* lineFileEdit = ui.fileEdit; //TODO later: fill the fileCompleteList with previous items played. QCompleter *fileCompleter = new QCompleter( fileCompleteList, this ); fileCompleter->setModel( new QDirModel( fileCompleter ) ); lineFileEdit->setCompleter( fileCompleter );*/ if( var_InheritBool( p_intf, "qt-embedded-open" ) ) { ui.tempWidget->hide(); BuildOldPanel(); } /* Subtitles */ /* Deactivate the subtitles control by default. */ ui.subGroupBox->setEnabled( false ); /* Connects */ BUTTONACT( ui.fileBrowseButton, browseFile() ); BUTTONACT( ui.removeFileButton, removeFile() ); BUTTONACT( ui.subBrowseButton, browseFileSub() ); CONNECT( ui.subGroupBox, toggled( bool ), this, updateMRL() ); CONNECT( ui.fileListWidg, itemChanged( QListWidgetItem * ), this, updateMRL() ); CONNECT( ui.subInput, textChanged( const QString& ), this, updateMRL() ); updateButtons(); }
GotoTimeDialog::GotoTimeDialog( intf_thread_t *_p_intf) : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf ) { setWindowFlags( Qt::Tool ); setWindowTitle( qtr( "Go to Time" ) ); setWindowRole( "vlc-goto-time" ); QGridLayout *mainLayout = new QGridLayout( this ); mainLayout->setSizeConstraint( QLayout::SetFixedSize ); QPushButton *gotoButton = new QPushButton( qtr( "&Go" ) ); QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) ); QDialogButtonBox *buttonBox = new QDialogButtonBox; gotoButton->setDefault( true ); buttonBox->addButton( gotoButton, QDialogButtonBox::AcceptRole ); buttonBox->addButton( cancelButton, QDialogButtonBox::RejectRole ); QLabel *timeIntro = new QLabel( qtr( "Go to time" ) + ":" ); timeIntro->setWordWrap( true ); timeIntro->setAlignment( Qt::AlignCenter ); timeEdit = new QTimeEdit(); timeEdit->setDisplayFormat( "HH'H':mm'm':ss's'" ); timeEdit->setAlignment( Qt::AlignRight ); timeEdit->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ); QPushButton *resetButton = new QPushButton( QIcon(":/update.svg"), "" ); resetButton->setToolTip( qtr("Reset") ); mainLayout->addWidget( timeIntro, 0, 0, 1, 1 ); mainLayout->addWidget( timeEdit, 0, 1, 1, 1 ); mainLayout->addWidget( resetButton, 0, 2, 1, 1 ); mainLayout->addWidget( buttonBox, 1, 0, 1, 3 ); BUTTONACT( gotoButton, close() ); BUTTONACT( cancelButton, cancel() ); BUTTONACT( resetButton, reset() ); QVLCTools::restoreWidgetPosition( p_intf, "gototimedialog", this ); }
/*********** File **************/ FileConfigControl::FileConfigControl( vlc_object_t *_p_this, module_config_t *_p_item, QWidget *p ) : VStringConfigControl( _p_this, _p_item ) { label = new QLabel( qtr(p_item->psz_text), p ); text = new QLineEdit( qfu(p_item->value.psz), p ); browse = new QPushButton( qtr( "Browse..." ), p ); BUTTONACT( browse, updateField() ); finish(); }
VLMAWidget::VLMAWidget( const QString& _name, const QString& _input, const QString& _inputOptions, const QString& _output, bool _enabled, VLMDialog *_parent, int _type ) : QGroupBox( _name, _parent ) { parent = _parent; name = _name; input = _input; inputOptions = _inputOptions; output = _output; b_enabled = _enabled; type = _type; setCheckable( true ); setChecked( b_enabled ); objLayout = new QGridLayout( this ); setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ); nameLabel = new QLabel; objLayout->addWidget( nameLabel, 0, 0, 1, 4 ); /*QLabel *time = new QLabel( "--:--/--:--" ); objLayout->addWidget( time, 1, 3, 1, 2 );*/ QToolButton *modifyButton = new QToolButton; modifyButton->setIcon( QIcon( ":/menu/settings" ) ); modifyButton->setToolTip( qtr("Change") ); objLayout->addWidget( modifyButton, 0, 5 ); QToolButton *deleteButton = new QToolButton; deleteButton->setIcon( QIcon( ":/menu/quit" ) ); deleteButton->setToolTip("Delete"); objLayout->addWidget( deleteButton, 0, 6 ); BUTTONACT( modifyButton, modify() ); BUTTONACT( deleteButton, del() ); CONNECT( this, clicked( bool ), this, toggleEnabled( bool ) ); }
/********************************************************************** * Visualization selector panel **********************************************************************/ VisualSelector::VisualSelector( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i ) { QHBoxLayout *layout = new QHBoxLayout( this ); layout->setMargin( 0 ); QPushButton *prevButton = new QPushButton( "Prev" ); QPushButton *nextButton = new QPushButton( "Next" ); layout->addWidget( prevButton ); layout->addWidget( nextButton ); layout->addStretch( 10 ); layout->addWidget( new QLabel( qtr( "Current visualization" ) ) ); current = new QLabel( qtr( "None" ) ); layout->addWidget( current ); BUTTONACT( prevButton, prev() ); BUTTONACT( nextButton, next() ); setLayout( layout ); setMaximumHeight( 35 ); }
PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) { setAttribute( Qt::WA_DeleteOnClose ); setWindowTitle( qtr( "Plugins and extensions" ) ); QGridLayout *layout = new QGridLayout( this ); /* Main Tree for modules */ treePlugins = new QTreeWidget; layout->addWidget( treePlugins, 0, 0, 1, -1 ); /* Users cannot move the columns around but we need to sort */ treePlugins->header()->setMovable( false ); treePlugins->header()->setSortIndicatorShown( true ); // treePlugins->header()->setResizeMode( QHeaderView::ResizeToContents ); treePlugins->setAlternatingRowColors( true ); treePlugins->setColumnWidth( 0, 200 ); QStringList headerNames; headerNames << qtr("Name") << qtr("Capability" ) << qtr( "Score" ); treePlugins->setHeaderLabels( headerNames ); FillTree(); /* Set capability column to the correct Size*/ treePlugins->resizeColumnToContents( 1 ); treePlugins->header()->restoreState( getSettings()->value( "Plugins/Header-State" ).toByteArray() ); treePlugins->setSortingEnabled( true ); treePlugins->sortByColumn( 1, Qt::AscendingOrder ); QLabel *label = new QLabel( qtr("&Search:"), this ); edit = new SearchLineEdit( this ); label->setBuddy( edit ); layout->addWidget( label, 1, 0 ); layout->addWidget( edit, 1, 1, 1, -1 ); CONNECT( edit, textChanged( const QString& ), this, search( const QString& ) ); QDialogButtonBox *box = new QDialogButtonBox; QPushButton *okButton = new QPushButton( qtr( "&Close" ), this ); box->addButton( okButton, QDialogButtonBox::AcceptRole ); layout->addWidget( box, 2, 2 ); BUTTONACT( okButton, close() ); setMinimumSize( 500, 300 ); readSettings( "Plugins", QSize( 540, 400 ) ); }
FileConfigControl::FileConfigControl( vlc_object_t *_p_this, module_config_t *_p_item, QLabel *_label, QLineEdit *_text, QPushButton *_button ): VStringConfigControl( _p_this, _p_item ) { browse = _button; text = _text; label = _label; BUTTONACT( browse, updateField() ); finish( ); }
HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) { setWindowTitle( qtr( "Help" ) ); setMinimumSize( 350, 300 ); QGridLayout *layout = new QGridLayout( this ); QTextBrowser *helpBrowser = new QTextBrowser( this ); helpBrowser->setOpenExternalLinks( true ); helpBrowser->setHtml( qtr(I_LONGHELP) ); QPushButton *closeButton = new QPushButton( qtr( "&Close" ) ); closeButton->setDefault( true ); layout->addWidget( helpBrowser, 0, 0, 1, 0 ); layout->addWidget( closeButton, 1, 3 ); BUTTONACT( closeButton, close() ); readSettings( "Help", QSize( 500, 450 ) ); }
OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool b_selectMode, int _action_flag, bool _b_pl) : QVLCDialog( parent, _p_intf ) { i_action_flag = _action_flag; b_pl =_b_pl; if( b_selectMode ) /* Select mode */ i_action_flag = SELECT; /* Basic Creation of the Window */ ui.setupUi( this ); setWindowTitle( qtr( "Open Media" ) ); setWindowRole( "vlc-open-media" ); setWindowModality( Qt::WindowModal ); /* Tab definition and creation */ fileOpenPanel = new FileOpenPanel( this, p_intf ); discOpenPanel = new DiscOpenPanel( this, p_intf ); netOpenPanel = new NetOpenPanel( this, p_intf ); captureOpenPanel = new CaptureOpenPanel( this, p_intf ); /* Insert the tabs */ ui.Tab->insertTab( OPEN_FILE_TAB, fileOpenPanel, QIcon( ":/type/file-asym" ), qtr( "&File" ) ); ui.Tab->insertTab( OPEN_DISC_TAB, discOpenPanel, QIcon( ":/type/disc" ), qtr( "&Disc" ) ); ui.Tab->insertTab( OPEN_NETWORK_TAB, netOpenPanel, QIcon( ":/type/network" ), qtr( "&Network" ) ); ui.Tab->insertTab( OPEN_CAPTURE_TAB, captureOpenPanel, QIcon( ":/type/capture-card" ), qtr( "Capture &Device" ) ); /* Hide the Slave input widgets */ ui.slaveLabel->hide(); ui.slaveText->hide(); ui.slaveBrowseButton->hide(); /* Buttons Creation */ /* Play Button */ playButton = ui.playButton; /* Cancel Button */ cancelButton = new QPushButton( qtr( "&Cancel" ) ); /* Select Button */ selectButton = new QPushButton( qtr( "&Select" ) ); /* Menu for the Play button */ QMenu * openButtonMenu = new QMenu( "Open" ); openButtonMenu->addAction( qtr( "&Enqueue" ), this, SLOT( enqueue() ), QKeySequence( "Alt+E" ) ); openButtonMenu->addAction( qtr( "&Play" ), this, SLOT( play() ), QKeySequence( "Alt+P" ) ); openButtonMenu->addAction( qtr( "&Stream" ), this, SLOT( stream() ) , QKeySequence( "Alt+S" ) ); openButtonMenu->addAction( qtr( "C&onvert" ), this, SLOT( transcode() ) , QKeySequence( "Alt+O" ) ); playButton->setMenu( openButtonMenu ); /* Add the three Buttons */ ui.buttonsBox->addButton( selectButton, QDialogButtonBox::AcceptRole ); ui.buttonsBox->addButton( cancelButton, QDialogButtonBox::RejectRole ); /* At creation time, modify the default buttons */ setMenuAction(); /* Force MRL update on tab change */ CONNECT( ui.Tab, currentChanged( int ), this, signalCurrent( int ) ); CONNECT( fileOpenPanel, mrlUpdated( const QStringList&, const QString& ), this, updateMRL( const QStringList&, const QString& ) ); CONNECT( netOpenPanel, mrlUpdated( const QStringList&, const QString& ), this, updateMRL( const QStringList&, const QString& ) ); CONNECT( discOpenPanel, mrlUpdated( const QStringList&, const QString& ), this, updateMRL( const QStringList&, const QString& ) ); CONNECT( captureOpenPanel, mrlUpdated( const QStringList&, const QString& ), this, updateMRL( const QStringList&, const QString& ) ); CONNECT( fileOpenPanel, methodChanged( const QString& ), this, newCachingMethod( const QString& ) ); CONNECT( netOpenPanel, methodChanged( const QString& ), this, newCachingMethod( const QString& ) ); CONNECT( discOpenPanel, methodChanged( const QString& ), this, newCachingMethod( const QString& ) ); CONNECT( captureOpenPanel, methodChanged( const QString& ), this, newCachingMethod( const QString& ) ); /* Advanced frame Connects */ CONNECT( ui.slaveCheckbox, toggled( bool ), this, updateMRL() ); CONNECT( ui.slaveText, textChanged( const QString& ), this, updateMRL() ); CONNECT( ui.cacheSpinBox, valueChanged( int ), this, updateMRL() ); CONNECT( ui.startTimeTimeEdit, timeChanged ( const QTime& ), this, updateMRL() ); BUTTONACT( ui.advancedCheckBox, toggleAdvancedPanel() ); BUTTONACT( ui.slaveBrowseButton, browseInputSlave() ); /* Buttons action */ BUTTONACT( playButton, selectSlots() ); BUTTONACT( selectButton, close() ); BUTTONACT( cancelButton, cancel() ); /* Hide the advancedPanel */ if( !getSettings()->value( "OpenDialog/advanced", false ).toBool()) { ui.advancedFrame->hide(); ui.advancedFrame->setEnabled( false ); } else ui.advancedCheckBox->setChecked( true ); /* Initialize caching */ storedMethod = ""; newCachingMethod( "file-caching" ); /* enforce section due to .ui bug */ ui.startTimeTimeEdit->setCurrentSection( QDateTimeEdit::SecondSection ); setMinimumSize( sizeHint() ); setMaximumWidth( 900 ); resize( getSettings()->value( "OpenDialog/size", QSize( 500, 400 ) ).toSize() ); }
ToolbarEditDialog::ToolbarEditDialog( QWidget *_w, intf_thread_t *_p_intf) : QVLCDialog( _w, _p_intf ) { setWindowTitle( qtr( "Toolbars Editor" ) ); setWindowRole( "vlc-toolbars-editor" ); QGridLayout *mainLayout = new QGridLayout( this ); setMinimumWidth( 600 ); setAttribute( Qt::WA_DeleteOnClose ); /* main GroupBox */ QGroupBox *widgetBox = new QGroupBox( qtr( "Toolbar Elements") , this ); widgetBox->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::MinimumExpanding ); QGridLayout *boxLayout = new QGridLayout( widgetBox ); flatBox = new QCheckBox( qtr( "Flat Button" ) ); flatBox->setToolTip( qtr( "Next widget style" ) ); bigBox = new QCheckBox( qtr( "Big Button" ) ); bigBox->setToolTip( flatBox->toolTip() ); shinyBox = new QCheckBox( qtr( "Native Slider" ) ); shinyBox->setToolTip( flatBox->toolTip() ); boxLayout->addWidget( new WidgetListing( p_intf, this ), 1, 0, 1, -1 ); boxLayout->addWidget( flatBox, 0, 0 ); boxLayout->addWidget( bigBox, 0, 1 ); boxLayout->addWidget( shinyBox, 0, 2 ); mainLayout->addWidget( widgetBox, 5, 0, 3, 6 ); QTabWidget *tabWidget = new QTabWidget(); mainLayout->addWidget( tabWidget, 1, 0, 4, 9 ); /* Main ToolBar */ QWidget *mainToolbarBox = new QWidget(); tabWidget->addTab( mainToolbarBox, qtr( "Main Toolbar" ) ); QFormLayout *mainTboxLayout = new QFormLayout( mainToolbarBox ); positionCheckbox = new QCheckBox( qtr( "Above the Video" ) ); positionCheckbox->setChecked( getSettings()->value( "MainWindow/ToolbarPos", false ).toBool() ); mainTboxLayout->addRow( new QLabel( qtr( "Toolbar position:" ) ), positionCheckbox ); QString line1 = getSettings()->value( "MainWindow/MainToolbar1", MAIN_TB1_DEFAULT ).toString(); controller1 = new DroppingController( p_intf, line1, this ); mainTboxLayout->addRow( new QLabel( qtr("Line 1:") ), controller1 ); QString line2 = getSettings()->value( "MainWindow/MainToolbar2", MAIN_TB2_DEFAULT ).toString(); controller2 = new DroppingController( p_intf, line2, this ); mainTboxLayout->addRow( new QLabel( qtr("Line 2:") ), controller2 ); /* TimeToolBar */ QString line = getSettings()->value( "MainWindow/InputToolbar", INPT_TB_DEFAULT ).toString(); controller = new DroppingController( p_intf, line, this ); QWidget *timeToolbarBox = new QWidget(); timeToolbarBox->setLayout( new QVBoxLayout() ); timeToolbarBox->layout()->addWidget( controller ); tabWidget->addTab( timeToolbarBox, qtr( "Time Toolbar" ) ); /* Advanced ToolBar */ QString lineA = getSettings()->value( "MainWindow/AdvToolbar", ADV_TB_DEFAULT ).toString(); controllerA = new DroppingController( p_intf, lineA, this ); QWidget *advToolbarBox = new QWidget(); advToolbarBox->setLayout( new QVBoxLayout() ); advToolbarBox->layout()->addWidget( controllerA ); tabWidget->addTab( advToolbarBox, qtr( "Advanced Widget" ) ); /* FSCToolBar */ QString lineFSC = getSettings()->value( "MainWindow/FSCtoolbar", FSC_TB_DEFAULT ).toString(); controllerFSC = new DroppingController( p_intf, lineFSC, this ); QWidget *FSCToolbarBox = new QWidget(); FSCToolbarBox->setLayout( new QVBoxLayout() ); FSCToolbarBox->layout()->addWidget( controllerFSC ); tabWidget->addTab( FSCToolbarBox, qtr( "Fullscreen Controller" ) ); /* Profile */ QGridLayout *profileBoxLayout = new QGridLayout(); profileCombo = new QComboBox; QToolButton *newButton = new QToolButton; newButton->setIcon( QIcon( ":/new.svg" ) ); newButton->setToolTip( qtr("New profile") ); QToolButton *deleteButton = new QToolButton; deleteButton->setIcon( QIcon( ":/toolbar/clear.svg" ) ); deleteButton->setToolTip( qtr( "Delete the current profile" ) ); profileBoxLayout->addWidget( new QLabel( qtr( "Select profile:" ) ), 0, 0 ); profileBoxLayout->addWidget( profileCombo, 0, 1 ); profileBoxLayout->addWidget( newButton, 0, 2 ); profileBoxLayout->addWidget( deleteButton, 0, 3 ); mainLayout->addLayout( profileBoxLayout, 0, 0, 1, 9 ); /* Fill combos */ int i_size = getSettings()->beginReadArray( "ToolbarProfiles" ); for( int i = 0; i < i_size; i++ ) { getSettings()->setArrayIndex(i); profileCombo->addItem( getSettings()->value( "ProfileName" ).toString(), getSettings()->value( "Value" ).toString() ); } getSettings()->endArray(); /* Load defaults ones if we have no combos */ /* We could decide that we load defaults on first launch of the dialog or when the combo is back to 0. I choose the second solution, because some clueless user might hit on delete a bit too much, but discussion is opened. -- jb */ if( i_size == 0 ) { profileCombo->addItem( PROFILE_NAME_6, QString( VALUE_6 ) ); profileCombo->addItem( PROFILE_NAME_1, QString( VALUE_1 ) ); profileCombo->addItem( PROFILE_NAME_2, QString( VALUE_2 ) ); profileCombo->addItem( PROFILE_NAME_3, QString( VALUE_3 ) ); profileCombo->addItem( PROFILE_NAME_4, QString( VALUE_4 ) ); profileCombo->addItem( PROFILE_NAME_5, QString( VALUE_5 ) ); } profileCombo->setCurrentIndex( -1 ); /* Build and prepare our preview */ PreviewWidget *previewWidget = new PreviewWidget( controller, controller1, controller2, positionCheckbox->isChecked() ); QGroupBox *previewBox = new QGroupBox( qtr("Preview"), this ); previewBox->setLayout( new QVBoxLayout() ); previewBox->layout()->addWidget( previewWidget ); mainLayout->addWidget( previewBox, 5, 6, 3, 3 ); CONNECT( positionCheckbox, stateChanged(int), previewWidget, setBarsTopPosition(int) ); /* Buttons */ QDialogButtonBox *okCancel = new QDialogButtonBox; QPushButton *okButton = new QPushButton( qtr( "Cl&ose" ), this ); okButton->setDefault( true ); QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ), this ); okCancel->addButton( okButton, QDialogButtonBox::AcceptRole ); okCancel->addButton( cancelButton, QDialogButtonBox::RejectRole ); BUTTONACT( deleteButton, deleteProfile() ); BUTTONACT( newButton, newProfile() ); CONNECT( profileCombo, currentIndexChanged( int ), this, changeProfile( int ) ); BUTTONACT( okButton, close() ); BUTTONACT( cancelButton, cancel() ); mainLayout->addWidget( okCancel, 8, 0, 1, 9 ); }
ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& inputMRL ) : QVLCDialog( parent, _p_intf ) { setWindowTitle( qtr( "Convert" ) ); setWindowRole( "vlc-convert" ); QGridLayout *mainLayout = new QGridLayout( this ); SoutInputBox *inputBox = new SoutInputBox( this ); inputBox->setMRL( inputMRL ); mainLayout->addWidget( inputBox, 0, 0, 1, -1 ); /** * Destination **/ QGroupBox *destBox = new QGroupBox( qtr( "Destination" ) ); QGridLayout *destLayout = new QGridLayout( destBox ); QLabel *destLabel = new QLabel( qtr( "Destination file:" ) ); destLayout->addWidget( destLabel, 0, 0); fileLine = new QLineEdit; fileLine->setMinimumWidth( 300 ); fileLine->setFocus( Qt::ActiveWindowFocusReason ); destLabel->setBuddy( fileLine ); QPushButton *fileSelectButton = new QPushButton( qtr( "Browse" ) ); destLayout->addWidget( fileLine, 0, 1 ); destLayout->addWidget( fileSelectButton, 0, 2); BUTTONACT( fileSelectButton, fileBrowse() ); mainLayout->addWidget( destBox, 3, 0, 1, -1 ); /* Profile Editor */ QGroupBox *settingBox = new QGroupBox( qtr( "Settings" ) ); QGridLayout *settingLayout = new QGridLayout( settingBox ); QRadioButton *convertRadio = new QRadioButton( qtr( "Convert" ) ); dumpRadio = new QRadioButton( qtr( "Dump raw input" ) ); QButtonGroup *buttonGroup = new QButtonGroup(this); buttonGroup->addButton( convertRadio ); buttonGroup->addButton( dumpRadio ); convertRadio->setChecked( true ); settingLayout->addWidget( convertRadio, 1, 0 ); QWidget *convertPanel = new QWidget( this ); QVBoxLayout *convertLayout = new QVBoxLayout( convertPanel ); displayBox = new QCheckBox( qtr( "Display the output" ) ); displayBox->setToolTip( qtr( "This display the resulting media, but can " "slow things down." ) ); convertLayout->addWidget( displayBox ); deinterBox = new QCheckBox( qtr( "Deinterlace" ) ); convertLayout->addWidget( deinterBox ); profile = new VLCProfileSelector( this ); convertLayout->addWidget( profile ); settingLayout->addWidget( convertPanel, 2, 0 ); settingLayout->addWidget( dumpRadio, 5, 0 ); mainLayout->addWidget( settingBox, 1, 0, 1, -1 ); /* Buttons */ QPushButton *okButton = new QPushButton( qtr( "&Start" ) ); QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) ); QDialogButtonBox *buttonBox = new QDialogButtonBox; okButton->setDefault( true ); buttonBox->addButton( okButton, QDialogButtonBox::AcceptRole ); buttonBox->addButton( cancelButton, QDialogButtonBox::RejectRole ); mainLayout->addWidget( buttonBox, 5, 3 ); BUTTONACT(okButton,close()); BUTTONACT(cancelButton,cancel()); CONNECT( convertRadio, toggled(bool), convertPanel, setEnabled(bool) ); CONNECT(profile, optionsChanged(), this, setDestinationFileExtension()); CONNECT(fileLine, editingFinished(), this, setDestinationFileExtension()); }
AboutDialog::AboutDialog( QWidget *parent, intf_thread_t *_p_intf) : QVLCDialog( parent, _p_intf ) { setWindowTitle( qtr( "About" ) ); resize( 600, 500 ); setMinimumSize( 600, 500 ); QGridLayout *layout = new QGridLayout( this ); QTabWidget *tab = new QTabWidget( this ); QPushButton *closeButton = new QPushButton( qtr( "&Close" ) ); closeButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); closeButton->setDefault( true ); QLabel *introduction = new QLabel( qtr( "VLC media player" ) + qfu( " " VERSION_MESSAGE ) ); QLabel *iconVLC = new QLabel; if( QDate::currentDate().dayOfYear() >= 354 ) iconVLC->setPixmap( QPixmap( ":/logo/vlc48-christmas.png" ) ); else iconVLC->setPixmap( QPixmap( ":/logo/vlc48.png" ) ); layout->addWidget( iconVLC, 0, 0, 1, 1 ); layout->addWidget( introduction, 0, 1, 1, 7 ); layout->addWidget( tab, 1, 0, 1, 8 ); layout->addWidget( closeButton, 2, 6, 1, 2 ); /* Main Introduction */ QWidget *infoWidget = new QWidget( this ); QHBoxLayout *infoLayout = new QHBoxLayout( infoWidget ); QLabel *infoLabel = new QLabel( qtr( "VLC media player is a free media player, " "encoder and streamer that can read from files, " "CDs, DVDs, network streams, capture cards and even more!\n" "VLC uses its internal codecs and works on essentially every " "popular platform.\n\n" ) + qtr( "This version of VLC was compiled by:\n " ) + qfu( VLC_CompileBy() )+ "@" + qfu( VLC_CompileHost() ) + "." + qfu( VLC_CompileDomain() ) + ".\n" + qtr( "Compiler: " ) + qfu( VLC_Compiler() ) + ".\n" + qtr( "You are using the Qt4 Interface.\n\n" ) + qtr( "Copyright (C) " ) + COPYRIGHT_YEARS + qtr( " by the VideoLAN Team.\n" ) + "[email protected], http://www.videolan.org" ); infoLabel->setWordWrap( infoLabel ); QLabel *iconVLC2 = new QLabel; if( QDate::currentDate().dayOfYear() >= 354 ) iconVLC2->setPixmap( QPixmap( ":/logo/vlc128-christmas.png" ) ); else iconVLC2->setPixmap( QPixmap( ":/logo/vlc128.png" ) ); infoLayout->addWidget( iconVLC2 ); infoLayout->addWidget( infoLabel ); /* GPL License */ QTextEdit *licenseEdit = new QTextEdit( this ); licenseEdit->setText( qfu( psz_license ) ); licenseEdit->setReadOnly( true ); /* People who helped */ QWidget *thanksWidget = new QWidget( this ); QVBoxLayout *thanksLayout = new QVBoxLayout( thanksWidget ); QLabel *thanksLabel = new QLabel( qtr( "We would like to thank the whole " "VLC community, the testers, our users and the following people " "(and the missing ones...) for their collaboration to " "create the best free software." ) ); thanksLabel->setWordWrap( true ); thanksLayout->addWidget( thanksLabel ); QTextEdit *thanksEdit = new QTextEdit( this ); thanksEdit->setText( qfu( psz_thanks ) ); thanksEdit->setReadOnly( true ); thanksLayout->addWidget( thanksEdit ); /* People who wrote the software */ QTextEdit *authorsEdit = new QTextEdit( this ); authorsEdit->setText( qfu( psz_authors ) ); authorsEdit->setReadOnly( true ); /* add the tabs to the Tabwidget */ tab->addTab( infoWidget, qtr( "About" ) ); tab->addTab( authorsEdit, qtr( "Authors" ) ); tab->addTab( thanksWidget, qtr("Thanks") ); tab->addTab( licenseEdit, qtr("License") ); BUTTONACT( closeButton, close() ); }
VLMDialog::VLMDialog( intf_thread_t *_p_intf ) : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf ) { p_vlm = vlm_New( p_intf ); if( !p_vlm ) { msg_Warn( p_intf, "Couldn't build VLM object "); return; } vlmWrapper = new VLMWrapper( p_vlm ); // UI stuff ui.setupUi( this ); ui.saveButton->hide(); #define ADDMEDIATYPES( str, type ) ui.mediaType->addItem( qtr( str ), QVariant( type ) ); ADDMEDIATYPES( N_("Broadcast"), QVLM_Broadcast ); ADDMEDIATYPES( N_("Schedule"), QVLM_Schedule ); ADDMEDIATYPES( N_("Video On Demand ( VOD )"), QVLM_VOD ); #undef ADDMEDIATYPES /* Schedule Stuffs */ QGridLayout *schetimelayout = new QGridLayout( ui.schedBox ); QLabel *schetimelabel = new QLabel( qtr( "Hours / Minutes / Seconds:" ) ); schetimelayout->addWidget( schetimelabel, 0, 0 ); QLabel *schedatelabel = new QLabel( qtr( "Day / Month / Year:" ) ); schetimelayout->addWidget( schedatelabel, 1, 0 ); QLabel *scherepeatLabel = new QLabel( qtr( "Repeat:" ) ); schetimelayout->addWidget( scherepeatLabel, 2, 0 ); QLabel *scherepeatTimeLabel = new QLabel( qtr( "Repeat delay:" ) ); schetimelayout->addWidget( scherepeatTimeLabel, 3, 0 ); time = new QDateTimeEdit( QTime::currentTime() ); time->setAlignment( Qt::AlignRight ); time->setDisplayFormat( "hh:mm:ss" ); schetimelayout->addWidget( time, 0, 1, 1, 3 ); date = new QDateTimeEdit( QDate::currentDate() ); date->setAlignment( Qt::AlignRight ); date->setCalendarPopup( true ); #ifdef WIN32 date->setDisplayFormat( "dd MM yyyy" ); #else date->setDisplayFormat( "dd MMMM yyyy" ); #endif schetimelayout->addWidget( date, 1, 1, 1, 3 ); scherepeatnumber = new QSpinBox; scherepeatnumber->setAlignment( Qt::AlignRight ); schetimelayout->addWidget( scherepeatnumber, 2, 1, 1, 3 ); repeatDays = new QSpinBox; repeatDays->setAlignment( Qt::AlignRight ); schetimelayout->addWidget( repeatDays, 3, 1, 1, 1 ); repeatDays->setSuffix( qtr(" days") ); repeatTime = new QDateTimeEdit; repeatTime->setAlignment( Qt::AlignRight ); schetimelayout->addWidget( repeatTime, 3, 2, 1, 2 ); repeatTime->setDisplayFormat( "hh:mm:ss" ); /* scrollArea */ ui.vlmItemScroll->setFrameStyle( QFrame::NoFrame ); ui.vlmItemScroll->setWidgetResizable( true ); vlmItemWidget = new QWidget; vlmItemLayout = new QVBoxLayout( vlmItemWidget ); vlmItemWidget->setLayout( vlmItemLayout ); ui.vlmItemScroll->setWidget( vlmItemWidget ); QSpacerItem *spacer = new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding); vlmItemLayout->addItem( spacer ); QPushButton *importButton = new QPushButton( qtr( "I&mport" ) ); ui.buttonBox->addButton( importButton, QDialogButtonBox::ActionRole ); QPushButton *exportButton = new QPushButton( qtr( "E&xport" ) ); ui.buttonBox->addButton( exportButton, QDialogButtonBox::ActionRole ); QPushButton *closeButton = new QPushButton( qtr( "&Close" ) ); ui.buttonBox->addButton( closeButton, QDialogButtonBox::RejectRole ); showScheduleWidget( QVLM_Broadcast ); /* Connect the comboBox to show the right Widgets */ CONNECT( ui.mediaType, currentIndexChanged( int ), this, showScheduleWidget( int ) ); /* Connect the leftList to show the good VLMItem */ CONNECT( ui.vlmListItem, currentRowChanged( int ), this, selectVLMItem( int ) ); BUTTONACT( closeButton, close() ); BUTTONACT( exportButton, exportVLMConf() ); BUTTONACT( importButton, importVLMConf() ); BUTTONACT( ui.addButton, addVLMItem() ); BUTTONACT( ui.clearButton, clearWidgets() ); BUTTONACT( ui.saveButton, saveModifications() ); BUTTONACT( ui.inputButton, selectInput() ); BUTTONACT( ui.outputButton, selectOutput() ); if( !restoreGeometry( getSettings()->value("VLM/geometry").toByteArray() ) ) { resize( QSize( 700, 500 ) ); } }
StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent, intf_thread_t *_p_intf, playlist_t *p_playlist, playlist_item_t *p_root ): QWidget( _parent ), p_intf( _p_intf ) { layout = new QGridLayout( this ); layout->setSpacing( 0 ); layout->setMargin( 0 ); setMinimumWidth( 300 ); iconView = NULL; treeView = NULL; listView = NULL; viewStack = new QStackedLayout(); layout->addLayout( viewStack, 1, 0, 1, -1 ); model = new PLModel( p_playlist, p_intf, p_root, this ); currentRootId = -1; currentRootIndexId = -1; lastActivatedId = -1; locationBar = new LocationBar( model ); locationBar->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Preferred ); layout->addWidget( locationBar, 0, 0 ); layout->setColumnStretch( 0, 5 ); CONNECT( locationBar, invoked( const QModelIndex & ), this, browseInto( const QModelIndex & ) ); searchEdit = new SearchLineEdit( this ); searchEdit->setMaximumWidth( 250 ); searchEdit->setMinimumWidth( 80 ); layout->addWidget( searchEdit, 0, 2 ); CONNECT( searchEdit, textChanged( const QString& ), this, search( const QString& ) ); layout->setColumnStretch( 2, 3 ); /* Button to switch views */ QToolButton *viewButton = new QToolButton( this ); viewButton->setIcon( style()->standardIcon( QStyle::SP_FileDialogDetailedView ) ); viewButton->setToolTip( qtr("Change playlistview")); layout->addWidget( viewButton, 0, 1 ); /* View selection menu */ viewSelectionMapper = new QSignalMapper( this ); CONNECT( viewSelectionMapper, mapped( int ), this, showView( int ) ); QActionGroup *actionGroup = new QActionGroup( this ); for( int i = 0; i < VIEW_COUNT; i++ ) { viewActions[i] = actionGroup->addAction( viewNames[i] ); viewActions[i]->setCheckable( true ); viewSelectionMapper->setMapping( viewActions[i], i ); CONNECT( viewActions[i], triggered(), viewSelectionMapper, map() ); } BUTTONACT( viewButton, cycleViews() ); QMenu *viewMenu = new QMenu( this ); viewMenu->addActions( actionGroup->actions() ); viewButton->setMenu( viewMenu ); /* Saved Settings */ getSettings()->beginGroup("Playlist"); int i_viewMode = getSettings()->value( "view-mode", TREE_VIEW ).toInt(); getSettings()->endGroup(); showView( i_viewMode ); DCONNECT( THEMIM, leafBecameParent( input_item_t *), this, browseInto( input_item_t * ) ); CONNECT( model, currentChanged( const QModelIndex& ), this, handleExpansion( const QModelIndex& ) ); CONNECT( model, rootChanged(), this, handleRootChange() ); }
BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf ) { b_ignore_updates = false; setWindowFlags( Qt::Tool ); setWindowOpacity( var_InheritFloat( p_intf, "qt-opacity" ) ); setWindowTitle( qtr( "Edit Bookmarks" ) ); setWindowRole( "vlc-bookmarks" ); QHBoxLayout *layout = new QHBoxLayout( this ); QDialogButtonBox *buttonsBox = new QDialogButtonBox( Qt::Vertical ); QPushButton *addButton = new QPushButton( qtr( "Create" ) ); addButton->setToolTip( qtr( "Create a new bookmark" ) ); buttonsBox->addButton( addButton, QDialogButtonBox::ActionRole ); delButton = new QPushButton( qtr( "Delete" ) ); delButton->setToolTip( qtr( "Delete the selected item" ) ); buttonsBox->addButton( delButton, QDialogButtonBox::ActionRole ); clearButton = new QPushButton( qtr( "Clear" ) ); clearButton->setToolTip( qtr( "Delete all the bookmarks" ) ); buttonsBox->addButton( clearButton, QDialogButtonBox::ResetRole ); #if 0 QPushButton *extractButton = new QPushButton( qtr( "Extract" ) ); extractButton->setToolTip( qtr() ); buttonsBox->addButton( extractButton, QDialogButtonBox::ActionRole ); #endif /* ?? Feels strange as Qt guidelines will put reject on top */ buttonsBox->addButton( new QPushButton( qtr( "&Close" ) ), QDialogButtonBox::RejectRole); bookmarksList = new QTreeWidget( this ); bookmarksList->setRootIsDecorated( false ); bookmarksList->setAlternatingRowColors( true ); bookmarksList->setSelectionMode( QAbstractItemView::ExtendedSelection ); bookmarksList->setSelectionBehavior( QAbstractItemView::SelectRows ); bookmarksList->setEditTriggers( QAbstractItemView::SelectedClicked ); bookmarksList->setColumnCount( 3 ); bookmarksList->resize( sizeHint() ); QStringList headerLabels; headerLabels << qtr( "Description" ); headerLabels << qtr( "Bytes" ); headerLabels << qtr( "Time" ); bookmarksList->setHeaderLabels( headerLabels ); layout->addWidget( buttonsBox ); layout->addWidget( bookmarksList ); CONNECT( THEMIM->getIM(), bookmarksChanged(), this, update() ); CONNECT( bookmarksList, activated( QModelIndex ), this, activateItem( QModelIndex ) ); CONNECT( bookmarksList, itemChanged( QTreeWidgetItem*, int ), this, edit( QTreeWidgetItem*, int ) ); CONNECT( bookmarksList->model(), rowsInserted( const QModelIndex &, int, int ), this, updateButtons() ); CONNECT( bookmarksList->model(), rowsRemoved( const QModelIndex &, int, int ), this, updateButtons() ); CONNECT( bookmarksList->selectionModel(), selectionChanged( const QItemSelection &, const QItemSelection & ), this, updateButtons() ); BUTTONACT( addButton, add() ); BUTTONACT( delButton, del() ); BUTTONACT( clearButton, clear() ); #if 0 BUTTONACT( extractButton, extract() ); #endif CONNECT( buttonsBox, rejected(), this, close() ); updateButtons(); restoreWidgetPosition( "Bookmarks", QSize( 435, 280 ) ); updateGeometry(); }
PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf ) : QVLCDialog( parent, _p_intf ) { QGridLayout *main_layout = new QGridLayout( this ); setWindowTitle( qtr( "Preferences" ) ); setWindowRole( "vlc-preferences" ); setWindowModality( Qt::WindowModal ); /* Whether we want it or not, we need to destroy on close to get consistency when reset */ setAttribute( Qt::WA_DeleteOnClose ); /* Create Panels */ tree_panel = new QWidget; tree_panel_l = new QHBoxLayout; tree_panel->setLayout( tree_panel_l ); main_panel = new QWidget; main_panel_l = new QHBoxLayout; main_panel->setLayout( main_panel_l ); /* Choice for types */ types = new QGroupBox( qtr("Show settings") ); types->setAlignment( Qt::AlignHCenter ); QHBoxLayout *types_l = new QHBoxLayout; types_l->setSpacing( 3 ); types_l->setMargin( 3 ); small = new QRadioButton( qtr( "Simple" ), types ); small->setToolTip( qtr( "Switch to simple preferences view" ) ); types_l->addWidget( small ); all = new QRadioButton( qtr("All"), types ); types_l->addWidget( all ); all->setToolTip( qtr( "Switch to full preferences view" ) ); types->setLayout( types_l ); small->setChecked( true ); /* Tree and panel initialisations */ advanced_tree = NULL; simple_tree = NULL; current_simple_panel = NULL; advanced_panel = NULL; /* Buttons */ QDialogButtonBox *buttonsBox = new QDialogButtonBox(); QPushButton *save = new QPushButton( qtr( "&Save" ) ); save->setToolTip( qtr( "Save and close the dialog" ) ); QPushButton *cancel = new QPushButton( qtr( "&Cancel" ) ); QPushButton *reset = new QPushButton( qtr( "&Reset Preferences" ) ); buttonsBox->addButton( save, QDialogButtonBox::AcceptRole ); buttonsBox->addButton( cancel, QDialogButtonBox::RejectRole ); buttonsBox->addButton( reset, QDialogButtonBox::ResetRole ); /* Layout */ main_layout->addWidget( tree_panel, 0, 0, 3, 1 ); main_layout->addWidget( types, 3, 0, 2, 1 ); main_layout->addWidget( main_panel, 0, 1, 4, 2 ); main_layout->addWidget( buttonsBox, 4, 2, 1 ,1 ); main_layout->setColumnMinimumWidth( 0, 150 ); main_layout->setColumnMinimumWidth( 1, 10 ); main_layout->setColumnStretch( 0, 1 ); main_layout->setColumnStretch( 1, 0 ); main_layout->setColumnStretch( 2, 10 ); main_layout->setRowStretch( 2, 4 ); main_layout->setMargin( 9 ); setLayout( main_layout ); /* Margins */ tree_panel_l->setMargin( 1 ); main_panel_l->setContentsMargins( 6, 0, 0, 3 ); b_small = (p_intf->p_sys->i_screenHeight < 750); if( b_small ) msg_Dbg( p_intf, "Small"); setMaximumHeight( p_intf->p_sys->i_screenHeight ); for( int i = 0; i < SPrefsMax ; i++ ) simple_panels[i] = NULL; if( var_InheritBool( p_intf, "qt-advanced-pref" ) || var_InheritBool( p_intf, "advanced" ) ) setAdvanced(); else setSmall(); BUTTONACT( save, save() ); BUTTONACT( cancel, cancel() ); BUTTONACT( reset, reset() ); BUTTONACT( small, setSmall() ); BUTTONACT( all, setAdvanced() ); resize( 780, sizeHint().height() ); }
MessagesDialog::MessagesDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf ) { setWindowTitle( qtr( "Messages" ) ); setWindowRole( "vlc-messages" ); /* Build Ui */ ui.setupUi( this ); ui.bottomButtonsBox->addButton( new QPushButton( qtr("&Close"), this ), QDialogButtonBox::RejectRole ); /* Modules tree */ ui.modulesTree->setHeaderHidden( true ); /* Buttons and general layout */ ui.saveLogButton->setToolTip( qtr( "Saves all the displayed logs to a file" ) ); int i_verbosity = var_InheritInteger( p_intf, "verbose" ); changeVerbosity( i_verbosity ); ui.verbosityBox->setValue( qMin( i_verbosity, 2 ) ); getSettings()->beginGroup( "Messages" ); ui.filterEdit->setText( getSettings()->value( "messages-filter" ).toString() ); getSettings()->endGroup(); updateButton = new QPushButton( QIcon(":/update"), "" ); updateButton->setFlat( true ); ui.mainTab->setCornerWidget( updateButton ); #ifndef NDEBUG QWidget *pldebugTab = new QWidget(); QVBoxLayout *pldebugTabLayout = new QVBoxLayout(); pldebugTab->setLayout( pldebugTabLayout ); ui.mainTab->addTab( pldebugTab, "Playlist Tree" ); pldebugTree = new QTreeWidget(); pldebugTree->headerItem()->setText( 0, "Name" ); pldebugTree->headerItem()->setText( 1, "PL id" ); pldebugTree->headerItem()->setText( 2, "Item id" ); pldebugTree->headerItem()->setText( 3, "PL flags" ); pldebugTree->headerItem()->setText( 4, "Item flags" ); pldebugTree->setColumnCount( 5 ); pldebugTabLayout->addWidget( pldebugTree ); #endif tabChanged(0); BUTTONACT( updateButton, updateOrClear() ); BUTTONACT( ui.saveLogButton, save() ); CONNECT( ui.filterEdit, editingFinished(), this, updateConfig() ); CONNECT( ui.filterEdit, textChanged(QString), this, filterMessages() ); CONNECT( ui.bottomButtonsBox, rejected(), this, hide() ); CONNECT( ui.verbosityBox, valueChanged( int ), this, changeVerbosity( int ) ); CONNECT( ui.mainTab, currentChanged( int ), this, tabChanged( int ) ); /* General action */ restoreWidgetPosition( "Messages", QSize( 600, 450 ) ); /* Hook up to LibVLC messaging */ vlc_LogSet( p_intf->p_libvlc, MsgCallback, this ); buildTree( NULL, VLC_OBJECT( p_intf->p_libvlc ) ); }
MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, input_item_t *p_item ) : QVLCFrame( _p_intf ) { isMainInputInfo = ( p_item == NULL ); setWindowTitle( qtr( "Media Information" ) ); /* TabWidgets and Tabs creation */ infoTabW = new QTabWidget; MP = new MetaPanel( infoTabW, p_intf ); infoTabW->addTab( MP, qtr( "&General" ) ); EMP = new ExtraMetaPanel( infoTabW, p_intf ); infoTabW->addTab( EMP, qtr( "&Extra Metadata" ) ); IP = new InfoPanel( infoTabW, p_intf ); infoTabW->addTab( IP, qtr( "&Codec Details" ) ); if( isMainInputInfo ) { ISP = new InputStatsPanel( infoTabW, p_intf ); infoTabW->addTab( ISP, qtr( "&Statistics" ) ); } QGridLayout *layout = new QGridLayout( this ); /* No need to use a QDialogButtonBox here */ saveMetaButton = new QPushButton( qtr( "&Save Metadata" ) ); saveMetaButton->hide(); QPushButton *closeButton = new QPushButton( qtr( "&Close" ) ); closeButton->setDefault( true ); QLabel *uriLabel = new QLabel( qtr( "Location:" ) ); QLineEdit *uriLine = new QLineEdit; layout->addWidget( infoTabW, 0, 0, 1, 8 ); layout->addWidget( uriLabel, 1, 0, 1, 1 ); layout->addWidget( uriLine, 1, 1, 1, 7 ); layout->addWidget( saveMetaButton, 2, 6 ); layout->addWidget( closeButton, 2, 7 ); BUTTONACT( closeButton, close() ); /* The tabs buttons are shown in the main dialog for space and cosmetics */ BUTTONACT( saveMetaButton, saveMeta() ); /* Let the MetaData Panel update the URI */ CONNECT( MP, uriSet( const QString& ), uriLine, setText( const QString& ) ); CONNECT( MP, editing(), saveMetaButton, show() ); /* Display the buttonBar according to the Tab selected */ CONNECT( infoTabW, currentChanged( int ), this, updateButtons( int ) ); /* If using the General Mode */ if( isMainInputInfo ) { msg_Dbg( p_intf, "Using a general info windows" ); /** * Connects on the various signals of input_Manager * For the currently playing element **/ CONNECT( THEMIM->getIM(), infoChanged( input_item_t* ), IP, update( input_item_t* ) ); CONNECT( THEMIM->getIM(), currentMetaChanged( input_item_t* ), MP, update( input_item_t* ) ); CONNECT( THEMIM->getIM(), currentMetaChanged( input_item_t* ), EMP, update( input_item_t* ) ); CONNECT( THEMIM->getIM(), statisticsUpdated( input_item_t* ), ISP, update( input_item_t* ) ); if( THEMIM->getInput() ) p_item = input_GetItem( THEMIM->getInput() ); } else
SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& inputMRL ) : QVLCDialog( parent, _p_intf ) { setWindowTitle( qtr( "Stream Output" ) ); setWindowRole( "vlc-stream-output" ); /* UI stuff */ ui.setupUi( this ); ui.inputBox->setMRL( inputMRL ); ui.helpEdit->setPlainText( qtr("This dialog will allow you to stream or " "convert your media for use locally, on your private network, " "or on the Internet.\n" "You should start by checking that source matches what you want " "your input to be and then press the \"Next\" " "button to continue.\n") ); ui.mrlEdit->setToolTip ( qtr( "Stream output string.\n" "This is automatically generated " "when you change the above settings,\n" "but you can change it manually." ) ) ; #if 0 /* This needs Qt4.5 to be cool */ ui.destTab->setTabsClosable( true ); #else closeTabButton = new QToolButton( this ); ui.destTab->setCornerWidget( closeTabButton ); closeTabButton->hide(); closeTabButton->setAutoRaise( true ); closeTabButton->setIcon( QIcon( ":/toolbar/clear" ) ); closeTabButton->setToolTip( qtr("Clear") ); BUTTONACT( closeTabButton, closeTab() ); #endif CONNECT( ui.destTab, currentChanged( int ), this, tabChanged( int ) ); ui.destTab->setTabIcon( 0, QIcon( ":/buttons/playlist/playlist_add" ) ); ui.destBox->addItem( qtr( "File" ) ); ui.destBox->addItem( "HTTP" ); ui.destBox->addItem( "MS-WMSP (MMSH)" ); ui.destBox->addItem( "RTSP" ); ui.destBox->addItem( "RTP / MPEG Transport Stream" ); ui.destBox->addItem( "RTP Audio/Video Profile" ); ui.destBox->addItem( "UDP (legacy)" ); ui.destBox->addItem( "IceCast" ); BUTTONACT( ui.addButton, addDest() ); // /* Connect everything to the updateMRL function */ #define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() ); #define CT( x ) CONNECT( ui.x, textChanged( const QString& ), this, updateMRL() ); #define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() ); #define CC( x ) CONNECT( ui.x, currentIndexChanged( int ), this, updateMRL() ); /* Misc */ CB( soutAll ); CS( ttl ); CT( sapName ); CT( sapGroup ); CB( localOutput ); CB( transcodeBox ); CONNECT( ui.profileSelect, optionsChanged(), this, updateMRL() ); okButton = new QPushButton( qtr( "&Stream" ) ); QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) ); okButton->setDefault( true ); ui.acceptButtonBox->addButton( okButton, QDialogButtonBox::AcceptRole ); ui.acceptButtonBox->addButton( cancelButton, QDialogButtonBox::RejectRole ); BUTTONACT( okButton, ok() ); BUTTONACT( cancelButton, cancel() ); BUTTONACT( ui.nextButton, next() ); BUTTONACT( ui.nextButton2, next() ); BUTTONACT( ui.prevButton, prev() ); BUTTONACT( ui.prevButton2, prev() ); #undef CC #undef CS #undef CT #undef CB }