Changeset e26679937d in tspsg for src/settingsdialog.cpp


Ignore:
Timestamp:
Sep 1, 2010, 8:31:16 PM (14 years ago)
Author:
Oleksii Serdiuk
Branches:
0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
Children:
ac76a6a753
Parents:
672e522ba2
git-author:
Oleksii Serdiuk <contacts@…> (09/01/10 20:31:16)
git-committer:
Oleksii Serdiuk <contacts@…> (06/29/12 19:45:57)
Message:

Added an option to select graph quality, because higher graph quality looked uglier on the screen while looked nicer when printing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/settingsdialog.cpp

    r672e522ba2 re26679937d  
    5555        p.setColor(QPalette::Window, p.color(QPalette::Text));
    5656        lineHorizontal->setPalette(p);
     57
     58#ifndef QT_NO_PRINTER
     59        cbHQGraph = new QCheckBox(bgWhite);
     60        cbHQGraph->setObjectName("cbHQGraph");
     61#ifndef QT_NO_STATUSTIP
     62        cbHQGraph->setStatusTip(tr("Higher quality graph looks much better when printing but uglier on the screen"));
     63#endif // QT_NO_STATUSTIP
     64        cbHQGraph->setText(tr("Draw solution graph in higher quality"));
     65        cbHQGraph->setCursor(QCursor(Qt::PointingHandCursor));
     66
     67QBoxLayout *box = static_cast<QBoxLayout *>(tabOutput->layout());
     68QHBoxLayout *hbox1 = new QHBoxLayout();
     69        hbox1->addSpacing(10);
     70        hbox1->addWidget(cbHQGraph);
     71        box->insertLayout(box->indexOf(cbShowGraph) + 1, hbox1);
     72        connect(cbShowGraph, SIGNAL(toggled(bool)), cbHQGraph, SLOT(setEnabled(bool)));
     73#endif
    5774
    5875#ifdef HANDHELD
     
    87104#else // HANDHELD
    88105        // Layout helper elements
    89 QVBoxLayout *vbox1, *vbox2;
    90 QHBoxLayout *hbox1;
     106QVBoxLayout *vbox;
     107QHBoxLayout *hbox;
    91108
    92109#ifdef Q_OS_WIN32
     
    139156
    140157        // Top line
    141         hbox1 = new QHBoxLayout();
    142         hbox1->addWidget(imgIcon);
    143         hbox1->addWidget(lineVertical);
    144         hbox1->addWidget(bgWhite);
    145 
    146         vbox1 = static_cast<QVBoxLayout *>(tabGeneral->layout());
    147         vbox1->insertWidget(vbox1->indexOf(cbUseNativeDialogs) + 1, cbSaveState);
     158        hbox = new QHBoxLayout();
     159        hbox->addWidget(imgIcon);
     160        hbox->addWidget(lineVertical);
     161        hbox->addWidget(bgWhite);
     162
     163#ifdef QT_NO_PRINTER
     164QBoxLayout *box;
     165#endif
     166        box = static_cast<QBoxLayout *>(tabGeneral->layout());
     167        box->insertWidget(box->indexOf(cbUseNativeDialogs) + 1, cbSaveState);
    148168#ifdef Q_OS_WIN32
    149169        if (QtWin::isCompositionEnabled())
    150                 vbox1->insertWidget(vbox1->indexOf(cbUseNativeDialogs) + 1, cbUseTranslucency);
     170                box->insertWidget(box->indexOf(cbUseNativeDialogs) + 1, cbUseTranslucency);
    151171#endif // Q_OS_WIN32
    152172
     
    155175
    156176        // Central layout
    157         vbox2 = new QVBoxLayout(this);
    158         vbox2->setMargin(0);
    159         vbox2->setSpacing(0);
    160         vbox2->addLayout(hbox1);
    161         vbox2->addWidget(bgGrey);
    162         setLayout(vbox2);
     177        vbox = new QVBoxLayout(this);
     178        vbox->setMargin(0);
     179        vbox->setSpacing(0);
     180        vbox->addLayout(hbox);
     181        vbox->addWidget(bgGrey);
     182        setLayout(vbox);
    163183#endif // HANDHELD
    164184
     
    167187        connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(desktopResized(int)));
    168188#endif // Q_OS_WINCE_WM
    169         connect(spinRandMin,SIGNAL(valueChanged(int)),this,SLOT(spinRandMinValueChanged(int)));
    170         connect(buttonFont,SIGNAL(clicked()),this,SLOT(buttonFontClicked()));
    171         connect(buttonColor,SIGNAL(clicked()),this,SLOT(buttonColorClicked()));
     189        connect(spinRandMin, SIGNAL(valueChanged(int)), SLOT(spinRandMinValueChanged(int)));
     190        connect(buttonFont, SIGNAL(clicked()), SLOT(buttonFontClicked()));
     191        connect(buttonColor, SIGNAL(clicked()), SLOT(buttonColorClicked()));
    172192        setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
    173193#ifndef HANDHELD
     
    201221        settings->beginGroup("Output");
    202222        cbShowGraph->setChecked(settings->value("ShowGraph", DEF_SHOW_GRAPH).toBool());
     223
     224#ifndef QT_NO_PRINTER
     225        cbHQGraph->setEnabled(cbShowGraph->isChecked());
     226        cbHQGraph->setChecked(settings->value("HQGraph", DEF_HQ_GRAPH && cbShowGraph->isChecked()).toBool());
     227#endif
    203228
    204229#if !defined(NOSVG) && (QT_VERSION >= 0x040500)
     
    311336        settings->beginGroup("Output");
    312337        settings->setValue("ShowGraph", cbShowGraph->isChecked());
     338#ifndef QT_NO_PRINTER
     339        settings->setValue("HQGraph", cbShowGraph->isChecked() && cbHQGraph->isChecked());
     340#endif
    313341        if (cbShowGraph->isChecked()) {
    314342                if (comboGraphImageFormat->currentIndex() >= 0)
Note: See TracChangeset for help on using the changeset viewer.