@ -12,28 +12,29 @@
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
*/
*/
# include <QMessageBox>
# include <QFileDialog>
# include <QFileDialog>
# include "UBUpdateDlg.h"
# include "UBUpdateDlg.h"
# include "core/UBApplication.h"
# include "UBMainWindow.h"
# include "core/memcheck.h"
# include "core/memcheck.h"
UBUpdateDlg : : UBUpdateDlg ( QWidget * parent , int nbFiles , const QString & bkpPath )
UBUpdateDlg : : UBUpdateDlg ( QWidget * parent , int nbFiles , const QString & bkpPath )
: QDialog ( parent )
: QDialog ( parent )
, mMainLayout ( NULL )
, mMainLayout ( NULL )
, mNbFilesLabel ( NULL )
, mNbFilesLabel ( NULL )
, mBkpLabel ( NULL )
, mBkpLabel ( NULL )
, mBkpPath ( NULL )
, mBkpPath ( NULL )
, mBrowseBttn ( NULL )
, mBrowseBttn ( NULL )
, mpDlgBttn ( NULL )
, mpDlgBttn ( NULL )
, mLayout ( NULL )
, mLayout ( NULL )
, mHLayout ( NULL )
, mHLayout ( NULL )
, mStackedWidget ( NULL )
, mStackedWidget ( NULL )
, mDialogWidget ( NULL )
, mDialogWidget ( NULL )
, mProgressWidget ( NULL )
, mProgressWidget ( NULL )
, mProgressLayout ( NULL )
, mProgressLayout ( NULL )
, mProgressLabel ( NULL )
, mProgressLabel ( NULL )
{
{
mDialogWidget = new QWidget ( this ) ;
mDialogWidget = new QWidget ( this ) ;
@ -178,18 +179,16 @@ void UBUpdateDlg::onUpdate()
void UBUpdateDlg : : onFilesUpdated ( bool bResult )
void UBUpdateDlg : : onFilesUpdated ( bool bResult )
{
{
this - > hide ( ) ;
this - > hide ( ) ;
QString qsMsg ;
QString qsMsg ;
if ( bResult )
if ( bResult ) {
{
qsMsg = tr ( " Files update successful! \n Please reboot the application to access the updated documents. " ) ;
qsMsg = tr ( " Files update successful! \n Please reboot the application to access the updated documents. " ) ;
}
}
else
else {
{
qsMsg = tr ( " An error occured during the update. The files have not been affected. " ) ;
qsMsg = tr ( " An error occured during the update. The files have not been affected. " ) ;
}
}
QMessageBox : : information ( this , tr ( " Files update results " ) , qsMsg , QMessageBox : : Ok ) ;
UBApplication : : mainWindow - > information ( tr ( " Files update results " ) , qsMsg ) ;
}
}
QString UBUpdateDlg : : backupPath ( )
QString UBUpdateDlg : : backupPath ( )