~ubuntu-branches/ubuntu/maverick/luckybackup/maverick

« back to all changes in this revision

Viewing changes to src/global.h

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Matthäi
  • Date: 2009-05-21 20:09:36 UTC
  • Revision ID: james.westby@ubuntu.com-20090521200936-jcbu6euvoxz7sef7
Tags: upstream-0.3
Import upstream version 0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ------------------ global.h --------------------------------------------------------------------------------------
 
2
 header file for luckyBackup project
 
3
 
 
4
===============================================================================================================================
 
5
===============================================================================================================================
 
6
     This file is part of "luckyBackup" project
 
7
     Copyright 2008-2009, Loukas Avgeriou
 
8
     luckyBackup is distributed under the terms of the GNU General Public License
 
9
     luckyBackup is free software: you can redistribute it and/or modify
 
10
     it under the terms of the GNU General Public License as published by
 
11
     the Free Software Foundation, either version 3 of the License, or
 
12
     (at your option) any later version.
 
13
 
 
14
     luckyBackup is distributed in the hope that it will be useful,
 
15
     but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
     GNU General Public License for more details.
 
18
 
 
19
     You should have received a copy of the GNU General Public License
 
20
     along with luckyBackup.  If not, see <http://www.gnu.org/licenses/>.
 
21
 
 
22
 
 
23
 project version        : Please see "main.cpp" for project version
 
24
 
 
25
 developer              : luckyb 
 
26
 last modified          : 30 April 2009
 
27
===============================================================================================================================
 
28
===============================================================================================================================
 
29
*/
 
30
 
 
31
 
 
32
#ifndef GLOBAL_H
 
33
#define GLOBAL_H
 
34
 
 
35
QString myHome = QDir::homePath();                              // user's home directory
 
36
QString const appName = "luckyBackup";                          // application name
 
37
double const appVersion = 0.30;                                 // application version
 
38
double const validProfileVersion = 0.21;                        // profile version before this a profile won't be loaded
 
39
double const validScheduleVersion = 0.21;                       // schedule version before this a schedule won't be loaded
 
40
double const validSettingsVersion = 0.3;                        // Settings file valid version
 
41
QString luckyBackupDir = myHome + "/."+appName+"/";             // app working directory
 
42
QString settingsFile = luckyBackupDir + "settings.ini";         // settings file
 
43
QString profileDir = luckyBackupDir + "profiles/";              // profiles directory
 
44
QString defaultProfile = profileDir + "default.profile";        // default profile
 
45
QString standardDefaultProfile = profileDir + "default.profile"; // standard default profile
 
46
QString logDir = luckyBackupDir + "logs/";                      // logs directory
 
47
QString logfilename = logDir + "logfile.txt";                   // logfile filename
 
48
QString cronlogfilename = logDir + "cronLogfile.txt";           // cron logfile filename
 
49
QString scheduleDir = luckyBackupDir + "schedule/";             // schedule directory
 
50
QString schedulefilename = scheduleDir + "schedule.dat";        // cron data filename
 
51
QString cronfilename = scheduleDir + "luckyCron.txt";           // cron filename
 
52
QString relativeTransDir = "translations/";                     // translation directory when app executed but not installed
 
53
QString systemTransDir = "/usr/share/luckybackup/translations/";// system translation directory (when app is installed)
 
54
QDir transDir;                                                  // the current translations directory
 
55
QTranslator appTranslator;                                      //QTranslator that holds the applications translation
 
56
QString locale = QLocale::system().name();                      //String that holds the current language locale
 
57
QString relativeLicense = "license/gpl.html";                   // licence directory when app executed but not installed
 
58
QString systemLicense = "/usr/share/doc/luckybackup/license/gpl.html";  // system licence directory (when app is installed)
 
59
QString suseLicense = "/usr/share/doc/packages/luckybackup/license/gpl.html";   // system licence directory (when app is installed) - openSuse
 
60
QString relativeManual = "manual/index.html";                   // manual directory when app executed but not installed
 
61
QString systemManual = "/usr/share/doc/luckybackup/manual/index.html";  // system manual directory (when app is installed)
 
62
QString suseManual = "/usr/share/doc/packages/luckybackup/manual/index.html";   // system manual directory (when app is installed) - opensuse
 
63
 
 
64
QString countStr;                                               //this helps displaying integers as strings
 
65
QString message="";                                             //this is really handy to hold messages for dialogs
 
66
QString messageCLI="";                                          //this is really handy to hold messages for the Command-Line
 
67
int errorsFound;                                                //count errors when executing rync
 
68
 
 
69
 
 
70
// Useful variables for operations ---------------------------------------------------------------------------------------------------
 
71
int const maxOperations = 100;          //The maximum number or operations permitted
 
72
int TotalOperations=0;                  //The number of available operations "operations list"- starts from 1
 
73
int currentOperation=-1;                //this holds the current row from the operations list- starts from 0
 
74
bool modifyOK=FALSE;                    //bool variable that says create or modify opeartion went ok
 
75
bool modifyConnected=FALSE;             //if the operation under modification is connected to another op, this becomes TRUE
 
76
bool DryRun=FALSE;                      //shows if dry-run is checked
 
77
bool ask=FALSE;                         // becomes true if we want to ask the user if he/she wants to continue with the execution of operations or not
 
78
bool NothingToDo=FALSE;                 // Becomes true if there is nothing to do when start button pressed
 
79
bool NothingIncluded=FALSE;             // Becomes true if there is nothing checked ("include" checkboxes)
 
80
QString currentProfile="";              // This holds the filename of the currently used profile
 
81
QString profileName="";                 //just holds the profile name not the full path+filename.profile
 
82
QFile profile("");                      //this is the profile QFile
 
83
QString CheckedData;                    //String holding the current task message (OK - WARNING - CRITICAL) for info window display
 
84
QString CheckedDataCLI;                 //String holding the current task message (OK - WARNING - CRITICAL) for CLI  display
 
85
operation *Operation[maxOperations];    //The array that holds name, source, destination & arguments of "Opereations list"
 
86
 
 
87
// functions ------------------------------------------------------------------------------------------------------------------------
 
88
void checkSyncDirs(QString, QString);   // function to check if the directories to be synced exist or are empty
 
89
void checkBackupDirs(QString, QString); // function to check if the source & dest dirs exist and are not empty
 
90
int loadProfile(QString);               // loads an existing profile
 
91
bool saveProfile(QString);              // saves an existing profile
 
92
bool checkTaskList();                   // Checks if the Task list is ok to proceed
 
93
bool checkDeclaredDirs();               // Check if the declared data are ok by calling checkBackupDirs or checkSyncDirs
 
94
QStringList AppendArguments(operation*);// Set command's (normally rsync) arguments
 
95
 
 
96
#endif
 
97
 
 
98
// end of global.h--------------------------------------------------------------
 
 
b'\\ No newline at end of file'