mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Project Templates: Allow multiple line titles
This fixes two display issues in the project template selector. The first captured HTML tags in the template title display and the second prevented more than one line for showing (at least on GTK) in the preview. This prevented disambiguation between the various templates. (cherry picked from commit 24b032ce5bf31b1d3d8d7de185c828ffa6b44647)
This commit is contained in:
parent
7759ad7e27
commit
3514473a5a
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 1 2018)
|
||||
// C++ code generated with wxFormBuilder (version Apr 23 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -102,7 +102,7 @@ TEMPLATE_SELECTION_PANEL_BASE::~TEMPLATE_SELECTION_PANEL_BASE()
|
||||
|
||||
TEMPLATE_WIDGET_BASE::TEMPLATE_WIDGET_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
||||
{
|
||||
this->SetMinSize( wxSize( 74,-1 ) );
|
||||
this->SetMinSize( wxSize( 74,150 ) );
|
||||
this->SetMaxSize( wxSize( 74,-1 ) );
|
||||
|
||||
wxBoxSizer* bSizer4;
|
||||
|
@ -14,6 +14,7 @@
|
||||
<property name="file">dialog_template_selector_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">DIALOG_TEMPLATE_SELECTOR_BASE</property>
|
||||
@ -25,6 +26,7 @@
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
@ -644,7 +646,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size">74,-1</property>
|
||||
<property name="minimum_size">74,-1</property>
|
||||
<property name="minimum_size">74,150</property>
|
||||
<property name="name">TEMPLATE_WIDGET_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">74,118</property>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 1 2018)
|
||||
// C++ code generated with wxFormBuilder (version Apr 23 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -253,27 +253,25 @@ wxString* PROJECT_TEMPLATE::GetTitle(void)
|
||||
while( input.IsOk() && !input.Eof() && !done )
|
||||
{
|
||||
wxString line = text.ReadLine();
|
||||
wxString upperline = line.Clone().Upper();
|
||||
|
||||
start = line.Find( wxT( "<title>" ) );
|
||||
if( start == wxNOT_FOUND )
|
||||
start = line.Find( wxT( "<TITLE>" ) );
|
||||
|
||||
finish = line.Find( wxT( "</title>" ) );
|
||||
if( finish == wxNOT_FOUND )
|
||||
finish = line.Find( wxT( "</TITLE>" ) );
|
||||
start = upperline.Find( wxT( "<TITLE>" ) );
|
||||
finish = upperline.Find( wxT( "</TITLE>" ) );
|
||||
int length = finish - start - 7;
|
||||
|
||||
// find the opening tag
|
||||
if( start != wxNOT_FOUND )
|
||||
{
|
||||
if( finish != wxNOT_FOUND )
|
||||
{
|
||||
title = line.SubString( start + 7, finish );
|
||||
title = line( start + 7, length );
|
||||
}
|
||||
else
|
||||
{
|
||||
title = line.SubString( start + 7, line.Len() - 1 );
|
||||
done = true;
|
||||
title = line.Mid( start + 7 );
|
||||
}
|
||||
|
||||
done = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -282,15 +280,11 @@ wxString* PROJECT_TEMPLATE::GetTitle(void)
|
||||
title += line.SubString( 0, finish );
|
||||
done = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
title += line;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove line endings
|
||||
title.Replace( wxT( "\r" ), wxT( "" ) );
|
||||
title.Replace( wxT( "\n" ), wxT( "" ) );
|
||||
title.Replace( wxT( "\r" ), wxT( " " ) );
|
||||
title.Replace( wxT( "\n" ), wxT( " " ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user