~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to kde/src/conf/configurationdialog.cpp

  • Committer: Jackson Doak
  • Date: 2013-07-10 21:04:46 UTC
  • mfrom: (20.1.3 sid)
  • Revision ID: noskcaj@ubuntu.com-20130710210446-y8f587vza807icr9
Properly merged from upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 *   Copyright (C) 2009 by Savoir-Faire Linux                               *
 
2
 *   Copyright (C) 2009-2013 by Savoir-Faire Linux                          *
3
3
 *   Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com>          *
4
4
 *            Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
5
5
 *                                                                          *
37
37
 
38
38
///Constructor
39
39
ConfigurationDialog::ConfigurationDialog(SFLPhoneView *parent)
40
 
 :KConfigDialog(parent, SETTINGS_NAME, ConfigurationSkeleton::self()),dlgVideo(0)
 
40
 :KConfigDialog(parent, SETTINGS_NAME, ConfigurationSkeleton::self()),dlgVideo(0),dlgGeneral(0),dlgDisplay(0)
 
41
 ,dlgAudio(0),dlgAddressBook(0),dlgHooks(0),dlgAccessibility(0),dlgAccounts(0)
41
42
{
42
43
   this->setWindowIcon(QIcon(ICON_SFLPHONE));
43
44
 
103
104
   dlgGeneral->updateSettings      ();
104
105
   dlgAddressBook->updateSettings  ();
105
106
   dlgAccessibility->updateSettings();
 
107
   dlgDisplay->updateSettings      ();
106
108
}
107
109
 
108
110
///Cancel current modification
114
116
///If the account changed
115
117
bool ConfigurationDialog::hasChanged()
116
118
{
117
 
   bool res = dlgAudio->hasChanged() || dlgAccounts->hasChanged() || dlgGeneral->hasChanged() || dlgAddressBook->hasChanged() || (dlgVideo && dlgVideo->hasChanged());
 
119
   bool res =  (dlgAudio         && dlgAudio->hasChanged()         )
 
120
            || (dlgAccounts      && dlgAccounts->hasChanged()      )
 
121
            || (dlgGeneral       && dlgGeneral->hasChanged()       )
 
122
            || (dlgDisplay       && dlgDisplay->hasChanged()       )
 
123
            || (dlgAddressBook   && dlgAddressBook->hasChanged()   )
 
124
            || (dlgAccessibility && dlgAccessibility->hasChanged() )
 
125
            || (dlgVideo         && dlgVideo->hasChanged()         );
 
126
 
118
127
   return res;
119
128
}
120
129
 
 
130
bool ConfigurationDialog::hasIncompleteRequiredFields()
 
131
{
 
132
   return dlgAccounts && dlgAccounts->hasIncompleteRequiredFields();
 
133
}
 
134
 
121
135
///Update the buttons
122
136
void ConfigurationDialog::updateButtons()
123
137
{
124
 
   bool changed = hasChanged();
125
 
   enableButtonApply( changed );
 
138
   bool changed      = hasChanged();
 
139
   bool preventApply = hasIncompleteRequiredFields();
 
140
   enableButtonApply( changed && (!preventApply) );
 
141
   enableButtonOk   ( !preventApply              );
126
142
}
127
143
 
128
144
///Apply settings