From 7693c59df60346c2e933ed617afe272cadffde2c Mon Sep 17 00:00:00 2001 From: upstream svn Date: Mon, 17 May 2010 20:11:13 +0000 Subject: [PATCH] Upstream tarball 10178 --- .svn-revision | 2 +- src/SharedFilesWnd.cpp | 30 +++++++++------ src/muuli.wdr | Bin 328500 -> 326923 bytes src/muuli_wdr.cpp | 100 ++++++++++++++++++++----------------------------- src/muuli_wdr.h | 41 ++++++++++---------- 5 files changed, 78 insertions(+), 95 deletions(-) diff --git a/.svn-revision b/.svn-revision index ffcfcbf2..4dbfac81 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -10177 +10178 diff --git a/src/SharedFilesWnd.cpp b/src/SharedFilesWnd.cpp index 62f60a99..4da2e3fa 100644 --- a/src/SharedFilesWnd.cpp +++ b/src/SharedFilesWnd.cpp @@ -109,18 +109,15 @@ void CSharedFilesWnd::SelectionUpdated() if ( !sharedfilesctrl->GetSelectedItemCount() ) { // Requests m_bar_requests->SetValue( 0 ); - CastChild(IDC_SREQUESTED, wxStaticText)->SetLabel( wxT("- /") ); - CastChild(IDC_SREQUESTED2, wxStaticText)->SetLabel( wxT("- /") ); + CastChild(IDC_SREQUESTED, wxStaticText)->SetLabel( wxT("- / -") ); // Accepted requets m_bar_accepted->SetValue( 0 ); - CastChild(IDC_SACCEPTED, wxStaticText)->SetLabel( wxT("- /") ); - CastChild(IDC_SACCEPTED2, wxStaticText)->SetLabel( wxT("- /") ); + CastChild(IDC_SACCEPTED, wxStaticText)->SetLabel( wxT("- / -") ); // Transferred m_bar_transfer->SetValue( 0 ); - CastChild(IDC_STRANSFERRED, wxStaticText)->SetLabel( wxT("- /") ); - CastChild(IDC_STRANSFERRED2, wxStaticText)->SetLabel( wxT("- /") ); + CastChild(IDC_STRANSFERRED, wxStaticText)->SetLabel( wxT("- / -") ); } else { // Create a total statistic for the selected item(s) @@ -154,23 +151,32 @@ void CSharedFilesWnd::SelectionUpdated() std::sort(fileVector.begin(), fileVector.end()); + // Store text lengths, and layout() when the texts have grown + static uint32 lReq = 0, lAcc = 0, lTrans = 0; // Requests session_requests = session_requests > lRequested ? lRequested : session_requests; m_bar_requests->SetValue( session_requests ); - CastChild(IDC_SREQUESTED, wxStaticText)->SetLabel( wxString::Format(wxT("%u /"), session_requests ) ); - CastChild(IDC_SREQUESTED2, wxStaticText)->SetLabel( wxString::Format(wxT("%u /"), all_requests ) ); + wxString labelReq = CFormat(wxT("%d / %d")) % session_requests % all_requests; + CastChild(IDC_SREQUESTED, wxStaticText)->SetLabel(labelReq); // Accepted requets session_accepted = session_accepted > lAccepted ? lAccepted : session_accepted; m_bar_accepted->SetValue( session_accepted ); - CastChild(IDC_SACCEPTED, wxStaticText)->SetLabel( wxString::Format(wxT("%u /"), session_accepted ) ); - CastChild(IDC_SACCEPTED2, wxStaticText)->SetLabel( wxString::Format(wxT("%u /"), all_accepted ) ); + wxString labelAcc = CFormat(wxT("%d / %d")) % session_accepted % all_accepted; + CastChild(IDC_SACCEPTED, wxStaticText)->SetLabel(labelAcc); // Transferred session_transferred = session_transferred > lTransferred ? lTransferred : session_transferred; m_bar_transfer->SetValue( session_transferred / 1024 ); - CastChild(IDC_STRANSFERRED, wxStaticText)->SetLabel( CastItoXBytes( session_transferred ) + wxT(" /")); - CastChild(IDC_STRANSFERRED2, wxStaticText)->SetLabel( CastItoXBytes( all_transferred ) + wxT(" /")); + wxString labelTrans = CastItoXBytes( session_transferred ) + wxT(" / ") + CastItoXBytes( all_transferred ); + CastChild(IDC_STRANSFERRED, wxStaticText)->SetLabel(labelTrans); + + if (labelReq.Len() > lReq || labelAcc.Len() > lAcc || labelTrans.Len() > lTrans) { + lReq = labelReq.Len(); + lAcc = labelAcc.Len(); + lTrans = labelTrans.Len(); + s_sharedfilespeerHeader->Layout(); + } } this->peerslistctrl->ShowSources(fileVector); diff --git a/src/muuli.wdr b/src/muuli.wdr index ea9578104a37997a91768edfaee9e2e498da36a7..f04e4b0fe69bfd3489dd4dccc9f0394cb4bd96b3 100644 GIT binary patch delta 360 zcwXDmCer;&xS@q{3sd5^$pPm@wwHcmQe>Ro_?L0bbO$Y_rPF8pV9J_);V;wj=@Wt( zc_#PTW=$86XX2S&KZDV3@`81S)7R=UC4!W$oWA-eQ#MGc&GdL*CXVSm%*;ucnnWf) zkmHzqK-Fvd8eOI&upN^pRI*Ip|BERDqM4V2ITwe%=@X7IMNV&UW8|0~;Lj8~jfcr+ zxPw z(lT>Wi>Dv_!stKU{sI%%WG%mg)8Df)OHV$a&ocRdlj~%Clh{emG$$LxNKT*plPPuj zeg#ITfbewLsZ1Q)!9lKpp{~Ipt}aHC19wSGs&$0CrUyJ_;+dSlAL7-1OU4YIB33Bucc5@91BEv=CSX|D+Y&vNM}bPCBm8Zp^{F-I#;r G#uorEc+xTe diff --git a/src/muuli_wdr.cpp b/src/muuli_wdr.cpp index 00c42a21..eff2770b 100644 --- a/src/muuli_wdr.cpp +++ b/src/muuli_wdr.cpp @@ -3363,11 +3363,10 @@ wxSizer *PreferencesEventsTab( wxWindow *parent, bool call_fit, bool set_sizer ) wxSizer *s_sharedfilespeerHeader; wxSizer *sharedfilesBottomDlg( wxWindow *parent, bool call_fit, bool set_sizer ) { - wxStaticBox *item1 = new wxStaticBox( parent, -1, _("Statistics and queued clients for selected file(s)") ); + wxStaticBox *item1 = new wxStaticBox( parent, -1, _("Statistics and queued clients for selected file(s) : Session / All time") ); wxStaticBoxSizer *item0 = new wxStaticBoxSizer( item1, wxVERTICAL ); wxFlexGridSizer *item2 = new wxFlexGridSizer( 4, 0, 0 ); - item2->AddGrowableCol( 0 ); item2->AddGrowableCol( 1 ); item2->AddGrowableCol( 2 ); item2->AddGrowableCol( 3 ); @@ -3376,83 +3375,64 @@ wxSizer *sharedfilesBottomDlg( wxWindow *parent, bool call_fit, bool set_sizer ) wxBitmapButton *item3 = new wxBitmapButton( parent, ID_SHAREDCLIENTTOGGLE, amuleDlgImages( 10 ), wxDefaultPosition, wxDefaultSize ); item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL, 5 ); - wxStaticText *item4 = new wxStaticText( parent, -1, _("Requested"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item4, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - - wxStaticText *item5 = new wxStaticText( parent, -1, _("Active Uploads"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item5, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - - wxStaticText *item6 = new wxStaticText( parent, -1, _("Transferred"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item6, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - - wxStaticText *item7 = new wxStaticText( parent, -1, _("Session / All time / % of total files"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item7, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - - wxFlexGridSizer *item8 = new wxFlexGridSizer( 4, 0, 0 ); - - wxStaticLine *item9 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); - item8->Add( item9, 0, wxALIGN_CENTER|wxALL, 5 ); + wxFlexGridSizer *item4 = new wxFlexGridSizer( 3, 0, 0 ); + item4->AddGrowableCol( 1 ); + item4->AddGrowableCol( 2 ); - wxStaticText *item10 = new wxStaticText( parent, IDC_SREQUESTED, _("N/A"), wxDefaultPosition, wxDefaultSize, 0 ); - item10->SetForegroundColour( *wxBLUE ); - item8->Add( item10, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + wxStaticText *item5 = new wxStaticText( parent, -1, _("Requested"), wxDefaultPosition, wxDefaultSize, 0 ); + item4->Add( item5, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - wxStaticText *item11 = new wxStaticText( parent, IDC_SREQUESTED2, _("N/A"), wxDefaultPosition, wxDefaultSize, 0 ); - item11->SetForegroundColour( *wxBLUE ); - item8->Add( item11, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + wxStaticText *item6 = new wxStaticText( parent, IDC_SREQUESTED, _("N/A"), wxDefaultPosition, wxDefaultSize, 0 ); + item6->SetForegroundColour( *wxBLUE ); + item4->Add( item6, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); - wxGauge *item12 = new wxGauge( parent, -1, 100, wxDefaultPosition, wxSize(200,-1), 0 ); - item12->SetName( wxT("popbar") ); - item8->Add( item12, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); + item2->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 ); - item2->Add( item8, 0, wxALIGN_CENTER, 5 ); + wxFlexGridSizer *item7 = new wxFlexGridSizer( 3, 0, 0 ); - wxFlexGridSizer *item13 = new wxFlexGridSizer( 4, 0, 0 ); + wxStaticText *item8 = new wxStaticText( parent, -1, _("Active Uploads"), wxDefaultPosition, wxDefaultSize, 0 ); + item7->Add( item8, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - wxStaticLine *item14 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); - item13->Add( item14, 0, wxALIGN_CENTER|wxALL, 5 ); - - wxStaticText *item15 = new wxStaticText( parent, IDC_SACCEPTED, _("N/A"), wxDefaultPosition, wxDefaultSize, 0 ); - item15->SetForegroundColour( *wxBLUE ); - item13->Add( item15, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + wxStaticText *item9 = new wxStaticText( parent, IDC_SACCEPTED, _("N/A"), wxDefaultPosition, wxDefaultSize, 0 ); + item9->SetForegroundColour( *wxBLUE ); + item7->Add( item9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); - wxStaticText *item16 = new wxStaticText( parent, IDC_SACCEPTED2, _("N/A"), wxDefaultPosition, wxDefaultSize, 0 ); - item16->SetForegroundColour( *wxBLUE ); - item13->Add( item16, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + item2->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 ); - wxGauge *item17 = new wxGauge( parent, -1, 100, wxDefaultPosition, wxSize(200,-1), 0 ); - item17->SetName( wxT("popbarAccept") ); - item13->Add( item17, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 ); + wxFlexGridSizer *item10 = new wxFlexGridSizer( 3, 0, 0 ); - item2->Add( item13, 0, wxALIGN_CENTER, 5 ); + wxStaticText *item11 = new wxStaticText( parent, -1, _("Transferred"), wxDefaultPosition, wxDefaultSize, 0 ); + item10->Add( item11, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - wxFlexGridSizer *item18 = new wxFlexGridSizer( 4, 0, 0 ); + wxStaticText *item12 = new wxStaticText( parent, IDC_STRANSFERRED, _("N/A"), wxDefaultPosition, wxDefaultSize, 0 ); + item12->SetForegroundColour( *wxBLUE ); + item10->Add( item12, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); - wxStaticLine *item19 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); - item18->Add( item19, 0, wxALIGN_CENTER|wxALL, 5 ); + item2->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 ); - wxStaticText *item20 = new wxStaticText( parent, IDC_STRANSFERRED, _("N/A"), wxDefaultPosition, wxDefaultSize, 0 ); - item20->SetForegroundColour( *wxBLUE ); - item18->Add( item20, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + wxStaticText *item13 = new wxStaticText( parent, -1, _("% of total files"), wxDefaultPosition, wxDefaultSize, 0 ); + item2->Add( item13, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - wxStaticText *item21 = new wxStaticText( parent, IDC_STRANSFERRED2, _("N/A"), wxDefaultPosition, wxDefaultSize, 0 ); - item21->SetForegroundColour( *wxBLUE ); - item18->Add( item21, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + wxGauge *item14 = new wxGauge( parent, -1, 100, wxDefaultPosition, wxSize(200,18), 0 ); + item14->SetName( wxT("popbar") ); + item2->Add( item14, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - wxGauge *item22 = new wxGauge( parent, -1, 100, wxDefaultPosition, wxSize(200,-1), 0 ); - item22->SetName( wxT("popbarTrans") ); - item18->Add( item22, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 ); + wxGauge *item15 = new wxGauge( parent, -1, 100, wxDefaultPosition, wxSize(200,18), 0 ); + item15->SetName( wxT("popbarAccept") ); + item2->Add( item15, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - item2->Add( item18, 0, wxALIGN_CENTER, 5 ); + wxGauge *item16 = new wxGauge( parent, -1, 100, wxDefaultPosition, wxSize(200,18), 0 ); + item16->SetName( wxT("popbarTrans") ); + item2->Add( item16, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); item0->Add( item2, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - wxStaticLine *item23 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL ); - item0->Add( item23, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + wxStaticLine *item17 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL ); + item0->Add( item17, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - CSharedFilePeersListCtrl *item24 = new CSharedFilePeersListCtrl( parent, ID_SHAREDCLIENTLIST, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER ); - item24->SetName( wxT("sharedFilesSrcCt") ); - item0->Add( item24, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + CSharedFilePeersListCtrl *item18 = new CSharedFilePeersListCtrl( parent, ID_SHAREDCLIENTLIST, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER ); + item18->SetName( wxT("sharedFilesSrcCt") ); + item0->Add( item18, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); if (set_sizer) { diff --git a/src/muuli_wdr.h b/src/muuli_wdr.h index bc09858b..5cd64aba 100644 --- a/src/muuli_wdr.h +++ b/src/muuli_wdr.h @@ -442,36 +442,33 @@ wxSizer *PreferencesEventsTab( wxWindow *parent, bool call_fit = TRUE, bool set_ extern wxSizer *s_sharedfilespeerHeader; #define ID_SHAREDCLIENTTOGGLE 10313 -#define ID_LINE 10314 -#define IDC_SREQUESTED 10315 -#define IDC_SREQUESTED2 10316 -#define IDC_SACCEPTED 10317 -#define IDC_SACCEPTED2 10318 -#define IDC_STRANSFERRED 10319 -#define IDC_STRANSFERRED2 10320 -#define ID_SHAREDCLIENTLIST 10321 +#define IDC_SREQUESTED 10314 +#define IDC_SACCEPTED 10315 +#define IDC_STRANSFERRED 10316 +#define ID_LINE 10317 +#define ID_SHAREDCLIENTLIST 10318 wxSizer *sharedfilesBottomDlg( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_BTN_SHARED_ALL 10322 -#define ID_BTN_SHARED_ONLY_UL 10323 -#define ID_BTNRELSHARED 10324 -#define ID_SHFILELIST 10325 +#define ID_BTN_SHARED_ALL 10319 +#define ID_BTN_SHARED_ONLY_UL 10320 +#define ID_BTNRELSHARED 10321 +#define ID_SHFILELIST 10322 wxSizer *sharedfilesTopDlg( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); // Declare menubar functions // Declare toolbar functions -#define ID_BUTTONCONNECT 10326 -#define ID_BUTTONNETWORKS 10327 -#define ID_BUTTONSEARCH 10328 -#define ID_BUTTONDOWNLOADS 10329 -#define ID_BUTTONSHARED 10330 -#define ID_BUTTONMESSAGES 10331 -#define ID_BUTTONSTATISTICS 10332 -#define ID_BUTTONNEWPREFERENCES 10333 -#define ID_BUTTONIMPORT 10334 -#define ID_ABOUT 10335 +#define ID_BUTTONCONNECT 10323 +#define ID_BUTTONNETWORKS 10324 +#define ID_BUTTONSEARCH 10325 +#define ID_BUTTONDOWNLOADS 10326 +#define ID_BUTTONSHARED 10327 +#define ID_BUTTONMESSAGES 10328 +#define ID_BUTTONSTATISTICS 10329 +#define ID_BUTTONNEWPREFERENCES 10330 +#define ID_BUTTONIMPORT 10331 +#define ID_ABOUT 10332 void muleToolbar( wxToolBar *parent ); // Declare bitmap functions -- 2.11.4.GIT