]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/vlm.cpp
i18n fixes
[vlc] / modules / gui / qt4 / dialogs / vlm.cpp
index 12bf3b4ded476bc24aaa28500ec64d334a55fe3f..16e2b34cffc4839deb5cb01f70a20379e70c431f 100644 (file)
@@ -53,7 +53,6 @@
 #include <QScrollArea>
 #include <QFileDialog>
 
-static const char *psz_type[] = { "Broadcast", "Schedule", "VOD" };
 
 VLMDialog *VLMDialog::instance = NULL;
 
@@ -73,9 +72,9 @@ VLMDialog::VLMDialog( QWidget *parent, intf_thread_t *_p_intf ) : QVLCDialog( pa
     ui.saveButton->hide();
 
 #define ADDMEDIATYPES( str, type ) ui.mediaType->addItem( qtr( str ), QVariant( type ) );
-    ADDMEDIATYPES( "Broadcast", QVLM_Broadcast );
-    ADDMEDIATYPES( "Schedule", QVLM_Schedule );
-    ADDMEDIATYPES( "Video On Demand ( VOD )", QVLM_VOD );
+    ADDMEDIATYPES( N_("Broadcast"), QVLM_Broadcast );
+    ADDMEDIATYPES( N_("Schedule"), QVLM_Schedule );
+    ADDMEDIATYPES( N_("Video On Demand ( VOD )"), QVLM_VOD );
 #undef ADDMEDIATYPES
 
     /* Schedule Stuffs */
@@ -130,10 +129,10 @@ VLMDialog::VLMDialog( QWidget *parent, intf_thread_t *_p_intf ) : QVLCDialog( pa
         new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding);
     vlmItemLayout->addItem( spacer );
 
-    QPushButton *importButton = new QPushButton( qtr( "Import" ) );
+    QPushButton *importButton = new QPushButton( qtr( "I&mport" ) );
     ui.buttonBox->addButton( importButton, QDialogButtonBox::ActionRole );
 
-    QPushButton *exportButton = new QPushButton( qtr( "Export" ) );
+    QPushButton *exportButton = new QPushButton( qtr( "E&xport" ) );
     ui.buttonBox->addButton( exportButton, QDialogButtonBox::ActionRole );
 
     QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
@@ -164,7 +163,7 @@ VLMDialog::~VLMDialog()
 {
     delete vlmWrapper;
 
-   /* FIXME :you have to destroy vlm here to close
+   /* TODO :you have to destroy vlm here to close
     * but we shouldn't destroy vlm here in case somebody else wants it */
     if( p_vlm )
     {
@@ -259,11 +258,11 @@ void VLMDialog::addVLMItem()
     clearWidgets();
 }
 
-// FIXME : VOD are not exported to the file
+/* TODO : VOD are not exported to the file */
 bool VLMDialog::exportVLMConf()
 {
     QString saveVLMConfFileName = QFileDialog::getSaveFileName(
-            this, qtr( "Choose a filename to save the VLM configuration..." ),
+            this, qtr( "Save VLM configuration as..." ),
             qfu( config_GetHomeDir() ),
             qtr( "VLM conf (*.vlm) ;; All (*.*)" ) );
 
@@ -333,7 +332,7 @@ void VLMDialog::mediasPopulator()
 bool VLMDialog::importVLMConf()
 {
     QString openVLMConfFileName = QFileDialog::getOpenFileName(
-            this, qtr( "Open a VLM Configuration File" ),
+            this, qtr( "Open VLM configuration..." ),
             qfu( config_GetHomeDir() ),
             qtr( "VLM conf (*.vlm) ;; All (*.*)" ) );
 
@@ -375,7 +374,7 @@ void VLMDialog::clearWidgets()
 
 void VLMDialog::selectInput()
 {
-    OpenDialog *o = OpenDialog::getInstance( this, p_intf, SELECT, true );
+    OpenDialog *o = OpenDialog::getInstance( this, p_intf, false, SELECT, true );
     o->exec();
     ui.inputLedit->setText( o->getMRL() );
 }
@@ -454,8 +453,7 @@ void VLMDialog::saveModifications()
             break;
            //           vlmObj->
         }
-        vlmObj->update(); /* It should call the correct function is VLMAWidget
-                             is abstract, but I am far from sure... FIXME ? */
+        vlmObj->update();
     }
     clearWidgets();
 }
@@ -492,11 +490,11 @@ VLMAWidget::VLMAWidget( QString _name,
     objLayout->addWidget( time, 1, 3, 1, 2 );*/
 
     QToolButton *modifyButton = new QToolButton;
-    modifyButton->setIcon( QIcon( QPixmap( ":/pixmaps/menus_settings_16px.png" ) ) );
+    modifyButton->setIcon( QIcon( QPixmap( ":/settings" ) ) );
     objLayout->addWidget( modifyButton, 0, 5 );
 
     QToolButton *deleteButton = new QToolButton;
-    deleteButton->setIcon( QIcon( QPixmap( ":/pixmaps/menus_quit_16px.png" ) ) );
+    deleteButton->setIcon( QIcon( QPixmap( ":/quit" ) ) );
     objLayout->addWidget( deleteButton, 0, 6 );
 
     BUTTONACT( modifyButton, modify() );
@@ -514,12 +512,6 @@ void VLMAWidget::del()
     parent->removeVLMItem( this );
 }
 
-//FIXME, remove me before release
-void VLMAWidget::enterEvent( QEvent *event )
-{
-    printf( "test" );
-}
-
 void VLMAWidget::toggleEnabled( bool b_enable )
 {
     VLMWrapper::EnableItem( name, b_enable );
@@ -533,17 +525,17 @@ VLMBroadcast::VLMBroadcast( QString _name, QString _input, QString _output,
                           : VLMAWidget( _name, _input, _output,
                                         _enabled, _parent, QVLM_Broadcast )
 {
-    nameLabel->setText( "Broadcast: " + name );
+    nameLabel->setText( qtr("Broadcast: ") + name );
     type = QVLM_Broadcast;
     b_looped = _looped;
 
     playButton = new QToolButton;
-    playButton->setIcon( QIcon( QPixmap( ":/pixmaps/play_16px.png" ) ) );
+    playButton->setIcon( QIcon( QPixmap( ":/play_16px" ) ) );
     objLayout->addWidget( playButton, 1, 0 );
     b_playing = true;
 
     QToolButton *stopButton = new QToolButton;
-    stopButton->setIcon( QIcon( QPixmap( ":/pixmaps/stop_16px.png" ) ) );
+    stopButton->setIcon( QIcon( QPixmap( ":/stop_16px" ) ) );
     objLayout->addWidget( stopButton, 1, 1 );
 
     loopButton = new QToolButton;
@@ -560,9 +552,9 @@ void VLMBroadcast::update()
 {
     VLMWrapper::EditBroadcast( name, input, output, b_enabled, b_looped );
     if( b_looped )
-        loopButton->setIcon( QIcon( QPixmap( ":/pixmaps/playlist_repeat_all.png" ) ) );
+        loopButton->setIcon( QIcon( QPixmap( ":/repeat_all" ) ) );
     else
-        loopButton->setIcon( QIcon( QPixmap( ":/pixmaps/playlist_repeat_off.png" ) ) );
+        loopButton->setIcon( QIcon( QPixmap( ":/repeat_off" ) ) );
 }
 
 void VLMBroadcast::togglePlayPause()
@@ -570,12 +562,12 @@ void VLMBroadcast::togglePlayPause()
     if( b_playing = true )
     {
         VLMWrapper::ControlBroadcast( name, ControlBroadcastPause );
-        playButton->setIcon( QIcon( QPixmap( ":/pixmaps/pause_16px.png" ) ) );
+        playButton->setIcon( QIcon( QPixmap( ":/pause_16px" ) ) );
     }
     else
     {
         VLMWrapper::ControlBroadcast( name, ControlBroadcastPlay );
-        playButton->setIcon( QIcon( QPixmap( ":/pixmaps/play_16px.png" ) ) );
+        playButton->setIcon( QIcon( QPixmap( ":/play_16px" ) ) );
     }
     b_playing = !b_playing;
 }
@@ -589,7 +581,7 @@ void VLMBroadcast::toggleLoop()
 void VLMBroadcast::stop()
 {
     VLMWrapper::ControlBroadcast( name, ControlBroadcastStop );
-    playButton->setIcon( QIcon( QPixmap( ":/pixmaps/play_16px.png" ) ) );
+    playButton->setIcon( QIcon( QPixmap( ":/play_16px" ) ) );
 }
 
 /****************
@@ -601,7 +593,7 @@ VLMSchedule::VLMSchedule( QString name, QString input, QString output,
                           bool enabled, VLMDialog *parent )
             : VLMAWidget( name, input, output, enabled, parent, QVLM_Schedule )
 {
-    nameLabel->setText( "Schedule: " + name );
+    nameLabel->setText( qtr("Schedule: ") + name );
     schetime = _schetime;
     schedate = _schedate;
     rNumber = _scherepeatnumber;
@@ -623,7 +615,7 @@ VLMVod::VLMVod( QString name, QString input, QString output,
                 bool enabled, QString _mux, VLMDialog *parent)
        : VLMAWidget( name, input, output, enabled, parent, QVLM_VOD )
 {
-    nameLabel->setText( "VOD:" + name );
+    nameLabel->setText( qtr("VOD: ") + name );
 
     mux = _mux;
     muxLabel = new QLabel;