Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
uroni committed Jan 16, 2011
0 parents commit dbbf397
Show file tree
Hide file tree
Showing 56 changed files with 9,861 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

backup-bad.png
backup-bad.psb
backup-bad32.ico
backup-bad32.png
backup-ok-big.ico
backup-ok.png
backup-ok.psb
backup-ok32.png
BaseImage.psb
BaseImage_ok.psb
comp.uri
curr_version.txt
data/*
data_dbg/*
data_x64/*
Debug/*
Installer/*
ipch/*
KillProc/Debug/*
KillProc/ipch/*
*.ncb
*.sdf
*.suo
*.vcproj*
*.vcxproj.user
KillProc/Release/*
KillProc/x64/*
logos/*
messages.mo
pw.txt
release.bat
Release/*
sha256deep.exe
signer/*
test
tool2.exe
update_data.bat
update_data_dbg.bat
update_sign.bat
urbackup - Kopie.nsi
UrBackup Client*.exe
urbackup/*
UrBackupClientGUI.aps
UrBackupUpdate.exe
UrBackupUpdate.sig
VCRedist/*
wx64/*
wx86/*
x64/*
UrBackupClientGUI.exe
UrBackupClientGUI.opensdf
91 changes: 91 additions & 0 deletions ConfigPath.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*************************************************************************
* UrBackup - Client/Server backup system
* Copyright (C) 2011 Martin Raiber
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/

#include "ConfigPath.h"

#define CP_ID_OK 100

ConfigPath::ConfigPath(void)
: wxFrame(NULL, wxID_ANY, _("Pfade hinzufügen und entfernen"), wxDefaultPosition, wxSize(500, 600))

{
SetIcon(wxIcon(wxT("backup-ok-big.ico"), wxBITMAP_TYPE_ICO));
wxPanel *panel = new wxPanel(this, wxID_ANY);
listbox=new wxListBox(panel, wxID_ANY, wxPoint(17,5), wxSize(450,500));
wxButton *btnOk=new wxButton(panel, wxID_ANY, _("Ok"), wxPoint(17,517), wxSize(60,30) );
wxButton *btnAbort=new wxButton(panel, wxID_ANY, _("Abbrechen"), wxPoint(85,517), wxSize(70,30) );
wxButton *btnNew=new wxButton(panel, wxID_ANY, _("Neuer Pfad"), wxPoint(286,517), wxSize(80,30) );
wxButton *btnDel=new wxButton(panel, wxID_ANY, _("Pfad entfernen"), wxPoint(377,517), wxSize(90,30) );

btnOk->Connect(wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&ConfigPath::OnClickOk, NULL, this);
btnAbort->Connect(wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&ConfigPath::OnClickAbort, NULL, this);
btnNew->Connect(wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&ConfigPath::OnClickNew, NULL, this);
btnDel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&ConfigPath::OnClickDel, NULL, this);

dirs=Connector::getSharedPaths();

if(Connector::hasError())
{
wxMessageBox(_("Ein Fehler ist aufgetreten. Backups werden momentan nicht durchgeführt."), wxT("UrBackup"), wxOK|wxICON_ERROR);
Hide();
Close();
}


for(size_t i=0;i<dirs.size();++i)
{
listbox->Append(dirs[i].path);
}

Centre();
Show(true);
}

void ConfigPath::OnClickOk(wxCommandEvent &evt)
{
Connector::saveSharedPaths(dirs);
Close();
}

void ConfigPath::OnClickAbort(wxCommandEvent &evt)
{
Close();
}

void ConfigPath::OnClickNew(wxCommandEvent &evt)
{
wxDirDialog ed(this, _("Bitte Verzeichnis das gesichert werden soll auswählen"), wxEmptyString, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
int rc=ed.ShowModal();
if(rc==wxID_OK)
{
listbox->Append(ed.GetPath() );
SBackupDir ad;
ad.path=ed.GetPath();
dirs.push_back(ad);
}
}

void ConfigPath::OnClickDel(wxCommandEvent &evt)
{
int sel=listbox->GetSelection();
if(sel>=0)
{
listbox->Delete(sel);
dirs.erase(dirs.begin()+sel);
}
}
38 changes: 38 additions & 0 deletions ConfigPath.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*************************************************************************
* UrBackup - Client/Server backup system
* Copyright (C) 2011 Martin Raiber
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/

#include <wx/wx.h>
#include <wx/listctrl.h>

#include "Connector.h"


class ConfigPath : public wxFrame
{
public:
ConfigPath(void);

void OnClickOk(wxCommandEvent &evt);
void OnClickAbort(wxCommandEvent &evt);
void OnClickNew(wxCommandEvent &evt);
void OnClickDel(wxCommandEvent &evt);

private:
std::vector<SBackupDir> dirs;
wxListBox *listbox;
};
Loading

0 comments on commit dbbf397

Please sign in to comment.