Commit b879f3e1 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - renaming functions cosmetic and KDE/GNome/Windows button fight.

parent ef805923
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* $Id$ * $Id$
* *
* Authors: Clément Stenac <zorglub@videolan.org> * Authors: Clément Stenac <zorglub@videolan.org>
* Jean-Baptiste Kempf <jb@videolan.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -27,6 +28,7 @@ ...@@ -27,6 +28,7 @@
#include <QTextEdit> #include <QTextEdit>
#include <QCheckBox> #include <QCheckBox>
#include <QGridLayout> #include <QGridLayout>
#include <QDialogButtonBox>
#include <QPushButton> #include <QPushButton>
ErrorsDialog *ErrorsDialog::instance = NULL; ErrorsDialog *ErrorsDialog::instance = NULL;
...@@ -34,13 +36,18 @@ ErrorsDialog *ErrorsDialog::instance = NULL; ...@@ -34,13 +36,18 @@ ErrorsDialog *ErrorsDialog::instance = NULL;
ErrorsDialog::ErrorsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ErrorsDialog::ErrorsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{ {
setWindowTitle( qtr( "Errors" ) ); setWindowTitle( qtr( "Errors" ) );
resize( 500 , 200 ); resize( 500 , 300 );
setWindowModality( Qt::ApplicationModal ); setWindowModality( Qt::ApplicationModal );
QGridLayout *layout = new QGridLayout( this ); QGridLayout *layout = new QGridLayout( this );
QDialogButtonBox *buttonBox = new QDialogButtonBox;
QPushButton *closeButton = new QPushButton( qtr( "&Close" ) ); QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
QPushButton *clearButton = new QPushButton( qtr( "&Clear" ) ); QPushButton *clearButton = new QPushButton( qtr( "&Clear" ) );
buttonBox->addButton( closeButton, QDialogButtonBox::AcceptRole );
buttonBox->addButton( clearButton, QDialogButtonBox::ActionRole );
messages = new QTextEdit(); messages = new QTextEdit();
messages->setReadOnly( true ); messages->setReadOnly( true );
messages->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); messages->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
...@@ -49,10 +56,9 @@ ErrorsDialog::ErrorsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -49,10 +56,9 @@ ErrorsDialog::ErrorsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
layout->addWidget( messages, 0, 0, 1, 3 ); layout->addWidget( messages, 0, 0, 1, 3 );
layout->addWidget( stopShowing, 1, 0 ); layout->addWidget( stopShowing, 1, 0 );
layout->addItem( new QSpacerItem( 200, 20, QSizePolicy::Expanding ), 2,0 ); layout->addItem( new QSpacerItem( 200, 20, QSizePolicy::Expanding ), 2,0 );
layout->addWidget( clearButton, 2, 1 ); layout->addWidget( buttonBox, 2, 2 );
layout->addWidget( closeButton, 2, 2 );
BUTTONACT( closeButton, close() ); CONNECT( buttonBox, accepted(), this, close() );
BUTTONACT( clearButton, clear() ); BUTTONACT( clearButton, clear() );
BUTTONACT( stopShowing, dontShow() ); BUTTONACT( stopShowing, dontShow() );
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* $Id$ * $Id$
* *
* Authors: Clément Stenac <zorglub@videolan.org> * Authors: Clément Stenac <zorglub@videolan.org>
* Jean-Baptiste Kempf <jb@videolan.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -34,7 +35,6 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) ...@@ -34,7 +35,6 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
{ {
setWindowFlags( Qt::Tool ); setWindowFlags( Qt::Tool );
setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) ); setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) );
setWindowTitle( qtr( "Adjustments and Effects" ) ); setWindowTitle( qtr( "Adjustments and Effects" ) );
QGridLayout *layout = new QGridLayout( this ); QGridLayout *layout = new QGridLayout( this );
...@@ -42,7 +42,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) ...@@ -42,7 +42,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
QTabWidget *mainTab = new QTabWidget( this ); QTabWidget *mainTab = new QTabWidget( this );
mainTab->setTabPosition( QTabWidget::West ); mainTab->setTabPosition( QTabWidget::West );
QWidget *audioWidget = new QWidget( this ); QWidget *audioWidget = new QWidget;
QHBoxLayout *audioLayout = new QHBoxLayout( audioWidget ); QHBoxLayout *audioLayout = new QHBoxLayout( audioWidget );
QTabWidget *audioTab = new QTabWidget( mainTab ); QTabWidget *audioTab = new QTabWidget( mainTab );
......
...@@ -146,6 +146,7 @@ void DialogsProvider::prefsDialog() ...@@ -146,6 +146,7 @@ void DialogsProvider::prefsDialog()
{ {
PrefsDialog::getInstance( p_intf )->toggleVisible(); PrefsDialog::getInstance( p_intf )->toggleVisible();
} }
void DialogsProvider::extendedDialog() void DialogsProvider::extendedDialog()
{ {
ExtendedDialog::getInstance( p_intf )->toggleVisible(); ExtendedDialog::getInstance( p_intf )->toggleVisible();
...@@ -278,6 +279,11 @@ QStringList DialogsProvider::showSimpleOpen( QString help, ...@@ -278,6 +279,11 @@ QStringList DialogsProvider::showSimpleOpen( QString help,
fileTypes ); fileTypes );
} }
/**
* Open a file,
* pl helps you to choose from playlist or media library,
* go to start or enqueue
**/
void DialogsProvider::addFromSimple( bool pl, bool go) void DialogsProvider::addFromSimple( bool pl, bool go)
{ {
QStringList files = DialogsProvider::showSimpleOpen(); QStringList files = DialogsProvider::showSimpleOpen();
...@@ -295,6 +301,11 @@ void DialogsProvider::addFromSimple( bool pl, bool go) ...@@ -295,6 +301,11 @@ void DialogsProvider::addFromSimple( bool pl, bool go)
} }
} }
void DialogsProvider::simpleOpenDialog()
{
addFromSimple( true, true ); /* Playlist and Go */
}
void DialogsProvider::simplePLAppendDialog() void DialogsProvider::simplePLAppendDialog()
{ {
addFromSimple( true, false ); addFromSimple( true, false );
...@@ -305,13 +316,7 @@ void DialogsProvider::simpleMLAppendDialog() ...@@ -305,13 +316,7 @@ void DialogsProvider::simpleMLAppendDialog()
addFromSimple( false, false ); addFromSimple( false, false );
} }
void DialogsProvider::simpleOpenDialog()
{
addFromSimple( true, true );
}
/* Directory */ /* Directory */
/** /**
* Open a directory, * Open a directory,
* pl helps you to choose from playlist or media library, * pl helps you to choose from playlist or media library,
...@@ -344,7 +349,7 @@ void DialogsProvider::MLAppendDir() ...@@ -344,7 +349,7 @@ void DialogsProvider::MLAppendDir()
/**************** /****************
* Playlist * * Playlist *
****************/ ****************/
void DialogsProvider::openPlaylist() void DialogsProvider::openAPlaylist()
{ {
QStringList files = showSimpleOpen( qtr( "Open playlist file" ), QStringList files = showSimpleOpen( qtr( "Open playlist file" ),
EXT_FILTER_PLAYLIST ); EXT_FILTER_PLAYLIST );
...@@ -354,7 +359,7 @@ void DialogsProvider::openPlaylist() ...@@ -354,7 +359,7 @@ void DialogsProvider::openPlaylist()
} }
} }
void DialogsProvider::savePlaylist() void DialogsProvider::saveAPlaylist()
{ {
QFileDialog *qfd = new QFileDialog( NULL, QFileDialog *qfd = new QFileDialog( NULL,
qtr("Choose a filename to save playlist"), qtr("Choose a filename to save playlist"),
...@@ -458,7 +463,6 @@ void DialogsProvider::streamingDialog() ...@@ -458,7 +463,6 @@ void DialogsProvider::streamingDialog()
}*/ }*/
/**************************************************************************** /****************************************************************************
* Menus / Interaction * Menus / Interaction
****************************************************************************/ ****************************************************************************/
......
...@@ -147,6 +147,7 @@ public slots: ...@@ -147,6 +147,7 @@ public slots:
void updateDialog(); void updateDialog();
void aboutDialog(); void aboutDialog();
void gotoTimeDialog(); void gotoTimeDialog();
void podcastConfigureDialog();
void simpleOpenDialog(); void simpleOpenDialog();
void simplePLAppendDialog(); void simplePLAppendDialog();
...@@ -168,10 +169,8 @@ public slots: ...@@ -168,10 +169,8 @@ public slots:
void openThenStreamingDialogs(); void openThenStreamingDialogs();
void openThenTranscodingDialogs(); void openThenTranscodingDialogs();
void openPlaylist(); void openAPlaylist();
void savePlaylist(); void saveAPlaylist();
void podcastConfigureDialog();
void switchToSkins(); void switchToSkins();
void quit(); void quit();
......
...@@ -217,8 +217,8 @@ QMenu *QVLCMenu::PlaylistMenu( intf_thread_t *p_intf, MainInterface *mi ) ...@@ -217,8 +217,8 @@ QMenu *QVLCMenu::PlaylistMenu( intf_thread_t *p_intf, MainInterface *mi )
qtr( "Show Playlist" ), mi, SLOT( togglePlaylist() ) ); qtr( "Show Playlist" ), mi, SLOT( togglePlaylist() ) );
menu->addSeparator(); menu->addSeparator();
DP_SADD( menu, qtr( I_PL_LOAD ), "", "", openPlaylist(), "Ctrl+X" ); DP_SADD( menu, qtr( I_PL_LOAD ), "", "", openAPlaylist(), "Ctrl+X" );
DP_SADD( menu, qtr( I_PL_SAVE ), "", "", savePlaylist(), "Ctrl+Y" ); DP_SADD( menu, qtr( I_PL_SAVE ), "", "", saveAPlaylist(), "Ctrl+Y" );
menu->addSeparator(); menu->addSeparator();
menu->addAction( qtr( "Undock from interface" ), mi, menu->addAction( qtr( "Undock from interface" ), mi,
SLOT( undockPlaylist() ), qtr( "Ctrl+U" ) ); SLOT( undockPlaylist() ), qtr( "Ctrl+U" ) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment