annotate colourset.h @ 363:f89e50d748ed feature_93

Enable Push button whenever the repo is non-empty, even when there is no remote location -- ask for remote location when it is pressed. Also change "Change Remote..." to "Set Remote..." to be consistent with this new usage
author Chris Cannam
date Thu, 17 Mar 2011 17:48:18 +0000
parents 8fd71f570884
children
rev   line source
Chris@57 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@57 2
Chris@57 3 /*
Chris@57 4 EasyMercurial
Chris@57 5
Chris@57 6 Based on HgExplorer by Jari Korhonen
Chris@57 7 Copyright (c) 2010 Jari Korhonen
Chris@244 8 Copyright (c) 2011 Chris Cannam
Chris@244 9 Copyright (c) 2011 Queen Mary, University of London
Chris@57 10
Chris@57 11 This program is free software; you can redistribute it and/or
Chris@57 12 modify it under the terms of the GNU General Public License as
Chris@57 13 published by the Free Software Foundation; either version 2 of the
Chris@57 14 License, or (at your option) any later version. See the file
Chris@57 15 COPYING included with this distribution for more information.
Chris@57 16 */
Chris@57 17
Chris@53 18 #ifndef _COLOURSET_H_
Chris@53 19 #define _COLOURSET_H_
Chris@53 20
Chris@53 21 #include <QSet>
Chris@53 22 #include <QMap>
Chris@53 23 #include <QColor>
Chris@53 24 #include <QString>
Chris@53 25
Chris@53 26 class ColourSet
Chris@53 27 {
Chris@53 28 public:
Chris@53 29 void clearDefaultNames() { m_defaultNames.clear(); }
Chris@53 30 void addDefaultName(QString n) { m_defaultNames.insert(n); }
Chris@53 31
Chris@53 32 QColor getColourFor(QString n);
Chris@53 33
Chris@53 34 static ColourSet *instance();
Chris@53 35
Chris@53 36 private:
Chris@53 37 ColourSet();
Chris@53 38 QSet<QString> m_defaultNames;
Chris@53 39 QMap<QString, QColor> m_colours;
Chris@53 40 QColor m_lastColour;
Chris@53 41
Chris@53 42 static ColourSet m_instance;
Chris@53 43 };
Chris@53 44
Chris@53 45 #endif