"Fossies" - the Fresh Open Source Software Archive

Member "cb2bib-2.0.1/src/c2bColors.cpp" (12 Feb 2021, 3868 Bytes) of package /linux/privat/cb2bib-2.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "c2bColors.cpp" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.0.0_vs_2.0.1.

    1 /***************************************************************************
    2  *   Copyright (C) 2004-2021 by Pere Constans
    3  *   constans@molspaces.com
    4  *   cb2Bib version 2.0.1. Licensed under the GNU GPL version 3.
    5  *   See the LICENSE file that comes with this distribution.
    6  ***************************************************************************/
    7 #include "c2bColors.h"
    8 #include "c2bSettings.h"
    9 
   10 
   11 c2bColors::c2bColors()
   12 {
   13     colorList.insert("BibTeX delimiters", &bib_delimiter_color);
   14     colorList.insert("BibTeX reference field", &bib_reference_field_color);
   15     colorList.insert("BibTeX reference type", &bib_reference_type_color);
   16     colorList.insert("Comments and line numbers", &comment_color);
   17     colorList.insert("NetQInf command contents", &netqinf_command_content_color);
   18     colorList.insert("NetQInf command keys", &netqinf_command_key_color);
   19     colorList.insert("RegExp and NetQInf cb2Bib tags", &cb2bib_tag_color);
   20     colorList.insert("cb2Bib digits", &cb2bib_digit_color);
   21     colorList.insert("cb2Bib highly relevant text", &cb2bib_highly_relevant_color);
   22     colorList.insert("cb2Bib metadata", &cb2bib_metadata_color);
   23     colorList.insert("cb2Bib relevant text", &cb2bib_relevant_color);
   24     colorList.insert("cb2Bib unrelevant text", &cb2bib_unrelevant_color);
   25 }
   26 
   27 c2bColors::~c2bColors() {}
   28 
   29 
   30 void c2bColors::updateColor(const QColor& color, const QString& colorName)
   31 {
   32     *colorList[colorName] = color;
   33 }
   34 
   35 void c2bColors::saveColors(c2bSettings* settings)
   36 {
   37     settings->setValue("c2bColors/bib_delimiter_color", bib_delimiter_color);
   38     settings->setValue("c2bColors/bib_reference_field_color", bib_reference_field_color);
   39     settings->setValue("c2bColors/bib_reference_type_color", bib_reference_type_color);
   40     settings->setValue("c2bColors/cb2bib_digit_color", cb2bib_digit_color);
   41     settings->setValue("c2bColors/cb2bib_highly_relevant_color", cb2bib_highly_relevant_color);
   42     settings->setValue("c2bColors/cb2bib_metadata_color", cb2bib_metadata_color);
   43     settings->setValue("c2bColors/cb2bib_relevant_color", cb2bib_relevant_color);
   44     settings->setValue("c2bColors/cb2bib_tag_color", cb2bib_tag_color);
   45     settings->setValue("c2bColors/cb2bib_unrelevant_color", cb2bib_unrelevant_color);
   46     settings->setValue("c2bColors/comment_color", comment_color);
   47     settings->setValue("c2bColors/netqinf_command_content_color", netqinf_command_content_color);
   48     settings->setValue("c2bColors/netqinf_command_key_color", netqinf_command_key_color);
   49 }
   50 
   51 void c2bColors::loadColors(c2bSettings* settings)
   52 {
   53     bib_delimiter_color = settings->value("c2bColors/bib_delimiter_color", "#555555").value<QColor>();
   54     bib_reference_field_color = settings->value("c2bColors/bib_reference_field_color", "#00007f").value<QColor>();
   55     bib_reference_type_color = settings->value("c2bColors/bib_reference_type_color", "#00007f").value<QColor>();
   56     cb2bib_digit_color = settings->value("c2bColors/cb2bib_digit_color", "#005500").value<QColor>();
   57     cb2bib_highly_relevant_color = settings->value("c2bColors/cb2bib_highly_relevant_color", "#0000ff").value<QColor>();
   58     cb2bib_metadata_color = settings->value("c2bColors/cb2bib_metadata_color", "#595942").value<QColor>();
   59     cb2bib_relevant_color = settings->value("c2bColors/cb2bib_relevant_color", "#005500").value<QColor>();
   60     cb2bib_tag_color = settings->value("c2bColors/cb2bib_tag_color", "#550000").value<QColor>();
   61     cb2bib_unrelevant_color = settings->value("c2bColors/cb2bib_unrelevant_color", "#595942").value<QColor>();
   62     comment_color = settings->value("c2bColors/comment_color", "#595942").value<QColor>();
   63     netqinf_command_content_color =
   64         settings->value("c2bColors/netqinf_command_content_color", "#000000").value<QColor>();
   65     netqinf_command_key_color = settings->value("c2bColors/netqinf_command_key_color", "#00007f").value<QColor>();
   66 }