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 (C) 1992-2022 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 "grid_tricks.h"
29#include "ki_exception.h"
30#include "pcm_task_manager.h"
31#include "pgm_base.h"
34#include "thread"
35#include "widgets/wx_grid.h"
36
37#include <fstream>
38#include <launch_ext.h>
39#include <sstream>
40#include <vector>
41#include <wx/filedlg.h>
42#include <wx/msgdlg.h>
43
44
45#define GRID_CELL_MARGIN 4
46
47// Notes: These strings are static, so wxGetTranslation must be called to display the
48// transalted text
49static std::vector<std::pair<PCM_PACKAGE_TYPE, wxString>> PACKAGE_TYPE_LIST = {
50 { PT_PLUGIN, _( "Plugins (%d)" ) },
51 { PT_LIBRARY, _( "Libraries (%d)" ) },
52 { PT_COLORTHEME, _( "Color themes (%d)" ) },
53};
54
55
56DIALOG_PCM::DIALOG_PCM( wxWindow* parent, std::shared_ptr<PLUGIN_CONTENT_MANAGER> pcm ) :
57 DIALOG_PCM_BASE( parent ),
58 m_pcm( pcm )
59{
60 SetDoubleBuffered( true );
61
62 m_defaultBitmap = KiBitmap( BITMAPS::icon_pcm );
63
64 m_pcm->SetDialogWindow( this );
65 m_pcm->StopBackgroundUpdate();
66
67 m_gridPendingActions->PushEventHandler( new GRID_TRICKS( m_gridPendingActions ) );
68
69 m_discardActionButton->SetBitmap( KiBitmap( BITMAPS::small_trash ) );
70 m_panelPending->Layout();
71
72 m_actionCallback = [this]( const PACKAGE_VIEW_DATA& aData, PCM_PACKAGE_ACTION aAction,
73 const wxString& aVersion )
74 {
75 if( aAction == PPA_UPDATE && m_pcm->IsPackagePinned( aData.package.identifier ) )
76 {
77 if( wxMessageBox( wxString::Format( _( "Are you sure you want to update pinned package "
78 "from version %s to %s?" ),
79 aData.current_version, aVersion ),
80 _( "Confirm update" ), wxICON_QUESTION | wxYES_NO, this )
81 == wxNO )
82 {
83 return;
84 }
85 }
86
87 m_gridPendingActions->Freeze();
88
89 PCM_PACKAGE_STATE new_state;
90
91 m_gridPendingActions->AppendRows();
92 int row = m_gridPendingActions->GetNumberRows() - 1;
93
94 m_gridPendingActions->SetCellValue( row, PENDING_COL_NAME, aData.package.name );
96
97 switch( aAction )
98 {
99 default:
100 case PPA_INSTALL:
101 m_gridPendingActions->SetCellValue( row, PENDING_COL_ACTION, _( "Install" ) );
102 m_gridPendingActions->SetCellValue( row, PENDING_COL_VERSION, aVersion );
103 new_state = PPS_PENDING_INSTALL;
104 break;
105
106 case PPA_UPDATE:
107 m_gridPendingActions->SetCellValue( row, PENDING_COL_ACTION, _( "Update" ) );
108 m_gridPendingActions->SetCellValue(
110 wxString::Format( wxT( "%s \u279C %s" ), aData.current_version, aVersion ) );
111 new_state = PPS_PENDING_UPDATE;
112 break;
113
114 case PPA_UNINSTALL:
115 m_gridPendingActions->SetCellValue( row, PENDING_COL_ACTION, _( "Uninstall" ) );
116 m_gridPendingActions->SetCellValue(
118 m_pcm->GetInstalledPackageVersion( aData.package.identifier ) );
119 new_state = PPS_PENDING_UNINSTALL;
120 break;
121 }
122
123 m_pendingActions.emplace_back( aAction, aData.repository_id, aData.package, aVersion );
124
125 m_gridPendingActions->Thaw();
126
128
129 updatePackageState( aData.package.identifier, new_state );
130 };
131
133 [this]( const wxString& aPackageId, const PCM_PACKAGE_STATE aState, const bool aPinned )
134 {
135 m_pcm->SetPinned( aPackageId, aPinned );
136
137 updatePackageState( aPackageId, aState );
138 };
139
142 m_panelInstalledHolder->GetSizer()->Add( m_installedPanel, 1, wxEXPAND );
143 m_panelInstalledHolder->Layout();
144
145 for( const std::pair<PCM_PACKAGE_TYPE, wxString>& entry : PACKAGE_TYPE_LIST )
146 {
149 wxString label = wxGetTranslation( entry.second );
150 m_contentNotebook->AddPage( panel, wxString::Format( label, 0 ) );
151 m_repositoryContentPanels.insert( { entry.first, panel } );
152 }
153
154 m_dialogNotebook->SetPageText( 0, wxString::Format( _( "Repository (%d)" ), 0 ) );
155
158
159 m_dialogNotebook->SetSelection( 0 );
160
161 SetupStandardButtons( { { wxID_OK, _( "Close" ) },
162 { wxID_APPLY, _( "Apply Pending Changes" ) },
163 { wxID_CANCEL, _( "Discard Pending Changes" ) } } );
164
165 Bind( wxEVT_CLOSE_WINDOW, &DIALOG_PCM::OnCloseWindow, this );
166 m_sdbSizer1Cancel->Bind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
167 m_sdbSizer1Apply->Bind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
168
170
171 for( int col = 0; col < m_gridPendingActions->GetNumberCols(); col++ )
172 {
173 const wxString& heading = m_gridPendingActions->GetColLabelValue( col );
174 int headingWidth = GetTextExtent( heading ).x + 2 * GRID_CELL_MARGIN;
175
176 // Set the minimal width to the column label size.
177 m_gridPendingActions->SetColMinimalWidth( col, headingWidth );
178 }
179
180 // fix sizers now widgets are set.
182}
183
184
186{
187 m_pcm->SaveInstalledPackages();
188 m_pcm->SetDialogWindow( nullptr );
189 m_pcm->RunBackgroundUpdate();
190
191 m_gridPendingActions->PopEventHandler( true );
192}
193
194
195void DIALOG_PCM::OnUpdateEventButtons( wxUpdateUIEvent& event )
196{
197 event.Enable( !m_pendingActions.empty() );
198}
199
200
201void DIALOG_PCM::OnCloseClicked( wxCommandEvent& event )
202{
203 if( m_pendingActions.size() == 0
204 || wxMessageBox( _( "Are you sure you want to close the package manager "
205 "and discard pending changes?" ),
206 _( "Plugin and Content Manager" ), wxICON_QUESTION | wxYES_NO, this )
207 == wxYES )
208 {
209 EndModal( wxID_OK );
210 }
211}
212
213
214void DIALOG_PCM::OnCloseWindow( wxCloseEvent& aEvent )
215{
216 wxCommandEvent dummy;
217
219}
220
221
222void DIALOG_PCM::OnManageRepositoriesClicked( wxCommandEvent& event )
223{
225
226 std::vector<std::pair<wxString, wxString>> dialog_data;
227 std::vector<std::tuple<wxString, wxString, wxString>> repo_list = m_pcm->GetRepositoryList();
228
229 for( const std::tuple<wxString, wxString, wxString>& repo : repo_list )
230 dialog_data.push_back( std::make_pair( std::get<1>( repo ), std::get<2>( repo ) ) );
231
232 dialog->SetData( dialog_data );
233
234 if( dialog->ShowModal() == wxID_SAVE )
235 {
236 dialog_data = dialog->GetData();
237 m_pcm->SetRepositoryList( dialog_data );
238
239 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
240 KICAD_SETTINGS* app_settings = mgr.GetAppSettings<KICAD_SETTINGS>();
241
242 app_settings->m_PcmRepositories = std::move( dialog_data );
243
245 }
246
247 dialog->Destroy();
248}
249
250
252{
253 std::vector<std::tuple<wxString, wxString, wxString>> repositories = m_pcm->GetRepositoryList();
254
255 m_choiceRepository->Clear();
256
257 for( const std::tuple<wxString, wxString, wxString>& entry : repositories )
258 {
259 m_choiceRepository->Append( std::get<1>( entry ),
260 new wxStringClientData( std::get<0>( entry ) ) );
261 }
262
263 if( repositories.size() > 0 )
264 {
265 m_choiceRepository->SetSelection( 0 );
266 m_selectedRepositoryId = std::get<0>( repositories[0] );
268 }
269 else
270 {
272 }
273}
274
275
276void DIALOG_PCM::OnRefreshClicked( wxCommandEvent& event )
277{
278 m_pcm->DiscardRepositoryCache( m_selectedRepositoryId );
280}
281
282
283void DIALOG_PCM::OnInstallFromFileClicked( wxCommandEvent& event )
284{
285 wxFileDialog open_file_dialog( this, _( "Choose package file" ), wxEmptyString, wxEmptyString,
286 wxT( "Zip files (*.zip)|*.zip" ),
287 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
288
289 if( open_file_dialog.ShowModal() == wxID_CANCEL )
290 return;
291
292 PCM_TASK_MANAGER task_manager( m_pcm );
293 task_manager.InstallFromFile( this, open_file_dialog.GetPath() );
294
295 m_changed_package_types.merge( task_manager.GetChangedPackageTypes() );
296
298
299 if( !m_selectedRepositoryId.IsEmpty() )
301}
302
303
304void DIALOG_PCM::OnRepositoryChoice( wxCommandEvent& event )
305{
306 wxStringClientData* data = static_cast<wxStringClientData*>(
307 m_choiceRepository->GetClientObject( m_choiceRepository->GetSelection() ) );
308
309 m_selectedRepositoryId = data->GetData();
310
312}
313
314
315void DIALOG_PCM::setRepositoryData( const wxString& aRepositoryId )
316{
317 m_dialogNotebook->Freeze();
318
319 if( m_pcm->CacheRepository( aRepositoryId ) )
320 {
321 for( const auto& [ packageType, packagesView ] : m_repositoryContentPanels )
322 packagesView->ClearData();
323
324 m_packageBitmaps = m_pcm->GetRepositoryPackageBitmaps( aRepositoryId );
325
326 const std::vector<PCM_PACKAGE> packages = m_pcm->GetRepositoryPackages( aRepositoryId );
327
328 std::unordered_map<PCM_PACKAGE_TYPE, std::vector<PACKAGE_VIEW_DATA>> data;
329
330 for( const PCM_PACKAGE& pkg : packages )
331 {
332 PACKAGE_VIEW_DATA package_data( pkg );
333
334 if( m_packageBitmaps.count( package_data.package.identifier ) > 0 )
335 package_data.bitmap = &m_packageBitmaps.at( package_data.package.identifier );
336 else
337 package_data.bitmap = &m_defaultBitmap;
338
339 package_data.state = m_pcm->GetPackageState( aRepositoryId, pkg.identifier );
340
341 if( package_data.state == PPS_INSTALLED || package_data.state == PPS_UPDATE_AVAILABLE )
342 {
343 package_data.current_version = m_pcm->GetInstalledPackageVersion( pkg.identifier );
344 package_data.pinned = m_pcm->IsPackagePinned( pkg.identifier );
345 }
346
347 if( package_data.state == PPS_UPDATE_AVAILABLE )
348 package_data.update_version = m_pcm->GetPackageUpdateVersion( pkg );
349
350
351 for( const PENDING_ACTION& action : m_pendingActions )
352 {
353 if( action.package.identifier != pkg.identifier )
354 continue;
355
356 switch( action.action )
357 {
358 case PPA_INSTALL: package_data.state = PPS_PENDING_INSTALL; break;
359 case PPA_UPDATE: package_data.state = PPS_PENDING_UPDATE; break;
360 case PPA_UNINSTALL: package_data.state = PPS_PENDING_UNINSTALL; break;
361 }
362
363 break;
364 }
365
366 package_data.repository_id = aRepositoryId;
367 package_data.repository_name = m_choiceRepository->GetStringSelection();
368
369 data[pkg.type].emplace_back( package_data );
370 }
371
372 for( size_t i = 0; i < PACKAGE_TYPE_LIST.size(); i++ )
373 {
374 PCM_PACKAGE_TYPE type = PACKAGE_TYPE_LIST[i].first;
375 const wxString& label = PACKAGE_TYPE_LIST[i].second;
376 m_repositoryContentPanels[type]->SetData( data[type] );
377 m_contentNotebook->SetPageText( i, wxString::Format( wxGetTranslation( label ),
378 (int) data[type].size() ) );
379 }
380
381 m_dialogNotebook->SetPageText( 0, wxString::Format( _( "Repository (%d)" ),
382 (int) packages.size() ) );
383 }
384
385 m_dialogNotebook->Thaw();
386}
387
388
390{
391 m_gridPendingActions->ClearSelection();
392 m_gridPendingActions->SelectRow( event.GetRow() );
393}
394
395
397{
398 m_dialogNotebook->SetPageText( 2, wxString::Format( _( "Pending (%d)" ),
399 (int) m_pendingActions.size() ) );
400
401 for( int col = 0; col < m_gridPendingActions->GetNumberCols(); col++ )
402 {
403 // Set the width to see the full contents
405 }
406}
407
408
410{
412
413 const std::vector<PCM_INSTALLATION_ENTRY> installed = m_pcm->GetInstalledPackages();
414 std::vector<PACKAGE_VIEW_DATA> package_list;
415
416 m_installedBitmaps = m_pcm->GetInstalledPackageBitmaps();
417
418 for( const PCM_INSTALLATION_ENTRY& entry : installed )
419 {
420 PACKAGE_VIEW_DATA package_data( entry );
421
422 if( m_installedBitmaps.count( package_data.package.identifier ) > 0 )
423 package_data.bitmap = &m_installedBitmaps.at( package_data.package.identifier );
424 else
425 package_data.bitmap = &m_defaultBitmap;
426
427 package_data.state = m_pcm->GetPackageState( entry.repository_id,
428 entry.package.identifier );
429
430 if( package_data.state == PPS_UPDATE_AVAILABLE )
431 package_data.update_version = m_pcm->GetPackageUpdateVersion( entry.package );
432
433 package_list.emplace_back( package_data );
434 }
435
436 m_installedPanel->SetData( package_list );
437
438 m_dialogNotebook->SetPageText( 1, wxString::Format( _( "Installed (%d)" ),
439 (int) package_list.size() ) );
440}
441
442
443void DIALOG_PCM::OnApplyChangesClicked( wxCommandEvent& event )
444{
445 if( m_pendingActions.size() == 0 )
446 return;
447
448 m_sdbSizer1OK->Disable();
449 m_sdbSizer1Apply->Disable();
450 m_sdbSizer1Cancel->Disable();
451
452 PCM_TASK_MANAGER task_manager( m_pcm );
453
454 for( const PENDING_ACTION& action : m_pendingActions )
455 {
456 if( action.action == PPA_UNINSTALL )
457 {
458 task_manager.Uninstall( action.package );
459 }
460 else
461 {
462 bool isUpdate = action.action == PPA_UPDATE;
463 task_manager.DownloadAndInstall( action.package, action.version, action.repository_id,
464 isUpdate );
465 }
466 }
467
468 task_manager.RunQueue( this );
469
470 m_changed_package_types.merge( task_manager.GetChangedPackageTypes() );
471
472 m_sdbSizer1OK->Enable();
473 m_sdbSizer1Apply->Enable();
474 m_sdbSizer1Cancel->Enable();
475
477 wxCommandEvent dummy;
479
480 if( !m_selectedRepositoryId.IsEmpty() )
482}
483
484
485void DIALOG_PCM::OnDiscardChangesClicked( wxCommandEvent& event )
486{
487 m_gridPendingActions->Freeze();
488
489 for( int i = m_pendingActions.size() - 1; i >= 0; i-- )
490 discardAction( i );
491
493 m_gridPendingActions->Thaw();
494}
495
496
497void DIALOG_PCM::OnDiscardActionClicked( wxCommandEvent& event )
498{
499 wxArrayInt rows = m_gridPendingActions->GetSelectedRows();
500
501 std::sort( rows.begin(), rows.end(),
502 []( const int& a, const int& b )
503 {
504 return a > b;
505 } );
506
507 m_gridPendingActions->Freeze();
508
509 for( int row : rows )
510 discardAction( row );
511
513 m_gridPendingActions->Thaw();
514}
515
516
518{
519 m_gridPendingActions->DeleteRows( aIndex );
520
521 PENDING_ACTION action = m_pendingActions[aIndex];
522
523 PCM_PACKAGE_STATE state = m_pcm->GetPackageState( action.repository_id,
524 action.package.identifier );
525
526 updatePackageState( action.package.identifier, state );
527
528 m_pendingActions.erase( m_pendingActions.begin() + aIndex );
529}
530
531
532void DIALOG_PCM::updatePackageState( const wxString& aPackageId, const PCM_PACKAGE_STATE aState )
533{
534 bool pinned = m_pcm->IsPackagePinned( aPackageId );
535
536 m_installedPanel->SetPackageState( aPackageId, aState, pinned );
537
538 for( const auto& [ packageType, packagesView ] : m_repositoryContentPanels )
539 packagesView->SetPackageState( aPackageId, aState, pinned );
540}
541
542
543void DIALOG_PCM::OnOpenPackageDirClicked( wxCommandEvent& event )
544{
545 LaunchExternal( m_pcm->Get3rdPartyPath() );
546}
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:106
Implementing DIALOG_MANAGE_REPOSITORIES_BASE.
std::vector< std::pair< wxString, wxString > > GetData()
void SetData(const std::vector< std::pair< wxString, wxString > > &aData)
Class DIALOG_PCM_BASE.
wxChoice * m_choiceRepository
wxNotebook * m_contentNotebook
WX_GRID * m_gridPendingActions
wxButton * m_sdbSizer1OK
wxButton * m_sdbSizer1Cancel
wxBitmapButton * m_discardActionButton
wxNotebook * m_dialogNotebook
wxButton * m_sdbSizer1Apply
wxPanel * m_panelInstalledHolder
wxPanel * m_panelPending
ActionCallback m_actionCallback
Definition: dialog_pcm.h:106
void OnDiscardChangesClicked(wxCommandEvent &event) override
Switches to another repository.
Definition: dialog_pcm.cpp:485
std::unordered_map< wxString, wxBitmap > m_installedBitmaps
Definition: dialog_pcm.h:112
std::unordered_map< wxString, wxBitmap > m_packageBitmaps
Definition: dialog_pcm.h:111
void OnManageRepositoriesClicked(wxCommandEvent &event) override
Discards current repo cache, fetches it anew and displays.
Definition: dialog_pcm.cpp:222
void updatePackageState(const wxString &aPackageId, const PCM_PACKAGE_STATE aState)
Discards specified pending action.
Definition: dialog_pcm.cpp:532
void OnApplyChangesClicked(wxCommandEvent &event) override
Discards all pending changes.
Definition: dialog_pcm.cpp:443
void OnDiscardActionClicked(wxCommandEvent &event) override
Handles modification of the buttons' status.
Definition: dialog_pcm.cpp:497
void OnUpdateEventButtons(wxUpdateUIEvent &event)
Returns types of packages that were installed/uninstalled.
Definition: dialog_pcm.cpp:195
std::unordered_map< PCM_PACKAGE_TYPE, PANEL_PACKAGES_VIEW * > m_repositoryContentPanels
Definition: dialog_pcm.h:109
void OnOpenPackageDirClicked(wxCommandEvent &event) override
Enqueues current pending actions in PCM_TASK_MANAGER and runs the queue.
Definition: dialog_pcm.cpp:543
PinCallback m_pinCallback
Definition: dialog_pcm.h:107
DIALOG_PCM(wxWindow *parent, std::shared_ptr< PLUGIN_CONTENT_MANAGER > pcm)
Constructor.
Definition: dialog_pcm.cpp:56
std::unordered_set< PCM_PACKAGE_TYPE > m_changed_package_types
Definition: dialog_pcm.h:114
void updatePendingActionsTab()
Gets installed packages list from PCM and displays it on installed tab.
Definition: dialog_pcm.cpp:396
std::vector< PENDING_ACTION > m_pendingActions
Definition: dialog_pcm.h:130
void setRepositoryListFromPcm()
Updates pending actions tab caption and content-fits the grid.
Definition: dialog_pcm.cpp:251
void OnInstallFromFileClicked(wxCommandEvent &event) override
Opens local directory where packages are installed in file manager.
Definition: dialog_pcm.cpp:283
@ PENDING_COL_NAME
Definition: dialog_pcm.h:135
@ PENDING_COL_REPOSITORY
Definition: dialog_pcm.h:137
@ PENDING_COL_VERSION
Definition: dialog_pcm.h:136
@ PENDING_COL_ACTION
Definition: dialog_pcm.h:134
void OnCloseWindow(wxCloseEvent &aEvent)
Opens repository management dialog, saves changes to PCM.
Definition: dialog_pcm.cpp:214
std::shared_ptr< PLUGIN_CONTENT_MANAGER > m_pcm
Definition: dialog_pcm.h:105
void OnRepositoryChoice(wxCommandEvent &event) override
Selects the whole row in the grid if a cell is clicked.
Definition: dialog_pcm.cpp:304
wxString m_selectedRepositoryId
Definition: dialog_pcm.h:110
PANEL_PACKAGES_VIEW * m_installedPanel
Definition: dialog_pcm.h:108
~DIALOG_PCM()
Closes the window, asks user confirmation if there are pending actions.
Definition: dialog_pcm.cpp:185
void setInstalledPackages()
Reflects new state of the package in all panels where it is displayed.
Definition: dialog_pcm.cpp:409
void OnPendingActionsCellClicked(wxGridEvent &event) override
Discards selected pending actions.
Definition: dialog_pcm.cpp:389
void setRepositoryData(const wxString &aRepositoryId)
Gets package data from PCM and displays it on repository tab.
Definition: dialog_pcm.cpp:315
void discardAction(int aIndex)
Definition: dialog_pcm.cpp:517
wxBitmap m_defaultBitmap
Definition: dialog_pcm.h:113
void OnRefreshClicked(wxCommandEvent &event) override
Opens file selection dialog and installs selected package archive.
Definition: dialog_pcm.cpp:276
void OnCloseClicked(wxCommandEvent &event) override
Definition: dialog_pcm.cpp:201
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...
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:61
std::vector< std::pair< wxString, wxString > > m_PcmRepositories
void ClearData()
Selects full row of the clicked cell.
void SetData(const std::vector< PACKAGE_VIEW_DATA > &aPackageData)
Recreates package panels and displays data.
void SetPackageState(const wxString &aPackageId, const PCM_PACKAGE_STATE aState, const bool aPinned)
Set the state of package.
Helper class that handles package (un)installation.
void InstallFromFile(wxWindow *aParent, const wxString &aFilePath)
Installs package from an archive file on disk.
void Uninstall(const PCM_PACKAGE &aPackage)
Enqueue package uninstallation.
void DownloadAndInstall(const PCM_PACKAGE &aPackage, const wxString &aVersion, const wxString &aRepositoryId, const bool isUpdate)
Enqueue package download and installation.
std::unordered_set< PCM_PACKAGE_TYPE > & GetChangedPackageTypes()
void RunQueue(wxWindow *aParent)
Run queue of pending actions.
T * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculates the specified column based on the actual size of the text on screen.
Definition: wx_grid.cpp:571
#define GRID_CELL_MARGIN
static std::vector< std::pair< PCM_PACKAGE_TYPE, wxString > > PACKAGE_TYPE_LIST
Definition: dialog_pcm.cpp:49
#define _(s)
bool LaunchExternal(const wxString &aPath)
Launches the given file or folder in the host OS.
Definition: launch_ext.cpp:25
PCM_PACKAGE_STATE
Definition: pcm.h:55
@ PPS_INSTALLED
Definition: pcm.h:58
@ PPS_PENDING_UPDATE
Definition: pcm.h:62
@ PPS_UPDATE_AVAILABLE
Definition: pcm.h:61
@ PPS_PENDING_UNINSTALL
Definition: pcm.h:60
@ PPS_PENDING_INSTALL
Definition: pcm.h:59
PCM_PACKAGE_ACTION
Definition: pcm.h:68
@ PPA_UNINSTALL
Definition: pcm.h:70
@ PPA_UPDATE
Definition: pcm.h:71
@ PPA_INSTALL
Definition: pcm.h:69
PCM_PACKAGE_TYPE
< Supported package types
Definition: pcm_data.h:41
@ PT_COLORTHEME
Definition: pcm_data.h:45
@ PT_PLUGIN
Definition: pcm_data.h:43
@ PT_LIBRARY
Definition: pcm_data.h:44
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:115
std::vector< FAB_LAYER_COLOR > dummy
< Collection of data relevant to the package display panel Callback for (un)install button
Definition: panel_package.h:31
wxString update_version
Definition: panel_package.h:39
wxString repository_id
Definition: panel_package.h:36
wxString current_version
Definition: panel_package.h:38
const PCM_PACKAGE package
Definition: panel_package.h:32
wxString repository_name
Definition: panel_package.h:37
wxBitmap * bitmap
Definition: panel_package.h:33
PCM_PACKAGE_STATE state
Definition: panel_package.h:34
Definition: pcm_data.h:138
Repository reference to a resource.
Definition: pcm_data.h:95
wxString identifier
Definition: pcm_data.h:99
wxString name
Definition: pcm_data.h:96