Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
6119143e
Commit
6119143e
authored
Sep 16, 2012
by
Vasily Fomin
Committed by
Jean-Baptiste Kempf
Sep 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: Automatic file extension in Transcode/Save
Close #4345 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
f447119e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
modules/gui/qt4/dialogs/convert.cpp
modules/gui/qt4/dialogs/convert.cpp
+23
-2
modules/gui/qt4/dialogs/convert.hpp
modules/gui/qt4/dialogs/convert.hpp
+1
-0
No files found.
modules/gui/qt4/dialogs/convert.cpp
View file @
6119143e
...
...
@@ -106,14 +106,19 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
BUTTONACT
(
cancelButton
,
cancel
());
CONNECT
(
dumpBox
,
toggled
(
bool
),
this
,
dumpChecked
(
bool
));
CONNECT
(
profile
,
optionsChanged
(),
this
,
setDestinationFileExtension
());
CONNECT
(
fileLine
,
editingFinished
(),
this
,
setDestinationFileExtension
());
}
void
ConvertDialog
::
fileBrowse
()
{
QString
fileExtension
=
"."
+
profile
->
getMux
();
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
qtr
(
"Save file..."
),
""
,
qtr
(
"Containers (*.ps *.ts *.mpg *.ogg *.asf *.mp4 *.mov *.wav *.raw *.flv *.webm
)"
)
);
""
,
QString
(
qtr
(
"Containers (*"
)
+
fileExtension
+
"
)"
)
);
fileLine
->
setText
(
toNativeSeparators
(
fileName
)
);
setDestinationFileExtension
();
}
void
ConvertDialog
::
cancel
()
...
...
@@ -156,3 +161,19 @@ void ConvertDialog::dumpChecked( bool checked )
displayBox
->
setEnabled
(
!
checked
);
profile
->
setEnabled
(
!
checked
);
}
void
ConvertDialog
::
setDestinationFileExtension
()
{
if
(
!
fileLine
->
text
().
isEmpty
()
)
{
QString
newFileExtension
=
"."
+
profile
->
getMux
();
QString
newFileName
;
int
index
=
fileLine
->
text
().
lastIndexOf
(
"."
);
if
(
index
!=
-
1
)
{
newFileName
=
fileLine
->
text
().
left
(
index
).
append
(
newFileExtension
);
}
else
{
newFileName
=
fileLine
->
text
().
append
(
newFileExtension
);
}
fileLine
->
setText
(
toNativeSeparators
(
newFileName
)
);
}
}
modules/gui/qt4/dialogs/convert.hpp
View file @
6119143e
...
...
@@ -50,6 +50,7 @@ private slots:
virtual
void
cancel
();
void
fileBrowse
();
void
dumpChecked
(
bool
);
void
setDestinationFileExtension
();
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment