File indexing completed on 2024-12-22 04:17:32

0001 /***************************************************************************
0002  *                                                                         *
0003  *   copyright : (C) 2007 The University of Toronto                        *
0004  *                   netterfield@astro.utoronto.ca                         *
0005  *                                                                         *
0006  *   This program is free software; you can redistribute it and/or modify  *
0007  *   it under the terms of the GNU General Public License as published by  *
0008  *   the Free Software Foundation; either version 2 of the License, or     *
0009  *   (at your option) any later version.                                   *
0010  *                                                                         *
0011  ***************************************************************************/
0012 #include "generaltab.h"
0013 
0014 #if !defined(Q_OS_WIN) &&  QT_VERSION < 0x050000
0015 #define HAVE_SWITCHABLE_RASTER
0016 #endif
0017 
0018 namespace Kst {
0019 
0020 GeneralTab::GeneralTab(QWidget *parent)
0021   : DialogTab(parent) {
0022 
0023   setupUi(this);
0024   setTabTitle(tr("General"));
0025 
0026   connect(_useRaster, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));
0027   connect(_maxUpdate, SIGNAL(valueChanged(int)), this, SIGNAL(modified()));
0028   connect(_transparentDrag, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));
0029   connect(_antialiasPlots, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));
0030 }
0031 
0032 
0033 GeneralTab::~GeneralTab() {
0034 }
0035 
0036 bool GeneralTab::useRaster() const {
0037 #ifdef HAVE_SWITCHABLE_RASTER
0038   return _useRaster->isChecked();
0039 #else
0040   return false;
0041 #endif
0042 }
0043 
0044 
0045 void GeneralTab::setUseRaster(bool useRaster) {
0046 #ifdef HAVE_SWITCHABLE_RASTER
0047   _useRaster->setChecked(useRaster);
0048 #else
0049   _useRaster->setCheckState(Qt::Checked);
0050   _useRaster->hide();
0051 #endif
0052 }
0053 
0054 bool GeneralTab::transparentDrag() const {
0055   return _transparentDrag->isChecked();
0056 }
0057 
0058 void GeneralTab::setTransparentDrag(const bool transparent_drag) {
0059   _transparentDrag->setChecked(transparent_drag);
0060 }
0061 
0062 bool GeneralTab::antialiasPlot() const {
0063   return _antialiasPlots->isChecked();
0064 }
0065 
0066 void GeneralTab::setAntialiasPlot(bool antialias) {
0067   _antialiasPlots->setChecked(antialias);
0068 }
0069 
0070 int GeneralTab::minimumUpdatePeriod() const {
0071   return _maxUpdate->value();
0072 }
0073 
0074 
0075 void GeneralTab::setMinimumUpdatePeriod(const int period) {
0076   _maxUpdate->setValue(period);
0077 }
0078 
0079 }
0080 
0081 // vim: ts=2 sw=2 et