diff --git a/include/wx/msw/taskbarbutton.h b/include/wx/msw/taskbarbutton.h index 409e5e046d..537f2f361d 100644 --- a/include/wx/msw/taskbarbutton.h +++ b/include/wx/msw/taskbarbutton.h @@ -81,9 +81,9 @@ public: const wxTaskBarJumpListCategory& GetRecentCategory(); const wxTaskBarJumpListCategories& GetCustomCategories() const; - void AddCategory(wxTaskBarJumpListCategory* category); - wxTaskBarJumpListCategory* RemoveCategory(const wxString& title); - void DeleteCategory(const wxString& title); + void AddCustomCategory(wxTaskBarJumpListCategory* category); + wxTaskBarJumpListCategory* RemoveCustomCategory(const wxString& title); + void DeleteCustomCategory(const wxString& title); void Update(); private: diff --git a/include/wx/taskbarbutton.h b/include/wx/taskbarbutton.h index 4804782996..c513bdc8dc 100644 --- a/include/wx/taskbarbutton.h +++ b/include/wx/taskbarbutton.h @@ -224,9 +224,10 @@ public: const wxTaskBarJumpListCategory& GetRecentCategory() const; const wxTaskBarJumpListCategories& GetCustomCategories() const; - void AddCategory(wxTaskBarJumpListCategory* category); - wxTaskBarJumpListCategory* RemoveCategory(const wxString& title); - void DeleteCategory(const wxString& title); + void AddCustomCategory(wxTaskBarJumpListCategory* category); + wxTaskBarJumpListCategory* RemoveCustomCategory(const wxString& title); + void DeleteCustomCategory(const wxString& title); + void Update(); private: diff --git a/samples/taskbarbutton/taskbarbutton.cpp b/samples/taskbarbutton/taskbarbutton.cpp index d48692ead4..a339bdea10 100644 --- a/samples/taskbarbutton/taskbarbutton.cpp +++ b/samples/taskbarbutton/taskbarbutton.cpp @@ -139,6 +139,7 @@ bool MyApp::OnInit() { if ( !wxApp::OnInit() ) return false; + wxTaskBarJumpList jumpList; wxTaskBarJumpListItem *item1 = new wxTaskBarJumpListItem( wxTASKBAR_JUMP_LIST_TASK, @@ -165,16 +166,16 @@ bool MyApp::OnInit() wxTaskBarJumpListItem* item3 = new wxTaskBarJumpListItem( wxTASKBAR_JUMP_LIST_DESTIONATION, - wxT("Custom Item - Help"), + wxT("Help"), wxStandardPaths::Get().GetExecutablePath(), wxT("--help"), - wxT("Test Custom Category."), + wxT("wxTaskBarButton help."), wxStandardPaths::Get().GetExecutablePath(), 0); wxTaskBarJumpListCategory* customCategory = new wxTaskBarJumpListCategory(wxT("Custom")); customCategory->Append(item3); - jumpList.AddCategory(customCategory); + jumpList.AddCustomCategory(customCategory); jumpList.Update(); diff --git a/src/msw/taskbarbutton.cpp b/src/msw/taskbarbutton.cpp index 72f6beb8b1..89effdb1a6 100644 --- a/src/msw/taskbarbutton.cpp +++ b/src/msw/taskbarbutton.cpp @@ -919,7 +919,6 @@ wxTaskBarJumpListItem::wxTaskBarJumpListItem(wxTaskBarJumpListItemType type, { } - wxTaskBarJumpListItemType wxTaskBarJumpListItem::GetType() const { return m_type; @@ -1129,20 +1128,20 @@ wxTaskBarJumpList::GetCustomCategories() const return m_jumpListImpl->GetCustomCategories(); } -void wxTaskBarJumpList::AddCategory(wxTaskBarJumpListCategory* category) +void wxTaskBarJumpList::AddCustomCategory(wxTaskBarJumpListCategory* category) { - m_jumpListImpl->AddCategory(category); + m_jumpListImpl->AddCustomCategory(category); } -wxTaskBarJumpListCategory* wxTaskBarJumpList::RemoveCategory( +wxTaskBarJumpListCategory* wxTaskBarJumpList::RemoveCustomCategory( const wxString& title) { - return m_jumpListImpl->RemoveCategory(title); + return m_jumpListImpl->RemoveCustomCategory(title); } -void wxTaskBarJumpList::DeleteCategory(const wxString& title) +void wxTaskBarJumpList::DeleteCustomCategory(const wxString& title) { - m_jumpListImpl->DeleteCategory(title); + m_jumpListImpl->DeleteCustomCategory(title); } void wxTaskBarJumpList::Update() @@ -1251,13 +1250,15 @@ wxTaskBarJumpListImpl::GetCustomCategories() const return m_customCategories; } -void wxTaskBarJumpListImpl::AddCategory(wxTaskBarJumpListCategory *category) +void +wxTaskBarJumpListImpl::AddCustomCategory(wxTaskBarJumpListCategory *category) { + wxASSERT_MSG( category != NULL, "Invalid category." ); m_customCategories.push_back(category); } wxTaskBarJumpListCategory* -wxTaskBarJumpListImpl::RemoveCategory(const wxString& title) +wxTaskBarJumpListImpl::RemoveCustomCategory(const wxString& title) { for ( wxTaskBarJumpListCategories::iterator it = m_customCategories.begin(); it != m_customCategories.end(); @@ -1273,9 +1274,9 @@ wxTaskBarJumpListImpl::RemoveCategory(const wxString& title) return NULL; } -void wxTaskBarJumpListImpl::DeleteCategory(const wxString& title) +void wxTaskBarJumpListImpl::DeleteCustomCategory(const wxString& title) { - wxTaskBarJumpListCategory* category = RemoveCategory(title); + wxTaskBarJumpListCategory* category = RemoveCustomCategory(title); if ( category ) delete category; }