diff options
author | Siteshwar Vashisht <siteshwar@gmail.com> | 2012-05-24 23:54:48 +0530 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-05-28 00:10:31 +0200 |
commit | 4a33568b6d177921e50445a9ded44386febe60c0 (patch) | |
tree | 171c6185c19789c33912c1170fa974c00ea6f335 /src/sync/syncdatawidget.cpp | |
parent | Final refactoring and clean up to support Opera bookmarks. (diff) | |
download | rekonq-4a33568b6d177921e50445a9ded44386febe60c0.tar.xz |
Made UI changes to disable history and password sync for certain services, added some notification messages in Opera sync handler.
Diffstat (limited to 'src/sync/syncdatawidget.cpp')
-rw-r--r-- | src/sync/syncdatawidget.cpp | 58 |
1 files changed, 26 insertions, 32 deletions
diff --git a/src/sync/syncdatawidget.cpp b/src/sync/syncdatawidget.cpp index fe3637b1..9b415ad2 100644 --- a/src/sync/syncdatawidget.cpp +++ b/src/sync/syncdatawidget.cpp @@ -38,55 +38,49 @@ SyncDataWidget::SyncDataWidget(QWidget *parent) : QWizardPage(parent) - , _changed(false) { setupUi(this); - - kcfg_syncEnabled->setChecked(ReKonfig::syncEnabled()); - - kcfg_syncBookmarks->setChecked(ReKonfig::syncBookmarks()); - kcfg_syncHistory->setChecked(ReKonfig::syncHistory()); - kcfg_syncPasswords->setChecked(ReKonfig::syncPasswords()); - - bool isSyncEnabled = ReKonfig::syncEnabled(); - enablewidgets(isSyncEnabled); - - connect(kcfg_syncEnabled, SIGNAL(clicked()), this, SLOT(hasChanged())); } - -bool SyncDataWidget::changed() +void SyncDataWidget::initializePage() { - return _changed; -} + kcfg_syncBookmarks->setDisabled(true); + kcfg_syncHistory->setDisabled(true); + kcfg_syncPasswords->setDisabled(true); + + switch(ReKonfig::syncType()) + { + //Ftp Sync Handler + case 0: + kcfg_syncBookmarks->setEnabled(true); + kcfg_syncHistory->setEnabled(true); + kcfg_syncPasswords->setEnabled(true); + break; + //Google Sync Handler + case 1: + //Opera Sync Handler + case 2: + kcfg_syncBookmarks->setEnabled(true); + break; + default: + kDebug() << "Unknown sync type!"; + } -void SyncDataWidget::hasChanged() -{ - enablewidgets(kcfg_syncEnabled->isChecked()); - - _changed = true; - emit changed(true); -} - + kcfg_syncBookmarks->setChecked(ReKonfig::syncBookmarks()); + kcfg_syncHistory->setChecked(ReKonfig::syncHistory()); + kcfg_syncPasswords->setChecked(ReKonfig::syncPasswords()); -void SyncDataWidget::enablewidgets(bool b) -{ - syncGroupBox->setEnabled(b); } int SyncDataWidget::nextId() const { // save - ReKonfig::setSyncEnabled(kcfg_syncEnabled->isChecked()); ReKonfig::setSyncBookmarks(kcfg_syncBookmarks->isChecked()); ReKonfig::setSyncHistory(kcfg_syncHistory->isChecked()); ReKonfig::setSyncPasswords(kcfg_syncPasswords->isChecked()); - if (ReKonfig::syncEnabled()) - return SyncAssistant::Page_Type; - else - return SyncAssistant::Page_Check; + return SyncAssistant::Page_Check; } |