summaryrefslogtreecommitdiffstats
path: root/bibletime/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'bibletime/frontend')
-rw-r--r--bibletime/frontend/btinstallmgr.cpp25
-rw-r--r--bibletime/frontend/btinstallmgr.h12
-rw-r--r--bibletime/frontend/cswordsetupdialog.cpp3
3 files changed, 38 insertions, 2 deletions
diff --git a/bibletime/frontend/btinstallmgr.cpp b/bibletime/frontend/btinstallmgr.cpp
index 76eef81..b253286 100644
--- a/bibletime/frontend/btinstallmgr.cpp
+++ b/bibletime/frontend/btinstallmgr.cpp
@@ -10,6 +10,7 @@
//BibleTime includes
#include "btinstallmgr.h"
#include "util/cpointers.h"
+#include "cbtconfig.h"
//Qt includes
#include <tqfile.h>
@@ -18,8 +19,11 @@
//KDE includes
#include <kapplication.h>
#include <kglobal.h>
+#include <klocale.h>
#include <kstandarddirs.h>
#include <kprocess.h>
+#include <kconfig.h>
+#include <kmessagebox.h>
//Sword includes
#include <filemgr.h>
@@ -269,8 +273,29 @@ namespace BookshelfManager {
BTInstallMgr::BTInstallMgr() : InstallMgr(Tool::RemoteConfig::configPath().latin1(), this) { //use this class also as status reporter
this->setFTPPassive(true);
+ }
+#ifdef SWORD_INTERNET_WARNING
+ bool BTInstallMgr::isUserDisclaimerConfirmed() const
+ {
+ KConfig* config = CBTConfig::getConfig();
+ config->setGroup("Remote Resources");
+ if (config->readNumEntry("Allowed", 0) == 1) {
+ return true;
+ }
+ else {
+ if (KMessageBox::questionYesNo(0, i18n("Do you wish to allow BibleTime to access the Internet?\nWARNING: Click DENY if you live in a persecuted country!"), i18n("Confirm Internet Access"), i18n("DENY"), i18n("Allow") ) == KMessageBox::No ) {
+ config->setGroup("Remote Resources");
+ config->writeEntry("Allowed", 1);
+ config->sync();
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
}
+#endif
BTInstallMgr::~BTInstallMgr() {
terminate(); //make sure to close the connection
diff --git a/bibletime/frontend/btinstallmgr.h b/bibletime/frontend/btinstallmgr.h
index c82b77b..386e718 100644
--- a/bibletime/frontend/btinstallmgr.h
+++ b/bibletime/frontend/btinstallmgr.h
@@ -15,7 +15,7 @@
//BibleTIme includes
#include "backend/cswordbackend.h"
-
+#include "config.h"
//sword includes
#include <installmgr.h>
@@ -27,6 +27,10 @@
#include <tqstring.h>
#include <tqstringlist.h>
+#ifdef SWORD_MULTIVERSE
+#define SWORD_INTERNET_WARNING 1
+#endif
+
namespace BookshelfManager {
typedef TQPtrList<sword::InstallSource> InstallSourceList;
@@ -80,6 +84,12 @@ private:
BTInstallMgr();
virtual ~BTInstallMgr();
+#ifdef SWORD_INTERNET_WARNING
+public:
+ /** Re-implemented from sword::InstallMgr. */
+ virtual bool isUserDisclaimerConfirmed() const;
+#endif
+
protected:
/* Reimplementations of method in StatusReporter */
virtual void statusUpdate(double dltotal, double dlnow);
diff --git a/bibletime/frontend/cswordsetupdialog.cpp b/bibletime/frontend/cswordsetupdialog.cpp
index a8607e2..c02db6f 100644
--- a/bibletime/frontend/cswordsetupdialog.cpp
+++ b/bibletime/frontend/cswordsetupdialog.cpp
@@ -502,7 +502,8 @@ the module remote installation feature!</b>")
if (BTInstallMgr::Tool::RemoteConfig::isRemoteSource(&is)) {
// int errorCode = 0;
if (!m_refreshedRemoteSources) {
- if (!iMgr.refreshRemoteSource( &is ) ) { //make sure the sources were updated sucessfully
+ bool successful = iMgr.refreshRemoteSource( &is );
+ if (!successful ) { //make sure the sources were updated sucessfully
m_refreshedRemoteSources = true;
success = true;
}