⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 settings.h

📁 给予QT的qps开源最新源码
💻 H
字号:
/*
   qpegps is a program for displaying a map centered at the current longitude/
   latitude as read from a gps receiver.

   Copyright (C) 2002 Ralf Haselmeier <Ralf.Haselmeier@gmx.de>

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

 */

#ifndef SETTINGS_H
#define SETTINGS_H

#include <qsocket.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qgrid.h>
#include <qtextview.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qtextstream.h>
#include <qtimer.h>
#include <qpixmap.h>
#include <qpainter.h>
#include <qfileinfo.h>
#include <qdir.h>
#include <qarray.h>
#include <qwidget.h>
#include <qcombobox.h>
#include <qscrollview.h>
#include <qstringlist.h>
#include <qhbuttongroup.h>
#include <qradiobutton.h>
#include <qpushbutton.h>
#include <qfiledialog.h>
#include <qcheckbox.h>
#include <qcolor.h>
#include <qdialog.h>
#include <qspinbox.h>
#include <qsizepolicy.h>
#include <qlistbox.h>

#include <stdlib.h>
#include <math.h>
#include "gpsdata.h"
#include "dirdialog.h"
#include "colordlg.h"

#ifndef DESKTOP
#include <qpe/global.h>
#include <qpe/config.h>
#include <qpe/menubutton.h>

#else
#include <qsettings.h>
#define Config QSettings 

#include <qpushbutton.h>
#define MenuButton QPushButton
#endif

#define gpsdDefaultArg "-p /dev/ttyS0 -s 4800"
#define gpsdDefaultHost "localhost"
#define gpsdDefaultPort 2947
#define QPEGPS_DEFAULT_CONF "default_profile"

class ConfigDialog : public QDialog
{
   Q_OBJECT

   // ----- METHODS -----
   public:
      ConfigDialog(QStringList, int, QWidget *, const char *, bool, WFlags);
      ~ConfigDialog() {}

   // ---- MEMBERS -----
   public:
      QListBox * profileSelector;
      QCheckBox * cbox;
};

class Settings : public QScrollView
{
   Q_OBJECT

   // ----- METHODS -----
   public:
      Settings(Qpegps *, MapDispOptions *mapDispOpts, 
         PlacesOptions *placesOpt, MapOptions *mapOpts, 
         TrackOptions *trackOpts, GeoDatumOptions *geodatumOpts,
         QWidget * parent = 0, const char * name = 0, WFlags f = 0);
      ~Settings() {}

      void selectConfigR(bool);
      void selectConfigW(bool);

   public slots:
      void updateConfig();

   private slots:
      void setAlt(int);
      void setSpeed(int);
      void setDist(int);
      void setPos(int);
      void setBear(bool);
      void setHead(bool);
      void setTime(bool);
      void setMapPath();
      void setSubdir(bool);
      void mapPathLEChanged();

#if 0 // PROXY
//      void proxyUrlLEChanged();
#endif
      /*
         void okColorChanged(int);
         void noFixColorChanged(int);
         void headColorChanged(int);
         void bearColorChanged(int);
       */
      void setColors();
      void textSizeChanged(int);
      void geoDatGpsChanged(int);
      void geoDatMapChanged(int);
      void addConfig();
      void delConfig();
      void setDialog();
      void selectConfig(int);
      void selectConfigRename(const QString & string);
      void setRotate(int);

   // ----- MEMBERS -----
   public:
      Config *qpegpsConfigSelect;
      
   private:
      Qpegps *app;
      MapDispOptions *mapDispOptions;     // show
      PlacesOptions *placesOptions;       // places
      MapOptions *mapOptions;             // maps
      GeoDatumOptions *geodatumOptions;
      TrackOptions *trackOptions;

      QComboBox *altCB, *speedCB, *distCB, *posCB;
      QCheckBox *bearTB, *headTB, *timeTB;
      QCheckBox * showConfigDialog;
      QSpinBox * textSizeSB;
      QLineEdit * mapPath;
      QCheckBox * subdirTB;
      QLineEdit * proxyUrlLE;
      /*MenuButton *okColorCB, *noFixColorCB, *headColorCB, *bearColorCB;*/
//      QString okColorName, noFixColorName;
//      QString headColorName, bearColorName, trackColorName, scaleColorName;
//      QString placesColorName;
      QStringList colorList;
      QList <QColor>qColorPtrList;
      /*QLabel *okLabel, *noFixLabel, *headColorLabel, *bearColorLabel, *proxyUrlL;*/
      QComboBox *geoDatGpsCB, *geoDatMapCB, *configName;
      unsigned int configIdx;
      QStringList configFileList;
      QComboBox *rotateCB;

   signals:
      void mapPathChanged();
};

#endif // SETTINGS_H

// end of file

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -