"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/symboldlg.cpp" between
kpl-4.1.tar.gz and kpl-5.0.tar.gz

About: Kpl is a KDE program for two- and three-dimensional graphical presentation (plots) of data sets and functions. Multidimensional nonlinear parameter and general linear least square parameter fits can be performed.

symboldlg.cpp  (kpl-4.1):symboldlg.cpp  (kpl-5.0)
/*************************************************************************** /***************************************************************************
symboldlg.cpp - description symboldlg.cpp - description
------------------- -------------------
This file is a part of kpl - a program for graphical presentation of This file is a part of kpl - a program for graphical presentation of
data sets and functions. data sets and functions.
begin : Sun Apr 25 1999 begin : Sun Apr 25 1999
copyright : (C) 2015 by Werner Stille copyright : (C) 2017 by Werner Stille
email : stille@uni-freiburg.de email : kpl@werner-stille.de
***************************************************************************/ ***************************************************************************/
/*************************************************************************** /***************************************************************************
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
***************************************************************************/ ***************************************************************************/
#include <QButtonGroup> #include <QButtonGroup>
#include <QDialogButtonBox>
#include <QGroupBox> #include <QGroupBox>
#include <QLabel> #include <QLabel>
#include <QLayout> #include <QLayout>
#include <QRadioButton> #include <QRadioButton>
#include <QSpinBox> #include <QSpinBox>
#include <KLocalizedString> #include <KLocalizedString>
#include "symboldlg.h" #include "symboldlg.h"
SymbolButton::SymbolButton(QSpinBox* sb, bool lines, bool disable, SymbolButton::SymbolButton(QSpinBox* sb, bool lines, bool disable,
QWidget* parent) : QWidget* parent) :
skipping to change at line 63 skipping to change at line 64
QIcon() : KplItem::pixmap(KplItem::Symbol(isymb))); QIcon() : KplItem::pixmap(KplItem::Symbol(isymb)));
} }
void SymbolButton::slotSymbol() void SymbolButton::slotSymbol()
{ {
SymbolDlg dlg(parentWidget(), symb, linesOnly); SymbolDlg dlg(parentWidget(), symb, linesOnly);
dlg.exec(); dlg.exec();
} }
SymbolDlg::SymbolDlg(QWidget* parent, QSpinBox* sb0, bool lines) : SymbolDlg::SymbolDlg(QWidget* parent, QSpinBox* sb0, bool lines) :
KDialog(parent), sb(sb0), linesOnly(lines) QDialog(parent), sb(sb0), linesOnly(lines)
{ {
setCaption(i18n(lines ? "Lines" : "Lines and markers")); setWindowTitle(i18n(lines ? "Lines" : "Lines and markers"));
setButtons(Ok | Cancel); QVBoxLayout* vbox = new QVBoxLayout(this);
QWidget* page = new QWidget;
setMainWidget(page);
QVBoxLayout* vbox = new QVBoxLayout(page);
vbox->setSpacing(spacingHint());
QGroupBox* g1 = new QGroupBox(linesOnly ? QString("") : i18n("Lines")); QGroupBox* g1 = new QGroupBox(linesOnly ? QString("") : i18n("Lines"));
bg = new QButtonGroup(g1); bg = new QButtonGroup(g1);
QRadioButton* r; QRadioButton* r;
QLabel* l; QLabel* l;
QGridLayout* grid; QGridLayout* grid;
QHBoxLayout* hbox; QHBoxLayout* hbox;
if (linesOnly) if (linesOnly)
vbox->addWidget(g1); vbox->addWidget(g1);
else { else {
vbox->addLayout(hbox = new QHBoxLayout); vbox->addLayout(hbox = new QHBoxLayout);
skipping to change at line 107 skipping to change at line 104
} }
g1->setLayout(grid = new QGridLayout); g1->setLayout(grid = new QGridLayout);
for (int i = 1; i < 10; i++) { for (int i = 1; i < 10; i++) {
grid->addWidget(r = new QRadioButton(QString::number(i)), i - 1, 1); grid->addWidget(r = new QRadioButton(QString::number(i)), i - 1, 1);
bg->addButton(r, i); bg->addButton(r, i);
grid->addWidget(l = new QLabel, i - 1, 0); grid->addWidget(l = new QLabel, i - 1, 0);
l->setPixmap(KplItem::pixmap(KplItem::Symbol(i))); l->setPixmap(KplItem::pixmap(KplItem::Symbol(i)));
} }
int i = sb->value(); int i = sb->value();
bg->button((i < 1) ? i - 2 : i)->setChecked(true); bg->button((i < 1) ? i - 2 : i)->setChecked(true);
vbox->addWidget(buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
QDialogButtonBox::Cancel));
connect(buttonBox, SIGNAL(clicked(QAbstractButton*)),
SLOT(slotButtonClicked(QAbstractButton*)));
} }
SymbolDlg::~SymbolDlg() SymbolDlg::~SymbolDlg()
{ {
} }
void SymbolDlg::slotButtonClicked(int button) void SymbolDlg::slotButtonClicked(QAbstractButton* button)
{ {
switch (button) { int id = buttonBox->standardButton(button);
case Ok: { switch (id) {
case QDialogButtonBox::Ok: {
int i = bg->checkedId(); int i = bg->checkedId();
sb->setValue((i < 0) ? i + 2 : i); sb->setValue((i < 0) ? i + 2 : i);
accept(); accept();
} }
default: case QDialogButtonBox::Cancel:
KDialog::slotButtonClicked(button); reject();
} }
} }
 End of changes. 8 change blocks. 
14 lines changed or deleted 16 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS