Save work.

This commit is contained in:
Martin Rotter 2016-02-17 13:33:45 +01:00
parent 79ae3bfd94
commit 4b37dd8200
7 changed files with 21 additions and 33 deletions

View file

@ -31,6 +31,7 @@
ServiceRoot::ServiceRoot(RootItem *parent) : RootItem(parent), m_accountId(NO_PARENT_CATEGORY) {
setKind(RootItemKind::ServiceRoot);
setCreationDate(QDateTime::currentDateTime());
}
ServiceRoot::~ServiceRoot() {

View file

@ -15,7 +15,6 @@
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#include "services/owncloud/gui/formeditowncloudaccount.h"
#include "services/owncloud/definitions.h"
@ -31,14 +30,14 @@ FormEditOwnCloudAccount::FormEditOwnCloudAccount(QWidget *parent)
m_btnOk = m_ui->m_buttonBox->button(QDialogButtonBox::Ok);
setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint);
setWindowIcon(qApp->icons()->fromTheme(QSL("application-ttrss")));
setWindowIcon(qApp->icons()->fromTheme(QSL("application-owncloud")));
m_ui->m_lblServerSideUpdateInformation->setText(tr("Leaving this option on causes that updates "
"of feeds will be probably much slower and may time-out often."));
m_ui->m_lblDescription->setText(tr("Note that at least API level %1 is required.").arg(MINIMAL_OC_VERSION));
m_ui->m_lblDescription->setText(tr("Note that at least version %1 is required.").arg(MINIMAL_OC_VERSION));
m_ui->m_txtPassword->lineEdit()->setPlaceholderText(tr("Password for your TT-RSS account"));
m_ui->m_txtUsername->lineEdit()->setPlaceholderText(tr("Username for your TT-RSS account"));
m_ui->m_txtUrl->lineEdit()->setPlaceholderText(tr("FULL URL of your TT-RSS instance WITH trailing \"/api/\" string"));
m_ui->m_txtUrl->lineEdit()->setPlaceholderText(tr("URL of your ownCloud server, without any API path"));
m_ui->m_lblTestResult->setStatus(WidgetWithStatus::Information,
tr("No test done yet."),
tr("Here, results of connection test are shown."));
@ -72,13 +71,13 @@ FormEditOwnCloudAccount::~FormEditOwnCloudAccount() {
}
OwnCloudServiceRoot *FormEditOwnCloudAccount::execForCreate() {
setWindowTitle(tr("Add new Tiny Tiny RSS account"));
setWindowTitle(tr("Add new ownCloud News account"));
exec();
return m_editableRoot;
}
void FormEditOwnCloudAccount::execForEdit(OwnCloudServiceRoot *existing_root) {
setWindowTitle(tr("Edit existing Tiny Tiny RSS account"));
setWindowTitle(tr("Edit existing ownCloud News account"));
m_editableRoot = existing_root;
m_ui->m_txtUsername->lineEdit()->setText(existing_root->network()->authUsername());
@ -139,24 +138,19 @@ void FormEditOwnCloudAccount::onClickedOk() {
editing_account = false;
}
// TODO: TODO
/*
m_editableRoot->network()->setUrl(m_ui->m_txtUrl->lineEdit()->text());
m_editableRoot->network()->setUsername(m_ui->m_txtUsername->lineEdit()->text());
m_editableRoot->network()->setPassword(m_ui->m_txtPassword->lineEdit()->text());
m_editableRoot->network()->setAuthIsUsed(m_ui->m_gbHttpAuthentication->isChecked());
m_editableRoot->network()->setAuthUsername(m_ui->m_txtHttpUsername->lineEdit()->text());
m_editableRoot->network()->setAuthPassword(m_ui->m_txtHttpPassword->lineEdit()->text());
m_editableRoot->network()->setAuthUsername(m_ui->m_txtUsername->lineEdit()->text());
m_editableRoot->network()->setAuthPassword(m_ui->m_txtPassword->lineEdit()->text());
m_editableRoot->network()->setForceServerSideUpdate(m_ui->m_checkServerSideUpdate->isChecked());
m_editableRoot->saveAccountDataToDatabase();
//m_editableRoot->saveAccountDataToDatabase();
accept();
if (editing_account) {
m_editableRoot->network()->logout();
m_editableRoot->completelyRemoveAllData();
m_editableRoot->syncIn();
}*/
// TODO: TODO
//m_editableRoot->completelyRemoveAllData();
//m_editableRoot->syncIn();
}
}
void FormEditOwnCloudAccount::onClickedCancel() {
@ -191,9 +185,6 @@ void FormEditOwnCloudAccount::onUrlChanged() {
if (url.isEmpty()) {
m_ui->m_txtUrl->setStatus(WidgetWithStatus::Error, tr("URL cannot be empty."));
}
else if (!url.endsWith(QL1S("/api/"))) {
m_ui->m_txtUrl->setStatus(WidgetWithStatus::Warning, tr("URL should end with \"/api/\"."));
}
else {
m_ui->m_txtUrl->setStatus(WidgetWithStatus::Ok, tr("URL is okay."));
}

View file

@ -22,6 +22,9 @@
#include "miscellaneous/iconfactory.h"
#include "services/owncloud/definitions.h"
#include "services/owncloud/owncloudserviceroot.h"
#include "services/owncloud/gui/formeditowncloudaccount.h"
#include "gui/dialogs/formmain.h"
OwnCloudServiceEntryPoint::OwnCloudServiceEntryPoint() {
}
@ -30,14 +33,8 @@ OwnCloudServiceEntryPoint::~OwnCloudServiceEntryPoint() {
}
ServiceRoot *OwnCloudServiceEntryPoint::createNewRoot() const {
// TODO: TODO
//QPointer<FormEditAccount> form_acc = new FormEditAccount(qApp->mainForm());
//OwnCloudServiceRoot *new_root = form_acc.data()->execForCreate();
//delete form_acc.data();
//return new_root;
return NULL;
QScopedPointer<FormEditOwnCloudAccount> form_acc(new FormEditOwnCloudAccount(qApp->mainForm()));
return form_acc->execForCreate();
}
QList<ServiceRoot*> OwnCloudServiceEntryPoint::initializeSubtree() const {

View file

@ -18,10 +18,12 @@
#include "services/owncloud/owncloudserviceroot.h"
#include "definitions/definitions.h"
#include "services/owncloud/owncloudserviceentrypoint.h"
#include "services/owncloud/network/owncloudnetworkfactory.h"
OwnCloudServiceRoot::OwnCloudServiceRoot(RootItem *parent) : ServiceRoot(parent), m_network(new OwnCloudNetworkFactory()) {
OwnCloudServiceRoot::OwnCloudServiceRoot(RootItem *parent)
: ServiceRoot(parent), m_network(new OwnCloudNetworkFactory()) {
}
OwnCloudServiceRoot::~OwnCloudServiceRoot() {

View file

@ -45,7 +45,6 @@ class OwnCloudServiceRoot : public ServiceRoot {
void start(bool freshly_activated);
void stop();
QString code() const;
bool loadMessagesForItem(RootItem *item, QSqlTableModel *model);

View file

@ -51,7 +51,6 @@ StandardServiceRoot::StandardServiceRoot(RootItem *parent)
setTitle(qApp->system()->getUsername() + QL1S("@") + QL1S(APP_LOW_NAME));
setIcon(StandardServiceEntryPoint().icon());
setDescription(tr("This is obligatory service account for standard RSS/RDF/ATOM feeds."));
setCreationDate(QDateTime::currentDateTime());
}
StandardServiceRoot::~StandardServiceRoot() {

View file

@ -43,7 +43,6 @@ TtRssServiceRoot::TtRssServiceRoot(RootItem *parent)
: ServiceRoot(parent), m_recycleBin(new TtRssRecycleBin(this)),
m_actionSyncIn(NULL), m_serviceMenu(QList<QAction*>()), m_network(new TtRssNetworkFactory()) {
setIcon(TtRssServiceEntryPoint().icon());
setCreationDate(QDateTime::currentDateTime());
}
TtRssServiceRoot::~TtRssServiceRoot() {