mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Cutecash: Adapt to changed session_begin in r19798.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19807 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
ec6412f3c9
commit
5816a971ce
@ -58,9 +58,9 @@ public:
|
||||
|
||||
// Now the actual functions on the object
|
||||
|
||||
void begin(const QString& book_id, bool ignore_lock, bool create_if_nonexistent)
|
||||
void begin(const QString& book_id, bool ignore_lock, bool create_if_nonexistent, bool force)
|
||||
{
|
||||
qof_session_begin(get(), book_id.toUtf8(), ignore_lock, create_if_nonexistent);
|
||||
qof_session_begin(get(), book_id.toUtf8(), ignore_lock, create_if_nonexistent, force);
|
||||
}
|
||||
void load (QofPercentageFunc percentage_func)
|
||||
{
|
||||
@ -94,10 +94,6 @@ public:
|
||||
{
|
||||
return qof_session_save_in_progress(get());
|
||||
}
|
||||
bool save_may_clobber_data () const
|
||||
{
|
||||
return qof_session_save_may_clobber_data(get());
|
||||
}
|
||||
void save (QofPercentageFunc percentage_func)
|
||||
{
|
||||
qof_session_save(get(), percentage_func);
|
||||
|
@ -382,7 +382,7 @@ void MainWindow::loadFile(const QString &fileName)
|
||||
QofSession *new_session = qof_session_new ();
|
||||
|
||||
bool we_are_in_error = false;
|
||||
qof_session_begin (new_session, newfile, FALSE, FALSE);
|
||||
qof_session_begin (new_session, newfile, FALSE, FALSE, FALSE);
|
||||
QofBackendError io_err = qof_session_get_error (new_session);
|
||||
/* if file appears to be locked, ask the user ... */
|
||||
if (ERR_BACKEND_LOCKED == io_err || ERR_BACKEND_READONLY == io_err)
|
||||
@ -407,7 +407,7 @@ void MainWindow::loadFile(const QString &fileName)
|
||||
if (msgBox.clickedButton() == openAnyway)
|
||||
{
|
||||
/* user told us to ignore locks. So ignore them. */
|
||||
qof_session_begin (new_session, newfile, TRUE, FALSE);
|
||||
qof_session_begin (new_session, newfile, TRUE, FALSE, FALSE);
|
||||
}
|
||||
else if (msgBox.clickedButton() == createNewFile)
|
||||
{
|
||||
@ -432,7 +432,7 @@ void MainWindow::loadFile(const QString &fileName)
|
||||
if (false == show_session_error (this, io_err, newfile, GNC_FILE_DIALOG_OPEN))
|
||||
{
|
||||
/* user told us to create a new database. Do it. */
|
||||
qof_session_begin (new_session, newfile, FALSE, TRUE);
|
||||
qof_session_begin (new_session, newfile, FALSE, TRUE, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -597,7 +597,7 @@ bool MainWindow::saveFileAs(const QString &fileName)
|
||||
|
||||
save_in_progress++;
|
||||
QofSession *new_session = qof_session_new ();
|
||||
qof_session_begin (new_session, newfile, FALSE, FALSE);
|
||||
qof_session_begin (new_session, newfile, FALSE, FALSE, FALSE);
|
||||
|
||||
QofBackendError io_err = qof_session_get_error (new_session);
|
||||
|
||||
@ -607,7 +607,7 @@ bool MainWindow::saveFileAs(const QString &fileName)
|
||||
if (false == show_session_error (this, io_err, newfile, GNC_FILE_DIALOG_SAVE))
|
||||
{
|
||||
/* user told us to ignore locks. So ignore them. */
|
||||
qof_session_begin (new_session, newfile, TRUE, FALSE);
|
||||
qof_session_begin (new_session, newfile, TRUE, FALSE, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -619,7 +619,7 @@ bool MainWindow::saveFileAs(const QString &fileName)
|
||||
if (false == show_session_error (this, io_err, newfile, GNC_FILE_DIALOG_SAVE))
|
||||
{
|
||||
/* user told us to create a new database. Do it. */
|
||||
qof_session_begin (new_session, newfile, FALSE, TRUE);
|
||||
qof_session_begin (new_session, newfile, FALSE, TRUE, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -639,7 +639,9 @@ bool MainWindow::saveFileAs(const QString &fileName)
|
||||
}
|
||||
|
||||
/* oops ... file already exists ... ask user what to do... */
|
||||
if (qof_session_save_may_clobber_data (new_session))
|
||||
if (false) //qof_session_save_may_clobber_data (new_session))
|
||||
// FIXME: Need to copy the other implementation from r19798 in
|
||||
// gnc-file.c for overwrite-on-existing-file.
|
||||
{
|
||||
if (QMessageBox::question(this, tr("File Exists"),
|
||||
tr("The file %1 already exists. "
|
||||
|
Loading…
Reference in New Issue
Block a user