"Fossies" - the Fresh Open Source Software Archive

Member "mathmod-branches-r508-trunk/ui_modules/selectoptions.cpp" (8 Mar 2021, 4193 Bytes) of package /linux/misc/mathmod-11.0-source.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. For more information about "selectoptions.cpp" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 10.1_vs_11.0.

    1 /***************************************************************************
    2  *   Copyright (C) 2021 by Abderrahman Taha                                *
    3  *                                                                         *
    4  *                                                                         *
    5  *   This program is free software; you can redistribute it and/or modify  *
    6  *   it under the terms of the GNU General Public License as published by  *
    7  *   the Free Software Foundation; either version 2 of the License, or     *
    8  *   (at your option) any later version.                                   *
    9  *                                                                         *
   10  *   This program is distributed in the hope that it will be useful,       *
   11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
   12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
   13  *   GNU General Public License for more details.                          *
   14  *                                                                         *
   15  *   You should have received a copy of the GNU General Public License     *
   16  *   along with this program; if not, write to the                         *
   17  *   Free Software Foundation, Inc.,                                       *
   18  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
   19  ***************************************************************************/
   20 #include <QtGui>
   21 #include "selectoptions.h"
   22 
   23 SelectOptions::SelectOptions(QWidget *parent) : QWidget(parent)
   24 {
   25     this->setWindowFlags(Qt::WindowStaysOnTopHint);
   26     ui.setupUi(this);
   27 }
   28 
   29 void SelectOptions::on_addpushButton_clicked()
   30 {
   31     QString select = ui.StringlineEdit->text();
   32     if (select != "")
   33     {
   34         if (selectedoptions.selectedwords.size() > 0)
   35             selectedoptions.selectedwords.removeAt(0);
   36         selectedoptions.selectedwords.append(ui.StringlineEdit->text());
   37         selectedoptions.selectedwords.insert(
   38             0, "Words Selection (" +
   39             QString::number(selectedoptions.selectedwords.count()) + ")");
   40         ui.StringSelect->clear();
   41         ui.StringSelect->addItems(selectedoptions.selectedwords);
   42         ui.StringlineEdit->clear();
   43     }
   44     emitUpdateSignal();
   45 }
   46 
   47 void SelectOptions::on_CutpushButton_clicked()
   48 {
   49     int currentindex = ui.StringSelect->currentIndex();
   50     if (currentindex > 0)
   51     {
   52         selectedoptions.selectedwords.removeAt(currentindex);
   53         selectedoptions.selectedwords.removeAt(0);
   54         if (selectedoptions.selectedwords.count() > 0)
   55         {
   56             selectedoptions.selectedwords.insert(
   57                 0, "Words Selection (" +
   58                 QString::number(selectedoptions.selectedwords.count()) + ")");
   59             ui.StringSelect->clear();
   60             ui.StringSelect->addItems(selectedoptions.selectedwords);
   61         }
   62         else
   63             ui.StringSelect->clear();
   64     }
   65     emitUpdateSignal();
   66 }
   67 
   68 void SelectOptions::on_ShowAllcheckBox_clicked(bool checked)
   69 {
   70     ui.SelectgroupBox->setEnabled(!checked);
   71     ui.SelectgroupBox->setVisible(!checked);
   72     selectedoptions.showall = checked;
   73     if (selectedoptions.selectedwords.count() > 0)
   74         emitUpdateSignal();
   75 }
   76 
   77 void SelectOptions::on_CaseSensitiveCheckBox_clicked(bool checked)
   78 {
   79     selectedoptions.sensitive = checked;
   80     emitUpdateSignal();
   81 }
   82 
   83 void SelectOptions::emitUpdateSignal()
   84 {
   85     emit UpdateSignal();
   86 }
   87 
   88 void SelectOptions::on_AND_clicked(bool checked)
   89 {
   90     selectedoptions.AND = checked;
   91     if (selectedoptions.selectedwords.count() > 1)
   92         emitUpdateSignal();
   93 }
   94 
   95 void SelectOptions::on_radioButton_clicked(bool checked)
   96 {
   97     selectedoptions.AND = !checked;
   98     if (selectedoptions.selectedwords.count() > 1)
   99         emitUpdateSignal();
  100 }
  101 
  102 void SelectOptions::on_FunctcheckBox_clicked(bool checked)
  103 {
  104     selectedoptions.parsefunctions = checked;
  105     emitUpdateSignal();
  106 }
  107 
  108 void SelectOptions::on_NamescheckBox_clicked(bool checked)
  109 {
  110     selectedoptions.parsenames = checked;
  111     emitUpdateSignal();
  112 }
  113 
  114 void SelectOptions::on_CompcheckBox_clicked(bool checked)
  115 {
  116     selectedoptions.parsecmpnames = checked;
  117     emitUpdateSignal();
  118 }