~ubuntu-branches/ubuntu/saucy/guayadeque/saucy

« back to all changes in this revision

Viewing changes to src/.svn/text-base/TaListBox.cpp.svn-base

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2011-02-25 11:59:10 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110225115910-13phl46pz0rgqg0a
Tags: 0.2.9-1
* Imported Upstream version 0.2.9
* Drop 02-google_cover_search_engine_crash.patch patch, applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "Config.h"
24
24
#include "Images.h"
25
25
#include "Utils.h"
 
26
#include "LibPanel.h"
26
27
 
27
28
// -------------------------------------------------------------------------------- //
28
 
guTaListBox::guTaListBox( wxWindow * parent, guDbLibrary * db, const wxString &label ) :
 
29
guTaListBox::guTaListBox( wxWindow * parent, guLibPanel * libpanel, guDbLibrary * db, const wxString &label ) :
29
30
     guListBox( parent, db, label, wxLB_MULTIPLE | guLISTVIEW_ALLOWDRAG | guLISTVIEW_HIDE_HEADER )
30
31
{
 
32
    m_LibPanel = libpanel;
 
33
 
31
34
    Connect( ID_LABEL_ADD, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( guTaListBox::AddLabel ) );
32
35
    Connect( ID_LABEL_DELETE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( guTaListBox::DelLabel ) );
33
36
    Connect( ID_LABEL_EDIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( guTaListBox::EditLabel ) );
49
52
}
50
53
 
51
54
// -------------------------------------------------------------------------------- //
52
 
int guTaListBox::GetSelectedSongs( guTrackArray * Songs ) const
 
55
int guTaListBox::GetSelectedSongs( guTrackArray * songs ) const
53
56
{
54
 
    return m_Db->GetLabelsSongs( GetSelectedItems(), Songs );
 
57
    int Count = m_Db->GetLabelsSongs( GetSelectedItems(), songs );
 
58
    m_LibPanel->NormalizeTracks( songs );
 
59
    return Count;
55
60
}
56
61
 
57
62
// -------------------------------------------------------------------------------- //
98
103
 
99
104
    Menu->AppendSeparator();
100
105
 
101
 
    MenuItem = new wxMenuItem( Menu, ID_LABEL_COPYTO, _( "Copy to..." ), _( "Copy the current selected songs to a directory or device" ) );
102
 
    MenuItem->SetBitmap( guImage( guIMAGE_INDEX_edit_copy ) );
 
106
    MenuItem = new wxMenuItem( Menu, ID_LABEL_SAVETOPLAYLIST, _( "Save to PlayList" ), _( "Save the selected tracks to PlayList" ) );
 
107
    MenuItem->SetBitmap( guImage( guIMAGE_INDEX_doc_save ) );
103
108
    Menu->Append( MenuItem );
 
109
 
 
110
    if( m_LibPanel->GetContextMenuFlags() & guLIBRARY_CONTEXTMENU_COPY_TO )
 
111
    {
 
112
        m_LibPanel->CreateCopyToMenu( Menu, ID_LABEL_COPYTO );
 
113
    }
 
114
 
 
115
    m_LibPanel->CreateContextMenu( Menu );
104
116
}
105
117
 
106
118
// -------------------------------------------------------------------------------- //
163
175
    guTrackArray Songs;
164
176
    int index;
165
177
    int count = GetSelectedSongs( &Songs );
 
178
    m_LibPanel->NormalizeTracks( &Songs, true );
166
179
    for( index = 0; index < count; index++ )
167
180
    {
168
181
       wxString FileName = guFileDnDEncode( Songs[ index ].m_FileName );