2006-01-16 22:02:54 +01:00
|
|
|
// Copyright (c) 2005, Rodrigo Braz Monteiro, Niels Martin Hansen
|
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer in the documentation
|
|
|
|
// and/or other materials provided with the distribution.
|
|
|
|
// * Neither the name of the Aegisub Group nor the names of its contributors
|
|
|
|
// may be used to endorse or promote products derived from this software
|
|
|
|
// without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
// POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file dialog_export.cpp
|
|
|
|
/// @brief Export set-up dialogue box
|
|
|
|
/// @ingroup export
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
///////////
|
|
|
|
// Headers
|
2009-01-04 07:31:48 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
#include <wx/tokenzr.h>
|
2007-09-12 01:22:26 +02:00
|
|
|
#include <wx/button.h>
|
|
|
|
#include <wx/stattext.h>
|
|
|
|
#include <wx/filedlg.h>
|
|
|
|
#include <wx/msgdlg.h>
|
2006-01-16 22:02:54 +01:00
|
|
|
#include "dialog_export.h"
|
|
|
|
#include "ass_file.h"
|
|
|
|
#include "ass_exporter.h"
|
2009-07-14 23:28:49 +02:00
|
|
|
#include "charset_conv.h"
|
2008-01-14 00:34:38 +01:00
|
|
|
#include "help_button.h"
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Constructor
|
|
|
|
/// @param parent
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
DialogExport::DialogExport (wxWindow *parent)
|
|
|
|
: wxDialog (parent, -1, _("Export"), wxDefaultPosition, wxSize(200,100), wxCAPTION | wxCLOSE_BOX, _T("Export"))
|
|
|
|
{
|
|
|
|
// Filter list
|
2007-09-24 19:40:03 +02:00
|
|
|
wxSizer *TopSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Filters"));
|
2006-01-16 22:02:54 +01:00
|
|
|
Export = new AssExporter(AssFile::top);
|
|
|
|
wxArrayString filters = Export->GetAllFilterNames();
|
|
|
|
FilterList = new wxCheckListBox(this, Filter_List_Box, wxDefaultPosition, wxSize(200,100), filters);
|
|
|
|
|
|
|
|
// Get selected filters
|
|
|
|
wxString selected = Export->GetOriginalSubs()->GetScriptInfo(_T("Export filters"));
|
|
|
|
wxStringTokenizer token(selected, _T("|"));
|
|
|
|
int n = 0;
|
|
|
|
while (token.HasMoreTokens()) {
|
|
|
|
wxString cur = token.GetNextToken();
|
|
|
|
if (!cur.IsEmpty()) {
|
|
|
|
n++;
|
2006-12-18 18:18:14 +01:00
|
|
|
for (unsigned int i=0;i<FilterList->GetCount();i++) {
|
2006-01-16 22:02:54 +01:00
|
|
|
if (FilterList->GetString(i) == cur) {
|
|
|
|
FilterList->Check(i);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// No filters listed on header, select all
|
2007-01-19 12:50:07 +01:00
|
|
|
/*if (n == 0) {
|
2006-12-18 18:18:14 +01:00
|
|
|
for (unsigned int i=0;i<FilterList->GetCount();i++) {
|
2006-01-16 22:02:54 +01:00
|
|
|
FilterList->Check(i);
|
|
|
|
}
|
2007-01-19 12:50:07 +01:00
|
|
|
}*/
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
// Top buttons
|
|
|
|
wxSizer *TopButtons = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
TopButtons->Add(new wxButton(this,Button_Move_Up,_("Move up"),wxDefaultPosition,wxSize(90,-1)),1,wxEXPAND | wxRIGHT,0);
|
|
|
|
TopButtons->Add(new wxButton(this,Button_Move_Down,_("Move down"),wxDefaultPosition,wxSize(90,-1)),1,wxEXPAND | wxRIGHT,5);
|
|
|
|
TopButtons->Add(new wxButton(this,Button_Select_All,_("Select all"),wxDefaultPosition,wxSize(80,-1)),1,wxEXPAND | wxRIGHT,0);
|
|
|
|
TopButtons->Add(new wxButton(this,Button_Select_None,_("Select none"),wxDefaultPosition,wxSize(80,-1)),1,wxEXPAND | wxRIGHT,0);
|
|
|
|
|
2007-08-16 01:17:42 +02:00
|
|
|
// Description field
|
|
|
|
Description = new wxTextCtrl(this, -1, _T(""), wxDefaultPosition, wxSize(200,60), wxTE_MULTILINE | wxTE_READONLY);
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
// Charset dropdown list
|
|
|
|
wxStaticText *charset_list_label = new wxStaticText(this, -1, _("Text encoding:"));
|
2009-07-14 23:28:49 +02:00
|
|
|
CharsetList = new wxChoice(this, Charset_List_Box, wxDefaultPosition, wxDefaultSize, AegisubCSConv::GetEncodingsList());
|
2006-01-16 22:02:54 +01:00
|
|
|
wxSizer *charset_list_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
charset_list_sizer->Add(charset_list_label, 0, wxALIGN_CENTER | wxRIGHT, 5);
|
|
|
|
charset_list_sizer->Add(CharsetList, 1, wxEXPAND);
|
|
|
|
if (!CharsetList->SetStringSelection(Export->GetOriginalSubs()->GetScriptInfo(_T("Export Encoding")))) {
|
2009-07-14 23:28:49 +02:00
|
|
|
CharsetList->SetStringSelection(_T("Unicode (UTF-8)"));
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Top sizer
|
|
|
|
TopSizer->Add(FilterList,1,wxEXPAND,0);
|
|
|
|
TopSizer->Add(TopButtons,0,wxEXPAND,0);
|
|
|
|
TopSizer->Add(Description,0,wxEXPAND | wxTOP,5);
|
|
|
|
TopSizer->Add(charset_list_sizer, 0, wxEXPAND | wxTOP, 5);
|
|
|
|
|
|
|
|
// Button sizer
|
2008-01-14 00:34:38 +01:00
|
|
|
wxStdDialogButtonSizer *ButtonSizer = new wxStdDialogButtonSizer();
|
|
|
|
wxButton *process = new wxButton(this,Button_Process,_("Export..."));
|
|
|
|
ButtonSizer->AddButton(process);
|
|
|
|
ButtonSizer->AddButton(new wxButton(this,wxID_CANCEL));
|
|
|
|
ButtonSizer->AddButton(new HelpButton(this,_T("Export")));
|
|
|
|
ButtonSizer->SetAffirmativeButton(process);
|
|
|
|
ButtonSizer->Realize();
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
// Draw stuff sizer
|
|
|
|
HorizSizer = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
OptionsSizer = new wxBoxSizer(wxVERTICAL);
|
|
|
|
Export->DrawSettings(this,OptionsSizer);
|
|
|
|
HorizSizer->Add(TopSizer,0,wxEXPAND | wxLEFT | wxTOP | wxBOTTOM,5);
|
|
|
|
HorizSizer->Add(OptionsSizer,1,wxEXPAND | wxTOP | wxRIGHT | wxBOTTOM,5);
|
|
|
|
|
|
|
|
// Main sizer
|
|
|
|
MainSizer = new wxBoxSizer(wxVERTICAL);
|
|
|
|
MainSizer->Add(HorizSizer,1,wxEXPAND,0);
|
|
|
|
MainSizer->Add(ButtonSizer,0,wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM,5);
|
|
|
|
MainSizer->SetSizeHints(this);
|
|
|
|
SetSizer(MainSizer);
|
|
|
|
RefreshOptions();
|
|
|
|
CenterOnParent();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Destructor
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
DialogExport::~DialogExport() {
|
|
|
|
// Set script info data
|
|
|
|
int n = 0;
|
|
|
|
wxString infoList;
|
2006-12-18 18:18:14 +01:00
|
|
|
for (unsigned int i=0;i<FilterList->GetCount();i++) {
|
2006-01-16 22:02:54 +01:00
|
|
|
if (FilterList->IsChecked(i)) {
|
|
|
|
infoList += FilterList->GetString(i) + _T("|");
|
|
|
|
n++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (n > 0) infoList = infoList.Left(infoList.Length()-1);
|
|
|
|
Export->GetOriginalSubs()->SetScriptInfo(_T("Export filters"),infoList);
|
|
|
|
|
|
|
|
// Delete exporter
|
|
|
|
if (Export) delete Export;
|
|
|
|
Export = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Refresh displaying of options
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void DialogExport::RefreshOptions() {
|
|
|
|
int num = FilterList->GetCount();
|
|
|
|
for (int i=0;i<num;i++) {
|
|
|
|
wxSizer *sizer = Export->GetSettingsSizer(FilterList->GetString(i));
|
|
|
|
if (sizer) OptionsSizer->Show(sizer,FilterList->IsChecked(i)?1:0,true);
|
|
|
|
}
|
|
|
|
Layout();
|
|
|
|
MainSizer->Fit(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
///////////////
|
|
|
|
// Event table
|
|
|
|
BEGIN_EVENT_TABLE(DialogExport,wxDialog)
|
|
|
|
EVT_BUTTON(Button_Process,DialogExport::OnProcess)
|
|
|
|
EVT_BUTTON(Button_Move_Up,DialogExport::OnMoveUp)
|
|
|
|
EVT_BUTTON(Button_Move_Down,DialogExport::OnMoveDown)
|
|
|
|
EVT_BUTTON(Button_Select_All,DialogExport::OnSelectAll)
|
|
|
|
EVT_BUTTON(Button_Select_None,DialogExport::OnSelectNone)
|
|
|
|
EVT_CHECKLISTBOX(Filter_List_Box,DialogExport::OnCheck)
|
|
|
|
EVT_LISTBOX(Filter_List_Box, DialogExport::OnChange)
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Process start
|
|
|
|
/// @param event
|
|
|
|
/// @return
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void DialogExport::OnProcess(wxCommandEvent &event) {
|
|
|
|
// Get destination
|
2007-01-22 20:31:49 +01:00
|
|
|
wxString filename = wxFileSelector(_("Export subtitles file"),_T(""),_T(""),_T(""),AssFile::GetWildcardList(2),wxFD_SAVE | wxFD_OVERWRITE_PROMPT,this);
|
2006-01-16 22:02:54 +01:00
|
|
|
if (filename.empty()) return;
|
|
|
|
|
|
|
|
// Add filters
|
2006-12-18 18:18:14 +01:00
|
|
|
for (unsigned int i=0;i<FilterList->GetCount();i++) {
|
2006-01-16 22:02:54 +01:00
|
|
|
if (FilterList->IsChecked(i)) {
|
|
|
|
Export->AddFilter(FilterList->GetString(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Export
|
|
|
|
try {
|
2006-12-28 23:31:33 +01:00
|
|
|
wxBusyCursor busy;
|
2006-01-16 22:02:54 +01:00
|
|
|
Export->GetOriginalSubs()->SetScriptInfo(_T("Export Encoding"), CharsetList->GetStringSelection());
|
2006-12-28 23:31:33 +01:00
|
|
|
Export->Export(filename, CharsetList->GetStringSelection(), this);
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
2006-04-14 18:46:38 +02:00
|
|
|
catch (const wchar_t *error) {
|
2006-01-16 22:02:54 +01:00
|
|
|
wxString err(error);
|
|
|
|
wxMessageBox(err, _T("Error exporting subtitles"), wxOK | wxICON_ERROR, this);
|
|
|
|
}
|
|
|
|
catch (...) {
|
|
|
|
wxMessageBox(_T("Unknown error"), _T("Error exporting subtitles"), wxOK | wxICON_ERROR, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Close dialog
|
|
|
|
EndModal(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Checked or unchecked item
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void DialogExport::OnCheck(wxCommandEvent &event) {
|
|
|
|
int n = event.GetInt();
|
|
|
|
wxSizer *sizer = Export->GetSettingsSizer(FilterList->GetString(n));
|
|
|
|
if (sizer) MainSizer->Show(sizer,FilterList->IsChecked(n)?1:0,true);
|
|
|
|
Layout();
|
|
|
|
MainSizer->Fit(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Changed item
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void DialogExport::OnChange(wxCommandEvent &event) {
|
|
|
|
int n = FilterList->GetSelection();
|
|
|
|
if (n != wxNOT_FOUND) {
|
|
|
|
wxString name = FilterList->GetString(n);
|
|
|
|
//Description->SetValue(wxGetTranslation(Export->GetDescription(name)));
|
|
|
|
Description->SetValue(Export->GetDescription(name));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Move up
|
|
|
|
/// @param event
|
|
|
|
/// @return
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void DialogExport::OnMoveUp(wxCommandEvent &event) {
|
|
|
|
int pos = FilterList->GetSelection();
|
2006-03-05 03:47:20 +01:00
|
|
|
if (pos <= 0) return;
|
2006-01-16 22:02:54 +01:00
|
|
|
FilterList->Freeze();
|
|
|
|
wxString tempname = FilterList->GetString(pos);
|
|
|
|
bool tempval = FilterList->IsChecked(pos);
|
|
|
|
FilterList->SetString(pos,FilterList->GetString(pos-1));
|
|
|
|
FilterList->Check(pos,FilterList->IsChecked(pos-1));
|
|
|
|
FilterList->SetString(pos-1,tempname);
|
|
|
|
FilterList->Check(pos-1,tempval);
|
|
|
|
FilterList->SetSelection(pos-1);
|
|
|
|
FilterList->Thaw();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Move down
|
|
|
|
/// @param event
|
|
|
|
/// @return
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void DialogExport::OnMoveDown(wxCommandEvent &event) {
|
|
|
|
int pos = FilterList->GetSelection();
|
|
|
|
int n = FilterList->GetCount();
|
2006-03-05 03:47:20 +01:00
|
|
|
if (pos == n-1 || pos == -1) return;
|
2006-01-16 22:02:54 +01:00
|
|
|
FilterList->Freeze();
|
|
|
|
wxString tempname = FilterList->GetString(pos);
|
|
|
|
bool tempval = FilterList->IsChecked(pos);
|
|
|
|
FilterList->SetString(pos,FilterList->GetString(pos+1));
|
|
|
|
FilterList->Check(pos,FilterList->IsChecked(pos+1));
|
|
|
|
FilterList->SetString(pos+1,tempname);
|
|
|
|
FilterList->Check(pos+1,tempval);
|
|
|
|
FilterList->SetSelection(pos+1);
|
|
|
|
FilterList->Thaw();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Select all
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void DialogExport::OnSelectAll(wxCommandEvent &event) {
|
|
|
|
Freeze();
|
|
|
|
FilterList->Freeze();
|
2006-12-18 18:18:14 +01:00
|
|
|
for (unsigned int i=0;i<FilterList->GetCount();i++) {
|
2006-01-16 22:02:54 +01:00
|
|
|
FilterList->Check(i,true);
|
|
|
|
wxSizer *sizer = Export->GetSettingsSizer(FilterList->GetString(i));
|
|
|
|
if (sizer) MainSizer->Show(sizer,true,true);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update dialog
|
|
|
|
Layout();
|
|
|
|
MainSizer->Fit(this);
|
|
|
|
FilterList->Thaw();
|
|
|
|
Thaw();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Select none
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void DialogExport::OnSelectNone(wxCommandEvent &event) {
|
|
|
|
Freeze();
|
|
|
|
FilterList->Freeze();
|
2006-12-18 18:18:14 +01:00
|
|
|
for (unsigned int i=0;i<FilterList->GetCount();i++) {
|
2006-01-16 22:02:54 +01:00
|
|
|
FilterList->Check(i,false);
|
|
|
|
wxSizer *sizer = Export->GetSettingsSizer(FilterList->GetString(i));
|
|
|
|
if (sizer) MainSizer->Show(sizer,false,true);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update dialog
|
|
|
|
FilterList->Thaw();
|
|
|
|
Thaw();
|
|
|
|
Layout();
|
|
|
|
MainSizer->Fit(this);
|
|
|
|
}
|
2009-07-29 07:43:02 +02:00
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|