Commit 3de7f18a authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: standardbuttons are bad for win32 and translation. Only use custom

buttons in the managed layout.
parent 7e6beb9e
...@@ -43,10 +43,10 @@ ErrorsDialog::ErrorsDialog( intf_thread_t *_p_intf ) ...@@ -43,10 +43,10 @@ ErrorsDialog::ErrorsDialog( intf_thread_t *_p_intf )
QGridLayout *layout = new QGridLayout( this ); QGridLayout *layout = new QGridLayout( this );
QDialogButtonBox *buttonBox = QDialogButtonBox *buttonBox = new QDialogButtonBox( Qt::Horizontal, this );
new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal, this ); QPushButton *clearButton = new QPushButton( qtr( "Cl&ear" ), this );
QPushButton *clearButton = new QPushButton( qtr( "&Clear" ) );
buttonBox->addButton( clearButton, QDialogButtonBox::ActionRole ); buttonBox->addButton( clearButton, QDialogButtonBox::ActionRole );
buttonBox->addButton( new QPushButton( qtr("&Close"), this ), QDialogButtonBox::RejectRole );
messages = new QTextEdit(); messages = new QTextEdit();
messages->setReadOnly( true ); messages->setReadOnly( true );
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <QTabWidget> #include <QTabWidget>
#include <QGridLayout> #include <QGridLayout>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QPushButton>
#include <vlc_modules.h> #include <vlc_modules.h>
ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
...@@ -87,8 +88,9 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) ...@@ -87,8 +88,9 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
layout->addWidget( mainTabW ); layout->addWidget( mainTabW );
QDialogButtonBox *closeButtonBox = QDialogButtonBox *closeButtonBox = new QDialogButtonBox( Qt::Horizontal, this );
new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal, this ); closeButtonBox->addButton(
new QPushButton( qtr("&Close"), this ), QDialogButtonBox::RejectRole );
layout->addWidget( closeButtonBox ); layout->addWidget( closeButtonBox );
CONNECT( closeButtonBox, rejected(), this, close() ); CONNECT( closeButtonBox, rejected(), this, close() );
......
...@@ -59,8 +59,9 @@ HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -59,8 +59,9 @@ HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
QTextBrowser *helpBrowser = new QTextBrowser( this ); QTextBrowser *helpBrowser = new QTextBrowser( this );
helpBrowser->setOpenExternalLinks( true ); helpBrowser->setOpenExternalLinks( true );
helpBrowser->setHtml( qtr(I_LONGHELP) ); helpBrowser->setHtml( qtr(I_LONGHELP) );
QDialogButtonBox *closeButtonBox = QDialogButtonBox *closeButtonBox = new QDialogButtonBox( Qt::Horizontal, this );
new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal, this ); closeButtonBox->addButton(
new QPushButton( qtr("&Close"), this ), QDialogButtonBox::RejectRole );
closeButtonBox->setFocus(); closeButtonBox->setFocus();
layout->addWidget( helpBrowser ); layout->addWidget( helpBrowser );
...@@ -85,6 +86,8 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) ...@@ -85,6 +86,8 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
{ {
/* Build UI */ /* Build UI */
ui.setupUi( this ); ui.setupUi( this );
ui.closeButtonBox->addButton(
new QPushButton( qtr("&Close"), this ), QDialogButtonBox::RejectRole );
setWindowTitle( qtr( "About" ) ); setWindowTitle( qtr( "About" ) );
setWindowRole( "vlc-about" ); setWindowRole( "vlc-about" );
...@@ -161,23 +164,20 @@ UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -161,23 +164,20 @@ UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{ {
/* build Ui */ /* build Ui */
ui.setupUi( this ); 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" ) ); setWindowTitle( qtr( "VLC media player updates" ) );
setWindowRole( "vlc-update" ); setWindowRole( "vlc-update" );
QList<QAbstractButton *> buttonsList = ui.updateDialogButtonBox->buttons(); BUTTONACT( recheckButton, UpdateOrDownload() );
QAbstractButton *currentButton;
for ( int i = 0; i < buttonsList.size() ; ++i )
{
currentButton = buttonsList.at( i );
if ( ui.updateDialogButtonBox->standardButton( currentButton )
== QDialogButtonBox::Retry )
{
currentButton->setText( qtr( "&Recheck version" ) );
qobject_cast<QPushButton *>(currentButton)->setDefault( true );
}
}
CONNECT( ui.updateDialogButtonBox, accepted(), this, UpdateOrDownload() );
CONNECT( ui.updateDialogButtonBox, rejected(), this, close() ); CONNECT( ui.updateDialogButtonBox, rejected(), this, close() );
CONNECT( ui.updateNotifyButtonBox, accepted(), this, UpdateOrDownload() ); CONNECT( ui.updateNotifyButtonBox, accepted(), this, UpdateOrDownload() );
......
...@@ -149,6 +149,7 @@ p, li { white-space: pre-wrap; } ...@@ -149,6 +149,7 @@ p, li { white-space: pre-wrap; }
&lt;tr&gt; &lt;tr&gt;
&lt;td style=&quot;border: none;&quot;&gt; &lt;td style=&quot;border: none;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
...@@ -167,7 +168,7 @@ p, li { white-space: pre-wrap; } ...@@ -167,7 +168,7 @@ p, li { white-space: pre-wrap; }
<item row="1" column="0"> <item row="1" column="0">
<widget class="QDialogButtonBox" name="closeButtonBox"> <widget class="QDialogButtonBox" name="closeButtonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Close</set> <set>QDialogButtonBox::NoButton</set>
</property> </property>
</widget> </widget>
</item> </item>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<item> <item>
<widget class="QDialogButtonBox" name="updateDialogButtonBox"> <widget class="QDialogButtonBox" name="updateDialogButtonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Retry</set> <set>QDialogButtonBox::NoButton</set>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<item> <item>
<widget class="QDialogButtonBox" name="updateNotifyButtonBox"> <widget class="QDialogButtonBox" name="updateNotifyButtonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::No|QDialogButtonBox::Yes</set> <set>QDialogButtonBox::NoButton</set>
</property> </property>
</widget> </widget>
</item> </item>
......
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