]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/plugins.cpp
Added window roles for X11
[vlc] / modules / gui / qt4 / dialogs / plugins.cpp
index 9b1665d2e425edbe7975522d94cf4aca04411a51..9ab3e36e607c2a0a14fa0f4fd890e41f71f4dfc9 100644 (file)
 #include <QLineEdit>
 #include <QLabel>
 
+PluginDialog *PluginDialog::instance = NULL;
+
 PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
 {
-    setAttribute( Qt::WA_DeleteOnClose );
-
     setWindowTitle( qtr( "Plugins and extensions" ) );
+    setWindowRole( "vlc-plugins" );
     QGridLayout *layout = new QGridLayout( this );
 
     /* Main Tree for modules */
@@ -57,7 +58,7 @@ PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
     treePlugins->setColumnWidth( 0, 200 );
 
     QStringList headerNames;
-    headerNames << _("Name") << _("Capability" ) << _( "Score" );
+    headerNames << qtr("Name") << qtr("Capability" ) << qtr( "Score" );
     treePlugins->setHeaderLabels( headerNames );
 
     FillTree();
@@ -70,24 +71,24 @@ PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
     treePlugins->setSortingEnabled( true );
     treePlugins->sortByColumn( 1, Qt::AscendingOrder );
 
-    QLabel *label = new QLabel( _("&Search:"), this );
+    QLabel *label = new QLabel( qtr("&Search:"), this );
     edit = new SearchLineEdit( this );
     label->setBuddy( edit );
 
     layout->addWidget( label, 1, 0 );
     layout->addWidget( edit, 1, 1, 1, -1 );
-    CONNECT( edit, textChanged( QString ),
-            this, search( QString ) );
+    CONNECT( edit, textChanged( const QString& ),
+            this, search( const QString& ) );
 
     QDialogButtonBox *box = new QDialogButtonBox;
-    QPushButton *okButton = new QPushButton( "ok", this );
+    QPushButton *okButton = new QPushButton( qtr( "&Close" ), this );
     box->addButton( okButton, QDialogButtonBox::AcceptRole );
     layout->addWidget( box, 2, 2 );
 
     BUTTONACT( okButton, close() );
 
     setMinimumSize( 500, 300 );
-    readSettings( "Plugins", QSize( 500, 300 ) );
+    readSettings( "Plugins", QSize( 540, 400 ) );
 }
 
 inline void PluginDialog::FillTree()
@@ -101,13 +102,16 @@ inline void PluginDialog::FillTree()
         qs_item << qfu( module_get_name( p_module, true ) )
                 << qfu( module_get_capability( p_module ) )
                 << QString::number( module_get_score( p_module ) );
+#ifndef DEBUG
+        if( qs_item.at(1).isEmpty() ) continue;
+#endif
 
         QTreeWidgetItem *item = new QTreeWidgetItem( qs_item );
         treePlugins->addTopLevelItem( item );
     }
 }
 
-void PluginDialog::search( const QString qs )
+void PluginDialog::search( const QString& qs )
 {
     QList<QTreeWidgetItem *> items = treePlugins->findItems( qs, Qt::MatchContains );
     items += treePlugins->findItems( qs, Qt::MatchContains, 1 );