[vlc-devel] [PATCH] Added window roles for X11
Nick Pope
nick at nickpope.me.uk
Tue Sep 1 17:45:15 CEST 2009
Window roles can be used when configuring window managers to help users
place their windows and dialogs according to their preference. This is
particularly useful for some of the *box window managers.
---
modules/gui/qt4/components/playlist/playlist.cpp | 1 +
modules/gui/qt4/dialogs/bookmarks.cpp | 1 +
modules/gui/qt4/dialogs/convert.cpp | 1 +
modules/gui/qt4/dialogs/errors.cpp | 1 +
modules/gui/qt4/dialogs/extended.cpp | 1 +
modules/gui/qt4/dialogs/gototime.cpp | 1 +
modules/gui/qt4/dialogs/help.cpp | 1 +
modules/gui/qt4/dialogs/mediainfo.cpp | 1 +
modules/gui/qt4/dialogs/messages.cpp | 1 +
modules/gui/qt4/dialogs/open.cpp | 1 +
modules/gui/qt4/dialogs/openurl.cpp | 1 +
modules/gui/qt4/dialogs/playlist.cpp | 1 +
modules/gui/qt4/dialogs/plugins.cpp | 1 +
modules/gui/qt4/dialogs/preferences.cpp | 1 +
modules/gui/qt4/dialogs/sout.cpp | 1 +
modules/gui/qt4/dialogs/toolbar.cpp | 1 +
modules/gui/qt4/main_interface.cpp | 2 ++
17 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist.cpp b/modules/gui/qt4/components/playlist/playlist.cpp
index 8ad5d11..4ae5a30 100644
--- a/modules/gui/qt4/components/playlist/playlist.cpp
+++ b/modules/gui/qt4/components/playlist/playlist.cpp
@@ -115,6 +115,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i ) : p_intf ( _p_i )
setAcceptDrops( true );
setWindowTitle( qtr( "Playlist" ) );
+ setWindowRole( "vlc-playlist" );
setWindowIcon( QApplication::windowIcon() );
}
diff --git a/modules/gui/qt4/dialogs/bookmarks.cpp b/modules/gui/qt4/dialogs/bookmarks.cpp
index 9fa7615..950f724 100644
--- a/modules/gui/qt4/dialogs/bookmarks.cpp
+++ b/modules/gui/qt4/dialogs/bookmarks.cpp
@@ -38,6 +38,7 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
setWindowFlags( Qt::Tool );
setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) );
setWindowTitle( qtr( "Edit Bookmarks" ) );
+ setWindowRole( "vlc-bookmarks" );
QGridLayout *layout = new QGridLayout( this );
diff --git a/modules/gui/qt4/dialogs/convert.cpp b/modules/gui/qt4/dialogs/convert.cpp
index 332aa85..cd2c8a8 100644
--- a/modules/gui/qt4/dialogs/convert.cpp
+++ b/modules/gui/qt4/dialogs/convert.cpp
@@ -42,6 +42,7 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
: QVLCDialog( parent, _p_intf )
{
setWindowTitle( qtr( "Convert" ) );
+ setWindowRole( "vlc-convert" );
QGridLayout *mainLayout = new QGridLayout( this );
SoutInputBox *inputBox = new SoutInputBox( this );
diff --git a/modules/gui/qt4/dialogs/errors.cpp b/modules/gui/qt4/dialogs/errors.cpp
index a2bd94f..2dd0b8b 100644
--- a/modules/gui/qt4/dialogs/errors.cpp
+++ b/modules/gui/qt4/dialogs/errors.cpp
@@ -40,6 +40,7 @@ ErrorsDialog::ErrorsDialog( QWidget *parent, intf_thread_t *_p_intf )
: QVLCDialog( parent, _p_intf )
{
setWindowTitle( qtr( "Errors" ) );
+ setWindowRole( "vlc-errors" );
resize( 500 , 300 );
QGridLayout *layout = new QGridLayout( this );
diff --git a/modules/gui/qt4/dialogs/extended.cpp b/modules/gui/qt4/dialogs/extended.cpp
index ffc34f0..f4fe68b 100644
--- a/modules/gui/qt4/dialogs/extended.cpp
+++ b/modules/gui/qt4/dialogs/extended.cpp
@@ -40,6 +40,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
setWindowFlags( Qt::Tool );
setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) );
setWindowTitle( qtr( "Adjustments and Effects" ) );
+ setWindowRole( "vlc-extended" );
QGridLayout *layout = new QGridLayout( this );
layout->setLayoutMargins( 0, 2, 0, 1, 1 );
diff --git a/modules/gui/qt4/dialogs/gototime.cpp b/modules/gui/qt4/dialogs/gototime.cpp
index 78ecbc1..5832acd 100644
--- a/modules/gui/qt4/dialogs/gototime.cpp
+++ b/modules/gui/qt4/dialogs/gototime.cpp
@@ -41,6 +41,7 @@ GotoTimeDialog::GotoTimeDialog( QWidget *parent, intf_thread_t *_p_intf)
{
setWindowFlags( Qt::Tool );
setWindowTitle( qtr( "Go to Time" ) );
+ setWindowRole( "vlc-goto-time" );
QGridLayout *mainLayout = new QGridLayout( this );
mainLayout->setSizeConstraint( QLayout::SetFixedSize );
diff --git a/modules/gui/qt4/dialogs/help.cpp b/modules/gui/qt4/dialogs/help.cpp
index edcba52..0a4b642 100644
--- a/modules/gui/qt4/dialogs/help.cpp
+++ b/modules/gui/qt4/dialogs/help.cpp
@@ -53,6 +53,7 @@ HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{
setWindowTitle( qtr( "Help" ) );
+ setWindowRole( "vlc-help" );
setMinimumSize( 350, 300 );
QGridLayout *layout = new QGridLayout( this );
diff --git a/modules/gui/qt4/dialogs/mediainfo.cpp b/modules/gui/qt4/dialogs/mediainfo.cpp
index eb3f242..371e878 100644
--- a/modules/gui/qt4/dialogs/mediainfo.cpp
+++ b/modules/gui/qt4/dialogs/mediainfo.cpp
@@ -48,6 +48,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf,
isMainInputInfo = ( p_item == NULL );
setWindowTitle( qtr( "Media Information" ) );
+ setWindowRole( "vlc-media-info" );
/* TabWidgets and Tabs creation */
infoTabW = new QTabWidget;
diff --git a/modules/gui/qt4/dialogs/messages.cpp b/modules/gui/qt4/dialogs/messages.cpp
index 9789cf7..06442e5 100644
--- a/modules/gui/qt4/dialogs/messages.cpp
+++ b/modules/gui/qt4/dialogs/messages.cpp
@@ -73,6 +73,7 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
: QVLCFrame( _p_intf )
{
setWindowTitle( qtr( "Messages" ) );
+ setWindowRole( "vlc-messages" );
/* General widgets */
QGridLayout *mainLayout = new QGridLayout( this );
diff --git a/modules/gui/qt4/dialogs/open.cpp b/modules/gui/qt4/dialogs/open.cpp
index 487745c..ceb356f 100644
--- a/modules/gui/qt4/dialogs/open.cpp
+++ b/modules/gui/qt4/dialogs/open.cpp
@@ -78,6 +78,7 @@ OpenDialog::OpenDialog( QWidget *parent,
/* Basic Creation of the Window */
ui.setupUi( this );
setWindowTitle( qtr( "Open Media" ) );
+ setWindowRole( "vlc-open-media" );
setWindowModality( Qt::WindowModal );
/* Tab definition and creation */
diff --git a/modules/gui/qt4/dialogs/openurl.cpp b/modules/gui/qt4/dialogs/openurl.cpp
index 49a791b..24f4adc 100644
--- a/modules/gui/qt4/dialogs/openurl.cpp
+++ b/modules/gui/qt4/dialogs/openurl.cpp
@@ -60,6 +60,7 @@ OpenUrlDialog::OpenUrlDialog( QWidget *parent,
QVLCDialog( parent, _p_intf ), bClipboard( _bClipboard )
{
setWindowTitle( qtr( "Open URL" ) );
+ setWindowRole( "vlc-open-url" );
/* Buttons */
QPushButton *but;
diff --git a/modules/gui/qt4/dialogs/playlist.cpp b/modules/gui/qt4/dialogs/playlist.cpp
index 2736e52..2b51810 100644
--- a/modules/gui/qt4/dialogs/playlist.cpp
+++ b/modules/gui/qt4/dialogs/playlist.cpp
@@ -41,6 +41,7 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf )
QWidget *main = new QWidget( this );
setCentralWidget( main );
setWindowTitle( qtr( "Playlist" ) );
+ setWindowRole( "vlc-playlist" );
setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) );
QHBoxLayout *l = new QHBoxLayout( centralWidget() );
diff --git a/modules/gui/qt4/dialogs/plugins.cpp b/modules/gui/qt4/dialogs/plugins.cpp
index 1575ca0..9ab3e36 100644
--- a/modules/gui/qt4/dialogs/plugins.cpp
+++ b/modules/gui/qt4/dialogs/plugins.cpp
@@ -43,6 +43,7 @@ PluginDialog *PluginDialog::instance = NULL;
PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{
setWindowTitle( qtr( "Plugins and extensions" ) );
+ setWindowRole( "vlc-plugins" );
QGridLayout *layout = new QGridLayout( this );
/* Main Tree for modules */
diff --git a/modules/gui/qt4/dialogs/preferences.cpp b/modules/gui/qt4/dialogs/preferences.cpp
index 89864d7..150dea8 100644
--- a/modules/gui/qt4/dialogs/preferences.cpp
+++ b/modules/gui/qt4/dialogs/preferences.cpp
@@ -44,6 +44,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
{
QGridLayout *main_layout = new QGridLayout( this );
setWindowTitle( qtr( "Preferences" ) );
+ setWindowRole( "vlc-preferences" );
/* Whether we want it or not, we need to destroy on close to get
consistency when reset */
diff --git a/modules/gui/qt4/dialogs/sout.cpp b/modules/gui/qt4/dialogs/sout.cpp
index ee603e5..2b99389 100644
--- a/modules/gui/qt4/dialogs/sout.cpp
+++ b/modules/gui/qt4/dialogs/sout.cpp
@@ -40,6 +40,7 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
: QVLCDialog( parent, _p_intf )
{
setWindowTitle( qtr( "Stream Output" ) );
+ setWindowRole( "vlc-stream-output" );
/* UI stuff */
ui.setupUi( this );
diff --git a/modules/gui/qt4/dialogs/toolbar.cpp b/modules/gui/qt4/dialogs/toolbar.cpp
index f3a6ca3..0f67025 100644
--- a/modules/gui/qt4/dialogs/toolbar.cpp
+++ b/modules/gui/qt4/dialogs/toolbar.cpp
@@ -45,6 +45,7 @@ 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 );
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 1807f3c..504d161 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -105,6 +105,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
/* Main settings */
setFocusPolicy( Qt::StrongFocus );
setAcceptDrops( true );
+ setWindowRole( "vlc-main" );
setWindowIcon( QApplication::windowIcon() );
setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) );
@@ -605,6 +606,7 @@ int MainInterface::privacyDialog( QList<ConfigControl *> *controls )
QDialog *privacy = new QDialog( this );
privacy->setWindowTitle( qtr( "Privacy and Network Policies" ) );
+ privacy->setWindowRole( "vlc-privacy" );
QGridLayout *gLayout = new QGridLayout( privacy );
--
1.6.3.3
More information about the vlc-devel
mailing list