mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 20:01:53 +00:00
Automatically set the output filename if the user wants that.
This commit is contained in:
parent
1b83f04cd5
commit
d62e9f5c5e
@ -1,10 +1,16 @@
|
|||||||
2004-03-09 Moritz Bunkus <moritz@bunkus.org>
|
2004-03-09 Moritz Bunkus <moritz@bunkus.org>
|
||||||
|
|
||||||
|
* mmg: new feature: Automatically set the output file name when
|
||||||
|
the first file is added to the same name but with a '.mkv'
|
||||||
|
extension if it hasn't been set yet. Can be disabled on the
|
||||||
|
'settings' page.
|
||||||
|
|
||||||
* mkvmerge: bug fix: More of the non-ASCII character fixes (in
|
* mkvmerge: bug fix: More of the non-ASCII character fixes (in
|
||||||
--tags and --chapters this time).
|
--tags and --chapters this time).
|
||||||
|
|
||||||
* mkvmerge/mmg: new feature: Made the process priority selectable
|
* mkvmerge/mmg: new feature: Made the process priority selectable
|
||||||
and default to 'normal' again (was 'lower' before).
|
on the 'settings' page and default to 'normal' again (was 'lower'
|
||||||
|
before).
|
||||||
|
|
||||||
2004-03-07 Moritz Bunkus <moritz@bunkus.org>
|
2004-03-07 Moritz Bunkus <moritz@bunkus.org>
|
||||||
|
|
||||||
|
@ -1234,12 +1234,25 @@ mmg_dialog::on_window_selected(wxCommandEvent &evt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mmg_dialog::set_title_maybe(const char *new_title) {
|
mmg_dialog::set_title_maybe(const wxString &new_title) {
|
||||||
if ((strlen(new_title) > 0) &&
|
if ((new_title.length() > 0) &&
|
||||||
(global_page->tc_title->GetValue().length() == 0))
|
(global_page->tc_title->GetValue().length() == 0))
|
||||||
global_page->tc_title->SetValue(new_title);
|
global_page->tc_title->SetValue(new_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mmg_dialog::set_output_maybe(const wxString &new_output) {
|
||||||
|
wxString output;
|
||||||
|
|
||||||
|
if (settings_page->cb_autoset_output_filename->IsChecked() &&
|
||||||
|
(new_output.length() > 0) &&
|
||||||
|
(tc_output->GetValue().length() == 0)) {
|
||||||
|
output = new_output.BeforeLast('.');
|
||||||
|
output += ".mkv";
|
||||||
|
tc_output->SetValue(output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IMPLEMENT_CLASS(mmg_dialog, wxFrame);
|
IMPLEMENT_CLASS(mmg_dialog, wxFrame);
|
||||||
BEGIN_EVENT_TABLE(mmg_dialog, wxFrame)
|
BEGIN_EVENT_TABLE(mmg_dialog, wxFrame)
|
||||||
EVT_BUTTON(ID_B_BROWSEOUTPUT, mmg_dialog::on_browse_output)
|
EVT_BUTTON(ID_B_BROWSEOUTPUT, mmg_dialog::on_browse_output)
|
||||||
|
@ -149,7 +149,8 @@ public:
|
|||||||
|
|
||||||
void on_window_selected(wxCommandEvent &evt);
|
void on_window_selected(wxCommandEvent &evt);
|
||||||
|
|
||||||
void set_title_maybe(const char *new_title);
|
void set_title_maybe(const wxString &new_title);
|
||||||
|
void set_output_maybe(const wxString &new_output);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern mmg_dialog *mdlg;
|
extern mmg_dialog *mdlg;
|
||||||
|
@ -634,7 +634,8 @@ void tab_input::on_add_file(wxCommandEvent &evt) {
|
|||||||
lb_input_files->Append(name);
|
lb_input_files->Append(name);
|
||||||
|
|
||||||
file.file_name = new wxString(dlg.GetPath());
|
file.file_name = new wxString(dlg.GetPath());
|
||||||
mdlg->set_title_maybe(file.title->c_str());
|
mdlg->set_title_maybe(*file.title);
|
||||||
|
mdlg->set_output_maybe(*file.file_name);
|
||||||
files.push_back(file);
|
files.push_back(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ tab_settings::tab_settings(wxWindow *parent):
|
|||||||
wxDefaultSize, 0);
|
wxDefaultSize, 0);
|
||||||
|
|
||||||
new wxStaticBox(this, -1, wxS("Miscellaneous options"), wxPoint(10, 65),
|
new wxStaticBox(this, -1, wxS("Miscellaneous options"), wxPoint(10, 65),
|
||||||
wxSize(475, 50));
|
wxSize(475, 75));
|
||||||
new wxStaticText(this, -1, wxS("Process priority:"), wxPoint(15, 85));
|
new wxStaticText(this, -1, wxS("Process priority:"), wxPoint(15, 85));
|
||||||
cob_priority =
|
cob_priority =
|
||||||
new wxComboBox(this, ID_COB_PRIORITY, wxS(""), wxPoint(120, 85 + YOFF),
|
new wxComboBox(this, ID_COB_PRIORITY, wxS(""), wxPoint(120, 85 + YOFF),
|
||||||
@ -60,6 +60,16 @@ tab_settings::tab_settings(wxWindow *parent):
|
|||||||
cob_priority->Append(wxS("lower"));
|
cob_priority->Append(wxS("lower"));
|
||||||
cob_priority->Append(wxS("lowest"));
|
cob_priority->Append(wxS("lowest"));
|
||||||
|
|
||||||
|
cb_autoset_output_filename =
|
||||||
|
new wxCheckBox(this, ID_CB_AUTOSET_OUTPUT_FILENAME,
|
||||||
|
wxS("Auto-set output filename"), wxPoint(15, 115 + YOFF));
|
||||||
|
cb_autoset_output_filename->
|
||||||
|
SetToolTip(wxS("If checked mmg will automatically set the output filename "
|
||||||
|
"if it hasn't been set already. This happens when you add "
|
||||||
|
"a file. It will be set to the same name as the "
|
||||||
|
"input file but with the extension '.mkv'. If unset mmg "
|
||||||
|
"will not touch the output filename."));
|
||||||
|
|
||||||
|
|
||||||
new wxStaticBox(this, -1, wxS("About"), wxPoint(10, 350),
|
new wxStaticBox(this, -1, wxS("About"), wxPoint(10, 350),
|
||||||
wxSize(475, 104));
|
wxSize(475, 104));
|
||||||
@ -100,7 +110,7 @@ tab_settings::on_browse(wxCommandEvent &evt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tab_settings::on_priority_selected(wxCommandEvent &evt) {
|
tab_settings::on_xyz_selected(wxCommandEvent &evt) {
|
||||||
save_preferences();
|
save_preferences();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,6 +118,7 @@ void
|
|||||||
tab_settings::load_preferences() {
|
tab_settings::load_preferences() {
|
||||||
wxConfig *cfg = (wxConfig *)wxConfigBase::Get();
|
wxConfig *cfg = (wxConfig *)wxConfigBase::Get();
|
||||||
wxString priority;
|
wxString priority;
|
||||||
|
bool b;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
cfg->SetPath(wxS("/GUI"));
|
cfg->SetPath(wxS("/GUI"));
|
||||||
@ -124,6 +135,10 @@ tab_settings::load_preferences() {
|
|||||||
cob_priority->SetSelection(i);
|
cob_priority->SetSelection(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!cfg->Read(wxS("autoset_output_filename"), &b))
|
||||||
|
b = true;
|
||||||
|
cb_autoset_output_filename->SetValue(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -132,6 +147,8 @@ tab_settings::save_preferences() {
|
|||||||
cfg->SetPath(wxS("/GUI"));
|
cfg->SetPath(wxS("/GUI"));
|
||||||
cfg->Write(wxS("mkvmerge_executable"), tc_mkvmerge->GetValue());
|
cfg->Write(wxS("mkvmerge_executable"), tc_mkvmerge->GetValue());
|
||||||
cfg->Write(wxS("process_priority"), cob_priority->GetValue());
|
cfg->Write(wxS("process_priority"), cob_priority->GetValue());
|
||||||
|
cfg->Write(wxS("autoset_output_filename"),
|
||||||
|
cb_autoset_output_filename->IsChecked());
|
||||||
cfg->Flush();
|
cfg->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,5 +191,6 @@ tab_settings::query_mkvmerge_capabilities() {
|
|||||||
IMPLEMENT_CLASS(tab_settings, wxPanel);
|
IMPLEMENT_CLASS(tab_settings, wxPanel);
|
||||||
BEGIN_EVENT_TABLE(tab_settings, wxPanel)
|
BEGIN_EVENT_TABLE(tab_settings, wxPanel)
|
||||||
EVT_BUTTON(ID_B_BROWSEMKVMERGE, tab_settings::on_browse)
|
EVT_BUTTON(ID_B_BROWSEMKVMERGE, tab_settings::on_browse)
|
||||||
EVT_COMBOBOX(ID_COB_PRIORITY, tab_settings::on_priority_selected)
|
EVT_COMBOBOX(ID_COB_PRIORITY, tab_settings::on_xyz_selected)
|
||||||
|
EVT_CHECKBOX(ID_CB_AUTOSET_OUTPUT_FILENAME, tab_settings::on_xyz_selected)
|
||||||
END_EVENT_TABLE();
|
END_EVENT_TABLE();
|
||||||
|
@ -25,13 +25,14 @@
|
|||||||
#define ID_TC_MKVMERGE 15000
|
#define ID_TC_MKVMERGE 15000
|
||||||
#define ID_B_BROWSEMKVMERGE 15001
|
#define ID_B_BROWSEMKVMERGE 15001
|
||||||
#define ID_COB_PRIORITY 15002
|
#define ID_COB_PRIORITY 15002
|
||||||
|
#define ID_CB_AUTOSET_OUTPUT_FILENAME 15003
|
||||||
|
|
||||||
class tab_settings: public wxPanel {
|
class tab_settings: public wxPanel {
|
||||||
DECLARE_CLASS(tab_settings);
|
DECLARE_CLASS(tab_settings);
|
||||||
DECLARE_EVENT_TABLE();
|
DECLARE_EVENT_TABLE();
|
||||||
public:
|
public:
|
||||||
wxTextCtrl *tc_mkvmerge;
|
wxTextCtrl *tc_mkvmerge;
|
||||||
wxCheckBox *cb_show_commandline;
|
wxCheckBox *cb_show_commandline, *cb_autoset_output_filename;
|
||||||
wxComboBox *cob_priority;
|
wxComboBox *cob_priority;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -39,7 +40,7 @@ public:
|
|||||||
virtual ~tab_settings();
|
virtual ~tab_settings();
|
||||||
|
|
||||||
void on_browse(wxCommandEvent &evt);
|
void on_browse(wxCommandEvent &evt);
|
||||||
void on_priority_selected(wxCommandEvent &evt);
|
void on_xyz_selected(wxCommandEvent &evt);
|
||||||
|
|
||||||
void load_preferences();
|
void load_preferences();
|
||||||
void save_preferences();
|
void save_preferences();
|
||||||
|
Loading…
Reference in New Issue
Block a user