Ticket #1521: confirm_delete_rev1.diff

File confirm_delete_rev1.diff, 3.9 KB (added by Eirik, 13 years ago)

The diff

  • src/interface/optionspage_interface.cpp

     
    1717    SetCheck(XRCID("ID_FILEPANESWAP"), m_pOptions->GetOptionVal(OPTION_FILEPANE_SWAP) != 0, failure);
    1818    SetChoice(XRCID("ID_FILEPANELAYOUT"), m_pOptions->GetOptionVal(OPTION_FILEPANE_LAYOUT), failure);
    1919    SetChoice(XRCID("ID_SORTMODE"), m_pOptions->GetOptionVal(OPTION_FILELIST_DIRSORT), failure);
     20    SetCheck(XRCID("ID_SITEMANAGER_CONFIRMDELETE"), m_pOptions->GetOptionVal(OPTION_SITEMANAGER_CONFIRMDELETE) != 0, failure);
    2021
    2122    return !failure;
    2223}
     
    2627    m_pOptions->SetOption(OPTION_FILEPANE_SWAP, GetCheck(XRCID("ID_FILEPANESWAP")) ? 1 : 0);
    2728    m_pOptions->SetOption(OPTION_FILEPANE_LAYOUT, GetChoice(XRCID("ID_FILEPANELAYOUT")));
    2829    m_pOptions->SetOption(OPTION_FILELIST_DIRSORT, GetChoice(XRCID("ID_SORTMODE")));
     30    m_pOptions->SetOption(OPTION_SITEMANAGER_CONFIRMDELETE, GetCheck(XRCID("ID_SITEMANAGER_CONFIRMDELETE")) ? 1 : 0);
    2931
    3032    return true;
    3133}
  • src/interface/sitemanager.cpp

     
    671671    wxTreeItemId item = pTree->GetSelection();
    672672    if (!item.IsOk() || item == pTree->GetRootItem() || item == m_ownSites || IsPredefinedItem(item))
    673673        return;
    674        
     674   
     675    const int confirm = COptions::Get()->GetOptionVal(OPTION_SITEMANAGER_CONFIRMDELETE);
     676    if (confirm == 1)
     677    {
     678        int res = wxMessageBox(_("Do you really want to delete selected entry?"), _("Delete Site Manager entry"), wxYES | wxNO | wxICON_QUESTION);
     679        if (res != wxYES)
     680            return;
     681    }   
    675682    pTree->Delete(item);
    676683}
    677684
  • src/interface/Options.h

     
    3838    OPTION_WINDOW_POSITION,
    3939    OPTION_LOCALFILELIST_SORTORDER,
    4040    OPTION_REMOTEFILELIST_SORTORDER,
     41    OPTION_SITEMANAGER_CONFIRMDELETE,
    4142
    4243    // Has to be last element
    4344    OPTIONS_NUM
  • src/interface/resources/dialogs.xrc

     
    15611561        </object>
    15621562        <flag>wxGROW</flag>
    15631563      </object>
     1564      <object class="sizeritem">
     1565        <object class="wxStaticBoxSizer">
     1566          <label>Site Manager</label>
     1567          <orient>wxVERTICAL</orient>
     1568          <object class="sizeritem">
     1569            <object class="wxFlexGridSizer">
     1570              <object class="sizeritem">
     1571                <object class="wxCheckBox" name="ID_SITEMANAGER_CONFIRMDELETE">
     1572                  <label>&amp;Confirm deletion of Site Manager entries</label>
     1573                </object>
     1574              </object>
     1575              <cols>1</cols>
     1576              <vgap>5</vgap>
     1577            </object>
     1578            <flag>wxBOTTOM|wxLEFT|wxRIGHT</flag>
     1579            <border>4</border>
     1580          </object>
     1581        </object>
     1582        <flag>wxGROW</flag>
     1583      </object>
    15641584    </object>
    15651585  </object>
    15661586  <object class="wxPanel" name="ID_SETTINGS_CONNECTION">
     
    37283748      </object>
    37293749    </object>
    37303750  </object>
    3731 </resource>
    3732  No newline at end of file
     3751</resource>
  • src/interface/Options.cpp

     
    8484    { "Remote filelist colwidths", string, _T("") },
    8585    { "Window position and size", string, _T("") },
    8686    { "Local filelist sortorder", string, _T("") },
    87     { "Remote filelist sortorder", string, _T("") }
     87    { "Remote filelist sortorder", string, _T("") },
     88    { "Site Manager confirm delete", number, _T("0") }
    8889};
    8990
    9091COptions::COptions()