mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Add "source" field for jobsets to discern SCH & PCB jobs
This commit is contained in:
parent
062a813139
commit
74b174e4f0
@ -63,6 +63,7 @@ public:
|
|||||||
int jobBmpColId = m_jobList->AppendColumn( wxT( "" ) );
|
int jobBmpColId = m_jobList->AppendColumn( wxT( "" ) );
|
||||||
int jobNoColId = m_jobList->AppendColumn( _( "No." ) );
|
int jobNoColId = m_jobList->AppendColumn( _( "No." ) );
|
||||||
int jobDescColId = m_jobList->AppendColumn( _( "Job Description" ) );
|
int jobDescColId = m_jobList->AppendColumn( _( "Job Description" ) );
|
||||||
|
int jobSourceColId = m_jobList->AppendColumn( wxT( "Source" ) );
|
||||||
m_jobList->SetColumnWidth( jobBmpColId, wxLIST_AUTOSIZE_USEHEADER );
|
m_jobList->SetColumnWidth( jobBmpColId, wxLIST_AUTOSIZE_USEHEADER );
|
||||||
m_jobList->SetColumnWidth( jobNoColId, wxLIST_AUTOSIZE_USEHEADER );
|
m_jobList->SetColumnWidth( jobNoColId, wxLIST_AUTOSIZE_USEHEADER );
|
||||||
m_jobList->SetColumnWidth( jobDescColId, wxLIST_AUTOSIZE_USEHEADER );
|
m_jobList->SetColumnWidth( jobDescColId, wxLIST_AUTOSIZE_USEHEADER );
|
||||||
@ -88,6 +89,22 @@ public:
|
|||||||
|
|
||||||
m_jobList->SetItem( itemIndex, jobNoColId, wxString::Format( "%d", num++ ) );
|
m_jobList->SetItem( itemIndex, jobNoColId, wxString::Format( "%d", num++ ) );
|
||||||
m_jobList->SetItem( itemIndex, jobDescColId, job.GetDescription() );
|
m_jobList->SetItem( itemIndex, jobDescColId, job.GetDescription() );
|
||||||
|
|
||||||
|
KIWAY::FACE_T iface = JOB_REGISTRY::GetKifaceType( job.m_type );
|
||||||
|
wxString source = wxEmptyString;
|
||||||
|
if( iface < KIWAY::KIWAY_FACE_COUNT )
|
||||||
|
{
|
||||||
|
|
||||||
|
if( iface == KIWAY::FACE_PCB )
|
||||||
|
{
|
||||||
|
source = wxT( "PCB" );
|
||||||
|
}
|
||||||
|
else if( iface == KIWAY::FACE_SCH )
|
||||||
|
{
|
||||||
|
source = wxT( "SCH" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_jobList->SetItem( itemIndex, jobSourceColId, source );
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupStandardButtons( { { wxID_OK, _( "Close" ) } } );
|
SetupStandardButtons( { { wxID_OK, _( "Close" ) } } );
|
||||||
@ -381,7 +398,7 @@ void JOBS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
|
|||||||
{
|
{
|
||||||
if( selectedRows.size() > 0 )
|
if( selectedRows.size() > 0 )
|
||||||
{
|
{
|
||||||
m_grid->SetGridCursor( selectedRows[0], 1 );
|
m_grid->SetGridCursor( selectedRows[0], 2 );
|
||||||
m_grid->EnableCellEditControl();
|
m_grid->EnableCellEditControl();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -409,7 +426,7 @@ bool JOBS_GRID_TRICKS::handleDoubleClick( wxGridEvent& aEvent )
|
|||||||
int curr_col = aEvent.GetCol();
|
int curr_col = aEvent.GetCol();
|
||||||
int curr_row = aEvent.GetRow();
|
int curr_row = aEvent.GetRow();
|
||||||
|
|
||||||
if( ( curr_col == 0 || curr_col == 1 )
|
if( ( curr_col == 0 || curr_col == 1 || curr_col == 2 )
|
||||||
&& curr_row >= 0 && curr_row < (int) m_parent->GetJobsFile()->GetJobs().size() )
|
&& curr_row >= 0 && curr_row < (int) m_parent->GetJobsFile()->GetJobs().size() )
|
||||||
{
|
{
|
||||||
m_doubleClickRow = curr_row;
|
m_doubleClickRow = curr_row;
|
||||||
@ -450,6 +467,7 @@ PANEL_JOBSET::PANEL_JOBSET( wxAuiNotebook* aParent, KICAD_MANAGER_FRAME* aFrame,
|
|||||||
|
|
||||||
// 'm' for margins
|
// 'm' for margins
|
||||||
m_jobsGrid->SetColSize( 0, GetTextExtent( wxT( "99m" ) ).x );
|
m_jobsGrid->SetColSize( 0, GetTextExtent( wxT( "99m" ) ).x );
|
||||||
|
m_jobsGrid->SetColSize( 1, GetTextExtent( wxT( "PCBm" ) ).x );
|
||||||
|
|
||||||
m_buttonAddJob->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
|
m_buttonAddJob->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
|
||||||
m_buttonUp->SetBitmap( KiBitmapBundle( BITMAPS::small_up ) );
|
m_buttonUp->SetBitmap( KiBitmapBundle( BITMAPS::small_up ) );
|
||||||
@ -503,7 +521,25 @@ void PANEL_JOBSET::rebuildJobList()
|
|||||||
m_jobsGrid->SetCellValue( num - 1, 0, wxString::Format( "%d", num ) );
|
m_jobsGrid->SetCellValue( num - 1, 0, wxString::Format( "%d", num ) );
|
||||||
m_jobsGrid->SetReadOnly( num - 1, 0 );
|
m_jobsGrid->SetReadOnly( num - 1, 0 );
|
||||||
|
|
||||||
m_jobsGrid->SetCellValue( num - 1, 1, job.GetDescription() );
|
m_jobsGrid->SetCellValue( num - 1, 2, job.GetDescription() );
|
||||||
|
|
||||||
|
m_jobsGrid->SetReadOnly( num - 1, 1 );
|
||||||
|
|
||||||
|
KIWAY::FACE_T iface = JOB_REGISTRY::GetKifaceType( job.m_type );
|
||||||
|
wxString source = wxEmptyString;
|
||||||
|
if( iface < KIWAY::KIWAY_FACE_COUNT )
|
||||||
|
{
|
||||||
|
if( iface == KIWAY::FACE_PCB )
|
||||||
|
{
|
||||||
|
source = wxT( "PCB" );
|
||||||
|
}
|
||||||
|
else if( iface == KIWAY::FACE_SCH )
|
||||||
|
{
|
||||||
|
source = wxT( "SCH" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_jobsGrid->SetCellValue( num - 1, 1, source );
|
||||||
|
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
@ -688,7 +724,7 @@ void PANEL_JOBSET::OnAddJobClick( wxCommandEvent& aEvent )
|
|||||||
{
|
{
|
||||||
rebuildJobList();
|
rebuildJobList();
|
||||||
|
|
||||||
m_jobsGrid->SetGridCursor( row, 1 );
|
m_jobsGrid->SetGridCursor( row, 2 );
|
||||||
m_jobsGrid->EnableCellEditControl();
|
m_jobsGrid->EnableCellEditControl();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -950,7 +986,8 @@ void PANEL_JOBSET::OnGenerateAllOutputsClick( wxCommandEvent& event )
|
|||||||
|
|
||||||
void PANEL_JOBSET::OnSizeGrid( wxSizeEvent& aEvent )
|
void PANEL_JOBSET::OnSizeGrid( wxSizeEvent& aEvent )
|
||||||
{
|
{
|
||||||
m_jobsGrid->SetColSize( 1, m_jobsGrid->GetSize().x - m_jobsGrid->GetColSize( 0 ) );
|
m_jobsGrid->SetColSize( 2, m_jobsGrid->GetSize().x - m_jobsGrid->GetColSize( 1 )
|
||||||
|
- m_jobsGrid->GetColSize( 0 ) );
|
||||||
|
|
||||||
// Always propagate for a grid repaint (needed if the height changes, as well as width)
|
// Always propagate for a grid repaint (needed if the height changes, as well as width)
|
||||||
aEvent.Skip();
|
aEvent.Skip();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
// C++ code generated with wxFormBuilder (version 4.2.1-62-g497c85bd-dirty)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
@ -26,7 +26,7 @@ PANEL_JOBSET_BASE::PANEL_JOBSET_BASE( wxWindow* parent, wxWindowID id, const wxP
|
|||||||
m_jobsGrid = new WX_GRID( sbJobs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
m_jobsGrid = new WX_GRID( sbJobs->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
|
||||||
// Grid
|
// Grid
|
||||||
m_jobsGrid->CreateGrid( 5, 2 );
|
m_jobsGrid->CreateGrid( 5, 3 );
|
||||||
m_jobsGrid->EnableEditing( true );
|
m_jobsGrid->EnableEditing( true );
|
||||||
m_jobsGrid->EnableGridLines( true );
|
m_jobsGrid->EnableGridLines( true );
|
||||||
m_jobsGrid->EnableDragGridSize( false );
|
m_jobsGrid->EnableDragGridSize( false );
|
||||||
@ -34,7 +34,8 @@ PANEL_JOBSET_BASE::PANEL_JOBSET_BASE( wxWindow* parent, wxWindowID id, const wxP
|
|||||||
|
|
||||||
// Columns
|
// Columns
|
||||||
m_jobsGrid->SetColSize( 0, 30 );
|
m_jobsGrid->SetColSize( 0, 30 );
|
||||||
m_jobsGrid->SetColSize( 1, 260 );
|
m_jobsGrid->SetColSize( 1, 30 );
|
||||||
|
m_jobsGrid->SetColSize( 2, 260 );
|
||||||
m_jobsGrid->EnableDragColMove( false );
|
m_jobsGrid->EnableDragColMove( false );
|
||||||
m_jobsGrid->EnableDragColSize( false );
|
m_jobsGrid->EnableDragColSize( false );
|
||||||
m_jobsGrid->SetColLabelSize( 0 );
|
m_jobsGrid->SetColLabelSize( 0 );
|
||||||
|
@ -111,8 +111,8 @@
|
|||||||
<property name="col_label_size">0</property>
|
<property name="col_label_size">0</property>
|
||||||
<property name="col_label_values"></property>
|
<property name="col_label_values"></property>
|
||||||
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
||||||
<property name="cols">2</property>
|
<property name="cols">3</property>
|
||||||
<property name="column_sizes">30,260</property>
|
<property name="column_sizes">30,30,260</property>
|
||||||
<property name="context_help"></property>
|
<property name="context_help"></property>
|
||||||
<property name="context_menu">1</property>
|
<property name="context_menu">1</property>
|
||||||
<property name="default_pane">0</property>
|
<property name="default_pane">0</property>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
// C++ code generated with wxFormBuilder (version 4.2.1-62-g497c85bd-dirty)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user