Hi
In actual CVS version avifile respect the QT3 themes, but some themes are 
partialy broken (for exsample mosfet-liquid). In these themes are no 
symbols on buttons. Zdenek told me that it is not important, byt i need 
it. I made small patch to allow select another theme for aviplay 
(included). Byt i don't know how aviplay save the settings and selected 
theme is not saved :-((( (Zdenek pls can u add it ?).

        MOJE

P.S Tomorrow i go out for 1 month (without internet). If u want tu mail me 
do it now or wait.

-- 
Tomas Konir
Brno
ICQ 25849167

diff -Nur avifile-0.6/player/configdialog.cpp avifile-0.6-moje/player/configdialog.cpp
--- avifile-0.6/player/configdialog.cpp 2002-07-24 20:38:37.000000000 +0200
+++ avifile-0.6-moje/player/configdialog.cpp    2002-07-25 18:48:36.000000000 +0200
@@ -12,6 +12,8 @@
 #include <qtooltip.h>
 #include <qvalidator.h>
 #include <qwhatsthis.h>
+#include <qstylefactory.h>
+#include <qapplication.h>
 
 #include "configdialog.h"
 
@@ -227,6 +229,35 @@
     }
 };
 
+class ThemeGroupBox: public QGroupBox
+{
+public:
+    ThemeGroupBox( ConfigDialog& m, QWidget* parent ) : QGroupBox( parent )
+    {
+       setTitle( tr( "Theme selector" ) );
+       setColumnLayout( LAYOUTCOL, Qt::Horizontal );
+
+       QGridLayout* gl = new QGridLayout( this->layout(), 1, 1 );
+       gl->setSpacing(10);
+
+        m.m_pNoDefaultTheme = new QCheckBox( tr( "&Use another theme" ), this );
+       gl->addWidget(m.m_pNoDefaultTheme, 0, 0);
+
+        m.m_pThemeList = new QComboBox( this );
+
+        QStringList list = QStyleFactory::keys();
+        list.sort();
+        m.m_pThemeList->insertStringList( list );
+       m.m_pThemeList->setEnabled(FALSE);
+
+       gl->addWidget(m.m_pThemeList,1,0);
+
+        QLabel* l = new QLabel( tr( "Theme " ), this );
+       gl->addWidget( l, 1, 1 );
+    }
+};
+
+
 class DecoderGroupBox: public QGroupBox
 {
 public:
@@ -274,6 +305,9 @@
     vl->addWidget(m_pDisplayFramePos);
 
     gl->addWidget(gb3, 1, 0);
+    
+    QGroupBox* t = new ThemeGroupBox( *this, w );
+    gl->addWidget(t, 2, 0);        
 
     gl->setColStretch(10, 1);
     gl->setRowStretch(10, 1);
diff -Nur avifile-0.6/player/configdialog.h avifile-0.6-moje/player/configdialog.h
--- avifile-0.6/player/configdialog.h   2002-07-18 18:35:05.000000000 +0200
+++ avifile-0.6-moje/player/configdialog.h      2002-07-25 18:48:36.000000000 +0200
@@ -37,6 +37,7 @@
     QCheckBox* m_pVideoDirect;
     QCheckBox* m_pVideoDropping;
     QCheckBox* m_pUseProxy;
+    QCheckBox* m_pNoDefaultTheme;
     QLabel* m_pAsync;
     QLabel* m_pFontType;
     QLabel* m_pPreview;
@@ -59,6 +60,7 @@
     //QPushButton* m_pVideoUp;
     //QPushButton* m_pVideoDown;
     QListBox* m_pAudioList;
+    QComboBox* m_pThemeList;
 
 protected:
     bool event( QEvent* );
diff -Nur avifile-0.6/player/configdialog_impl.cpp 
avifile-0.6-moje/player/configdialog_impl.cpp
--- avifile-0.6/player/configdialog_impl.cpp    2002-07-24 20:38:37.000000000 +0200
+++ avifile-0.6-moje/player/configdialog_impl.cpp       2002-07-25 18:52:52.000000000 
++0200
@@ -8,6 +8,7 @@
 #include <qpushbutton.h>
 #include <qslider.h>
 #include <qspinbox.h>
+#include <qapplication.h>
 
 #include "configdialog_impl.h"
 #include "playercontrol.h"
@@ -205,6 +206,7 @@
 
     connect(m_pUseProxy, SIGNAL(clicked()), this, SLOT(onProxyToggled()));
     connect(m_pAudioResampling, SIGNAL(clicked()), this, 
SLOT(onAudioResamplingToggled()));
+    connect(m_pNoDefaultTheme, SIGNAL(clicked()), this, SLOT(onNoDefaultTheme()));
     connect(m_pFontButton, SIGNAL(clicked()), this, SLOT(onFont()));
 
     connect(m_pDefAudio, SIGNAL(valueChanged(int)), this, 
SLOT(onAudioStreamChanged(int)));
@@ -317,9 +319,18 @@
     m_pAudioPlayingRate->setEnabled(s);
 }
 
+void ConfigDialog_impl::onNoDefaultTheme() 
+{ 
+    bool s = m_pNoDefaultTheme->isChecked(); 
+    m_pThemeList->setEnabled(s); 
+} 
+  
+
 void ConfigDialog_impl::apply()
 {
     IAviPlayer* p = m_pPlayer->GetPlayer();
+    if(m_pNoDefaultTheme->isChecked()) 
+       qApp->setStyle(m_pThemeList->currentText());
 #if QT_VERSION >= 300
     if (m_bFontChanged && m_defFont.toString().ascii())
 #else
diff -Nur avifile-0.6/player/configdialog_impl.h 
avifile-0.6-moje/player/configdialog_impl.h
--- avifile-0.6/player/configdialog_impl.h      2002-07-24 20:38:37.000000000 +0200
+++ avifile-0.6-moje/player/configdialog_impl.h 2002-07-25 18:48:36.000000000 +0200
@@ -21,6 +21,7 @@
     void onAsyncValChanged(int);
     void onSubAsyncValChanged(int);
     void onAudioResamplingToggled();
+    void onNoDefaultTheme();
     void onAudioStreamChanged(int);
     void onFont();
     void onFontChanged();

Reply via email to