Ticket #7991: myModif.patch

File myModif.patch, 8.6 KB (added by aug125, 12 years ago)
  • trunk/src/interface/Mainfrm.cpp

     
    5050#include "toolbar.h"
    5151#include "menu_bar.h"
    5252#include "string_coalescer.h"
     53#include "select_dialog.h"
    5354
    5455#ifdef __WXMSW__
    5556#include <wx/module.h>
     
    6768DEFINE_EVENT_TYPE(fzEVT_TASKBAR_CLICK_DELAYED);
    6869#endif
    6970
     71
     72
     73
    7074static int tab_hotkey_ids[10];
    7175
    7276BEGIN_EVENT_TABLE(CMainFrame, wxFrame)
     
    336340    m_pContextControl->CreateTab();
    337341
    338342    m_pContextControl->GetCurrentControls();
    339    
     343
    340344    switch (message_log_position)
    341345    {
    342346    case 1:
     
    508512        delete m_pMenuBar;
    509513    }
    510514    m_pMenuBar = CMenuBar::Load(this);
    511    
     515
    512516    if (!m_pMenuBar)
    513517        return false;
    514518
     
    610614    {
    611615        OnMenuEditSettings(event);
    612616    }
     617    else if(event.GetId() == XRCID("ID_MENU_EDIT_SELECT")) // Ma modification
     618    {
     619        OnSelectSettings(event);
     620
     621    }
    613622    else if (event.GetId() == XRCID("ID_MENU_EDIT_NETCONFWIZARD"))
    614623    {
    615624        CNetConfWizard wizard(this, COptions::Get());
     
    854863            CSiteManager::GetBookmarks(controls->site_bookmarks->path, controls->site_bookmarks->bookmarks);
    855864            if (m_pMenuBar)
    856865                m_pMenuBar->UpdateBookmarkMenu();
    857         }   
     866        }
    858867    }
    859868    else if (event.GetId() == XRCID("ID_MENU_HELP_WELCOME"))
    860869    {
     
    946955    {
    947956        if ((*iter)->m_pEngine != pEngine)
    948957            continue;
    949        
     958
    950959        pState = *iter;
    951960        break;
    952961    }
     
    12391248        }
    12401249
    12411250        RememberSplitterPositions();
    1242        
     1251
    12431252#ifdef __WXMAC__
    12441253        if (m_pToolBar)
    12451254            COptions::Get()->SetOption(OPTION_TOOLBAR_HIDDEN, m_pToolBar->IsShown() ? 0 : 1);
     
    15341543    CheckChangedSettings();
    15351544}
    15361545
     1546void CMainFrame::OnSelectSettings(wxCommandEvent& event)
     1547{
     1548
     1549        CContextControl::_context_controls* controls = m_pContextControl->GetCurrentControls();
     1550
     1551    CSelect_dialog *dlg= new CSelect_dialog(wxT("Select local files..."), (controls->pLocalListView));
     1552    dlg->ShowModal();
     1553    delete dlg;
     1554
     1555}
     1556
    15371557void CMainFrame::OnToggleLogView(wxCommandEvent& event)
    15381558{
    15391559    if (!m_pTopSplitter)
     
    15811601            shown = true;
    15821602        }
    15831603    }
    1584    
     1604
    15851605    if (COptions::Get()->GetOptionVal(OPTION_MESSAGELOG_POSITION) != 2)
    15861606        COptions::Get()->SetOption(OPTION_SHOW_MESSAGELOG, shown);
    15871607}
     
    16321652            continue;
    16331653
    16341654        controls->pLocalTreeViewPanel->SetHeader(controls->pLocalListViewPanel->DetachHeader());
    1635        
     1655
    16361656        if (layout == 3 && swap)
    16371657            controls->pLocalSplitter->SplitVertically(controls->pLocalListViewPanel, controls->pLocalTreeViewPanel);
    16381658        else if (layout)
     
    17961816
    17971817    if (messagelog_position == -1)
    17981818        messagelog_position = COptions::Get()->GetOptionVal(OPTION_MESSAGELOG_POSITION);
    1799    
     1819
    18001820    // First handle changes in message log position as it can make size of the other panes change
    18011821    {
    18021822        bool shown = m_pStatusView->IsShown();
    18031823        wxWindow* parent = m_pStatusView->GetParent();
    1804    
     1824
    18051825        bool changed;
    18061826        if (parent == m_pTopSplitter && messagelog_position != 0)
    18071827        {
     
    22032223    CContextControl::_context_controls* controls = m_pContextControl->GetCurrentControls();
    22042224    if (!controls)
    22052225        return;
    2206    
     2226
    22072227    wxString posString;
    22082228
    22092229    // top_pos
     
    25492569        // create another instance of the module and call its Exit() member.
    25502570        // After that, the next call to a wxDisplay will create a new factory and
    25512571        // get the new display layout from Windows.
    2552         // 
     2572        //
    25532573        // Note: Both the factory pattern as well as the dynamic object system
    25542574        //       are perfect example of bad design.
    25552575        //
  • trunk/src/interface/LocalListView.cpp

     
    18561856    }
    18571857}
    18581858
     1859
     1860void CLocalListView::StartSelect()
     1861{
     1862    m_selectIndex = 0;
     1863}
     1864
     1865bool CLocalListView::GetNextFileSelect(wxString& name, bool& dir, wxLongLong& size, wxDateTime& date, bool &hasTime)
     1866{
     1867
     1868    if (m_selectIndex >= m_fileData.size()) return false;
     1869
     1870    const CLocalFileData& data = m_fileData[m_indexMapping[m_selectIndex]];
     1871
     1872    name = data.name;
     1873    dir = data.dir;
     1874    size = data.size;
     1875    date = data.lastModified;
     1876    hasTime = true;
     1877
     1878    m_selectIndex++;
     1879
     1880    return true;
     1881}
     1882
     1883
     1884
    18591885bool CLocalListView::GetNextFile(wxString& name, bool& dir, wxLongLong& size, wxDateTime& date, bool &hasTime)
    18601886{
    18611887    if (++m_comparisonIndex >= (int)m_originalIndexMapping.size())
     
    22192245            continue;
    22202246
    22212247        m_fileData[index].label = drive + _T(" (") + iter->volumeName + _T(")");
    2222        
     2248
    22232249        RefreshItem(item);
    22242250    }
    22252251}
  • trunk/src/interface/Makefile.am

     
    6464        RemoteListView.cpp \
    6565        RemoteTreeView.cpp \
    6666        search.cpp \
     67        select_dialog.cpp \
    6768        settings/optionspage.cpp \
    6869        settings/optionspage_connection.cpp \
    6970        settings/optionspage_connection_active.cpp \
     
    176177         RemoteListView.h \
    177178         RemoteTreeView.h \
    178179         search.h \
     180         select_dialog.h \
    179181         settings/optionspage.h \
    180182         settings/optionspage_connection.h \
    181183         settings/optionspage_connection_active.h \
  • trunk/src/interface/resources/menus.xrc

     
    4343    </object>
    4444    <object class="wxMenu">
    4545      <label>&amp;Edit</label>
     46      <object class="wxMenuItem" name="ID_MENU_EDIT_SELECT">
     47        <label>Se&amp;lect local files...</label>
     48      </object>     
     49      <object class="separator"/>
    4650      <object class="wxMenuItem" name="ID_MENU_EDIT_NETCONFWIZARD">
    4751        <label>&amp;Network configuration wizard...</label>
    4852      </object>
     
    597601      <label>&amp;Configure speed limits...</label>
    598602    </object>
    599603  </object>
    600 </resource>
    601  No newline at end of file
     604</resource>
  • trunk/src/interface/Mainfrm.h

     
    5555    void ProcessCommandLine();
    5656
    5757    void PostInitialize();
    58    
     58
    5959    bool ConnectToServer(const CServer& server, const CServerPath& path = CServerPath());
    6060
    6161    CContextControl* GetContextControl() { return m_pContextControl; }
     
    117117    void OnSiteManager(wxCommandEvent& event);
    118118    void OnProcessQueue(wxCommandEvent& event);
    119119    void OnMenuEditSettings(wxCommandEvent& event);
     120    void OnSelectSettings(wxCommandEvent& event);
    120121    void OnToggleToolBar(wxCommandEvent& event);
    121122    void OnToggleLogView(wxCommandEvent& event);
    122123    void OnToggleLocalTreeView(wxCommandEvent& event);
  • trunk/src/interface/LocalListView.h

     
    6464    virtual bool GetNextFile(wxString& name, bool &dir, wxLongLong &size, wxDateTime& date, bool &hasTime);
    6565    virtual void FinishComparison();
    6666
     67    virtual void StartSelect();
     68    virtual bool GetNextFileSelect(wxString& name, bool &dir, wxLongLong &size, wxDateTime& date, bool &hasTime);
     69
    6770    virtual bool ItemIsDir(int index) const;
    6871    virtual wxLongLong ItemGetSize(int index) const;
    6972
     
    8790    wxDropTarget* m_pDropTarget;
    8891    int m_dropTarget;
    8992
     93    unsigned int m_selectIndex;
     94
    9095    // Event handlers
    9196    DECLARE_EVENT_TABLE();
    9297    void OnItemActivated(wxListEvent& event);
  • trunk/src/tinyxml/tinyxml.cpp

     
    5757    {
    5858        unsigned char c = (unsigned char) str[i];
    5959
    60         if ( c == '&' )
     60        if (    c == '&'
     61             && i < ( (int)str.length() - 2 )
     62             && str[i+1] == '#'
     63             && str[i+2] == 'x' )
    6164        {
     65            // Hexadecimal character reference.
     66            // Pass through unchanged.
     67            // &#xA9;   -- copyright symbol, for example.
     68            //
     69            // The -1 is a bug fix from Rob Laveaux. It keeps
     70            // an overflow from happening if there is no ';'.
     71            // There are actually 2 ways to exit this loop -
     72            // while fails (error case) and break (semicolon found).
     73            // However, there is no mechanism (currently) for
     74            // this function to return an error.
     75            while ( i<(int)str.length()-1 )
     76            {
     77                outString->append( str.c_str() + i, 1 );
     78                ++i;
     79                if ( str[i] == ';' )
     80                    break;
     81            }
     82        }
     83        else if ( c == '&' )
     84        {
    6285            outString->append( entity[0].str, entity[0].strLength );
    6386            ++i;
    6487        }