Commit 9b87b8bb authored by Clement CHAVANCE's avatar Clement CHAVANCE

Transcode UI added, but without translations

parent 1667afd2
......@@ -27,6 +27,7 @@
#include "MainWindow.h"
#include "Timeline.h"
#include "About.h"
#include "Transcode.h"
MainWindow::MainWindow( QWidget *parent ) :
QMainWindow( parent )
......@@ -92,3 +93,8 @@ void MainWindow::on_actionAbout_triggered()
{
About::instance()->exec();
}
void MainWindow::on_actionTranscode_File_triggered()
{
Transcode::instance( this )->exec();
}
......@@ -52,6 +52,7 @@ private slots:
void on_actionQuit_triggered();
void on_actionAbout_triggered();
void on_actionPreferences_triggered();
void on_actionTranscode_File_triggered();
signals:
void translateDockWidgetTitle();
......
/*****************************************************************************
* Transcode.cpp : File Transcoder
*****************************************************************************
* copyright (c) 2008-2009 the vlmc team
*
* authors: clement chavance <chavance.c@gmail.com>
*
* this program is free software; you can redistribute it and/or
* modify it under the terms of the gnu general public license
* as published by the free software foundation; either version 2
* of the license, or (at your option) any later version.
*
* this program is distributed in the hope that it will be useful,
* but without any warranty; without even the implied warranty of
* merchantability or fitness for a particular purpose. see the
* gnu general public license for more details.
*
* you should have received a copy of the gnu general public license
* along with this program; if not, write to the free software
* foundation, inc., 51 franklin street, fifth floor, boston ma 02110-1301, usa.
*****************************************************************************/
//DEBUG
#include <QtDebug>
//DEBUG
#include <QMessageBox>
#include <QFileDialog>
#include <QDir>
#include "Transcode.h"
Transcode *Transcode::m_instance = NULL;
Transcode *Transcode::instance( QWidget *parent )
{
if (Transcode::m_instance == NULL)
Transcode::m_instance = new Transcode( parent );
return ( Transcode::m_instance );
}
Transcode::Transcode( QWidget *parent )
: QDialog( parent )
{
m_ui.setupUi( this );
//TODO : load every known profiles
m_ui.profileSelector->addItem( tr( "High Quality" ), "high" );
m_ui.profileSelector->addItem( tr( "Medium Quality" ), "medium" );
m_ui.profileSelector->addItem( tr( "Low Quality" ), "low" );
}
void Transcode::on_browseFileButton_clicked()
{
QString path = QFileDialog::getOpenFileName( this,
tr( "Choose File to open" ),
QDir::currentPath(),
tr( "Video files (*.avi *.mkv *.ogg)" ) );
if (path == "")
return ;
m_origVidPath = path;
m_ui.inputFileBox->setText( path );
}
void Transcode::on_dialogButtonBox_accepted()
{
if (m_origVidPath == "")
{
QMessageBox::warning( this,
tr( "Warning" ),
tr( "Choose a video to transcode" ) );
return ;
}
QString path = QFileDialog::getOpenFileName( this,
tr( "Choose File to save" ),
m_origVidPath,
tr( "Video files (*.avi *.mkv *.ogg)" ) );
if (path == "")
return ;
//TODO : launch transcode
close();
}
void Transcode::on_dialogButtonBox_rejected()
{
close();
}
void Transcode::on_addProfile_clicked()
{
//show the profiles management widget;
}
void Transcode::on_editProfile_clicked()
{
//show the profile management widget and load the selected profile
}
void Transcode::on_deleteProfile_clicked()
{
}
/*****************************************************************************
* Transcode.h : File Transcoder
*****************************************************************************
* copyright (c) 2008-2009 the vlmc team
*
* authors: clement chavance <chavance.c@gmail.com>
*
* this program is free software; you can redistribute it and/or
* modify it under the terms of the gnu general public license
* as published by the free software foundation; either version 2
* of the license, or (at your option) any later version.
*
* this program is distributed in the hope that it will be useful,
* but without any warranty; without even the implied warranty of
* merchantability or fitness for a particular purpose. see the
* gnu general public license for more details.
*
* you should have received a copy of the gnu general public license
* along with this program; if not, write to the free software
* foundation, inc., 51 franklin street, fifth floor, boston ma 02110-1301, usa.
*****************************************************************************/
#ifndef TRANSCODE_H
#define TRANSCODE_H
#include <QDialog>
#include <QString>
#include "ui_transcode.h"
class Transcode : public QDialog
{
Q_OBJECT
Q_DISABLE_COPY( Transcode )
public:
static Transcode *instance( QWidget* parent = 0 );
private:
explicit Transcode( QWidget *parent = 0 );
~Transcode() {}
Ui::Transcode m_ui;
QString m_origVidPath;
static Transcode *m_instance;
public slots:
void on_browseFileButton_clicked();
void on_dialogButtonBox_accepted();
void on_dialogButtonBox_rejected();
void on_addProfile_clicked();
void on_editProfile_clicked();
void on_deleteProfile_clicked();
};
#endif
......@@ -34,6 +34,7 @@
<property name="title">
<string>File</string>
</property>
<addaction name="actionTranscode_File"/>
<addaction name="actionQuit"/>
</widget>
<widget class="QMenu" name="menuEdit">
......@@ -123,6 +124,11 @@
<string>Preview</string>
</property>
</action>
<action name="actionTranscode_File">
<property name="text">
<string>Transcode File</string>
</property>
</action>
</widget>
<resources>
<include location="../../../ressources.qrc"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Transcode</class>
<widget class="QWidget" name="Transcode">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>584</width>
<height>234</height>
</rect>
</property>
<property name="windowTitle">
<string>Transcode File</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_4" columnstretch="0,0">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Input File</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Profiles</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLineEdit" name="inputFileBox"/>
</item>
<item>
<widget class="QToolButton" name="browseFileButton">
<property name="text">
<string>...</string>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QComboBox" name="profileSelector"/>
</item>
<item>
<widget class="QPushButton" name="editProfile">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="deleteProfile">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addProfile">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1">
<widget class="QDialogButtonBox" name="dialogButtonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
......@@ -28,7 +28,8 @@ SOURCES += src/main.cpp \
src/gui/MediaListWidget.cpp \
src/Media.cpp \
src/OutputMedia.cpp \
src/gui/About.cpp
src/gui/About.cpp \
src/gui/Transcode.cpp
HEADERS += src/gui/MainWindow.h \
src/gui/DockWidgetManager.h \
src/gui/LibraryWidget.h \
......@@ -50,13 +51,15 @@ HEADERS += src/gui/MainWindow.h \
src/Image.h \
src/gui/MediaListWidget.h \
src/OutputMedia.h \
src/gui/About.h
src/gui/About.h \
src/gui/Transcode.h
FORMS += src/gui/ui/MainWindow.ui \
src/gui/ui/PreviewWidget.ui \
src/gui/ui/Preferences.ui \
src/gui/ui/Timeline.ui \
src/gui/ui/LibraryWidget.ui \
src/gui/ui/About.ui
src/gui/ui/About.ui \
src/gui/ui/Transcode.ui
FORMS +=
TRANSLATIONS = ts/vlmc_es.ts \
ts/vlmc_fr.ts \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment