Esempio n. 1
0
Konfigurator::Konfigurator(bool f, int startPage) : KPageDialog((QWidget *)0),
        firstTime(f), internalCall(false), sizeX(-1), sizeY(-1)
{
    setWindowTitle(i18n("Konfigurator - Creating Your Own Krusader"));
    setWindowModality(Qt::ApplicationModal);
    setFaceType(KPageDialog::List);

    setStandardButtons(QDialogButtonBox::Help|QDialogButtonBox::RestoreDefaults|QDialogButtonBox::Close|
                       QDialogButtonBox::Apply|QDialogButtonBox::Reset);
    button(QDialogButtonBox::Apply)->setDefault(true);

    connect(button(QDialogButtonBox::Close), SIGNAL(clicked()), SLOT(slotClose()));
    connect(button(QDialogButtonBox::Help), SIGNAL(clicked()), SLOT(slotShowHelp()));
    connect(button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked()), SLOT(slotRestoreDefaults()));
    connect(button(QDialogButtonBox::Reset), SIGNAL(clicked()), SLOT(slotReset()));
    connect(button(QDialogButtonBox::Apply), SIGNAL(clicked()), SLOT(slotApply()));
    connect(this, SIGNAL(currentPageChanged(KPageWidgetItem *, KPageWidgetItem *)), this, SLOT(slotPageSwitch(KPageWidgetItem *, KPageWidgetItem *)));
    connect(&restoreTimer, SIGNAL(timeout()), this, SLOT(slotRestorePage()));

    createLayout(startPage);

    KConfigGroup group(krConfig, "Konfigurator");
    int sx = group.readEntry("Window Width", -1);
    int sy = group.readEntry("Window Height", -1);

    if (sx != -1 && sy != -1)
        resize(sx, sy);
    else
        resize(900, 680);

    if (group.readEntry("Window Maximized",  false))
        showMaximized();
    else
        show();
}
Esempio n. 2
0
Preferences::Preferences(QWidget *parent)
    : QDialog(parent),
    m_numOctaves(DEFAULTNUMBEROFOCTAVES),
    m_drumsChannel(MIDIGMDRUMSCHANNEL),
    m_networkPort(NETWORKPORTNUMBER),
    m_grabKb(false),
    m_styledKnobs(true),
    m_alwaysOnTop(false),
    m_rawKeyboard(false),
    m_velocityColor(true)
{
    ui.setupUi( this );
    ui.txtFileInstrument->setText(QSTR_DEFAULT);
    ui.txtFileKmap->setText(QSTR_DEFAULT);
    ui.txtFileRawKmap->setText(QSTR_DEFAULT);
    m_keymap.setRawMode(false);
    m_rawmap.setRawMode(true);
    restoreDefaults();
    connect(ui.btnInstrument, SIGNAL(clicked()), SLOT(slotOpenInstrumentFile()));
    connect(ui.btnColor, SIGNAL(clicked()), SLOT(slotSelectColor()));
    connect(ui.btnKmap, SIGNAL(clicked()), SLOT(slotOpenKeymapFile()));
    connect(ui.btnRawKmap, SIGNAL(clicked()), SLOT(slotOpenRawKeymapFile()));
    QPushButton *btnDefaults = ui.buttonBox->button(QDialogButtonBox::RestoreDefaults);
    connect(btnDefaults, SIGNAL(clicked()), SLOT(slotRestoreDefaults()));
#if !defined(RAWKBD_SUPPORT)
    ui.chkRawKeyboard->setVisible(false);
    ui.lblRawKmap->setVisible(false);
    ui.txtFileRawKmap->setVisible(false);
    ui.btnRawKmap->setVisible(false);
#endif
#if !defined(NETWORK_MIDI)
    ui.lblNetworkPort->setVisible(false);
    ui.txtNetworkPort->setVisible(false);
#endif
#if defined(SMALL_SCREEN)
    ui.chkRawKeyboard->setVisible(false);
    ui.lblRawKmap->setVisible(false);
    ui.txtFileRawKmap->setVisible(false);
    ui.btnRawKmap->setVisible(false);
    ui.lblKmap->setVisible(false);
    ui.txtFileKmap->setVisible(false);
    ui.btnKmap->setVisible(false);
    ui.chkAlwaysOnTop->setVisible(false);
    ui.chkGrabKb->setVisible(false);
    setWindowState(Qt::WindowActive | Qt::WindowMaximized);
#else
    setMinimumSize(480,320);
    adjustSize();
#endif
}
Esempio n. 3
0
Preferences::Preferences(QWidget *parent)
    : QDialog(parent),
    m_numOctaves(5),
    m_drumsChannel(MIDIGMDRUMSCHANNEL),
    m_grabKb(false),
    m_styledKnobs(true),
    m_alwaysOnTop(false),
    m_rawKeyboard(false)
{
    ui.setupUi( this );
    ui.txtFileInstrument->setText(QSTR_DEFAULT);
    ui.txtFileKmap->setText(QSTR_DEFAULT);
    ui.txtFileRawKmap->setText(QSTR_DEFAULT);
    m_keymap.setRawMode(false);
    m_rawmap.setRawMode(true);
    restoreDefaults();
    connect(ui.btnInstrument, SIGNAL(clicked()), SLOT(slotOpenInstrumentFile()));
    connect(ui.btnColor, SIGNAL(clicked()), SLOT(slotSelectColor()));
    connect(ui.btnKmap, SIGNAL(clicked()), SLOT(slotOpenKeymapFile()));
    connect(ui.btnRawKmap, SIGNAL(clicked()), SLOT(slotOpenRawKeymapFile()));
    QPushButton *btnDefaults = ui.buttonBox->button(QDialogButtonBox::RestoreDefaults);
    connect(btnDefaults, SIGNAL(clicked()), SLOT(slotRestoreDefaults()));
}
Esempio n. 4
0
Prefs::Prefs (QWidget * parent, OPTIONS *op, MISC *mi):
  QDialog (parent, (Qt::WindowFlags) Qt::WA_DeleteOnClose)
{
  options = op;
  misc = mi;

  mod_options = *op;
  mod_misc = *mi;

  setModal (TRUE);

  dataChanged = NVFalse;


  setWindowTitle (tr ("mosaicView Preferences"));


  QVBoxLayout *vbox = new QVBoxLayout (this);
  vbox->setMargin (5);
  vbox->setSpacing (5);

  QGroupBox *fbox = new QGroupBox (tr ("Position Format"), this);
  fbox->setWhatsThis (bGrpText);

  QRadioButton *hdms = new QRadioButton (tr ("Hemisphere Degrees Minutes Seconds.decimal"));
  QRadioButton *hdm_ = new QRadioButton (tr ("Hemisphere Degrees Minutes.decimal"));
  QRadioButton *hd__ = new QRadioButton (tr ("Hemisphere Degrees.decimal"));
  QRadioButton *sdms = new QRadioButton (tr ("+/-Degrees Minutes Seconds.decimal"));
  QRadioButton *sdm_ = new QRadioButton (tr ("+/-Degrees Minutes.decimal"));
  QRadioButton *sd__ = new QRadioButton (tr ("+/-Degrees.decimal"));

  bGrp = new QButtonGroup (this);
  bGrp->setExclusive (TRUE);
  connect (bGrp, SIGNAL (buttonClicked (int)), this, SLOT (slotPositionClicked (int)));

  bGrp->addButton (hdms, 0);
  bGrp->addButton (hdm_, 1);
  bGrp->addButton (hd__, 2);
  bGrp->addButton (sdms, 3);
  bGrp->addButton (sdm_, 4);
  bGrp->addButton (sd__, 5);

  QHBoxLayout *fboxSplit = new QHBoxLayout;
  QVBoxLayout *fboxLeft = new QVBoxLayout;
  QVBoxLayout *fboxRight = new QVBoxLayout;
  fboxSplit->addLayout (fboxLeft);
  fboxSplit->addLayout (fboxRight);
  fboxLeft->addWidget (hdms);
  fboxLeft->addWidget (hdm_);
  fboxLeft->addWidget (hd__);
  fboxRight->addWidget (sdms);
  fboxRight->addWidget (sdm_);
  fboxRight->addWidget (sd__);
  fbox->setLayout (fboxSplit);

  vbox->addWidget (fbox, 1);


  QGroupBox *miscBox = new QGroupBox (tr ("Miscellaneous"), this);
  QHBoxLayout *miscBoxLayout = new QHBoxLayout;
  miscBox->setLayout (miscBoxLayout);


  QGroupBox *zoomBox = new QGroupBox (tr ("Zoom percentage"), this);
  QHBoxLayout *zoomBoxLayout = new QHBoxLayout;
  zoomBox->setLayout (zoomBoxLayout);
  zoomPercent = new QSpinBox (zoomBox);
  zoomPercent->setRange (10, 50);
  zoomPercent->setSingleStep (5);
  zoomPercent->setToolTip (tr ("Change the zoom in/out percentage (10-50)"));
  zoomPercent->setWhatsThis (zoomPercentText);
  zoomBoxLayout->addWidget (zoomPercent);
  miscBoxLayout->addWidget (zoomBox);


  QGroupBox *featureBox = new QGroupBox (tr ("Feature Circle Diameter"), this);
  QHBoxLayout *featureBoxLayout = new QHBoxLayout;
  featureBox->setLayout (featureBoxLayout);
  featureDiameter = new QLineEdit (featureBox);
  featureDiameter->setToolTip (tr ("Change the add feature circle diameter (meters)"));
  featureDiameter->setWhatsThis (featureDiameterText);
  featureBoxLayout->addWidget (featureDiameter);
  miscBoxLayout->addWidget (featureBox);


  QGroupBox *textSearchBox = new QGroupBox (tr ("Feature search string"), this);
  QHBoxLayout *textSearchBoxLayout = new QHBoxLayout;
  textSearchBox->setLayout (textSearchBoxLayout);
  textSearch = new QLineEdit (textSearchBox);
  textSearch->setToolTip (tr ("Highlight features based on text search"));
  textSearch->setWhatsThis (textSearchText);
  textSearchBoxLayout->addWidget (textSearch);
  miscBoxLayout->addWidget (textSearchBox);


  vbox->addWidget (miscBox);


  QGroupBox *cbox = new QGroupBox (tr ("Colors"), this);
  QVBoxLayout *cboxLayout = new QVBoxLayout;
  cbox->setLayout (cboxLayout);
  QHBoxLayout *cboxTopLayout = new QHBoxLayout;
  QHBoxLayout *cboxBottomLayout = new QHBoxLayout;
  cboxLayout->addLayout (cboxTopLayout);
  cboxLayout->addLayout (cboxBottomLayout);


  bMarkerColor = new QPushButton (tr ("Marker"), this);
  bMarkerColor->setToolTip (tr ("Change marker color"));
  bMarkerColor->setWhatsThis (markerColorText);
  bMarkerPalette = bMarkerColor->palette ();
  connect (bMarkerColor, SIGNAL (clicked ()), this, SLOT (slotMarkerColor ()));
  cboxTopLayout->addWidget (bMarkerColor);


  bCoastColor = new QPushButton (tr ("Coast"), this);
  bCoastColor->setToolTip (tr ("Change coastline color"));
  bCoastColor->setWhatsThis (coastColorText);
  bCoastPalette = bCoastColor->palette ();
  connect (bCoastColor, SIGNAL (clicked ()), this, SLOT (slotCoastColor ()));
  cboxBottomLayout->addWidget (bCoastColor);


  bLandmaskColor = new QPushButton (tr ("Landmask"), this);
  bLandmaskColor->setToolTip (tr ("Change landmask color"));
  bLandmaskColor->setWhatsThis (landmaskColorText);
  bLandmaskPalette = bLandmaskColor->palette ();
  connect (bLandmaskColor, SIGNAL (clicked ()), this, SLOT (slotLandmaskColor ()));
  cboxTopLayout->addWidget (bLandmaskColor);


  bRectColor = new QPushButton (tr ("Zoom box"), this);
  bRectColor->setToolTip (tr ("Change zomm rectangle color"));
  bRectColor->setWhatsThis (rectColorText);
  bRectPalette = bRectColor->palette ();
  connect (bRectColor, SIGNAL (clicked ()), this, SLOT (slotRectColor ()));
  cboxBottomLayout->addWidget (bRectColor);


  bFeatureColor = new QPushButton (tr ("Feature"), this);
  bFeatureColor->setToolTip (tr ("Change feature color"));
  bFeatureColor->setWhatsThis (featureColorText);
  bFeaturePalette = bFeatureColor->palette ();
  connect (bFeatureColor, SIGNAL (clicked ()), this, SLOT (slotFeatureColor ()));
  cboxTopLayout->addWidget (bFeatureColor);


  bFeatureInfoColor = new QPushButton (tr ("Feature information"), this);
  bFeatureInfoColor->setToolTip (tr ("Change feature information text color"));
  bFeatureInfoColor->setWhatsThis (featureInfoColorText);
  bFeatureInfoPalette = bFeatureInfoColor->palette ();
  connect (bFeatureInfoColor, SIGNAL (clicked ()), this, SLOT (slotFeatureInfoColor ()));
  cboxBottomLayout->addWidget (bFeatureInfoColor);


  bFeaturePolyColor = new QPushButton (tr ("Feature polygon"), this);
  bFeaturePolyColor->setToolTip (tr ("Change feature polygonal area color"));
  bFeaturePolyColor->setWhatsThis (featurePolyColorText);
  bFeaturePolyPalette = bFeaturePolyColor->palette ();
  connect (bFeaturePolyColor, SIGNAL (clicked ()), this, SLOT (slotFeaturePolyColor ()));
  cboxTopLayout->addWidget (bFeaturePolyColor);


  bHighlightColor = new QPushButton (tr ("Highlight"), this);
  bHighlightColor->setToolTip (tr ("Change feature highlight color"));
  bHighlightColor->setWhatsThis (highlightColorText);
  bHighlightPalette = bHighlightColor->palette ();
  connect (bHighlightColor, SIGNAL (clicked ()), this, SLOT (slotHighlightColor ()));
  cboxBottomLayout->addWidget (bHighlightColor);


  vbox->addWidget (cbox, 1);


  QGroupBox *mBox = new QGroupBox (tr ("Display startup message"), this);
  QHBoxLayout *mBoxLayout = new QHBoxLayout;
  mBox->setLayout (mBoxLayout);
  sMessage = new QCheckBox (mBox);
  sMessage->setToolTip (tr ("Toggle display of startup message when program starts"));
  mBoxLayout->addWidget (sMessage);


  vbox->addWidget (mBox, 1);


  setFields ();


  QHBoxLayout *actions = new QHBoxLayout (0);
  vbox->addLayout (actions);

  QPushButton *bHelp = new QPushButton (this);
  bHelp->setIcon (QIcon (":/icons/contextHelp.xpm"));
  bHelp->setToolTip (tr ("Enter What's This mode for help"));
  connect (bHelp, SIGNAL (clicked ()), this, SLOT (slotHelp ()));
  actions->addWidget (bHelp);

  actions->addStretch (10);

  bRestoreDefaults = new QPushButton (tr ("Restore Defaults"), this);
  bRestoreDefaults->setToolTip (tr ("Restore all preferences to the default state"));
  bRestoreDefaults->setWhatsThis (restoreDefaultsText);
  connect (bRestoreDefaults, SIGNAL (clicked ()), this, SLOT (slotRestoreDefaults ()));
  actions->addWidget (bRestoreDefaults);

  QPushButton *applyButton = new QPushButton (tr ("OK"), this);
  applyButton->setToolTip (tr ("Accept changes and close dialog"));
  applyButton->setWhatsThis (applyPrefsText);
  connect (applyButton, SIGNAL (clicked ()), this, SLOT (slotApplyPrefs ()));
  actions->addWidget (applyButton);

  QPushButton *closeButton = new QPushButton (tr ("Cancel"), this);
  closeButton->setToolTip (tr ("Discard changes and close dialog"));
  closeButton->setWhatsThis (closePrefsText);
  connect (closeButton, SIGNAL (clicked ()), this, SLOT (slotClosePrefs ()));
  actions->addWidget (closeButton);


  show ();
}
Esempio n. 5
0
Prefs::Prefs (QWidget * parent, OPTIONS *op, MISC *mi):
  QDialog (parent, (Qt::WindowFlags) Qt::WA_DeleteOnClose)
{
  options = op;
  mod_options = *options;
  misc = mi;
  dataChanged = NVFalse;


  setWindowTitle (tr ("areaCheck preferences"));


  QVBoxLayout *vbox = new QVBoxLayout (this);
  vbox->setMargin (5);
  vbox->setSpacing (5);


  QGroupBox *fbox = new QGroupBox (tr ("Position Format"), this);
  fbox->setWhatsThis (bGrpText);

  QRadioButton *hdms = new QRadioButton (tr ("Hemisphere Degrees Minutes Seconds.decimal"));
  QRadioButton *hdm_ = new QRadioButton (tr ("Hemisphere Degrees Minutes.decimal"));
  QRadioButton *hd__ = new QRadioButton (tr ("Hemisphere Degrees.decimal"));
  QRadioButton *sdms = new QRadioButton (tr ("+/-Degrees Minutes Seconds.decimal"));
  QRadioButton *sdm_ = new QRadioButton (tr ("+/-Degrees Minutes.decimal"));
  QRadioButton *sd__ = new QRadioButton (tr ("+/-Degrees.decimal"));

  bGrp = new QButtonGroup (this);
  bGrp->setExclusive (TRUE);
  connect (bGrp, SIGNAL (buttonClicked (int)), this, SLOT (slotPositionClicked (int)));

  bGrp->addButton (hdms, 0);
  bGrp->addButton (hdm_, 1);
  bGrp->addButton (hd__, 2);
  bGrp->addButton (sdms, 3);
  bGrp->addButton (sdm_, 4);
  bGrp->addButton (sd__, 5);

  QHBoxLayout *fboxSplit = new QHBoxLayout;
  QVBoxLayout *fboxLeft = new QVBoxLayout;
  QVBoxLayout *fboxRight = new QVBoxLayout;
  fboxSplit->addLayout (fboxLeft);
  fboxSplit->addLayout (fboxRight);
  fboxLeft->addWidget (hdms);
  fboxLeft->addWidget (hdm_);
  fboxLeft->addWidget (hd__);
  fboxRight->addWidget (sdms);
  fboxRight->addWidget (sdm_);
  fboxRight->addWidget (sd__);
  fbox->setLayout (fboxSplit);

  vbox->addWidget (fbox, 1);


  QGroupBox *cbox = new QGroupBox (tr ("Colors"), this);
  QHBoxLayout *cboxSplit = new QHBoxLayout;
  cbox->setLayout (cboxSplit);
  QVBoxLayout *cboxLeft = new QVBoxLayout;
  QVBoxLayout *cboxRight = new QVBoxLayout;
  cboxSplit->addLayout (cboxLeft);
  cboxSplit->addLayout (cboxRight);


  bCoastColor = new QPushButton (tr ("Coast"), this);
  bCoastPalette = bCoastColor->palette ();
  bCoastColor->setToolTip (tr ("Change coastline color"));
  bCoastColor->setWhatsThis (coastColorText);
  connect (bCoastColor, SIGNAL (clicked ()), this, SLOT (slotCoastColor ()));
  cboxLeft->addWidget (bCoastColor);


  bMaskColor = new QPushButton (tr ("Landmask"), this);
  bMaskPalette = bMaskColor->palette ();
  bMaskColor->setToolTip (tr ("Change landmask color"));
  bMaskColor->setWhatsThis (maskColorText);
  connect (bMaskColor, SIGNAL (clicked ()), this, SLOT (slotMaskColor ()));
  cboxLeft->addWidget (bMaskColor);


  bBackgroundColor = new QPushButton (tr ("Background"), this);
  bBackgroundPalette = bBackgroundColor->palette ();
  bBackgroundColor->setToolTip (tr ("Change display background color"));
  bBackgroundColor->setWhatsThis (backgroundColorText);
  connect (bBackgroundColor, SIGNAL (clicked ()), this, SLOT (slotBackgroundColor ()));
  cboxRight->addWidget (bBackgroundColor);


  bHighlightColor = new QPushButton (tr ("Highlight"), this);
  bHighlightPalette = bHighlightColor->palette ();
  bHighlightColor->setToolTip (tr ("Change highlight color"));
  bHighlightColor->setWhatsThis (highlightColorText);
  connect (bHighlightColor, SIGNAL (clicked ()), this, SLOT (slotHighlightColor ()));
  cboxRight->addWidget (bHighlightColor);


  vbox->addWidget (cbox, 1);


  QGroupBox *c2box = new QGroupBox (tr ("Data Type Colors"), this);
  c2box->setWhatsThis (colorGrpText);

  c2[0] = new QPushButton (misc->type_name[ISS60_AREA], this);
  c2Palette[0] = c2[0]->palette ();
  c2[1] = new QPushButton (misc->type_name[GENERIC_AREA], this);
  c2Palette[1] = c2[1]->palette ();
  c2[2] = new QPushButton (misc->type_name[ACE_AREA], this);
  c2Palette[2] = c2[2]->palette ();
  c2[3] = new QPushButton (misc->type_name[ISS60_ZONE], this);
  c2Palette[3] = c2[3]->palette ();
  c2[4] = new QPushButton (misc->type_name[GENERIC_ZONE], this);
  c2Palette[4] = c2[4]->palette ();
  c2[5] = new QPushButton (misc->type_name[SHAPE], this);
  c2Palette[5] = c2[5]->palette ();
  c2[6] = new QPushButton (misc->type_name[TRACK], this);
  c2Palette[6] = c2[6]->palette ();
  c2[7] = new QPushButton (misc->type_name[FEATURE], this);
  c2Palette[7] = c2[7]->palette ();
  c2[8] = new QPushButton (misc->type_name[YXZ], this);
  c2Palette[8] = c2[8]->palette ();
  c2[9] = new QPushButton (misc->type_name[LLZ_DATA], this);
  c2Palette[9] = c2[9]->palette ();
  c2[10] = new QPushButton (misc->type_name[GEOTIFF], this);
  c2Palette[10] = c2[10]->palette ();
  c2[11] = new QPushButton (misc->type_name[CHRTR], this);
  c2Palette[11] = c2[11]->palette ();
  c2[12] = new QPushButton (misc->type_name[BAG], this);
  c2Palette[12] = c2[12]->palette ();
  c2[13] = new QPushButton (misc->type_name[OPTECH_FLT], this);
  c2Palette[13] = c2[13]->palette ();


  colorGrp = new QButtonGroup (c2box);
  colorGrp->setExclusive (FALSE);
  connect (colorGrp, SIGNAL (buttonClicked (int)), this, SLOT (slotColor (int)));

  colorGrp->addButton (c2[0], ISS60_AREA);
  colorGrp->addButton (c2[1], GENERIC_AREA);
  colorGrp->addButton (c2[2], ACE_AREA);
  colorGrp->addButton (c2[3], ISS60_ZONE);
  colorGrp->addButton (c2[4], GENERIC_ZONE);
  colorGrp->addButton (c2[5], SHAPE);
  colorGrp->addButton (c2[6], TRACK);
  colorGrp->addButton (c2[7], FEATURE);
  colorGrp->addButton (c2[8], YXZ);
  colorGrp->addButton (c2[9], LLZ_DATA);
  colorGrp->addButton (c2[10], GEOTIFF);
  colorGrp->addButton (c2[11], CHRTR);
  colorGrp->addButton (c2[12], BAG);
  colorGrp->addButton (c2[13], OPTECH_FLT);

  QHBoxLayout *c2boxSplit = new QHBoxLayout;
  QVBoxLayout *c2boxLeft = new QVBoxLayout;
  QVBoxLayout *c2boxRight = new QVBoxLayout;
  c2boxSplit->addLayout (c2boxLeft);
  c2boxSplit->addLayout (c2boxRight);
  c2boxLeft->addWidget (c2[0]);
  c2boxLeft->addWidget (c2[1]);
  c2boxLeft->addWidget (c2[2]);
  c2boxLeft->addWidget (c2[3]);
  c2boxLeft->addWidget (c2[4]);
  c2boxLeft->addWidget (c2[5]);
  c2boxLeft->addWidget (c2[6]);
  c2boxRight->addWidget (c2[7]);
  c2boxRight->addWidget (c2[8]);
  c2boxRight->addWidget (c2[9]);
  c2boxRight->addWidget (c2[10]);
  c2boxRight->addWidget (c2[11]);
  c2boxRight->addWidget (c2[12]);
  c2boxRight->addWidget (c2[13]);
  c2box->setLayout (c2boxSplit);

  vbox->addWidget (c2box, 1);


  QGroupBox *sunBox = new QGroupBox (tr ("CHRTR/BAG Sun Shading"), this);
  QHBoxLayout *sunBoxLayout = new QHBoxLayout;
  sunBox->setLayout (sunBoxLayout);

  QGroupBox *angBox = new QGroupBox (tr ("Angle"), this);
  QHBoxLayout *angBoxLayout = new QHBoxLayout;
  angBox->setLayout (angBoxLayout);
  sunAz = new QDoubleSpinBox (angBox);
  sunAz->setDecimals (1);
  sunAz->setRange (0.0, 359.9);
  sunAz->setSingleStep (1.0);
  sunAz->setValue (mod_options.sunopts.azimuth);
  sunAz->setWrapping (TRUE);
  sunAz->setToolTip (tr ("Change the sun angle (0.0-360.0)"));
  sunAz->setWhatsThis (sunAzText);
  angBoxLayout->addWidget (sunAz);
  sunBoxLayout->addWidget (angBox);


  QGroupBox *eleBox = new QGroupBox (tr ("Elevation"), this);
  QHBoxLayout *eleBoxLayout = new QHBoxLayout;
  eleBox->setLayout (eleBoxLayout);
  sunEl = new QDoubleSpinBox (eleBox);
  sunEl->setDecimals (1);
  sunEl->setRange (0.0, 90.0);
  sunEl->setSingleStep (1.0);
  sunEl->setValue (mod_options.sunopts.elevation);
  sunEl->setWrapping (TRUE);
  sunEl->setToolTip (tr ("Change the sun elevation (0.0-90.0)"));
  sunEl->setWhatsThis (sunElText);
  eleBoxLayout->addWidget (sunEl);
  sunBoxLayout->addWidget (eleBox);


  QGroupBox *exaBox = new QGroupBox (tr ("Exaggeration"), this);
  QHBoxLayout *exaBoxLayout = new QHBoxLayout;
  exaBox->setLayout (exaBoxLayout);
  sunEx = new QDoubleSpinBox (exaBox);
  sunEx->setDecimals (1);
  sunEx->setRange (0.0, 359.9);
  sunEx->setSingleStep (1.0);
  sunEx->setValue (mod_options.sunopts.exag);
  sunEx->setWrapping (TRUE);
  sunEx->setToolTip (tr ("Change the sun Z exaggeration (1-10)"));
  sunEx->setWhatsThis (sunExText);
  exaBoxLayout->addWidget (sunEx);
  sunBoxLayout->addWidget (exaBox);


  vbox->addWidget (sunBox, 1);


  QGroupBox *mbox = new QGroupBox (tr ("MINMAX parameters"), this);
  mbox->setWhatsThis (colorGrpText);
  QHBoxLayout *mboxLayout = new QHBoxLayout;
  mbox->setLayout (mboxLayout);

  QGroupBox *sBox = new QGroupBox (tr ("Use stoplight colors"), this);
  QHBoxLayout *sBoxLayout = new QHBoxLayout;
  sBox->setLayout (sBoxLayout);
  stopLight = new QCheckBox (this);
  connect (stopLight, SIGNAL (clicked ()), this, SLOT (slotStopLightClicked ()));
  stopLight->setToolTip (tr ("Use stoplight colors when displaying MINMAX .trk files"));
  stopLight->setWhatsThis (stopLightText);
  sBoxLayout->addWidget (stopLight);
  mboxLayout->addWidget (sBox);

  QGroupBox *gBox = new QGroupBox (tr ("Green to yellow value"), this);
  QHBoxLayout *gBoxLayout = new QHBoxLayout;
  gBox->setLayout (gBoxLayout);
  minStop = new QLineEdit (this);
  mboxLayout->addWidget (minStop);
  minStop->setToolTip (tr ("Set value below which data is green"));
  minStop->setWhatsThis (minStopText);
  gBoxLayout->addWidget (minStop);
  mboxLayout->addWidget (gBox);

  QGroupBox *yBox = new QGroupBox (tr ("Yellow to red value"), this);
  QHBoxLayout *yBoxLayout = new QHBoxLayout;
  yBox->setLayout (yBoxLayout);
  maxStop = new QLineEdit (this);
  mboxLayout->addWidget (maxStop);
  maxStop->setToolTip (tr ("Set value above which data is red"));
  maxStop->setWhatsThis (maxStopText);
  yBoxLayout->addWidget (maxStop);
  mboxLayout->addWidget (yBox);


  vbox->addWidget (mbox, 1);


  setFields ();


  QHBoxLayout *actions = new QHBoxLayout (0);
  vbox->addLayout (actions);

  QPushButton *bHelp = new QPushButton (this);
  bHelp->setIcon (QIcon (":/icons/contextHelp.xpm"));
  bHelp->setToolTip (tr ("Enter What's This mode for help"));
  connect (bHelp, SIGNAL (clicked ()), this, SLOT (slotHelp ()));
  actions->addWidget (bHelp);

  actions->addStretch (10);

  bRestoreDefaults = new QPushButton (tr ("Restore Defaults"), this);
  bRestoreDefaults->setToolTip (tr ("Restore all preferences to the default state"));
  bRestoreDefaults->setWhatsThis (restoreDefaultsText);
  connect (bRestoreDefaults, SIGNAL (clicked ()), this, SLOT (slotRestoreDefaults ()));
  actions->addWidget (bRestoreDefaults);

  QPushButton *applyButton = new QPushButton (tr ("OK"), this);
  applyButton->setToolTip (tr ("Accept changes and close dialog"));
  applyButton->setWhatsThis (applyPrefsText);
  connect (applyButton, SIGNAL (clicked ()), this, SLOT (slotApplyPrefs ()));
  actions->addWidget (applyButton);

  QPushButton *closeButton = new QPushButton (tr ("Cancel"), this);
  closeButton->setToolTip (tr ("Discard changes and close dialog"));
  closeButton->setWhatsThis (closePrefsText);
  connect (closeButton, SIGNAL (clicked ()), this, SLOT (slotClosePrefs ()));
  actions->addWidget (closeButton);


  show ();
}
Esempio n. 6
0
Preferences::Preferences(QWidget *parent)
    : QDialog(parent),
    m_numOctaves(DEFAULTNUMBEROFOCTAVES),
    m_drumsChannel(MIDIGMDRUMSCHANNEL),
    m_networkPort(NETWORKPORTNUMBER),
    m_grabKb(false),
    m_styledKnobs(true),
    m_alwaysOnTop(false),
    m_rawKeyboard(false),
    m_velocityColor(true),
    m_enforceChannelState(false),
    m_enableKeyboard(true),
    m_enableMouse(true),
    m_enableTouch(true),
    m_colorDialog(0)
{
    ui.setupUi( this );
    ui.txtFileInstrument->setText(QSTR_DEFAULT);
    ui.txtFileKmap->setText(QSTR_DEFAULT);
    ui.txtFileRawKmap->setText(QSTR_DEFAULT);
    m_keymap.setRawMode(false);
    m_rawmap.setRawMode(true);
    restoreDefaults();
    connect(ui.btnInstrument, SIGNAL(clicked()), SLOT(slotOpenInstrumentFile()));
    connect(ui.btnColor, SIGNAL(clicked()), SLOT(slotSelectColor()));
    connect(ui.btnKmap, SIGNAL(clicked()), SLOT(slotOpenKeymapFile()));
    connect(ui.btnRawKmap, SIGNAL(clicked()), SLOT(slotOpenRawKeymapFile()));
    QPushButton *btnDefaults = ui.buttonBox->button(QDialogButtonBox::RestoreDefaults);
    connect(btnDefaults, SIGNAL(clicked()), SLOT(slotRestoreDefaults()));

    ui.cboMIDIDriver->clear();
#if defined(__LINUX_ALSASEQ__)
    ui.cboMIDIDriver->addItem(QSTR_DRIVERNAMEALSA);
#endif
#if defined(__LINUX_JACK__)
    ui.cboMIDIDriver->addItem(QSTR_DRIVERNAMEJACK);
#endif
#if defined(__MACOSX_CORE__)
    ui.cboMIDIDriver->addItem(QSTR_DRIVERNAMEMACOSX);
#endif
#if defined(__IRIX_MD__)
    ui.cboMIDIDriver->addItem(QSTR_DRIVERNAMEIRIX);
#endif
#if defined(__WINDOWS_MM__)
    ui.cboMIDIDriver->addItem(QSTR_DRIVERNAMEWINMM);
#endif
#if defined(NETWORK_MIDI)
    ui.cboMIDIDriver->addItem(QSTR_DRIVERNAMENET);
#endif

#if !defined(RAWKBD_SUPPORT)
    ui.chkRawKeyboard->setVisible(false);
    ui.lblRawKmap->setVisible(false);
    ui.txtFileRawKmap->setVisible(false);
    ui.btnRawKmap->setVisible(false);
#endif
#if !defined(NETWORK_MIDI)
    ui.lblNetworkPort->setVisible(false);
    ui.txtNetworkPort->setVisible(false);
    ui.lblNetworkIface->setVisible(false);
    ui.cboNetworkIface->setVisible(false);
#else
    ui.cboNetworkIface->clear();
    ui.cboNetworkIface->addItem(QString());
    foreach ( const QNetworkInterface& iface,
              QNetworkInterface::allInterfaces()) {
        if (iface.flags().testFlag(QNetworkInterface::CanMulticast) &&
            !iface.flags().testFlag(QNetworkInterface::IsLoopBack))
            ui.cboNetworkIface->addItem(iface.humanReadableName(), iface.name());
    }
#endif
#if defined(SMALL_SCREEN)
    ui.chkRawKeyboard->setVisible(false);
    ui.lblRawKmap->setVisible(false);
    ui.txtFileRawKmap->setVisible(false);
    ui.btnRawKmap->setVisible(false);
    ui.lblKmap->setVisible(false);
    ui.txtFileKmap->setVisible(false);
    ui.btnKmap->setVisible(false);
    ui.chkAlwaysOnTop->setVisible(false);
    ui.chkGrabKb->setVisible(false);
    ui.chkEnableKeyboard->setVisible(false);
    setWindowState(Qt::WindowActive | Qt::WindowMaximized);
#else
    setMinimumSize(480,500);
    adjustSize();
#endif
}