KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_pcm.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2021 Andrew Lutsenko, anlutsenko at gmail dot com
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21// kicad_curl_easy.h **must be** included before any wxWidgets header to avoid conflicts
22// at least on Windows/msys2
24
25#include "bitmaps.h"
27#include "dialog_pcm.h"
28#include <eda_base_frame.h>
29#include "grid_tricks.h"
30#include "ki_exception.h"
31#include "pcm_task_manager.h"
32#include "pgm_base.h"
35#include "thread"
36#include "widgets/wx_grid.h"
37
38#include <fstream>
39#include <launch_ext.h>
40#include <sstream>
41#include <vector>
42#include <wx/filedlg.h>
43#include <wx/msgdlg.h>
44
45
46#define GRID_CELL_MARGIN 4
47
48// Notes: These strings are static, so wxGetTranslation must be called to display the
49// transalted text
50static std::vector<std::pair<PCM_PACKAGE_TYPE, wxString>> PACKAGE_TYPE_LIST = {
51 { PT_PLUGIN, _( "Plugins (%d)" ) },
52 { PT_FAB, _( "Fabrication plugins (%d)" ) },
53 { PT_LIBRARY, _( "Libraries (%d)" ) },
54 { PT_DATASOURCE, _( "Data sources (%d)" ) },
55 { PT_COLORTHEME, _( "Color themes (%d)" ) },
56};
57
58
59DIALOG_PCM::DIALOG_PCM( EDA_BASE_FRAME* parent, std::shared_ptr<PLUGIN_CONTENT_MANAGER> pcm ) :
60 DIALOG_PCM_BASE( parent ),
61 m_parentFrame( parent ),
62 m_pcm( pcm )
63{
64 // correct the min size from wxfb with fromdip
65 SetMinSize( FromDIP( GetMinSize() ) );
66
67 SetDoubleBuffered( true );
68
70
71 m_pcm->SetDialogWindow( this );
72 m_pcm->StopBackgroundUpdate();
73
74 m_gridPendingActions->PushEventHandler( new GRID_TRICKS( m_gridPendingActions ) );
75
77 m_panelPending->Layout();
78
79 m_actionCallback = [this]( const PACKAGE_VIEW_DATA& aData, PCM_PACKAGE_ACTION aAction,
80 const wxString& aVersion )
81 {
82 if( aAction == PPA_UPDATE && m_pcm->IsPackagePinned( aData.package.identifier ) )
83 {
84 if( wxMessageBox( wxString::Format( _( "Are you sure you want to update pinned package "
85 "from version %s to %s?" ),
86 aData.current_version, aVersion ),
87 _( "Confirm update" ), wxICON_QUESTION | wxYES_NO, this )
88 == wxNO )
89 {
90 return;
91 }
92 }
93
94 m_gridPendingActions->Freeze();
95
96 PCM_PACKAGE_STATE new_state;
97
98 m_gridPendingActions->AppendRows();
99 int row = m_gridPendingActions->GetNumberRows() - 1;
100
101 m_gridPendingActions->SetCellValue( row, PENDING_COL_NAME, aData.package.name );
103
104 switch( aAction )
105 {
106 default:
107 case PPA_INSTALL:
108 m_gridPendingActions->SetCellValue( row, PENDING_COL_ACTION, _( "Install" ) );
109 m_gridPendingActions->SetCellValue( row, PENDING_COL_VERSION, aVersion );
110 new_state = PPS_PENDING_INSTALL;
111 break;
112
113 case PPA_UPDATE:
114 m_gridPendingActions->SetCellValue( row, PENDING_COL_ACTION, _( "Update" ) );
115 m_gridPendingActions->SetCellValue( row, PENDING_COL_VERSION,
116 wxString::Format( wxT( "%s \u279C %s" ),
117 aData.current_version,
118 aVersion ) );
119 new_state = PPS_PENDING_UPDATE;
120 break;
121
122 case PPA_UNINSTALL:
123 m_gridPendingActions->SetCellValue( row, PENDING_COL_ACTION, _( "Uninstall" ) );
124 m_gridPendingActions->SetCellValue( row, PENDING_COL_VERSION,
125 m_pcm->GetInstalledPackageVersion( aData.package.identifier ) );
126 new_state = PPS_PENDING_UNINSTALL;
127 break;
128 }
129
130 m_pendingActions.emplace_back( aAction, aData.repository_id, aData.package, aVersion );
131
132 m_gridPendingActions->Thaw();
133
135
136 updatePackageState( aData.package.identifier, new_state );
137 };
138
140 [this]( const wxString& aPackageId, const PCM_PACKAGE_STATE aState, const bool aPinned )
141 {
142 m_pcm->SetPinned( aPackageId, aPinned );
143
144 updatePackageState( aPackageId, aState );
145 };
146
148 m_panelInstalledHolder->GetSizer()->Add( m_installedPanel, 1, wxEXPAND );
149 m_panelInstalledHolder->Layout();
150
151 for( const std::pair<PCM_PACKAGE_TYPE, wxString>& entry : PACKAGE_TYPE_LIST )
152 {
155 wxString label = wxGetTranslation( entry.second );
156 m_contentNotebook->AddPage( panel, wxString::Format( label, 0 ) );
157 m_repositoryContentPanels.insert( { entry.first, panel } );
158 }
159
160 m_dialogNotebook->SetPageText( 0, wxString::Format( _( "Repository (%d)" ), 0 ) );
161
164
165 m_dialogNotebook->SetSelection( 0 );
166
167 SetupStandardButtons( { { wxID_OK, _( "Close" ) },
168 { wxID_APPLY, _( "Apply Pending Changes" ) },
169 { wxID_CANCEL, _( "Discard Pending Changes" ) } } );
170
171 Bind( wxEVT_CLOSE_WINDOW, &DIALOG_PCM::OnCloseWindow, this );
172 m_sdbSizer1Cancel->Bind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
173 m_sdbSizer1Apply->Bind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
174
176
177 for( int col = 0; col < m_gridPendingActions->GetNumberCols(); col++ )
178 {
179 const wxString& heading = m_gridPendingActions->GetColLabelValue( col );
180 int headingWidth = GetTextExtent( heading ).x + 2 * GRID_CELL_MARGIN;
181
182 // Set the minimal width to the column label size.
183 m_gridPendingActions->SetColMinimalWidth( col, headingWidth );
184 }
185
186 // fix sizers now widgets are set.
188}
189
190
192{
193 Unbind( wxEVT_CLOSE_WINDOW, &DIALOG_PCM::OnCloseWindow, this );
194 m_sdbSizer1Cancel->Unbind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
195 m_sdbSizer1Apply->Unbind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
196
197 m_pcm->SaveInstalledPackages();
198 m_pcm->SetDialogWindow( nullptr );
199 m_pcm->RunBackgroundUpdate();
200
201 m_gridPendingActions->PopEventHandler( true );
202}
203
204
206{
207 for( size_t i = 0; i < PACKAGE_TYPE_LIST.size(); ++i )
208 {
209 if( PACKAGE_TYPE_LIST[i].first == aType )
210 {
211 m_contentNotebook->SetSelection( i );
212 break;
213 }
214 }
215}
216
217
218void DIALOG_PCM::OnUpdateEventButtons( wxUpdateUIEvent& event )
219{
220 event.Enable( !m_pendingActions.empty() );
221}
222
223
224void DIALOG_PCM::OnCloseClicked( wxCommandEvent& event )
225{
226 if( m_pendingActions.size() == 0
227 || wxMessageBox( _( "Are you sure you want to close the package manager "
228 "and discard pending changes?" ),
229 _( "Plugin and Content Manager" ), wxICON_QUESTION | wxYES_NO, this )
230 == wxYES )
231 {
232 EndModal( wxID_OK );
233 }
234}
235
236
237void DIALOG_PCM::OnCloseWindow( wxCloseEvent& aEvent )
238{
239 wxCommandEvent dummy;
240
242}
243
244
245void DIALOG_PCM::OnManageRepositoriesClicked( wxCommandEvent& event )
246{
248
249 std::vector<std::pair<wxString, wxString>> dialog_data;
250 std::vector<std::tuple<wxString, wxString, wxString>> repo_list = m_pcm->GetRepositoryList();
251
252 for( const auto& [id, url, name] : repo_list )
253 dialog_data.push_back( std::make_pair( url, name ) );
254
255 dialog->SetData( dialog_data );
256
257 if( dialog->ShowModal() == wxID_SAVE )
258 {
259 dialog_data = dialog->GetData();
260 m_pcm->SetRepositoryList( dialog_data );
261
262 if( KICAD_SETTINGS* cfg = GetAppSettings<KICAD_SETTINGS>( "kicad" ) )
263 cfg->m_PcmRepositories = std::move( dialog_data );
264
266 }
267
268 dialog->Destroy();
269}
270
271
273{
274 std::vector<std::tuple<wxString, wxString, wxString>> repositories = m_pcm->GetRepositoryList();
275
276 m_choiceRepository->Clear();
277
278 for( const auto& [id, url, name] : repositories )
279 m_choiceRepository->Append( url, new wxStringClientData( id ) );
280
281 if( repositories.size() > 0 )
282 {
283 m_choiceRepository->SetSelection( 0 );
284 m_selectedRepositoryId = std::get<0>( repositories[0] );
286 }
287 else
288 {
290 }
291}
292
293
294void DIALOG_PCM::OnRefreshClicked( wxCommandEvent& event )
295{
296 m_pcm->DiscardRepositoryCache( m_selectedRepositoryId );
298}
299
300
301void DIALOG_PCM::OnInstallFromFileClicked( wxCommandEvent& event )
302{
303 wxFileDialog open_file_dialog( this, _( "Install Package" ), wxEmptyString, wxEmptyString,
304 wxT( "Zip files (*.zip)|*.zip" ), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
305
306 if( open_file_dialog.ShowModal() == wxID_CANCEL )
307 return;
308
309 PCM_TASK_MANAGER task_manager( m_pcm );
310 task_manager.InstallFromFile( this, open_file_dialog.GetPath() );
311
312 m_changed_package_types.merge( task_manager.GetChangedPackageTypes() );
313
315
316 if( !m_selectedRepositoryId.IsEmpty() )
318}
319
320
321void DIALOG_PCM::OnRepositoryChoice( wxCommandEvent& event )
322{
323 wxStringClientData* data = static_cast<wxStringClientData*>(
324 m_choiceRepository->GetClientObject( m_choiceRepository->GetSelection() ) );
325
326 m_selectedRepositoryId = data->GetData();
327
329}
330
331
332void DIALOG_PCM::setRepositoryData( const wxString& aRepositoryId )
333{
334 m_dialogNotebook->Freeze();
335
336 if( m_pcm->CacheRepository( aRepositoryId ) )
337 {
338 for( const auto& [ packageType, packagesView ] : m_repositoryContentPanels )
339 packagesView->ClearData();
340
341 m_packageBitmaps = m_pcm->GetRepositoryPackageBitmaps( aRepositoryId );
342
343 const std::vector<PCM_PACKAGE> packages = m_pcm->GetRepositoryPackages( aRepositoryId );
344
345 std::unordered_map<PCM_PACKAGE_TYPE, std::vector<PACKAGE_VIEW_DATA>> data;
346
347 for( const PCM_PACKAGE& pkg : packages )
348 {
349 PACKAGE_VIEW_DATA package_data( pkg );
350
351 if( m_packageBitmaps.count( package_data.package.identifier ) > 0 )
352 package_data.bitmap = &m_packageBitmaps.at( package_data.package.identifier );
353 else
354 package_data.bitmap = &m_defaultBitmap;
355
356 package_data.state = m_pcm->GetPackageState( aRepositoryId, pkg.identifier );
357
358 if( package_data.state == PPS_INSTALLED || package_data.state == PPS_UPDATE_AVAILABLE )
359 {
360 package_data.current_version = m_pcm->GetInstalledPackageVersion( pkg.identifier );
361 package_data.pinned = m_pcm->IsPackagePinned( pkg.identifier );
362 }
363
364 if( package_data.state == PPS_UPDATE_AVAILABLE )
365 package_data.update_version = m_pcm->GetPackageUpdateVersion( pkg );
366
367
368 for( const PENDING_ACTION& action : m_pendingActions )
369 {
370 if( action.package.identifier != pkg.identifier )
371 continue;
372
373 switch( action.action )
374 {
375 case PPA_INSTALL: package_data.state = PPS_PENDING_INSTALL; break;
376 case PPA_UPDATE: package_data.state = PPS_PENDING_UPDATE; break;
377 case PPA_UNINSTALL: package_data.state = PPS_PENDING_UNINSTALL; break;
378 }
379
380 break;
381 }
382
383 package_data.repository_id = aRepositoryId;
384 package_data.repository_name = m_choiceRepository->GetStringSelection();
385
386 // Fabrication plugins are displayed in a different tab although they are still plugins
387 PCM_PACKAGE_TYPE type = pkg.category == PC_FAB ? PT_FAB : pkg.type;
388
389 data[type].emplace_back( package_data );
390 }
391
392 for( size_t i = 0; i < PACKAGE_TYPE_LIST.size(); i++ )
393 {
394 PCM_PACKAGE_TYPE type = PACKAGE_TYPE_LIST[i].first;
395 const wxString& label = PACKAGE_TYPE_LIST[i].second;
396 m_repositoryContentPanels[type]->SetData( data[type] );
397 m_contentNotebook->SetPageText( i, wxString::Format( wxGetTranslation( label ),
398 (int) data[type].size() ) );
399 }
400
401 m_dialogNotebook->SetPageText( 0, wxString::Format( _( "Repository (%d)" ),
402 (int) packages.size() ) );
403 }
404
405 m_dialogNotebook->Thaw();
406}
407
408
410{
411 m_gridPendingActions->ClearSelection();
412 m_gridPendingActions->SelectRow( event.GetRow() );
413}
414
415
417{
418 m_dialogNotebook->SetPageText( 2, wxString::Format( _( "Pending (%d)" ),
419 (int) m_pendingActions.size() ) );
420
421 for( int col = 0; col < m_gridPendingActions->GetNumberCols(); col++ )
422 {
423 // Set the width to see the full contents
424 m_gridPendingActions->SetColSize( col, m_gridPendingActions->GetVisibleWidth( col ) );
425 }
426}
427
428
430{
431 m_installedPanel->ClearData();
432
433 const std::vector<PCM_INSTALLATION_ENTRY> installed = m_pcm->GetInstalledPackages();
434 std::vector<PACKAGE_VIEW_DATA> package_list;
435
436 m_installedBitmaps = m_pcm->GetInstalledPackageBitmaps();
437
438 for( const PCM_INSTALLATION_ENTRY& entry : installed )
439 {
440 PACKAGE_VIEW_DATA package_data( entry );
441
442 if( m_installedBitmaps.count( package_data.package.identifier ) > 0 )
443 package_data.bitmap = &m_installedBitmaps.at( package_data.package.identifier );
444 else
445 package_data.bitmap = &m_defaultBitmap;
446
447 package_data.state = m_pcm->GetPackageState( entry.repository_id,
448 entry.package.identifier );
449
450 if( package_data.state == PPS_UPDATE_AVAILABLE )
451 package_data.update_version = m_pcm->GetPackageUpdateVersion( entry.package );
452
453 package_list.emplace_back( package_data );
454 }
455
456 m_installedPanel->SetData( package_list );
457
458 m_dialogNotebook->SetPageText( 1, wxString::Format( _( "Installed (%d)" ),
459 (int) package_list.size() ) );
460}
461
462
463void DIALOG_PCM::OnApplyChangesClicked( wxCommandEvent& event )
464{
465 if( m_pendingActions.size() == 0 )
466 return;
467
468 m_sdbSizer1OK->Disable();
469 m_sdbSizer1Apply->Disable();
470 m_sdbSizer1Cancel->Disable();
471
472 PCM_TASK_MANAGER task_manager( m_pcm );
473
474 for( const PENDING_ACTION& action : m_pendingActions )
475 {
476 if( action.action == PPA_UNINSTALL )
477 {
478 task_manager.Uninstall( action.package );
479 }
480 else
481 {
482 bool isUpdate = action.action == PPA_UPDATE;
483 task_manager.DownloadAndInstall( action.package, action.version, action.repository_id,
484 isUpdate );
485 }
486 }
487
488 task_manager.RunQueue( this );
489
490 m_changed_package_types.merge( task_manager.GetChangedPackageTypes() );
491
492 m_sdbSizer1OK->Enable();
493 m_sdbSizer1Apply->Enable();
494 m_sdbSizer1Cancel->Enable();
495
497 wxCommandEvent dummy;
499
500 if( !m_selectedRepositoryId.IsEmpty() )
502}
503
504
505void DIALOG_PCM::OnDiscardChangesClicked( wxCommandEvent& event )
506{
507 m_gridPendingActions->Freeze();
508
509 for( int i = m_pendingActions.size() - 1; i >= 0; i-- )
510 discardAction( i );
511
513 m_gridPendingActions->Thaw();
514}
515
516
517void DIALOG_PCM::OnDiscardActionClicked( wxCommandEvent& event )
518{
519 wxArrayInt rows = m_gridPendingActions->GetSelectedRows();
520
521 std::sort( rows.begin(), rows.end(),
522 []( const int& a, const int& b )
523 {
524 return a > b;
525 } );
526
527 m_gridPendingActions->Freeze();
528
529 for( int row : rows )
530 discardAction( row );
531
533 m_gridPendingActions->Thaw();
534}
535
536
538{
539 m_gridPendingActions->DeleteRows( aIndex );
540
541 PENDING_ACTION action = m_pendingActions[aIndex];
542
543 PCM_PACKAGE_STATE state = m_pcm->GetPackageState( action.repository_id,
544 action.package.identifier );
545
546 updatePackageState( action.package.identifier, state );
547
548 m_pendingActions.erase( m_pendingActions.begin() + aIndex );
549}
550
551
552void DIALOG_PCM::updatePackageState( const wxString& aPackageId, const PCM_PACKAGE_STATE aState )
553{
554 bool pinned = m_pcm->IsPackagePinned( aPackageId );
555
556 m_installedPanel->SetPackageState( aPackageId, aState, pinned );
557
558 for( const auto& [ packageType, packagesView ] : m_repositoryContentPanels )
559 packagesView->SetPackageState( aPackageId, aState, pinned );
560}
561
562
563void DIALOG_PCM::OnOpenPackageDirClicked( wxCommandEvent& event )
564{
565 LaunchExternal( m_pcm->Get3rdPartyPath() );
566}
const char * name
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition bitmap.cpp:104
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:110
Implementing DIALOG_MANAGE_REPOSITORIES_BASE.
std::vector< std::pair< wxString, wxString > > GetData()
void SetData(const std::vector< std::pair< wxString, wxString > > &aData)
wxChoice * m_choiceRepository
wxNotebook * m_contentNotebook
WX_GRID * m_gridPendingActions
wxButton * m_sdbSizer1OK
wxButton * m_sdbSizer1Cancel
wxBitmapButton * m_discardActionButton
DIALOG_PCM_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Plugin And Content Manager"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxNotebook * m_dialogNotebook
wxButton * m_sdbSizer1Apply
wxPanel * m_panelInstalledHolder
wxPanel * m_panelPending
ActionCallback m_actionCallback
Definition dialog_pcm.h:114
void OnDiscardChangesClicked(wxCommandEvent &event) override
Switches to another repository.
std::unordered_map< wxString, wxBitmap > m_installedBitmaps
Definition dialog_pcm.h:120
std::unordered_map< wxString, wxBitmap > m_packageBitmaps
Definition dialog_pcm.h:119
void OnManageRepositoriesClicked(wxCommandEvent &event) override
Discards current repo cache, fetches it anew and displays.
void updatePackageState(const wxString &aPackageId, const PCM_PACKAGE_STATE aState)
Discards specified pending action.
void OnApplyChangesClicked(wxCommandEvent &event) override
Discards all pending changes.
void OnDiscardActionClicked(wxCommandEvent &event) override
Handles modification of the buttons' status.
void OnUpdateEventButtons(wxUpdateUIEvent &event)
Returns types of packages that were installed/uninstalled.
std::unordered_map< PCM_PACKAGE_TYPE, PANEL_PACKAGES_VIEW * > m_repositoryContentPanels
Definition dialog_pcm.h:117
void OnOpenPackageDirClicked(wxCommandEvent &event) override
Enqueues current pending actions in PCM_TASK_MANAGER and runs the queue.
PinCallback m_pinCallback
Definition dialog_pcm.h:115
std::unordered_set< PCM_PACKAGE_TYPE > m_changed_package_types
Definition dialog_pcm.h:122
void SetActivePackageType(PCM_PACKAGE_TYPE aType)
EDA_BASE_FRAME * m_parentFrame
Definition dialog_pcm.h:112
DIALOG_PCM(EDA_BASE_FRAME *parent, std::shared_ptr< PLUGIN_CONTENT_MANAGER > pcm)
Constructor.
void updatePendingActionsTab()
Gets installed packages list from PCM and displays it on installed tab.
std::vector< PENDING_ACTION > m_pendingActions
Definition dialog_pcm.h:138
void setRepositoryListFromPcm()
Updates pending actions tab caption and content-fits the grid.
void OnInstallFromFileClicked(wxCommandEvent &event) override
Opens local directory where packages are installed in file manager.
@ PENDING_COL_REPOSITORY
Definition dialog_pcm.h:145
@ PENDING_COL_VERSION
Definition dialog_pcm.h:144
@ PENDING_COL_ACTION
Definition dialog_pcm.h:142
void OnCloseWindow(wxCloseEvent &aEvent)
Opens repository management dialog, saves changes to PCM.
std::shared_ptr< PLUGIN_CONTENT_MANAGER > m_pcm
Definition dialog_pcm.h:113
void OnRepositoryChoice(wxCommandEvent &event) override
Selects the whole row in the grid if a cell is clicked.
wxString m_selectedRepositoryId
Definition dialog_pcm.h:118
PANEL_PACKAGES_VIEW * m_installedPanel
Definition dialog_pcm.h:116
void setInstalledPackages()
Reflects new state of the package in all panels where it is displayed.
void OnPendingActionsCellClicked(wxGridEvent &event) override
Discards selected pending actions.
void setRepositoryData(const wxString &aRepositoryId)
Gets package data from PCM and displays it on repository tab.
void discardAction(int aIndex)
wxBitmap m_defaultBitmap
Definition dialog_pcm.h:121
void OnRefreshClicked(wxCommandEvent &event) override
Opens file selection dialog and installs selected package archive.
void OnCloseClicked(wxCommandEvent &event) override
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
int ShowModal() override
The base frame for deriving all KiCad main window classes.
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition grid_tricks.h:61
Helper class that handles package (un)installation.
std::unordered_set< PCM_PACKAGE_TYPE > & GetChangedPackageTypes()
PCM_TASK_MANAGER::STATUS DownloadAndInstall(const PCM_PACKAGE &aPackage, const wxString &aVersion, const wxString &aRepositoryId, const bool isUpdate)
Enqueue package download and installation.
void RunQueue(wxWindow *aParent)
Run queue of pending actions.
PCM_TASK_MANAGER::STATUS Uninstall(const PCM_PACKAGE &aPackage)
Enqueue package uninstallation.
PCM_TASK_MANAGER::STATUS InstallFromFile(wxWindow *aParent, const wxString &aFilePath)
Installs package from an archive file on disk.
#define GRID_CELL_MARGIN
static std::vector< std::pair< PCM_PACKAGE_TYPE, wxString > > PACKAGE_TYPE_LIST
#define _(s)
Base window classes and related definitions.
bool LaunchExternal(const wxString &aPath)
Launches the given file or folder in the host OS.
PCM_PACKAGE_STATE
Definition pcm.h:58
@ PPS_INSTALLED
Definition pcm.h:61
@ PPS_PENDING_UPDATE
Definition pcm.h:65
@ PPS_UPDATE_AVAILABLE
Definition pcm.h:64
@ PPS_PENDING_UNINSTALL
Definition pcm.h:63
@ PPS_PENDING_INSTALL
Definition pcm.h:62
PCM_PACKAGE_ACTION
Definition pcm.h:71
@ PPA_UNINSTALL
Definition pcm.h:73
@ PPA_UPDATE
Definition pcm.h:74
@ PPA_INSTALL
Definition pcm.h:72
@ PC_FAB
Definition pcm_data.h:56
PCM_PACKAGE_TYPE
< Supported package types
Definition pcm_data.h:42
@ PT_DATASOURCE
Definition pcm_data.h:47
@ PT_COLORTHEME
Definition pcm_data.h:48
@ PT_PLUGIN
Definition pcm_data.h:44
@ PT_LIBRARY
Definition pcm_data.h:46
@ PT_FAB
Definition pcm_data.h:45
see class PGM_BASE
T * GetAppSettings(const char *aFilename)
std::vector< FAB_LAYER_COLOR > dummy
< Collection of data relevant to the package display panelCallback for (un)install button
wxString update_version
wxString current_version
const PCM_PACKAGE package
wxString repository_name
PCM_PACKAGE_STATE state
Definition pcm_data.h:158
Repository reference to a resource.
Definition pcm_data.h:114
wxString identifier
Definition pcm_data.h:118
wxString name
Definition pcm_data.h:115