1 /*************************************************************************** 2 * * 3 * copyright : (C) 2007 The University of Toronto * 4 * netterfield@astro.utoronto.ca * 5 * * 6 * This program is free software; you can redistribute it and/or modify * 7 * it under the terms of the GNU General Public License as published by * 8 * the Free Software Foundation; either version 2 of the License, or * 9 * (at your option) any later version. * 10 * * 11 ***************************************************************************/ 12 13 #ifndef CHOOSECOLORDIALOG_H 14 #define CHOOSECOLORDIALOG_H 15 16 #include <QDialog> 17 #include <QLineEdit> 18 19 #include "colorbutton.h" 20 #include "dataprimitive.h" 21 22 #include "ui_choosecolordialog.h" 23 24 #include "kst_export.h" 25 26 namespace Kst { 27 28 class ObjectStore; 29 30 class ChooseColorDialog : public QDialog, Ui::ChooseColorDialog 31 { 32 Q_OBJECT 33 public: 34 explicit ChooseColorDialog(QWidget *parent); 35 virtual ~ChooseColorDialog(); 36 37 void show(); 38 39 private slots: 40 void OKClicked(); 41 void apply(); 42 43 private: 44 QColor getColorForFile(const QString &fileName); 45 46 QGridLayout* _grid; 47 48 void updateColorGroup(); 49 void cleanColorGroup(); 50 51 QList<QLineEdit*> _lineEdits; 52 QList<ColorButton*> _colorButtons; 53 54 ObjectStore *_store; 55 // Use a QMap to store the list of used datasources and their color 56 QMap<DataSourcePtr, QColor> _dataSourceColors; 57 58 }; 59 60 } 61 62 #endif 63 64 // vim: ts=2 sw=2 et 65