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 <kiplatform/ui.h>
40#include <launch_ext.h>
41#include <sstream>
42#include <vector>
43#include <wx/filedlg.h>
44#include <wx/msgdlg.h>
45
46
47#define GRID_CELL_MARGIN 4
48
49// Notes: These strings are static, so wxGetTranslation must be called to display the
50// transalted text
51static std::vector<std::pair<PCM_PACKAGE_TYPE, wxString>> PACKAGE_TYPE_LIST = {
52 { PT_PLUGIN, _( "Plugins (%d)" ) },
53 { PT_FAB, _( "Fabrication plugins (%d)" ) },
54 { PT_LIBRARY, _( "Libraries (%d)" ) },
55 { PT_DATASOURCE, _( "Data sources (%d)" ) },
56 { PT_COLORTHEME, _( "Color themes (%d)" ) },
57};
58
59
60DIALOG_PCM::DIALOG_PCM( EDA_BASE_FRAME* parent, std::shared_ptr<PLUGIN_CONTENT_MANAGER> pcm ) :
61 DIALOG_PCM_BASE( parent ),
62 m_parentFrame( parent ),
63 m_pcm( pcm )
64{
65 // correct the min size from wxfb with fromdip
66 SetMinSize( FromDIP( GetMinSize() ) );
67
68 SetDoubleBuffered( true );
69
71
72 m_pcm->SetDialogWindow( this );
73 m_pcm->StopBackgroundUpdate();
74
75 m_gridPendingActions->PushEventHandler( new GRID_TRICKS( m_gridPendingActions ) );
76
78 m_panelPending->Layout();
79
80 m_actionCallback = [this]( const PACKAGE_VIEW_DATA& aData, PCM_PACKAGE_ACTION aAction,
81 const wxString& aVersion )
82 {
83 if( aAction == PPA_UPDATE && m_pcm->IsPackagePinned( aData.package.identifier ) )
84 {
85 if( wxMessageBox( wxString::Format( _( "Are you sure you want to update pinned package "
86 "from version %s to %s?" ),
87 aData.current_version, aVersion ),
88 _( "Confirm update" ), wxICON_QUESTION | wxYES_NO, this )
89 == wxNO )
90 {
91 return;
92 }
93 }
94
95 m_gridPendingActions->Freeze();
96
97 PCM_PACKAGE_STATE new_state;
98
99 m_gridPendingActions->AppendRows();
100 int row = m_gridPendingActions->GetNumberRows() - 1;
101
102 m_gridPendingActions->SetCellValue( row, PENDING_COL_NAME, aData.package.name );
104
105 switch( aAction )
106 {
107 default:
108 case PPA_INSTALL:
109 m_gridPendingActions->SetCellValue( row, PENDING_COL_ACTION, _( "Install" ) );
110 m_gridPendingActions->SetCellValue( row, PENDING_COL_VERSION, aVersion );
111 new_state = PPS_PENDING_INSTALL;
112 break;
113
114 case PPA_UPDATE:
115 m_gridPendingActions->SetCellValue( row, PENDING_COL_ACTION, _( "Update" ) );
116 m_gridPendingActions->SetCellValue( row, PENDING_COL_VERSION,
117 wxString::Format( wxT( "%s \u279C %s" ),
118 aData.current_version,
119 aVersion ) );
120 new_state = PPS_PENDING_UPDATE;
121 break;
122
123 case PPA_UNINSTALL:
124 m_gridPendingActions->SetCellValue( row, PENDING_COL_ACTION, _( "Uninstall" ) );
125 m_gridPendingActions->SetCellValue( row, PENDING_COL_VERSION,
126 m_pcm->GetInstalledPackageVersion( aData.package.identifier ) );
127 new_state = PPS_PENDING_UNINSTALL;
128 break;
129 }
130
131 m_pendingActions.emplace_back( aAction, aData.repository_id, aData.package, aVersion );
132
133 m_gridPendingActions->Thaw();
134
136
137 updatePackageState( aData.package.identifier, new_state );
138 };
139
141 [this]( const wxString& aPackageId, const PCM_PACKAGE_STATE aState, const bool aPinned )
142 {
143 m_pcm->SetPinned( aPackageId, aPinned );
144
145 updatePackageState( aPackageId, aState );
146 };
147
149 m_panelInstalledHolder->GetSizer()->Add( m_installedPanel, 1, wxEXPAND );
150 m_panelInstalledHolder->Layout();
151
152 for( const std::pair<PCM_PACKAGE_TYPE, wxString>& entry : PACKAGE_TYPE_LIST )
153 {
156 wxString label = wxGetTranslation( entry.second );
157 m_contentNotebook->AddPage( panel, wxString::Format( label, 0 ) );
158 m_repositoryContentPanels.insert( { entry.first, panel } );
159 }
160
161 m_dialogNotebook->SetPageText( 0, wxString::Format( _( "Repository (%d)" ), 0 ) );
162
165
166 m_dialogNotebook->SetSelection( 0 );
167
168 SetupStandardButtons( { { wxID_OK, _( "Close" ) },
169 { wxID_APPLY, _( "Apply Pending Changes" ) },
170 { wxID_CANCEL, _( "Discard Pending Changes" ) } } );
171
172 Bind( wxEVT_CLOSE_WINDOW, &DIALOG_PCM::OnCloseWindow, this );
173 m_sdbSizer1Cancel->Bind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
174 m_sdbSizer1Apply->Bind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
175
177
178 for( int col = 0; col < m_gridPendingActions->GetNumberCols(); col++ )
179 {
180 const wxString& heading = m_gridPendingActions->GetColLabelValue( col );
181 int headingWidth = GetTextExtent( heading ).x + 2 * GRID_CELL_MARGIN;
182
183 // Set the minimal width to the column label size.
184 m_gridPendingActions->SetColMinimalWidth( col, headingWidth );
185 }
186
187 // fix sizers now widgets are set.
189}
190
191
193{
194 Unbind( wxEVT_CLOSE_WINDOW, &DIALOG_PCM::OnCloseWindow, this );
195 m_sdbSizer1Cancel->Unbind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
196 m_sdbSizer1Apply->Unbind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
197
198 m_pcm->SaveInstalledPackages();
199 m_pcm->SetDialogWindow( nullptr );
200 m_pcm->RunBackgroundUpdate();
201
202 m_gridPendingActions->PopEventHandler( true );
203}
204
205
207{
208 for( size_t i = 0; i < PACKAGE_TYPE_LIST.size(); ++i )
209 {
210 if( PACKAGE_TYPE_LIST[i].first == aType )
211 {
212 m_contentNotebook->SetSelection( i );
213 break;
214 }
215 }
216}
217
218
219void DIALOG_PCM::OnUpdateEventButtons( wxUpdateUIEvent& event )
220{
221 event.Enable( !m_pendingActions.empty() );
222}
223
224
225void DIALOG_PCM::OnCloseClicked( wxCommandEvent& event )
226{
227 if( m_pendingActions.size() == 0
228 || wxMessageBox( _( "Are you sure you want to close the package manager "
229 "and discard pending changes?" ),
230 _( "Plugin and Content Manager" ), wxICON_QUESTION | wxYES_NO, this )
231 == wxYES )
232 {
233 EndModal( wxID_OK );
234 }
235}
236
237
238void DIALOG_PCM::OnCloseWindow( wxCloseEvent& aEvent )
239{
240 wxCommandEvent dummy;
241
243}
244
245
246void DIALOG_PCM::OnManageRepositoriesClicked( wxCommandEvent& event )
247{
249
250 std::vector<std::pair<wxString, wxString>> dialog_data;
251 std::vector<std::tuple<wxString, wxString, wxString>> repo_list = m_pcm->GetRepositoryList();
252
253 for( const auto& [id, url, name] : repo_list )
254 dialog_data.push_back( std::make_pair( url, name ) );
255
256 dialog->SetData( dialog_data );
257
258 if( dialog->ShowModal() == wxID_SAVE )
259 {
260 dialog_data = dialog->GetData();
261 m_pcm->SetRepositoryList( dialog_data );
262
263 if( KICAD_SETTINGS* cfg = GetAppSettings<KICAD_SETTINGS>( "kicad" ) )
264 cfg->m_PcmRepositories = std::move( dialog_data );
265
267 }
268
269 dialog->Destroy();
270}
271
272
274{
275 std::vector<std::tuple<wxString, wxString, wxString>> repositories = m_pcm->GetRepositoryList();
276
277 m_choiceRepository->Clear();
278
279 for( const auto& [id, url, name] : repositories )
280 m_choiceRepository->Append( url, new wxStringClientData( id ) );
281
282 if( repositories.size() > 0 )
283 {
284 m_choiceRepository->SetSelection( 0 );
285 m_selectedRepositoryId = std::get<0>( repositories[0] );
287 }
288 else
289 {
291 }
292}
293
294
295void DIALOG_PCM::OnRefreshClicked( wxCommandEvent& event )
296{
297 m_pcm->DiscardRepositoryCache( m_selectedRepositoryId );
299}
300
301
302void DIALOG_PCM::OnInstallFromFileClicked( wxCommandEvent& event )
303{
304 wxFileDialog open_file_dialog( this, _( "Install Package" ), wxEmptyString, wxEmptyString,
305 wxT( "Zip files (*.zip)|*.zip" ), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
306
307 KIPLATFORM::UI::AllowNetworkFileSystems( &open_file_dialog );
308
309 if( open_file_dialog.ShowModal() == wxID_CANCEL )
310 return;
311
312 PCM_TASK_MANAGER task_manager( m_pcm );
313 task_manager.InstallFromFile( this, open_file_dialog.GetPath() );
314
315 m_changed_package_types.merge( task_manager.GetChangedPackageTypes() );
316
318
319 if( !m_selectedRepositoryId.IsEmpty() )
321}
322
323
324void DIALOG_PCM::OnRepositoryChoice( wxCommandEvent& event )
325{
326 wxStringClientData* data = static_cast<wxStringClientData*>(
327 m_choiceRepository->GetClientObject( m_choiceRepository->GetSelection() ) );
328
329 m_selectedRepositoryId = data->GetData();
330
332}
333
334
335void DIALOG_PCM::setRepositoryData( const wxString& aRepositoryId )
336{
337 m_dialogNotebook->Freeze();
338
339 if( m_pcm->CacheRepository( aRepositoryId ) )
340 {
341 for( const auto& [ packageType, packagesView ] : m_repositoryContentPanels )
342 packagesView->ClearData();
343
344 m_packageBitmaps = m_pcm->GetRepositoryPackageBitmaps( aRepositoryId );
345
346 const std::vector<PCM_PACKAGE> packages = m_pcm->GetRepositoryPackages( aRepositoryId );
347
348 std::unordered_map<PCM_PACKAGE_TYPE, std::vector<PACKAGE_VIEW_DATA>> data;
349
350 for( const PCM_PACKAGE& pkg : packages )
351 {
352 if( pkg.type == PT_INVALID )
353 continue;
354
355 PACKAGE_VIEW_DATA package_data( pkg );
356
357 if( m_packageBitmaps.count( package_data.package.identifier ) > 0 )
358 package_data.bitmap = &m_packageBitmaps.at( package_data.package.identifier );
359 else
360 package_data.bitmap = &m_defaultBitmap;
361
362 package_data.state = m_pcm->GetPackageState( aRepositoryId, pkg.identifier );
363
364 if( package_data.state == PPS_INSTALLED || package_data.state == PPS_UPDATE_AVAILABLE )
365 {
366 package_data.current_version = m_pcm->GetInstalledPackageVersion( pkg.identifier );
367 package_data.pinned = m_pcm->IsPackagePinned( pkg.identifier );
368 }
369
370 if( package_data.state == PPS_UPDATE_AVAILABLE )
371 package_data.update_version = m_pcm->GetPackageUpdateVersion( pkg );
372
373
374 for( const PENDING_ACTION& action : m_pendingActions )
375 {
376 if( action.package.identifier != pkg.identifier )
377 continue;
378
379 switch( action.action )
380 {
381 case PPA_INSTALL: package_data.state = PPS_PENDING_INSTALL; break;
382 case PPA_UPDATE: package_data.state = PPS_PENDING_UPDATE; break;
383 case PPA_UNINSTALL: package_data.state = PPS_PENDING_UNINSTALL; break;
384 }
385
386 break;
387 }
388
389 package_data.repository_id = aRepositoryId;
390 package_data.repository_name = m_choiceRepository->GetStringSelection();
391
392 // Fabrication plugins are displayed in a different tab although they are still plugins
393 PCM_PACKAGE_TYPE type = pkg.category == PC_FAB ? PT_FAB : pkg.type;
394
395 data[type].emplace_back( package_data );
396 }
397
398 for( size_t i = 0; i < PACKAGE_TYPE_LIST.size(); i++ )
399 {
400 PCM_PACKAGE_TYPE type = PACKAGE_TYPE_LIST[i].first;
401 const wxString& label = PACKAGE_TYPE_LIST[i].second;
402 m_repositoryContentPanels[type]->SetData( data[type] );
403 m_contentNotebook->SetPageText( i, wxString::Format( wxGetTranslation( label ),
404 (int) data[type].size() ) );
405 }
406
407 m_dialogNotebook->SetPageText( 0, wxString::Format( _( "Repository (%d)" ),
408 (int) packages.size() ) );
409 }
410
411 m_dialogNotebook->Thaw();
412}
413
414
416{
417 m_gridPendingActions->ClearSelection();
418 m_gridPendingActions->SelectRow( event.GetRow() );
419}
420
421
423{
424 m_dialogNotebook->SetPageText( 2, wxString::Format( _( "Pending (%d)" ),
425 (int) m_pendingActions.size() ) );
426
427 for( int col = 0; col < m_gridPendingActions->GetNumberCols(); col++ )
428 {
429 // Set the width to see the full contents
430 m_gridPendingActions->SetColSize( col, m_gridPendingActions->GetVisibleWidth( col ) );
431 }
432}
433
434
436{
437 m_installedPanel->ClearData();
438
439 const std::vector<PCM_INSTALLATION_ENTRY> installed = m_pcm->GetInstalledPackages();
440 std::vector<PACKAGE_VIEW_DATA> package_list;
441
442 m_installedBitmaps = m_pcm->GetInstalledPackageBitmaps();
443
444 for( const PCM_INSTALLATION_ENTRY& entry : installed )
445 {
446 PACKAGE_VIEW_DATA package_data( entry );
447
448 if( m_installedBitmaps.count( package_data.package.identifier ) > 0 )
449 package_data.bitmap = &m_installedBitmaps.at( package_data.package.identifier );
450 else
451 package_data.bitmap = &m_defaultBitmap;
452
453 package_data.state = m_pcm->GetPackageState( entry.repository_id,
454 entry.package.identifier );
455
456 if( package_data.state == PPS_UPDATE_AVAILABLE )
457 package_data.update_version = m_pcm->GetPackageUpdateVersion( entry.package );
458
459 package_list.emplace_back( package_data );
460 }
461
462 m_installedPanel->SetData( package_list );
463
464 m_dialogNotebook->SetPageText( 1, wxString::Format( _( "Installed (%d)" ),
465 (int) package_list.size() ) );
466}
467
468
469void DIALOG_PCM::OnApplyChangesClicked( wxCommandEvent& event )
470{
471 if( m_pendingActions.size() == 0 )
472 return;
473
474 m_sdbSizer1OK->Disable();
475 m_sdbSizer1Apply->Disable();
476 m_sdbSizer1Cancel->Disable();
477
478 PCM_TASK_MANAGER task_manager( m_pcm );
479
480 for( const PENDING_ACTION& action : m_pendingActions )
481 {
482 if( action.action == PPA_UNINSTALL )
483 {
484 task_manager.Uninstall( action.package );
485 }
486 else
487 {
488 bool isUpdate = action.action == PPA_UPDATE;
489 task_manager.DownloadAndInstall( action.package, action.version, action.repository_id,
490 isUpdate );
491 }
492 }
493
494 task_manager.RunQueue( this );
495
496 m_changed_package_types.merge( task_manager.GetChangedPackageTypes() );
497
498 m_sdbSizer1OK->Enable();
499 m_sdbSizer1Apply->Enable();
500 m_sdbSizer1Cancel->Enable();
501
503 wxCommandEvent dummy;
505
506 if( !m_selectedRepositoryId.IsEmpty() )
508}
509
510
511void DIALOG_PCM::OnDiscardChangesClicked( wxCommandEvent& event )
512{
513 m_gridPendingActions->Freeze();
514
515 for( int i = m_pendingActions.size() - 1; i >= 0; i-- )
516 discardAction( i );
517
519 m_gridPendingActions->Thaw();
520}
521
522
523void DIALOG_PCM::OnDiscardActionClicked( wxCommandEvent& event )
524{
525 wxArrayInt rows = m_gridPendingActions->GetSelectedRows();
526
527 std::sort( rows.begin(), rows.end(),
528 []( const int& a, const int& b )
529 {
530 return a > b;
531 } );
532
533 m_gridPendingActions->Freeze();
534
535 for( int row : rows )
536 discardAction( row );
537
539 m_gridPendingActions->Thaw();
540}
541
542
544{
545 m_gridPendingActions->DeleteRows( aIndex );
546
547 PENDING_ACTION action = m_pendingActions[aIndex];
548
549 PCM_PACKAGE_STATE state = m_pcm->GetPackageState( action.repository_id,
550 action.package.identifier );
551
552 updatePackageState( action.package.identifier, state );
553
554 m_pendingActions.erase( m_pendingActions.begin() + aIndex );
555}
556
557
558void DIALOG_PCM::updatePackageState( const wxString& aPackageId, const PCM_PACKAGE_STATE aState )
559{
560 bool pinned = m_pcm->IsPackagePinned( aPackageId );
561
562 m_installedPanel->SetPackageState( aPackageId, aState, pinned );
563
564 for( const auto& [ packageType, packagesView ] : m_repositoryContentPanels )
565 packagesView->SetPackageState( aPackageId, aState, pinned );
566}
567
568
569void DIALOG_PCM::OnOpenPackageDirClicked( wxCommandEvent& event )
570{
571 LaunchExternal( m_pcm->Get3rdPartyPath() );
572}
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.
void AllowNetworkFileSystems(wxDialog *aDialog)
Configure a file dialog to show network and virtual file systems.
Definition wxgtk/ui.cpp:435
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_INVALID
Definition pcm_data.h:43
@ 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:159
Repository reference to a resource.
Definition pcm_data.h:114
wxString identifier
Definition pcm_data.h:118
wxString name
Definition pcm_data.h:115