From 5de3dd4762ca33a0f92e79ffa4fe2ff67069d531 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 24 Feb 2010 01:49:02 +0000 Subject: Added KDE3 version of ktechlab git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1095338 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/gui/microsettingsdlg.h | 105 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 src/gui/microsettingsdlg.h (limited to 'src/gui/microsettingsdlg.h') diff --git a/src/gui/microsettingsdlg.h b/src/gui/microsettingsdlg.h new file mode 100644 index 0000000..54582dd --- /dev/null +++ b/src/gui/microsettingsdlg.h @@ -0,0 +1,105 @@ +/*************************************************************************** + * Copyright (C) 2003-2005 by David Saxton * + * david@bluehaze.org * + * * + * 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. * + ***************************************************************************/ + +#ifndef MICROSETTINGSDLG_H +#define MICROSETTINGSDLG_H + +#include + +#include +#include +#include + +class KLineEdit; +class MicroSettings; +class MicroSettingsWidget; +class NewPinMappingWidget; +class PinMapping; + +typedef QMap< QString, PinMapping > PinMappingMap; + +/** +@author David Saxton +*/ +class MicroSettingsDlg : public KDialogBase +{ + Q_OBJECT + public: + MicroSettingsDlg( MicroSettings *_microSettings, QWidget *parent = 0L, const char *name = 0L ); + ~MicroSettingsDlg(); + + void reject(); + void accept(); + + /** + * @param pinMapName the pinMapName; may be changed to make it valid + * (e.g. spaces replaced with underscores). + * @returns Invalid for a pinMapName containing a non-variable name, + * Intermediate for a pinMapName that starts with a number or is already + * in use, and Acceptable otherwise. + */ + QValidator::State validatePinMapName( QString & pinMapName ) const; + + public slots: + /** + * Saves the port details in the given row to the MicroSettings class. + * Usually called when the value is changed, or on 'Apply' of the + * dialog. + */ + void savePort( int row ); + /** + * Saves the variable details to the MicroSettings class. + */ + void saveVariable( int row ); + /** + * Adds an extra row to the list of variable if one is required. + */ + void checkAddVariableRow(); + /** + * Called when the pinMapAdd button is pressed. + */ + void slotCreatePinMap(); + /** + * Called when the pinMapModify button is pressed. + */ + void slotModifyPinMap(); + /** + * Called when the pinMapRename button is pressed. + */ + void slotRenamePinMap(); + /** + * Called when the pinMapRemove button is pressed. + */ + void slotRemovePinMap(); + /** + * Called when the dialog is Applied or OK'd. + */ + void slotSaveStuff(); + + protected slots: + void slotCheckNewPinMappingName( const QString & name ); + + protected: + /** + * Set each button enabled / disabled as appropriate. + */ + void updatePinMapButtons(); + + NewPinMappingWidget * m_pNewPinMappingWidget; // Used for checking that the variable name is ok + KDialogBase * m_pNewPinMappingDlg; + MicroSettingsWidget * m_pWidget; + MicroSettings * m_pMicroSettings; + PinMappingMap m_pinMappings; + QValueVector< KLineEdit * > m_portTypeEdit; + QValueVector< KLineEdit * > m_portStateEdit; + QStringList m_portNames; +}; + +#endif -- cgit v1.2.1