Changeset 11086c2def in tspsg for src/settingsdialog.cpp
- Timestamp:
- Feb 23, 2010, 9:21:44 PM (15 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- 6beb157497
- Parents:
- 8203c075d5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/settingsdialog.cpp
r8203c075d5 r11086c2def 31 31 */ 32 32 SettingsDialog::SettingsDialog(QWidget *parent) 33 : QDialog(parent), newFont(false), newColor(false)33 : QDialog(parent), _newFont(false), _newColor(false), _translucency(0) 34 34 { 35 35 setupUi(this); … … 68 68 QVBoxLayout *vbox1, *vbox2; 69 69 QHBoxLayout *hbox1, *hbox2; 70 71 if (QtWin::isCompositionEnabled()) { 72 cbUseTranslucency = new QCheckBox(bgWhite); 73 cbUseTranslucency->setObjectName("cbUseTranslucency"); 74 #ifndef QT_NO_STATUSTIP 75 cbUseTranslucency->setStatusTip(tr("Use translucent effect on the Main Window under Windows Vista and 7")); 76 #endif // QT_NO_STATUSTIP 77 cbUseTranslucency->setText(tr("Use translucency effects")); 78 cbUseTranslucency->setCursor(QCursor(Qt::PointingHandCursor)); 79 } 70 80 71 81 cbSaveState = new QCheckBox(bgWhite); … … 114 124 vbox1 = static_cast<QVBoxLayout *>(tabGeneral->layout()); 115 125 vbox1->insertWidget(vbox1->indexOf(cbUseNativeDialogs) + 1, cbSaveState); 126 #ifdef Q_OS_WIN32 127 if (QtWin::isCompositionEnabled()) 128 vbox1->insertWidget(vbox1->indexOf(cbUseNativeDialogs) + 1, cbUseTranslucency); 129 #endif // Q_OS_WIN32 116 130 117 131 // Bottom part (with grey bg) … … 146 160 cbAutosize->setChecked(settings->value("Autosize", DEF_AUTOSIZE).toBool()); 147 161 cbUseNativeDialogs->setChecked(settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool()); 162 #ifdef Q_OS_WIN32 163 if (QtWin::isCompositionEnabled()) 164 cbUseTranslucency->setChecked(settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool()); 165 #endif // Q_OS_WIN32 148 166 #ifndef Q_OS_WINCE 149 167 cbSaveState->setChecked(settings->value("SavePos", DEF_SAVEPOS).toBool()); … … 181 199 bool SettingsDialog::colorChanged() const 182 200 { 183 return newColor;201 return _newColor; 184 202 } 185 203 … … 190 208 bool SettingsDialog::fontChanged() const 191 209 { 192 return newFont; 210 return _newFont; 211 } 212 213 /*! 214 * 215 */ 216 qint8 SettingsDialog::translucencyChanged() const 217 { 218 return _translucency; 193 219 } 194 220 … … 200 226 settings->setValue("SavePos", cbSaveState->isChecked()); 201 227 #endif // Q_OS_WINCE 228 #ifdef Q_OS_WIN32 229 if (QtWin::isCompositionEnabled()) { 230 bool old = settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool(); 231 if ((!old && cbUseTranslucency->isChecked()) || (old && !cbUseTranslucency->isChecked())) { 232 _translucency = old ? -1 : 1; 233 } else 234 _translucency = 0; 235 settings->setValue("UseTranslucency", cbUseTranslucency->isChecked()); 236 } 237 #endif // Q_OS_WIN32 202 238 settings->setValue("UseNativeDialogs", cbUseNativeDialogs->isChecked()); 203 settings->setValue("Autosize", cbAutosize->isChecked());204 239 205 240 settings->beginGroup("Task"); … … 216 251 settings->setValue("ShowMatrixLimit", spinCitiesLimit->value()); 217 252 settings->setValue("ScrollToEnd", cbScrollToEnd->isChecked()); 218 if ( newFont)253 if (_newFont) 219 254 settings->setValue("Font", font); 220 if ( newColor)255 if (_newColor) 221 256 settings->setValue("Color", color); 222 257 settings->endGroup(); … … 229 264 if (color.isValid() && (this->color != color)) { 230 265 this->color = color; 231 newColor = true;266 _newColor = true; 232 267 } 233 268 } … … 239 274 if (ok && (this->font != font)) { 240 275 this->font = font; 241 newFont = true;276 _newFont = true; 242 277 } 243 278 }
Note: See TracChangeset
for help on using the changeset viewer.