Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  export.cpp   Sprache: C

 

#include <filezilla.h>
#include "export.h"
#include "filezillaapp.h"
#include "xmlfunctions.h"
#include "ipcmutex.h"
#include "queue.h"

CExportDialog::CExportDialog(wxWindow* parent, CQueueView* pQueueView)
 : m_parent(parent), m_pQueueView(pQueueView)
{
}

void CExportDialog::Run()
{
 if (!Load(m_parent, _T("ID_EXPORT")))
  return;

 if (ShowModal() != wxID_OK)
  return;

 bool sitemanager = XRCCTRL(*this, "ID_SITEMANAGER", wxCheckBox)->GetValue();
 bool settings = XRCCTRL(*this, "ID_SETTINGS", wxCheckBox)->GetValue();
 bool queue = XRCCTRL(*this, "ID_QUEUE", wxCheckBox)->GetValue();

 if (!sitemanager && !settings && !queue) {
  wxMessageBoxEx(_("No category to export selected"), _("Error exporting settings"), wxICON_ERROR, m_parent);
  return;
 }

 wxString str;
 if (sitemanager && !queue && !settings)
  str = _("Select file for exported sites");
 else if (!sitemanager && queue && !settings)
  str = _("Select file for exported queue");
 else if (!sitemanager && !queue && settings)
  str = _("Select file for exported settings");
 else
  str = _("Select file for exported data");

 wxFileDialog dlg(m_parent, str, wxString(),
     _T("FileZilla.xml"), _T("XML files (*.xml)|*.xml"),
     wxFD_SAVE | wxFD_OVERWRITE_PROMPT);

 if (dlg.ShowModal() != wxID_OK)
  return;

 CXmlFile xml(dlg.GetPath());

 TiXmlElement* exportRoot = xml.CreateEmpty();

 if (sitemanager) {
  CInterProcessMutex mutex(MUTEX_SITEMANAGER);

  CXmlFile file(wxGetApp().GetSettingsFile(_T("sitemanager")));
  TiXmlElement* pDocument = file.Load();
  if (pDocument) {
   TiXmlElement* pElement = pDocument->FirstChildElement("Servers");
   if (pElement)
    exportRoot->InsertEndChild(*pElement);
  }
 }
 if (settings) {
  CInterProcessMutex mutex(MUTEX_OPTIONS);
  CXmlFile file(wxGetApp().GetSettingsFile(_T("filezilla")));
  TiXmlElement* pDocument = file.Load();
  if (pDocument) {
   TiXmlElement* pElement = pDocument->FirstChildElement("Settings");
   if (pElement)
    exportRoot->InsertEndChild(*pElement);
  }
 }

 if (queue) {
  m_pQueueView->WriteToFile(exportRoot);
 }

 xml.Save(true);
}

Messung
CHZG
839710093

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,188,068
#Domains=861,798