X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fqt4.hpp;h=8678b792ce26d15c87efd22c0ad130c5c72703f8;hb=fe145872fccb389edc97c3dea2463f4956bc3db4;hp=6bde27156959e2756d58fe83ba01014ac090cabe;hpb=152b1687c0ec112f3ab1360006d048d6b9cf7258;p=vlc diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp index 6bde271569..8678b792ce 100644 --- a/modules/gui/qt4/qt4.hpp +++ b/modules/gui/qt4/qt4.hpp @@ -33,21 +33,17 @@ #include /* intf_thread_t */ #include /* playlist_t */ -#include +#define QT_NO_CAST_TO_ASCII #include #if ( QT_VERSION < 0x040400 ) -# error Update your Qt version +# error Update your Qt version to at least 4.4.0 #endif #if QT_VERSION == 0x040500 -# warning Please update Qt version to 4.5.1. This warning will become an error. +# error Please update Qt version to 4.5.1. 4.5.0 is too buggy #endif -enum { - QT_NORMAL_MODE = 0, - QT_ALWAYS_VIDEO_MODE, - QT_MINIMAL_MODE -}; +#define HAS_QT45 ( QT_VERSION >= 0x040500 ) enum { DialogEventType = 0, @@ -78,7 +74,6 @@ struct intf_sys_t QString filepath; /* Last path used in dialogs */ - QMenu * p_popup_menu; /* The right click menu */ }; #define THEPL p_intf->p_sys->p_playlist @@ -87,12 +82,16 @@ struct intf_sys_t #define THEDP DialogsProvider::getInstance() #define THEMIM MainInputManager::getInstance( p_intf ) +#define THEAM ActionsManager::getInstance( p_intf ) #define qfu( i ) QString::fromUtf8( i ) #define qtr( i ) QString::fromUtf8( vlc_gettext(i) ) #define qtu( i ) ((i).toUtf8().constData()) -#define CONNECT( a, b, c, d ) connect( a, SIGNAL( b ), c, SLOT(d) ) +#define CONNECT( a, b, c, d ) \ + connect( a, SIGNAL( b ), c, SLOT(d) ) +#define DCONNECT( a, b, c, d ) \ + connect( a, SIGNAL( b ), c, SLOT(d), Qt::DirectConnection ) #define BUTTONACT( b, a ) connect( b, SIGNAL( clicked() ), this, SLOT(a) ) #define BUTTON_SET( button, text, tooltip ) \ @@ -116,9 +115,16 @@ struct intf_sys_t #define TOGGLEV( x ) { if( x->isVisible() ) x->hide(); \ else x->show(); } -#define setLayoutMargins( a, b, c, d, e) setContentsMargins( a, b, c, d ) - #define getSettings() p_intf->p_sys->mainSettings +static inline QString QVLCUserDir( vlc_userdir_t type ) +{ + char *dir = config_GetUserDir( type ); + if( !dir ) + return ""; + QString res = qfu( dir ); + free( dir ); + return res; +} #endif