"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/src/gui-qt/syntax_chooser.cpp" (12 May 2020, 1940 Bytes) of package /windows/www/highlight-3.57-x64.zip:


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.

    1 /***************************************************************************
    2                              syntax_chooser.cpp
    3                              -------------------
    4     begin                : Mo 17.03.2017
    5     copyright            : (C) 2017 by Andre Simon
    6     email                : a.simon@mailbox.org
    7  ***************************************************************************/
    8 
    9 /*
   10 This file is part of Highlight.
   11 
   12 Highlight is free software: you can redistribute it and/or modify
   13 it under the terms of the GNU General Public License as published by
   14 the Free Software Foundation, either version 3 of the License, or
   15 (at your option) any later version.
   16 
   17 Highlight is distributed in the hope that it will be useful,
   18 but WITHOUT ANY WARRANTY; without even the implied warranty of
   19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   20 GNU General Public License for more details.
   21 
   22 You should have received a copy of the GNU General Public License
   23 along with Highlight.  If not, see <http://www.gnu.org/licenses/>.
   24 */
   25 
   26 #include "syntax_chooser.h"
   27 #include "ui_syntax_chooser.h"
   28 
   29 syntax_chooser::syntax_chooser(QWidget *parent) :
   30     QDialog(parent),
   31     ui(new Ui::syntax_chooser)
   32 {
   33     ui->setupUi(this);
   34 }
   35 
   36 void syntax_chooser::changeEvent(QEvent *e)
   37 {
   38     switch (e->type()) {
   39     case QEvent::LanguageChange:
   40         ui->retranslateUi(this);
   41         break;
   42     default:
   43         break;
   44     }
   45 }
   46 
   47 syntax_chooser::~syntax_chooser()
   48 {
   49     delete ui;
   50 }
   51 
   52 void syntax_chooser::addSyntaxName(const QString& name){
   53     ui->cbSyntaxNames->addItem(name);
   54 }
   55 
   56 void syntax_chooser::setUnclearExtension(const QString& ext){
   57     ui->lblDescription->setText(tr("The file extension %1 is assigned to multiple syntax definitions.\nSelect the correct one:").arg(ext));
   58 }
   59 
   60 QString syntax_chooser::getSelection(){
   61     return ui->cbSyntaxNames->currentText();
   62 }
   63 
   64 bool syntax_chooser::getRememberFlag(){
   65     return ui->cbRemember->isChecked();
   66 }