MySqlLogin::MySqlLogin(QString msg,QString *username,QString *password,
		       QWidget *parent)
  : QDialog(parent,"",true)
{
  setCaption(tr("mySQL Admin"));
  login_name=username;
  login_password=password;

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",10,QFont::Normal);
  font.setPixelSize(10);

  //
  // Message Label
  //
  RDLabel *label=new RDLabel(msg,this);
  label->setFont(font);
  label->setGeometry(10,10,sizeHint().width()-20,sizeHint().height()-130);
  label->setAlignment(AlignCenter);
  

  //
  // MySql Login Name
  //
  login_name_edit=new QLineEdit(this);
  login_name_edit->setFont(font);
  login_name_edit->setGeometry(100,sizeHint().height()-110,100,19);
  login_name_edit->setMaxLength(16);
  login_name_edit->setFocus();
  QLabel *login_name_label=new QLabel(login_name_edit,tr("User &Name:"),this);
  login_name_label->setFont(font);
  login_name_label->setGeometry(10,sizeHint().height()-109,85,19);
  login_name_label->setAlignment(AlignRight|ShowPrefix);

  //
  // MySql Login Password
  //
  login_password_edit=new QLineEdit(this);
  login_password_edit->setFont(font);
  login_password_edit->setGeometry(100,sizeHint().height()-90,100,19);
  login_password_edit->setMaxLength(16);
  login_password_edit->setEchoMode(QLineEdit::Password);
  QLabel *login_password_label=new QLabel(login_password_edit,tr("&Password:"******"&OK"));
  ok_button->setDefault(true);
  connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  // Cancel Button
  //
  QPushButton *cancel_button=new QPushButton(this);
  cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  cancel_button->setFont(font);
  cancel_button->setText(tr("&Cancel"));
  connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
}
Example #2
0
//***************************************************************************
QSize Kwave::AboutContainer::minimumSizeHint(void) const
{
    return sizeHint();
}
Example #3
0
void Popup::realign()
{
    adjustSize();
    setGeometry(mPlugin->calculatePopupWindowPos(sizeHint()));
}
QSize EditableLabelQt::minimumSizeHint() const { return sizeHint(); }
Example #5
0
/*!
    \reimp
    \since 4.8
*/
QSize QRadioButton::minimumSizeHint() const
{
    return sizeHint();
}
Example #6
0
FindDialog::FindDialog(Stack* documents)
	: QDialog(documents->window(), Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint),
	m_documents(documents)
{
	// Create widgets
	QLabel* find_label = new QLabel(tr("Search for:"), this);
	m_find_string = new QLineEdit(this);
	m_replace_label = new QLabel(tr("Replace with:"), this);
	m_replace_string = new QLineEdit(this);
	connect(m_find_string, SIGNAL(textChanged(QString)), this, SLOT(findChanged(QString)));

	m_ignore_case = new QCheckBox(tr("Ignore case"), this);
	m_whole_words = new QCheckBox(tr("Whole words only"), this);
	m_regular_expressions = new QCheckBox(tr("Regular expressions"), this);
	connect(m_regular_expressions, SIGNAL(toggled(bool)), m_whole_words, SLOT(setDisabled(bool)));

	m_search_backwards = new QRadioButton(tr("Search up"), this);
	QRadioButton* search_forwards = new QRadioButton(tr("Search down"), this);
	search_forwards->setChecked(true);

	// Create buttons
	QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, this);
	connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));

	m_find_button = buttons->addButton(tr("&Find"), QDialogButtonBox::ActionRole);
	m_find_button->setEnabled(false);
	connect(m_find_button, SIGNAL(clicked()), this, SLOT(find()));

	m_replace_button = buttons->addButton(tr("&Replace"), QDialogButtonBox::ActionRole);
	m_replace_button->setEnabled(false);
	connect(m_replace_button, SIGNAL(clicked()), this, SLOT(replace()));

	m_replace_all_button = buttons->addButton(tr("Replace &All"), QDialogButtonBox::ActionRole);
	m_replace_all_button->setEnabled(false);
	connect(m_replace_all_button, SIGNAL(clicked()), this, SLOT(replaceAll()));

	if (!buttons->button(QDialogButtonBox::Close)->icon().isNull()) {
		m_find_button->setIcon(QIcon::fromTheme("edit-find"));
		m_replace_button->setIcon(QIcon::fromTheme("edit-find-replace"));
	}

	// Lay out dialog
	QGridLayout* layout = new QGridLayout(this);
	layout->setColumnStretch(1, 1);
	layout->addWidget(find_label, 0, 0, Qt::AlignRight | Qt::AlignVCenter);
	layout->addWidget(m_find_string, 0, 1, 1, 2);
	layout->addWidget(m_replace_label, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
	layout->addWidget(m_replace_string, 1, 1, 1, 2);
	layout->addWidget(m_ignore_case, 2, 1);
	layout->addWidget(m_whole_words, 3, 1);
	layout->addWidget(m_regular_expressions, 4, 1);
	layout->addWidget(m_search_backwards, 2, 2);
	layout->addWidget(search_forwards, 3, 2);
	layout->addWidget(buttons, 5, 0, 1, 3);
	setFixedWidth(sizeHint().width());

	// Load settings
	QSettings settings;
	m_ignore_case->setChecked(!settings.value("FindDialog/CaseSensitive", false).toBool());
	m_whole_words->setChecked(settings.value("FindDialog/WholeWords", false).toBool());
	m_regular_expressions->setChecked(settings.value("FindDialog/RegularExpressions", false).toBool());
	m_search_backwards->setChecked(settings.value("FindDialog/SearchBackwards", false).toBool());

	m_find_string->installEventFilter(this);
	m_replace_string->installEventFilter(this);
}
CustomColorDialog::CustomColorDialog(QWidget *parent) : QFrame(parent )
{

    setFrameStyle(QFrame::NoFrame);
    setFrameShape(QFrame::StyledPanel);
    setFrameShadow(QFrame::Sunken);

    QGraphicsDropShadowEffect *dropShadowEffect = new QGraphicsDropShadowEffect;
    dropShadowEffect->setBlurRadius(6);
    dropShadowEffect->setOffset(2, 2);
    setGraphicsEffect(dropShadowEffect);
    setAutoFillBackground(true);

    m_hueControl = new HueControl(this);
    m_colorBox = new ColorBox(this);

    QWidget *colorFrameWidget = new QWidget(this);
    QVBoxLayout* vBox = new QVBoxLayout(colorFrameWidget);
    colorFrameWidget->setLayout(vBox);
    vBox->setSpacing(0);
    vBox->setMargin(0);
    vBox->setContentsMargins(0,5,0,28);

    m_beforeColorWidget = new QFrame(colorFrameWidget);
    m_beforeColorWidget->setFixedSize(30, 18);
    m_beforeColorWidget->setAutoFillBackground(true);

    m_currentColorWidget = new QFrame(colorFrameWidget);
    m_currentColorWidget->setFixedSize(30, 18);
    m_currentColorWidget->setAutoFillBackground(true);

    vBox->addWidget(m_beforeColorWidget);
    vBox->addWidget(m_currentColorWidget);


    m_rSpinBox = new QDoubleSpinBox(this);
    m_gSpinBox = new QDoubleSpinBox(this);
    m_bSpinBox = new QDoubleSpinBox(this);
    m_alphaSpinBox = new QDoubleSpinBox(this);

    QGridLayout *gridLayout = new QGridLayout(this);
    gridLayout->setSpacing(4);
    gridLayout->setVerticalSpacing(4);
    gridLayout->setMargin(4);
    setLayout(gridLayout);

    gridLayout->addWidget(m_colorBox, 0, 0, 4, 1);
    gridLayout->addWidget(m_hueControl, 0, 1, 4, 1);

    gridLayout->addWidget(colorFrameWidget, 0, 2, 2, 1);

    gridLayout->addWidget(new QLabel("R", this), 0, 3, 1, 1);
    gridLayout->addWidget(new QLabel("G", this), 1, 3, 1, 1);
    gridLayout->addWidget(new QLabel("B", this), 2, 3, 1, 1);
    gridLayout->addWidget(new QLabel("A", this), 3, 3, 1, 1);

    gridLayout->addWidget(m_rSpinBox, 0, 4, 1, 1);
    gridLayout->addWidget(m_gSpinBox, 1, 4, 1, 1);
    gridLayout->addWidget(m_bSpinBox, 2, 4, 1, 1);
    gridLayout->addWidget(m_alphaSpinBox, 3, 4, 1, 1);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(this);

    QPushButton *cancelButton = buttonBox->addButton(QDialogButtonBox::Cancel);
    QPushButton *applyButton = buttonBox->addButton(QDialogButtonBox::Apply);

    gridLayout->addWidget(buttonBox, 4, 0, 1, 2);

    resize(sizeHint());

    connect(m_colorBox, SIGNAL(colorChanged()), this, SLOT(onColorBoxChanged()));
    connect(m_alphaSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
    connect(m_rSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
    connect(m_gSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
    connect(m_bSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
    connect(m_hueControl, SIGNAL(hueChanged(int)), this, SLOT(onHueChanged(int)));

    connect(applyButton, SIGNAL(pressed()), this, SLOT(onAccept()));
    connect(cancelButton, SIGNAL(pressed()), this, SIGNAL(rejected()));

    m_alphaSpinBox->setMaximum(1);
    m_rSpinBox->setMaximum(1);
    m_gSpinBox->setMaximum(1);
    m_bSpinBox->setMaximum(1);
    m_alphaSpinBox->setSingleStep(0.1);
    m_rSpinBox->setSingleStep(0.1);
    m_gSpinBox->setSingleStep(0.1);
    m_bSpinBox->setSingleStep(0.1);

    m_blockUpdate = false;
}
Example #8
0
ListSvcs::ListSvcs(QWidget *parent,const char *name)
  : QDialog(parent,name,true)
{
  setCaption(tr("Rivendell Services"));

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());

  //
  // Create Fonts
  //
  QFont bold_font=QFont("Helvetica",12,QFont::Bold);
  bold_font.setPixelSize(12);
  QFont font=QFont("Helvetica",12,QFont::Normal);
  font.setPixelSize(12);

  //
  // Log List
  //
  list_log_list=new QListView(this,"list_log_list");
  list_log_list->setAllColumnsShowFocus(true);
  list_log_list->setItemMargin(5);
  list_log_list->addColumn(tr("SERVICE"));
  list_log_list->setColumnAlignment(0,Qt::AlignLeft);
  list_log_list->addColumn(tr("OLDEST REPORT"));
  list_log_list->setColumnAlignment(1,Qt::AlignCenter);
  connect(list_log_list,
	  SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),
	  this,
	  SLOT(listDoubleClickedData(QListViewItem *,const QPoint &,int)));

  //
  //  Generate Report Button
  //
  list_generate_button=new QPushButton(this,"list_generate_button");
  list_generate_button->setFont(bold_font);
  list_generate_button->setText(tr("&Generate\nReports"));
  connect(list_generate_button,SIGNAL(clicked()),this,SLOT(generateData()));

  //
  //  Purge Button
  //
  list_purge_button=new QPushButton(this,"list_purge_button");
  list_purge_button->setFont(bold_font);
  list_purge_button->setText(tr("&Purge\nData"));
  connect(list_purge_button,SIGNAL(clicked()),this,SLOT(purgeData()));

  //
  //  Close Button
  //
  list_close_button=new QPushButton(this,"close_button");
  list_close_button->setDefault(true);
  list_close_button->setFont(bold_font);
  list_close_button->setText(tr("C&lose"));
  connect(list_close_button,SIGNAL(clicked()),this,SLOT(closeData()));

  RefreshList();
}
Example #9
0
/*!
    \reimp
 */
QSize QToolButton::minimumSizeHint() const
{
    return sizeHint();
}
TimeLagSettingsDialog::TimeLagSettingsDialog(QWidget *parent, EcProject *ecProject, ConfigState* config) :
    QDialog(parent),
    ecProject_(ecProject),
    configState_(config)
{
    setWindowModality(Qt::WindowModal);
    setWindowTitle(tr("Time Lag Optimization Settings"));
    WidgetUtils::removeContextHelpButton(this);

    auto groupTitle = new QLabel;
    groupTitle->setText(tr("Configure smart time lag detection, "
                           "providing quality selection criteria and initial "
                           "time lag windows"));

    auto hrLabel = new QLabel;
    hrLabel->setObjectName(QStringLiteral("hrLabel"));

    existingRadio = new QRadioButton(tr("Time lag file available : "));
    existingRadio->setToolTip(tr("<b>Time lag file available:</b> If you have a satisfactory time lag assessment from a previous run and it applies to the current dataset, you can use it by providing the path to the file 'eddypro_timelag_opt_ID.txt' that was generated by EddyPro in the previous run and contains the results of the assessment. This will shorten program execution time and assure full comparability between the current and previous results."));

    nonExistingRadio = new QRadioButton(tr("Time lag file not available :"));
    nonExistingRadio->setToolTip(tr("<b>Time lag file not available:</b> Choose this option and provide the following information if you need to optimize time lags for your dataset. EddyPro will complete the time lag optimization first and then complete the raw data processing and flux computation procedures."));

    subsetCheckBox = new QCheckBox;
    subsetCheckBox->setProperty("subperiod", true);
    subsetCheckBox->setText(tr("Select a different period"));
    subsetCheckBox->setToolTip(tr("<b>Select a different period:</b> Select this option and set the corresponding dates, to identify the time period EddyPro will use for the Time lag optimization. This subperiod must fall within the time period defined by the available raw data."));

    startDateLabel = new ClickLabel(this);
    startDateLabel->setText(tr("Start :"));
    startDateLabel->setToolTip(tr("<b>Start:</b> Starting date of the time period to be used for time lag optimization. This time should not be shorter than about 1-2 months. As a general recommendation, select a time period during which the instrument setup did not undergo major modifications. Results obtained using a given time period (e.g., 2 months) can be used for processing a longer time period, in which major modifications did not occur in the setup. The stricter the threshold setup in this dialogue, the longer the period should be in order to get robust results."));
    startDateEdit = new QDateEdit;
    startDateEdit->setToolTip(startDateLabel->toolTip());
    startDateEdit->setCalendarPopup(true);
    WidgetUtils::customizeCalendar(startDateEdit->calendarWidget());

    startTimeEdit = new QTimeEdit;
    startTimeEdit->setDisplayFormat(QStringLiteral("hh:mm"));
    startTimeEdit->setAccelerated(true);

    lockedIcon = new QLabel;
    auto pixmap = QPixmap(QStringLiteral(":/icons/vlink-locked"));
#if defined(Q_OS_MAC)
    pixmap.setDevicePixelRatio(2.0);
#endif
    lockedIcon->setPixmap(pixmap);

    endDateLabel = new ClickLabel(this);
    endDateLabel->setText(tr("End :"));
    endDateLabel->setToolTip(tr("<b>End:</b> End date of the time period to be used for time lag optimization. This time should not be shorter than about 1-2 months As a general recommendation, select a time period during which the instrumental setup did not undergo major modifications. Results obtained using a given time period (e.g., 2 months) can be used for processing a longer time period, in which major modifications did not occur in the setup. The stricter the threshold setup in this dialogue, the longer the period should be in order to get robust results."));
    endDateEdit = new QDateEdit;
    endDateEdit->setToolTip(endDateLabel->toolTip());
    endDateEdit->setCalendarPopup(true);
    WidgetUtils::customizeCalendar(endDateEdit->calendarWidget());

    endTimeEdit = new QTimeEdit;
    endTimeEdit->setDisplayFormat(QStringLiteral("hh:mm"));
    endTimeEdit->setAccelerated(true);

    auto dateTimeContainer = new QGridLayout;
    dateTimeContainer->addWidget(startDateEdit, 0, 1);
    dateTimeContainer->addWidget(startTimeEdit, 0, 2);
    dateTimeContainer->addWidget(lockedIcon, 0, 0, 2, 1);
    dateTimeContainer->addWidget(endDateEdit, 1, 1);
    dateTimeContainer->addWidget(endTimeEdit, 1, 2);
    dateTimeContainer->setColumnStretch(1, 1);
    dateTimeContainer->setColumnStretch(2, 1);
    dateTimeContainer->setColumnStretch(3, 2);
    dateTimeContainer->setContentsMargins(0, 0, 0, 0);
    dateTimeContainer->setVerticalSpacing(3);

    fileBrowse = new FileBrowseWidget;
    fileBrowse->setToolTip(tr("<b>Load:</b> Load an existing time lag file"));
    fileBrowse->setDialogTitle(tr("Select the Time Lag Optimization File"));
    fileBrowse->setDialogWorkingDir(WidgetUtils::getSearchPathHint());
    fileBrowse->setDialogFilter(tr("All Files (*.*)"));

    auto existingFileLayout = new QHBoxLayout;
    existingFileLayout->addWidget(existingRadio);
    existingFileLayout->addWidget(fileBrowse);
    existingFileLayout->setStretch(2, 1);
    existingFileLayout->setContentsMargins(0, 0, 0, 0);
    existingFileLayout->setSpacing(0);

    radioGroup = new QButtonGroup(this);
    radioGroup->addButton(existingRadio, 0);
    radioGroup->addButton(nonExistingRadio, 1);

    h2oTitleLabel = WidgetUtils::createBlueLabel(this, tr("Water vapor time lag as a function of relative humidity"));

    pgRangeLabel = new ClickLabel(tr("Plausibility range around median value :"));
    pgRangeLabel->setToolTip(tr("<b>Plausibility range around median value:</b> The plausibility range is defined as the median time lag, %1 <i>n</i> times the MAD (median of the absolute deviations from the median time lag). Specify <i>n</i> here. The value of 1.5 was heuristically found to be optimal.").arg(Defs::PLUSMINUS));
    pgRangeSpin = new QDoubleSpinBox;
    pgRangeSpin->setDecimals(1);
    pgRangeSpin->setRange(0.1, 100.0);
    pgRangeSpin->setSingleStep(0.1);
    pgRangeSpin->setAccelerated(true);
    pgRangeSpin->setSuffix(tr("  [mad]"));
    pgRangeSpin->setToolTip(pgRangeLabel->toolTip());
    pgRangeLabel_2 = new QLabel(tr("(<tt>%1%2n%3mad</tt>, where you set <tt>n</tt>)").arg(Defs::MICRO, Defs::PLUSMINUS, Defs::MID_DOT));

    rhClassLabel = new ClickLabel(tr("Number of RH classes :"));
    rhClassLabel->setToolTip(tr("<b>Number of RH classes:</b> Select the number or relative humidity classes, to assess water vapor time lag as a function of RH. The whole range or RH variation (0-100%) will be evenly divided according to the selected number of classes. For example, selecting 10 classes causes EddyPro to assess water vapor time lags for the classes 0-10%, 10-20%,..., 90-100%. Selecting 1 class, the label <b><i>Do not sort in RH classes</i></b> appears and will cause EddyPro to treat water vapor exactly like other passive gases. This option is only suitable for open path systems, or closed path systems with short and heated sampling lines."));

    rhClassSpin = new QSpinBox;
    rhClassSpin->setRange(1, 20);
    rhClassSpin->setSingleStep(1);
    rhClassSpin->setAccelerated(true);
    rhClassSpin->setSpecialValueText(tr("Do not sort in RH classes"));
    rhClassSpin->setToolTip(rhClassLabel->toolTip());

    gasTitleLabel = WidgetUtils::createBlueLabel(this, tr("Passive gases"));

    co2MinFluxLabel = new ClickLabel(tr("Minimum (absolute) %1 flux :").arg(Defs::CO2_STRING));
    co2MinFluxLabel->setToolTip(tr("<b>Minimum (absolute) %1 flux:</b> %1 time lags corresponding to fluxes smaller (in module) than this value will not be considered in the time lag optimization. Selecting high-enough fluxes assures that well developed turbulent conditions are met and the correlation function is well characterized.").arg(Defs::CO2_STRING));
    co2MinFluxSpin = new QDoubleSpinBox;
    co2MinFluxSpin->setDecimals(3);
    co2MinFluxSpin->setRange(0.0, 100.0);
    co2MinFluxSpin->setSingleStep(0.001);
    co2MinFluxSpin->setAccelerated(true);
    co2MinFluxSpin->setSuffix(tr("  [%1]").arg(Defs::UMOL_M2S_STRING));
    co2MinFluxSpin->setToolTip(co2MinFluxLabel->toolTip());

    ch4MinFluxLabel = new ClickLabel(tr("Minimum (absolute) %1 flux :").arg(Defs::CH4_STRING));
    ch4MinFluxLabel->setToolTip(tr("<b>Minimum (absolute) %1 flux:</b> %1 time lags corresponding to fluxes smaller (in module) than this value will not be considered in the time lag optimization. Selecting high-enough fluxes assures that well developed turbulent conditions are met and the correlation function is well characterized.").arg(Defs::CH4_STRING));
    ch4MinFluxSpin = new QDoubleSpinBox;
    ch4MinFluxSpin->setDecimals(3);
    ch4MinFluxSpin->setRange(0.0, 100.0);
    ch4MinFluxSpin->setSingleStep(0.001);
    ch4MinFluxSpin->setAccelerated(true);
    ch4MinFluxSpin->setSuffix(tr("  [%1]").arg(Defs::UMOL_M2S_STRING));
    ch4MinFluxSpin->setToolTip(ch4MinFluxLabel->toolTip());

    gas4MinFluxLabel = new ClickLabel(tr("Minimum (absolute) %1 gas flux :").arg(Defs::GAS4_STRING));
    gas4MinFluxLabel->setToolTip(tr("<b>Minimum (absolute) %1 gas flux:</b> %1 gas time lags corresponding to fluxes smaller (in module) than this value will not be considered in the time lag optimization. Selecting high-enough fluxes assures that well developed turbulent conditions are met and the correlation function is well characterized.").arg(Defs::GAS4_STRING));
    gas4MinFluxSpin = new QDoubleSpinBox;
    gas4MinFluxSpin->setDecimals(3);
    gas4MinFluxSpin->setRange(0.0, 100.0);
    gas4MinFluxSpin->setSingleStep(0.001);
    gas4MinFluxSpin->setAccelerated(true);
    gas4MinFluxSpin->setSuffix(tr("  [%1]").arg(Defs::UMOL_M2S_STRING));
    gas4MinFluxSpin->setToolTip(gas4MinFluxLabel->toolTip());

    leMinFluxLabel = new ClickLabel(tr("Minimum latent heat flux :"));
    leMinFluxLabel->setToolTip(tr("<b>Minimum latent heat flux:</b> Minimum latent heat flux: H<sub>2</sub>O time lags corresponding to latent heat fluxes smaller than this value will not be considered in the time lag optimization. Selecting high-enough fluxes assures that well developed turbulent conditions are met and the correlation function is well characterized."));
    leMinFluxSpin = new QDoubleSpinBox;
    leMinFluxSpin->setDecimals(1);
    leMinFluxSpin->setRange(0.0, 1000.0);
    leMinFluxSpin->setSingleStep(0.1);
    leMinFluxSpin->setAccelerated(true);
    leMinFluxSpin->setSuffix(tr("  [%1]").arg(Defs::W_M2_STRING));
    leMinFluxSpin->setToolTip(leMinFluxLabel->toolTip());

    searchWindowLabel = WidgetUtils::createBlueLabel(this, tr("Time lag searching windows"));

    minLabel = WidgetUtils::createBlueLabel(this, tr("Minimum"));
    minLabel->setToolTip(tr("<b>Minimum:</b> Minimum time lag for each gas, for initializing the time lag optimization procedure. The searching window defined by Minimum and Maximum should be large enough to accommodate all possible time lags. Leave as <i>Not set</i> if in doubt, EddyPro will initialize it automatically."));

    maxLabel = WidgetUtils::createBlueLabel(this, tr("Maximum"));
    maxLabel->setToolTip(tr("<b>Maximum:</b> Maximum time lag for each gas, for initializing the time lag optimization procedure. The searching window defined by Minimum and Maximum should be large enough to accommodate all possible time lags. In particular, maximum time lags of water vapor in closed path systems can up to ten times higher than its nominal value, or even higher. Leave as <i>Not set</i> if in doubt, EddyPro will initialize it automatically."));

    co2Label = new ClickLabel(tr("%1 :").arg(Defs::CO2_STRING));

    minCo2TlSpin = new QDoubleSpinBox;
    minCo2TlSpin->setDecimals(1);
    minCo2TlSpin->setRange(-1000.1, 1000.0);
    minCo2TlSpin->setSingleStep(0.1);
    minCo2TlSpin->setSpecialValueText(tr("Detect automatically"));
    minCo2TlSpin->setAccelerated(true);
    minCo2TlSpin->setSuffix(tr("  [s]"));
    minCo2TlSpin->setToolTip(minLabel->toolTip());

    maxCo2TlSpin = new QDoubleSpinBox;
    maxCo2TlSpin->setDecimals(1);
    maxCo2TlSpin->setRange(-1000.1, 1000.0);
    maxCo2TlSpin->setSingleStep(0.1);
    maxCo2TlSpin->setSpecialValueText(tr("Detect automatically"));
    maxCo2TlSpin->setAccelerated(true);
    maxCo2TlSpin->setSuffix(tr("  [s]"));
    maxCo2TlSpin->setToolTip(maxLabel->toolTip());

    h2oLabel = new ClickLabel(tr("%1 :").arg(Defs::H2O_STRING));

    minH2oTlSpin = new QDoubleSpinBox;
    minH2oTlSpin->setDecimals(1);
    minH2oTlSpin->setRange(-1000.1, 1000.0);
    minH2oTlSpin->setSingleStep(0.1);
    minH2oTlSpin->setSpecialValueText(tr("Detect automatically"));
    minH2oTlSpin->setAccelerated(true);
    minH2oTlSpin->setSuffix(tr("  [s]"));
    minH2oTlSpin->setToolTip(minLabel->toolTip());

    maxH2oTlSpin = new QDoubleSpinBox;
    maxH2oTlSpin->setDecimals(1);
    maxH2oTlSpin->setRange(-1000.1, 1000.0);
    maxH2oTlSpin->setSingleStep(0.1);
    maxH2oTlSpin->setSpecialValueText(tr("Detect automatically"));
    maxH2oTlSpin->setAccelerated(true);
    maxH2oTlSpin->setSuffix(tr("  [s]"));
    maxH2oTlSpin->setToolTip(maxLabel->toolTip());

    ch4Label = new ClickLabel(tr("%1 :").arg(Defs::CH4_STRING));

    minCh4TlSpin = new QDoubleSpinBox;
    minCh4TlSpin->setDecimals(1);
    minCh4TlSpin->setRange(-1000.1, 1000.0);
    minCh4TlSpin->setSingleStep(0.1);
    minCh4TlSpin->setSpecialValueText(tr("Detect automatically"));
    minCh4TlSpin->setAccelerated(true);
    minCh4TlSpin->setSuffix(tr("  [s]"));
    minCh4TlSpin->setToolTip(minLabel->toolTip());

    maxCh4TlSpin = new QDoubleSpinBox;
    maxCh4TlSpin->setDecimals(1);
    maxCh4TlSpin->setRange(-1000.1, 1000.0);
    maxCh4TlSpin->setSingleStep(0.1);
    maxCh4TlSpin->setSpecialValueText(tr("Detect automatically"));
    maxCh4TlSpin->setAccelerated(true);
    maxCh4TlSpin->setSuffix(tr("  [s]"));
    maxCh4TlSpin->setToolTip(maxLabel->toolTip());

    gas4Label = new ClickLabel(tr("%1 gas :").arg(Defs::GAS4_STRING));

    minGas4TlSpin = new QDoubleSpinBox;
    minGas4TlSpin->setDecimals(1);
    minGas4TlSpin->setRange(-1000.1, 1000.0);
    minGas4TlSpin->setSingleStep(0.1);
    minGas4TlSpin->setSpecialValueText(tr("Detect automatically"));
    minGas4TlSpin->setAccelerated(true);
    minGas4TlSpin->setSuffix(tr("  [s]"));
    minGas4TlSpin->setToolTip(minLabel->toolTip());

    maxGas4TlSpin = new QDoubleSpinBox;
    maxGas4TlSpin->setDecimals(1);
    maxGas4TlSpin->setRange(-1000.1, 1000.0);
    maxGas4TlSpin->setSingleStep(0.1);
    maxGas4TlSpin->setSpecialValueText(tr("Detect automatically"));
    maxGas4TlSpin->setAccelerated(true);
    maxGas4TlSpin->setSuffix(tr("  [s]"));
    maxGas4TlSpin->setToolTip(maxLabel->toolTip());

    auto propertiesLayout = new QGridLayout;
    propertiesLayout->addLayout(existingFileLayout, 0, 0, 1, -1);
    propertiesLayout->addWidget(nonExistingRadio, 1, 0);
    propertiesLayout->addWidget(subsetCheckBox, 1, 1, 1, 1, Qt::AlignLeft);
    propertiesLayout->addWidget(startDateLabel, 1, 1, Qt::AlignRight);
    propertiesLayout->addLayout(dateTimeContainer, 1, 2, 2, 1);
    propertiesLayout->addWidget(endDateLabel, 2, 1, Qt::AlignRight);
    propertiesLayout->addWidget(pgRangeLabel, 3, 1, 1, 1, Qt::AlignRight);
    propertiesLayout->addWidget(pgRangeSpin, 3, 2);
    propertiesLayout->addWidget(pgRangeLabel_2, 3, 3);

    propertiesLayout->addWidget(h2oTitleLabel, 4, 0, 1, 2);

    propertiesLayout->addWidget(rhClassLabel, 5, 1, Qt::AlignRight);
    propertiesLayout->addWidget(rhClassSpin, 5, 2);
    propertiesLayout->addWidget(leMinFluxLabel, 6, 1, Qt::AlignRight);
    propertiesLayout->addWidget(leMinFluxSpin, 6, 2);

    propertiesLayout->addWidget(gasTitleLabel, 7, 0);

    propertiesLayout->addWidget(co2MinFluxLabel, 8, 1, Qt::AlignRight);
    propertiesLayout->addWidget(co2MinFluxSpin, 8, 2);
    propertiesLayout->addWidget(ch4MinFluxLabel, 9, 1, Qt::AlignRight);
    propertiesLayout->addWidget(ch4MinFluxSpin, 9, 2);
    propertiesLayout->addWidget(gas4MinFluxLabel, 10, 1, Qt::AlignRight);
    propertiesLayout->addWidget(gas4MinFluxSpin, 10, 2);

    propertiesLayout->addWidget(searchWindowLabel, 11, 0);
    propertiesLayout->addWidget(minLabel, 12, 1);
    propertiesLayout->addWidget(maxLabel, 12, 2);
    propertiesLayout->addWidget(co2Label, 13, 0, Qt::AlignRight);
    propertiesLayout->addWidget(minCo2TlSpin, 13, 1);
    propertiesLayout->addWidget(maxCo2TlSpin, 13, 2);
    propertiesLayout->addWidget(h2oLabel, 14, 0, Qt::AlignRight);
    propertiesLayout->addWidget(minH2oTlSpin, 14, 1);
    propertiesLayout->addWidget(maxH2oTlSpin, 14, 2);
    propertiesLayout->addWidget(ch4Label, 15, 0, Qt::AlignRight);
    propertiesLayout->addWidget(minCh4TlSpin, 15, 1);
    propertiesLayout->addWidget(maxCh4TlSpin, 15, 2);
    propertiesLayout->addWidget(gas4Label, 16, 0, Qt::AlignRight);
    propertiesLayout->addWidget(minGas4TlSpin, 16, 1);
    propertiesLayout->addWidget(maxGas4TlSpin, 16, 2);
    propertiesLayout->setVerticalSpacing(3);
    propertiesLayout->setRowMinimumHeight(2, 10);
    propertiesLayout->setContentsMargins(3, 3, 3, 3);

    auto propertiesFrame = new QWidget;
    propertiesFrame->setLayout(propertiesLayout);
    propertiesFrame->setMinimumWidth(propertiesFrame->sizeHint().width());

    auto okButton = WidgetUtils::createCommonButton(this, tr("Ok"));

    auto mainLayout = new QGridLayout(this);
    mainLayout->addWidget(groupTitle, 0, 0);
    mainLayout->addWidget(hrLabel, 1, 0);
    mainLayout->addWidget(propertiesFrame, 2, 0);
    mainLayout->addWidget(okButton, 3, 0, 1, 1, Qt::AlignCenter);
    mainLayout->setVerticalSpacing(10);
    mainLayout->setContentsMargins(30, 30, 30, 30);
    mainLayout->setSizeConstraint(QLayout::SetFixedSize);
    setLayout(mainLayout);

    connect(radioGroup, SIGNAL(buttonClicked(int)),
            this, SLOT(updateTlMode(int)));

    connect(radioGroup, SIGNAL(buttonClicked(int)),
            this, SLOT(radioClicked(int)));

    connect(fileBrowse, &FileBrowseWidget::pathChanged,
            this, &TimeLagSettingsDialog::updateFile);
    connect(fileBrowse, &FileBrowseWidget::pathSelected,
        this, &TimeLagSettingsDialog::testSelectedFile);

    connect(subsetCheckBox, &QCheckBox::toggled,
            this, &TimeLagSettingsDialog::updateSubsetSelection);

    connect(startDateLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onStartDateLabelClicked);
    connect(startDateEdit, &QDateEdit::dateChanged,
            this, &TimeLagSettingsDialog::updateStartDate);
    connect(startTimeEdit, &QTimeEdit::timeChanged,
            this, &TimeLagSettingsDialog::updateStartTime);

    connect(endDateLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onEndDateLabelClicked);
    connect(endDateEdit, &QDateEdit::dateChanged,
            this, &TimeLagSettingsDialog::updateEndDate);
    connect(endTimeEdit, &QTimeEdit::timeChanged,
            this, &TimeLagSettingsDialog::updateEndTime);

    connect(rhClassLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onRhClassClicked);
    connect(rhClassSpin, SIGNAL(valueChanged(int)),
            this, SLOT(updateRhClass(int)));

    connect(co2MinFluxLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onCo2MinFluxClicked);
    connect(co2MinFluxSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateCo2MinFlux(double)));

    connect(ch4MinFluxLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onCh4MinFluxClicked);
    connect(ch4MinFluxSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateCh4MinFlux(double)));

    connect(gas4MinFluxLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onGas4MinFluxClicked);
    connect(gas4MinFluxSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateGas4MinFlux(double)));

    connect(leMinFluxLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onLeMinFluxClicked);
    connect(leMinFluxSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateLeMinFlux(double)));

    connect(pgRangeLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onPgRangeLabelClicked);
    connect(pgRangeSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updatePgRange(double)));

    connect(co2Label, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onCo2LabelClicked);
    connect(minCo2TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMinCo2Tl(double)));
    connect(maxCo2TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMaxCo2Tl(double)));

    connect(h2oLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onH2oLabelClicked);
    connect(minH2oTlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMinH2oTl(double)));
    connect(maxH2oTlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMaxH2oTl(double)));

    connect(ch4Label, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onCh4LabelClicked);
    connect(minCh4TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMinCh4Tl(double)));
    connect(maxCh4TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMaxCh4Tl(double)));

    connect(gas4Label, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onGas4LabelClicked);
    connect(minGas4TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMinGas4Tl(double)));
    connect(maxGas4TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMaxGas4Tl(double)));

    connect(okButton, &QPushButton::clicked,
            this, &TimeLagSettingsDialog::close);

    // init
    forceEndDatePolicy();
    forceEndTimePolicy();
}
Example #11
0
RenameGroup::RenameGroup(QString group,QWidget *parent,const char *name)
  : QDialog(parent,name,true)
{
  group_name=group;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  setCaption(tr("Rename Group"));

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);

  //
  // Text Validator
  //
  RDTextValidator *validator=new RDTextValidator(this,"validator");

  //
  // Current Group Name
  //
  group_name_edit=new QLineEdit(this,"group_name_edit");
  group_name_edit->setGeometry(165,11,sizeHint().width()-175,19);
  group_name_edit->setMaxLength(10);
  group_name_edit->setReadOnly(true);
  QLabel *group_name_label=
    new QLabel(group_name_edit,tr("Current Group Name:"),
	       this,"group_name_label");
  group_name_label->setGeometry(10,11,150,19);
  group_name_label->setFont(font);
  group_name_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // New Group Name
  //
  group_newname_edit=new QLineEdit(this,"group_newname_edit");
  group_newname_edit->setGeometry(165,33,sizeHint().width()-175,19);
  group_newname_edit->setMaxLength(10);
  group_newname_edit->setValidator(validator);
  QLabel *group_newname_label=
    new QLabel(group_newname_edit,tr("New &Group Name:"),
	       this,"group_newname_label");
  group_newname_label->setGeometry(10,33,150,19);
  group_newname_label->setFont(font);
  group_newname_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  //  Ok Button
  //
  QPushButton *ok_button=new QPushButton(this,"ok_button");
  ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  ok_button->setDefault(true);
  ok_button->setFont(font);
  ok_button->setText(tr("&OK"));
  connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  QPushButton *cancel_button=new QPushButton(this,"cancel_button");
  cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  cancel_button->setFont(font);
  cancel_button->setText(tr("&Cancel"));
  connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Populate Fields
  //
  group_name_edit->setText(group_name);
}
void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow)
{
    QRect scr = QApplication::desktop()->screenGeometry(pos);
    QSize sh = sizeHint();
    const int border = 1;
    const int ah = 18, ao = 18, aw = 18, rc = 7;
    bool arrowAtTop = (pos.y() + sh.height() + ah < scr.height());
    bool arrowAtLeft = (pos.x() + sh.width() - ao < scr.width());
    setContentsMargins(border + 3,  border + (arrowAtTop ? ah : 0) + 2, border + 3, border + (arrowAtTop ? 0 : ah) + 2);
    updateGeometry();
    sh  = sizeHint();

    int ml, mr, mt, mb;
    QSize sz = sizeHint();
    if (!arrowAtTop) {
        ml = mt = 0;
        mr = sz.width() - 1;
        mb = sz.height() - ah - 1;
    } else {
        ml = 0;
        mt = ah;
        mr = sz.width() - 1;
        mb = sz.height() - 1;
    }

    QPainterPath path;
#if defined(QT_NO_XSHAPE) && defined(Q_WS_X11)
    // XShape is required for setting the mask, so we just
    // draw an ugly square when its not available
    path.moveTo(0, 0);
    path.lineTo(sz.width() - 1, 0);
    path.lineTo(sz.width() - 1, sz.height() - 1);
    path.lineTo(0, sz.height() - 1);
    path.lineTo(0, 0);
    move(qMax(pos.x() - sz.width(), scr.left()), pos.y());
#else
    path.moveTo(ml + rc, mt);
    if (arrowAtTop && arrowAtLeft) {
        if (showArrow) {
            path.lineTo(ml + ao, mt);
            path.lineTo(ml + ao, mt - ah);
            path.lineTo(ml + ao + aw, mt);
        }
        move(qMax(pos.x() - ao, scr.left() + 2), pos.y());
    } else if (arrowAtTop && !arrowAtLeft) {
        if (showArrow) {
            path.lineTo(mr - ao - aw, mt);
            path.lineTo(mr - ao, mt - ah);
            path.lineTo(mr - ao, mt);
        }
        move(qMin(pos.x() - sh.width() + ao, scr.right() - sh.width() - 2), pos.y());
    }
    path.lineTo(mr - rc, mt);
    path.arcTo(QRect(mr - rc*2, mt, rc*2, rc*2), 90, -90);
    path.lineTo(mr, mb - rc);
    path.arcTo(QRect(mr - rc*2, mb - rc*2, rc*2, rc*2), 0, -90);
    if (!arrowAtTop && !arrowAtLeft) {
        if (showArrow) {
            path.lineTo(mr - ao, mb);
            path.lineTo(mr - ao, mb + ah);
            path.lineTo(mr - ao - aw, mb);
        }
        move(qMin(pos.x() - sh.width() + ao, scr.right() - sh.width() - 2),
             pos.y() - sh.height());
    } else if (!arrowAtTop && arrowAtLeft) {
        if (showArrow) {
            path.lineTo(ao + aw, mb);
            path.lineTo(ao, mb + ah);
            path.lineTo(ao, mb);
        }
        move(qMax(pos.x() - ao, scr.x() + 2), pos.y() - sh.height());
    }
    path.lineTo(ml + rc, mb);
    path.arcTo(QRect(ml, mb - rc*2, rc*2, rc*2), -90, -90);
    path.lineTo(ml, mt + rc);
    path.arcTo(QRect(ml, mt, rc*2, rc*2), 180, -90);

    // Set the mask
    QBitmap bitmap = QBitmap(sizeHint());
    bitmap.fill(Qt::color0);
    QPainter painter1(&bitmap);
    painter1.setPen(QPen(Qt::color1, border));
    painter1.setBrush(QBrush(Qt::color1));
    painter1.drawPath(path);
    setMask(bitmap);
#endif

    // Draw the border
    pixmap = QPixmap(sz);
    QPainter painter2(&pixmap);
    painter2.setPen(QPen(palette().color(QPalette::Window).darker(160), border));
    painter2.setBrush(palette().color(QPalette::Window));
    painter2.drawPath(path);

    if (msecs > 0)
        timerId = startTimer(msecs);
    show();
}
Example #13
0
ListLogs::ListLogs(QString *logname,QWidget *parent)
  : QDialog(parent,"",true)
{
  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  //
  // Generate Fonts
  //
  QFont button_font("Helvetica",12,QFont::Bold);
  button_font.setPixelSize(12);

  list_logname=logname;

  setCaption(tr("Select a Log"));

  //
  // Log List
  //
  list_log_list=new Q3ListView(this);
  list_log_list->setGeometry(10,10,
			    sizeHint().width()-20,sizeHint().height()-80);
  list_log_list->setAllColumnsShowFocus(true);
  list_log_list->setItemMargin(5);
  connect(list_log_list,
	  SIGNAL(doubleClicked(Q3ListViewItem *,const QPoint &,int)),
	  this,
	  SLOT(doubleClickedData(Q3ListViewItem *,const QPoint &,int)));
  list_log_list->addColumn(tr("NAME"));
  list_log_list->setColumnAlignment(0,Qt::AlignLeft);
  list_log_list->addColumn(tr("DESCRIPTION"));
  list_log_list->setColumnAlignment(1,Qt::AlignLeft);
  list_log_list->addColumn(tr("SERVICE"));
  list_log_list->setColumnAlignment(2,Qt::AlignLeft);

  //
  // Load Button
  //
  QPushButton *button=new QPushButton(this);
  button->setGeometry(10,sizeHint().height()-60,80,50);
  button->setFont(button_font);
  button->setText(tr("&OK"));
  connect(button,SIGNAL(clicked()),this,SLOT(okButtonData()));

  //
  // Cancel Button
  //
  button=new QPushButton(this);
  button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50);
  button->setFont(button_font);
  button->setText(tr("&Cancel"));
  button->setDefault(true);
  connect(button,SIGNAL(clicked()),this,SLOT(cancelButtonData()));

  RefreshList();
}
Example #14
0
OptionsDialog::OptionsDialog(QWidget* parent)
             : QDialog(parent)
{
    QTabWidget* tabs = new QTabWidget(this);
    QDirModel* dirModel = new QDirModel(QStringList("*"),
                                        QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Executable,
                                        QDir::Name | QDir::DirsLast | QDir::IgnoreCase,
                                        this);

    // "General" (programs) tab
    QWidget* tabProgs = new QWidget(tabs);
    fPrpEditorPath = new QLineEdit(tabProgs);
    fPrpEditorPath->setCompleter(new QCompleter(dirModel, fPrpEditorPath));
    QToolButton* browsePrpEditor = new QToolButton(tabProgs);
    browsePrpEditor->setText("...");
    fVaultEditorPath = new QLineEdit(tabProgs);
    fVaultEditorPath->setCompleter(new QCompleter(dirModel, fVaultEditorPath));
    QToolButton* browseVaultEditor = new QToolButton(tabProgs);
    browseVaultEditor->setText("...");
    fImageEditorPath = new QLineEdit(tabProgs);
    fImageEditorPath->setCompleter(new QCompleter(dirModel, fImageEditorPath));
    QToolButton* browseImageEditor = new QToolButton(tabProgs);
    browseImageEditor->setText("...");

    QLabel* lblPrpEditor = new QLabel(tr("&PRP Editor:"), tabProgs);
    lblPrpEditor->setBuddy(fPrpEditorPath);
    QLabel* lblVaultEditor = new QLabel(tr("&Vault Editor:"), tabProgs);
    lblVaultEditor->setBuddy(fVaultEditorPath);
    QLabel* lblImgEditor = new QLabel(tr("&Image Editor:"), tabProgs);
    lblImgEditor->setBuddy(fImageEditorPath);

    QGridLayout* layProgs = new QGridLayout(tabProgs);
    layProgs->setContentsMargins(8, 8, 8, 8);
    layProgs->addItem(new QSpacerItem(16, 0, QSizePolicy::Maximum, QSizePolicy::Minimum), 1, 0);
    layProgs->addWidget(lblPrpEditor, 0, 0, 1, 3);
    layProgs->addWidget(fPrpEditorPath, 1, 1);
    layProgs->addWidget(browsePrpEditor, 1, 2);
    layProgs->addItem(new QSpacerItem(0, 8, QSizePolicy::Minimum, QSizePolicy::Minimum), 2, 0, 1, 3);
    layProgs->addWidget(lblVaultEditor, 3, 0, 1, 3);
    layProgs->addWidget(fVaultEditorPath, 4, 1);
    layProgs->addWidget(browseVaultEditor, 4, 2);
    layProgs->addItem(new QSpacerItem(0, 8, QSizePolicy::Minimum, QSizePolicy::Minimum), 5, 0, 1, 3);
    layProgs->addWidget(lblImgEditor, 6, 0, 1, 3);
    layProgs->addWidget(fImageEditorPath, 7, 1);
    layProgs->addWidget(browseImageEditor, 7, 2);
    layProgs->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding), 8, 0, 1, 3);
    tabs->addTab(tabProgs, tr("&General"));

    // Editor tab
    QWidget* tabEditor = new QWidget(tabs);
    fSciLineNumbers = new QCheckBox(tr("&Line numbers"), tabEditor);
    fSciUseSpaces = new QCheckBox(tr("Use &spaces instead of tabs"), tabEditor);
    fSciAutoIndent = new QCheckBox(tr("&Auto-indent"), tabEditor);
    fSciIndentGuides = new QCheckBox(tr("Show in&dentation guides"), tabEditor);
    fSciShowWhitespace = new QCheckBox(tr("Show &whitespace"), tabEditor);
    fSciFont = new QPushButton(tr("Editor &Font"), tabEditor);
    fSciTabWidth = new QLineEdit(tabEditor);
    fSciLongLineMark = new QCheckBox(tr("Long line mar&ker:"), tabEditor);
    fSciLongLineSize = new QLineEdit(tabEditor);
    fSciTabWidth->setValidator(new QIntValidator(fSciTabWidth));
    ((QIntValidator*)fSciTabWidth->validator())->setRange(1, 80);
    fSciLongLineSize->setValidator(new QIntValidator(fSciLongLineSize));
    ((QIntValidator*)fSciLongLineSize->validator())->setRange(1, 9999);

    QLabel* lblTabWidth = new QLabel(tr("&Tab Width:"), tabEditor);
    lblTabWidth->setBuddy(fSciTabWidth);

    QGridLayout* layEditor = new QGridLayout(tabEditor);
    layEditor->setContentsMargins(8, 8, 8, 8);
    layEditor->setVerticalSpacing(4);
    layEditor->addWidget(fSciLineNumbers, 0, 0);
    layEditor->addWidget(fSciUseSpaces, 1, 0);
    layEditor->addWidget(fSciAutoIndent, 2, 0);
    layEditor->addWidget(fSciIndentGuides, 3, 0);
    layEditor->addWidget(fSciShowWhitespace, 4, 0);
    layEditor->addItem(new QSpacerItem(32, 0, QSizePolicy::Minimum, QSizePolicy::Minimum), 0, 1);
    layEditor->addWidget(fSciFont, 0, 2, 1, 2);
    layEditor->addItem(new QSpacerItem(0, 16, QSizePolicy::Minimum, QSizePolicy::Minimum), 1, 2, 1, 2);
    layEditor->addWidget(lblTabWidth, 2, 2);
    layEditor->addWidget(fSciTabWidth, 2, 3);
    layEditor->addWidget(fSciLongLineMark, 3, 2);
    layEditor->addWidget(fSciLongLineSize, 3, 3);
    fSciTabWidth->setMaximumWidth(40);
    fSciLongLineSize->setMaximumWidth(40);
    layEditor->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding), 6, 5);
    tabs->addTab(tabEditor, tr("Text &Editor"));

    // Lay out the dialog itself
    QGridLayout* dlgLayout = new QGridLayout(this);
    dlgLayout->setContentsMargins(4, 4, 4, 4);
    dlgLayout->setVerticalSpacing(4);
    dlgLayout->addWidget(tabs, 0, 0);
    QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel,
                                                     Qt::Horizontal, this);
    dlgLayout->addWidget(buttons, 1, 0);
    setFixedSize(sizeHint());
    setWindowTitle(tr("PlasmaShop Preferences"));

    // Populate the current/default settings
    QSettings settings("PlasmaShop", "PlasmaShop");
    fPrpEditorPath->setText(settings.value("PrpEditorPath", DEFAULT_PRP_EDITOR).toString());
    fVaultEditorPath->setText(settings.value("VaultEditorPath", DEFAULT_VAULT_EDITOR).toString());
    fImageEditorPath->setText(settings.value("ImageEditorPath", "").toString());
    fSciLineNumbers->setChecked(settings.value("SciLineNumberMargin", true).toBool());
    fSciUseSpaces->setChecked(settings.value("SciUseSpaces", true).toBool());
    fSciAutoIndent->setChecked(settings.value("SciAutoIndent", true).toBool());
    fSciIndentGuides->setChecked(settings.value("SciIndentGuides", false).toBool());
    fSciShowWhitespace->setChecked(settings.value("SciShowWhitespace", false).toBool());
    fSciLongLineMark->setChecked(settings.value("SciLongLineMark", false).toBool());
    fSciLongLineSize->setText(QString("%1").arg(settings.value("SciLongLineSize", 80).toInt()));
    fSciTabWidth->setText(QString("%1").arg(settings.value("SciTabWidth", 4).toInt()));

    QFont fnt;
    fnt.setFamily(settings.value("SciFont", PLAT_FONT).toString());
    fnt.setPointSize(settings.value("SciFontSize", 10).toInt());
    fnt.setWeight(settings.value("SciFontWeight", QFont::Normal).toInt());
    fnt.setItalic(settings.value("SciFontItalic", false).toBool());
    fSciFont->setFont(fnt);

    fSciLongLineSize->setEnabled(fSciLongLineMark->isChecked());

    // Set up signals for the buttons
    connect(buttons, SIGNAL(accepted()), this, SLOT(onSave()));
    connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
    connect(browsePrpEditor, SIGNAL(clicked()), this, SLOT(onBrowsePrpEditor()));
    connect(browseVaultEditor, SIGNAL(clicked()), this, SLOT(onBrowseVaultEditor()));
    connect(browseImageEditor, SIGNAL(clicked()), this, SLOT(onBrowseImageEditor()));
    connect(fSciLongLineMark, SIGNAL(clicked(bool)), fSciLongLineSize, SLOT(setEnabled(bool)));
    connect(fSciFont, SIGNAL(clicked()), this, SLOT(onSetFont()));
}
QSize CategoryFilterWidget::minimumSizeHint() const
{
    QSize size = sizeHint();
    size.setWidth(6);
    return size;
}
Example #16
0
TestSetupDialog::TestSetupDialog(QWidget* parent)
               : QDialog(parent)
{
    setWindowTitle(tr("Setup testing parameters"));

    QSettings settings("CCTools", "CCEdit");
    QCompleter* exeCompleter = new QCompleter(this);
    exeCompleter->setModel(new QDirModel(EXE_LIST,
            QDir::AllDirs | QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Executable,
            QDir::Name, exeCompleter));
    QCompleter* winExeCompleter = new QCompleter(this);
    winExeCompleter->setModel(new QDirModel(QStringList() << "*.exe",
            QDir::AllDirs | QDir::AllEntries | QDir::NoDotAndDotDot,
            QDir::Name, winExeCompleter));

#ifndef Q_OS_WIN
    m_winePath = new QLineEdit(settings.value("WineExe").toString(), this);
    m_winePath->setCompleter(exeCompleter);
    QLabel* lblWinePath = new QLabel(tr("&WINE Path:"), this);
    lblWinePath->setBuddy(m_winePath);
    QToolButton* browseWine = new QToolButton(this);
    browseWine->setIcon(QIcon(":/res/document-open-folder-sm.png"));
    browseWine->setAutoRaise(true);
#endif

    m_msccPath = new QLineEdit(settings.value("ChipsExe").toString(), this);
    m_msccPath->setCompleter(winExeCompleter);
    QLabel* lblMsccPath = new QLabel(tr("MS&CC Path:"), this);
    lblMsccPath->setBuddy(m_msccPath);
    QToolButton* browseChips = new QToolButton(this);
    browseChips->setIcon(QIcon(":/res/document-open-folder-sm.png"));
    browseChips->setAutoRaise(true);
    m_tworldPath = new QLineEdit(settings.value("TWorldExe").toString(), this);
    m_tworldPath->setCompleter(exeCompleter);
    QLabel* lblTWorldPath = new QLabel(tr("&Tile World Path:"), this);
    lblTWorldPath->setBuddy(m_tworldPath);
    QToolButton* browseTWorld = new QToolButton(this);
    browseTWorld->setIcon(QIcon(":/res/document-open-folder-sm.png"));
    browseTWorld->setAutoRaise(true);
    QDialogButtonBox* buttons = new QDialogButtonBox(
            QDialogButtonBox::Save | QDialogButtonBox::Cancel,
            Qt::Horizontal, this);

    m_useCCPatch = new QCheckBox(tr("MSCC: Use CCPatch"), this);
    m_useCCPatch->setChecked(settings.value("TestCCPatch", true).toBool());
    m_usePGPatch = new QCheckBox(tr("MSCC: Use PGChip (Ice Blocks)"), this);
    m_usePGPatch->setChecked(settings.value("TestPGPatch", false).toBool());

    QGridLayout* layout = new QGridLayout(this);
    layout->setContentsMargins(8, 8, 8, 8);
    layout->setVerticalSpacing(4);
    layout->setHorizontalSpacing(4);
#ifndef Q_OS_WIN
    layout->addWidget(lblWinePath, 0, 0);
    layout->addWidget(m_winePath, 0, 1);
    layout->addWidget(browseWine, 0, 2);
#endif
    layout->addWidget(lblMsccPath, POSIX_OFFSET + 0, 0);
    layout->addWidget(m_msccPath, POSIX_OFFSET + 0, 1);
    layout->addWidget(browseChips, POSIX_OFFSET + 0, 2);
    layout->addWidget(m_useCCPatch, POSIX_OFFSET + 1, 1);
    layout->addWidget(m_usePGPatch, POSIX_OFFSET + 2, 1);
    layout->addWidget(lblTWorldPath, POSIX_OFFSET + 3, 0);
    layout->addWidget(m_tworldPath, POSIX_OFFSET + 3, 1);
    layout->addWidget(browseTWorld, POSIX_OFFSET + 3, 2);
#ifndef Q_OS_WIN
    layout->addWidget(new QLabel(
            tr("Note: Leave WINE or Tile World paths empty to use system-installed locations"),
            this), POSIX_OFFSET + 4, 0, 1, 3);
#else
    layout->addWidget(new QLabel(
            tr("Note: MSCC will not work on 64-bit Windows platforms"),
            this), POSIX_OFFSET + 4, 0, 1, 3);
#endif
    layout->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding), POSIX_OFFSET + 5, 0, 1, 3);
    layout->addWidget(buttons, POSIX_OFFSET + 6, 0, 1, 3);
    resize(400, sizeHint().height());

    connect(buttons, SIGNAL(rejected()), SLOT(reject()));
    connect(buttons, SIGNAL(accepted()), SLOT(onSaveSettings()));
#ifndef Q_OS_WIN
    connect(browseWine, SIGNAL(clicked()), SLOT(onBrowseWine()));
#endif
    connect(browseChips, SIGNAL(clicked()), SLOT(onBrowseChips()));
    connect(browseTWorld, SIGNAL(clicked()), SLOT(onBrowseTWorld()));
}
Example #17
0
NovelDialog::NovelDialog(const QString& novel, Database* data, QWidget* parent) :
	QDialog(parent),
	m_data(data),
	m_new(novel.isEmpty())
{
	// Create name widget
	m_name = new QLineEdit(this);
	connect(m_name, &QLineEdit::textChanged, this, &NovelDialog::checkAcceptAllowed);

	QHBoxLayout* name_layout = new QHBoxLayout;
	name_layout->addWidget(new QLabel(tr("Name:"), this));
	name_layout->addWidget(m_name);

	// Create goals widgets
	QGroupBox* goals = new QGroupBox(tr("Goals"), this);

	m_total = new QSpinBox(goals);
	m_total->setCorrectionMode(QSpinBox::CorrectToNearestValue);
	m_total->setRange(0, 9999999);
	m_total->setSpecialValueText(tr("N/A"));

	m_daily = new QSpinBox(goals);
	m_daily->setCorrectionMode(QSpinBox::CorrectToNearestValue);
	m_daily->setRange(0, 9999999);
	m_daily->setSpecialValueText(tr("N/A"));

	// Create date widgets
	QGroupBox* dates = new QGroupBox(tr("Date Range"), this);

	m_start = new QDateEdit(dates);
	m_start->setCalendarPopup(true);
	connect(m_start, &QDateEdit::dateChanged, this, &NovelDialog::checkAcceptAllowed);

	m_end = new QDateEdit(dates);
	m_end->setCalendarPopup(true);
	connect(m_end, &QDateEdit::dateChanged, this, &NovelDialog::checkAcceptAllowed);

	// Create word count widgets
	QGroupBox* wordcount = new QGroupBox(tr("Word Count"), this);

	m_start_value = new QSpinBox(wordcount);
	m_start_value->setCorrectionMode(QSpinBox::CorrectToNearestValue);
	m_start_value->setRange(0, 9999999);

	// Create buttons
	QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
	m_accept = buttons->button(QDialogButtonBox::Ok);
	connect(buttons, &QDialogButtonBox::accepted, this, &NovelDialog::accept);
	connect(buttons, &QDialogButtonBox::rejected, this, &NovelDialog::reject);

	// Lay out window
	QFormLayout* goals_layout = new QFormLayout(goals);
	goals_layout->addRow(tr("Total:"), m_total);
	goals_layout->addRow(tr("Daily:"), m_daily);

	QFormLayout* dates_layout = new QFormLayout(dates);
	dates_layout->addRow(tr("Start On:"), m_start);
	dates_layout->addRow(tr("End On:"), m_end);

	QFormLayout* wordcount_layout = new QFormLayout(wordcount);
	wordcount_layout->addRow(tr("Start At:"), m_start_value);

	QVBoxLayout* layout = new QVBoxLayout(this);
	layout->addLayout(name_layout);
	layout->addWidget(goals);
	layout->addWidget(dates);
	layout->addWidget(wordcount);
	layout->addStretch();
	layout->addWidget(buttons);

	resize(sizeHint().width() * 1.25, sizeHint().height());

	// Load values
	if (m_new) {
		setWindowTitle(tr("Add Novel"));
		m_accept->setEnabled(false);
		m_total->setValue(50000);
		m_daily->setValue(2000);
		m_start_value->setValue(0);
		QDate date = QDate::currentDate();
		m_start->setDate(QDate(date.year(), date.month(), 1));
		m_end->setDate(QDate(date.year(), date.month(), date.daysInMonth()));
	} else {
		setWindowTitle(tr("Edit Novel"));
		m_name->setText(novel);
		m_total->setValue(m_data->goal(Database::Total));
		m_daily->setValue(m_data->goal(Database::Daily));
		m_start_value->setValue(m_data->startValue());
		m_start->setDate(m_data->startDate());
		m_end->setDate(m_data->endDate());
	}
}
Example #18
0
void ValidityDialog::changeIndexType(int _index)
{
    bool activate = (_index != 0);
    allowEmptyCell->setEnabled(activate);
    message->setEnabled(activate);
    title->setEnabled(activate);
    chooseAction->setEnabled(activate);
    displayMessage->setEnabled(activate);
    displayHelp->setEnabled(activate);
    messageHelp->setEnabled(activate);
    titleHelp->setEnabled(activate);
    if (_index == 7)
        displayOrNotListOfValidity(true);
    else
        displayOrNotListOfValidity(false);

    switch (_index) {
    case 0:
        edit1->setText("");
        edit2->setText("");
        val_max->setEnabled(false);
        val_min->setEnabled(false);
        choose->setEnabled(false);
        break;
    case 1:
        val_min->setEnabled(true);
        choose->setEnabled(true);
        val_min->setValidator(new KDoubleValidator(val_min));
        val_max->setValidator(new KDoubleValidator(val_max));
        if (choose->currentIndex() <= 4) {
            edit1->setText(i18n("Number:"));
            edit2->setText("");
            val_max->setEnabled(false);
        } else {
            edit1->setText(i18n("Minimum:"));
            edit2->setText(i18n("Maximum:"));
            val_max->setEnabled(true);
        }
        break;
    case 2:
    case 6:
        val_min->setEnabled(true);
        choose->setEnabled(true);
        val_min->setValidator(new KIntValidator(val_min));
        val_max->setValidator(new KIntValidator(val_max));
        if (choose->currentIndex() <= 4) {
            edit1->setText(i18n("Number:"));
            edit2->setText("");
            val_max->setEnabled(false);
        } else {
            edit1->setText(i18n("Minimum:"));
            edit2->setText(i18n("Maximum:"));
            val_max->setEnabled(true);
        }
        break;

    case 3:
        edit1->setText("");
        edit2->setText("");
        val_max->setEnabled(false);
        val_min->setEnabled(false);
        choose->setEnabled(false);
        break;
    case 4:
        edit1->setText(i18n("Date:"));
        edit2->setText("");
        val_min->setEnabled(true);
        choose->setEnabled(true);

        val_min->setValidator(0);
        val_max->setValidator(0);
        if (choose->currentIndex() <= 4) {
            edit1->setText(i18n("Date:"));
            edit2->setText("");
            val_max->setEnabled(false);
        } else {
            edit1->setText(i18n("Date minimum:"));
            edit2->setText(i18n("Date maximum:"));
            val_max->setEnabled(true);
        }
        break;
    case 5:
        val_min->setEnabled(true);
        choose->setEnabled(true);
        val_min->setValidator(0);
        val_max->setValidator(0);
        if (choose->currentIndex() <= 4) {
            edit1->setText(i18n("Time:"));
            edit2->setText("");
            val_max->setEnabled(false);
        } else {
            edit1->setText(i18n("Time minimum:"));
            edit2->setText(i18n("Time maximum:"));
            val_max->setEnabled(true);
        }
        break;
    }
    if (width() < sizeHint().width())
        resize(sizeHint());
}
Example #19
0
void MainWindow::actionFitWindow(){
    resize(sizeHint());
}
Example #20
0
void QgsCredentialDialog::requestCredentialsMasterPassword( QString * password, bool stored , bool *ok )
{
  QgsDebugMsg( "Entering." );
  stackedWidget->setCurrentIndex( 1 );

  QString titletxt( stored ? tr( "Enter CURRENT master authentication password" ) : tr( "Set NEW master authentication password" ) );
  lblPasswordTitle->setText( titletxt );

  leMasterPassVerify->setVisible( !stored );
  lblDontForget->setVisible( !stored );

  QApplication::setOverrideCursor( Qt::ArrowCursor );

  grpbxPassAttempts->setVisible( false );
  int passfailed = 0;
  while ( true )
  {
    mOkButton->setEnabled( false );
    // TODO: have the number of attempted passwords configurable in auth settings?
    if ( passfailed >= 3 )
    {
      lblSavedForSession->setVisible( false );
      grpbxPassAttempts->setTitle( tr( "Password attempts: %1" ).arg( passfailed ) );
      grpbxPassAttempts->setVisible( true );
    }

    // resize vertically to fit contents
    QSize s = sizeHint();
    s.setWidth( width() );
    resize( s );

    QgsDebugMsg( "exec()" );
    *ok = exec() == QDialog::Accepted;
    QgsDebugMsg( QString( "exec(): %1" ).arg( *ok ? "true" : "false" ) );

    if ( *ok )
    {
      bool passok = !leMasterPass->text().isEmpty();
      if ( passok && stored && !chkbxEraseAuthDb->isChecked() )
      {
        passok = QgsAuthManager::instance()->verifyMasterPassword( leMasterPass->text() );
      }

      if ( passok && !stored )
      {
        passok = ( leMasterPass->text() == leMasterPassVerify->text() );
      }

      if ( passok || chkbxEraseAuthDb->isChecked() )
      {
        if ( stored && chkbxEraseAuthDb->isChecked() )
        {
          QgsAuthManager::instance()->setScheduledAuthDbErase( true );
        }
        else
        {
          *password = leMasterPass->text();
        }
        break;
      }
      else
      {
        if ( stored )
          ++passfailed;

        leMasterPass->setStyleSheet( invalidStyle_() );
        if ( leMasterPassVerify->isVisible() )
        {
          leMasterPassVerify->setStyleSheet( invalidStyle_() );
        }
      }
    }
    else
    {
      break;
    }

    if ( passfailed >= 5 )
    {
      break;
    }
  }

  // don't leave master password in singleton's text field, or the ability to show it
  leMasterPass->clear();
  chkMasterPassShow->setChecked( false );
  leMasterPassVerify->clear();

  chkbxEraseAuthDb->setChecked( false );
  lblSavedForSession->setVisible( true );

  // re-enable OK button or non-master-password requests will be blocked
  // needs to come after leMasterPass->clear() or textChanged auto-slot with disable it again
  mOkButton->setEnabled( true );

  QApplication::restoreOverrideCursor();

  if ( passfailed >= 5 )
  {
    close();
  }
}
Example #21
0
PDFExportDialog::PDFExportDialog( QWidget* parent, const QString & docFileName,
								  const QMap<QString, int > & DocFonts,
								  ScribusView *currView, PDFOptions & pdfOptions,
								  const QList<PDFPresentationData> & Eff,
								  const ProfilesL & PDFXProfiles, const SCFonts &AllFonts,
								  double unitRatio, const ProfilesL & printerProfiles)
	: QDialog( parent ),
	doc(currView->Doc),
	EffVal(Eff),
	Opts(pdfOptions),
	docUnitRatio(unitRatio),
	cmsDescriptorName(""),
	components(3),
	appPrinterProfiles(printerProfiles)
{
	setModal(true);
	setWindowTitle( tr( "Save as PDF" ) );
	setWindowIcon(loadIcon("AppIcon.png"));
	PDFExportLayout = new QVBoxLayout( this );
	PDFExportLayout->setSpacing( 5 );
	PDFExportLayout->setMargin( 10 );
	Name = new QGroupBox( this );
	Name->setTitle( tr( "O&utput to File:" ) );
	NameLayout = new QGridLayout( Name );
	NameLayout->setSpacing( 5 );
	NameLayout->setMargin( 10 );
	NameLayout->setAlignment( Qt::AlignTop );
	fileNameLineEdit = new QLineEdit( Name );
	fileNameLineEdit->setMinimumSize( QSize( 268, 22 ) );
	if (!Opts.fileName.isEmpty())
		fileNameLineEdit->setText( QDir::toNativeSeparators(Opts.fileName) );
	else
	{
		QFileInfo fi(docFileName);
		QString completeBaseName = fi.completeBaseName();
		if (completeBaseName.endsWith(".sla", Qt::CaseInsensitive))
			if (completeBaseName.length() > 4) completeBaseName.chop(4);
		if (completeBaseName.endsWith(".gz", Qt::CaseInsensitive))
			if (completeBaseName.length() > 3) completeBaseName.chop(3);
		if (fi.exists())
		{
			QString fileName(fi.path() + "/" + completeBaseName + ".pdf");
			fileNameLineEdit->setText( QDir::toNativeSeparators(fileName) );
		}
		else
		{
			PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
			QString pdfdir = dirs->get("pdf", fi.path());
			if (pdfdir.right(1) != "/")
				pdfdir += "/";
			QString fileName(pdfdir + completeBaseName + ".pdf");
			fileNameLineEdit->setText( QDir::toNativeSeparators(fileName) );
		}
	}
	NameLayout->addWidget( fileNameLineEdit, 0, 0 );
	FileC = new QToolButton( Name );
	FileC->setText( tr( "Cha&nge..." ) );
	FileC->setMinimumSize( QSize( 88, 24 ) );
	NameLayout->addWidget( FileC, 0, 1 );
	multiFile = new QCheckBox( tr( "Output one file for eac&h page" ), Name );
	multiFile->setChecked(Opts.doMultiFile);
	NameLayout->addWidget( multiFile, 1, 0 );
	openAfterExportCheckBox = new QCheckBox( tr( "Open PDF after Export" ), Name );
	openAfterExportCheckBox->setChecked(Opts.openAfterExport);
	NameLayout->addWidget( openAfterExportCheckBox, 2, 0 );
	PDFExportLayout->addWidget( Name );

	Options = new TabPDFOptions( this, pdfOptions, AllFonts, PDFXProfiles, DocFonts,
								Eff, currView->Doc->unitIndex(), currView->Doc->pageHeight(),
								currView->Doc->pageWidth(), currView->Doc, true );
	PDFExportLayout->addWidget( Options );
	Layout7 = new QHBoxLayout;
	Layout7->setSpacing( 5 );
	Layout7->setMargin( 0 );
	QSpacerItem* spacer_2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
	Layout7->addItem( spacer_2 );
	OK = new QPushButton( tr( "&Save" ), this );
	OK->setAutoDefault( true );
	OK->setDefault( true );
	Layout7->addWidget( OK );
	Cancel = new QPushButton( CommonStrings::tr_Cancel, this );
	Layout7->addWidget( Cancel );
	PDFExportLayout->addLayout( Layout7 );
	if ((Opts.Version == PDFOptions::PDFVersion_X3) && (Options->InfoString->text().isEmpty()))
		OK->setEnabled(false);
	resize(sizeHint());
//	setMaximumSize( sizeHint() );
//tooltips
	multiFile->setToolTip( "<qt>" + tr( "This enables exporting one individually named PDF file for each page in the document. Page numbers are added automatically. This is most useful for imposing PDF for commercial printing.") + "</qt>" );
	openAfterExportCheckBox->setToolTip( "<qt>" + tr( "Open the exported PDF with the PDF viewer as set in External Tools preferences, when not exporting to a multi-file export destination.") + "</qt>" );
	OK->setToolTip( "<qt>" + tr( "The save button will be disabled if you are trying to export PDF/X and the info string is missing from the PDF/X tab.") + "</qt>" );
	// signals and slots connections
	connect( FileC, SIGNAL( clicked() ), this, SLOT( ChangeFile() ) );
	connect( OK, SIGNAL( clicked() ), this, SLOT( DoExport() ) );
	connect( Cancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
	connect( fileNameLineEdit, SIGNAL( editingFinished() ), this, SLOT( fileNameChanged() ) );
	connect( Options, SIGNAL(noInfo()), this, SLOT(disableSave()));
	connect( Options, SIGNAL(hasInfo()), this, SLOT(enableSave()));
}
Example #22
0
ListReports::ListReports(const QString &filter,const QString &type_filter,
			 const QString &group,const QString &schedcode,
			 QWidget *parent,const char *name)
  : QDialog(parent,name,true)
{
  list_filter=filter;
  list_type_filter=type_filter;
  list_group=group;
  list_schedcode=schedcode;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  setCaption(tr("RDLibrary Reports"));

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);

  //
  // Reports List
  //
  list_reports_box=new QComboBox(this,"list_reports_box");
  list_reports_box->setGeometry(50,10,sizeHint().width()-60,19);
  list_reports_box->insertItem(tr("Cart Report"));
  list_reports_box->insertItem(tr("Cut Report"));
  list_reports_box->insertItem(tr("Cart Data Dump (fixed width)"));
  list_reports_box->insertItem(tr("Cart Data Dump (CSV)"));
  list_reports_label=new QLabel(list_reports_box,tr("Type:"),this);
  list_reports_label->setGeometry(10,10,35,19);
  list_reports_label->setFont(font);
  list_reports_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(list_reports_box,SIGNAL(activated(int)),
	  this,SLOT(typeActivatedData(int)));

  //
  // Field Names Checkbox
  //
  list_fieldnames_check=new QCheckBox(this);
  list_fieldnames_check->setGeometry(55,34,15,15);
  list_fieldnames_check->setChecked(true);
  list_fieldnames_check->setDisabled(true);
  list_fieldnames_label=
    new QLabel(list_fieldnames_check,tr("Prepend Field Names"),this);
  list_fieldnames_label->setGeometry(75,32,sizeHint().width()-75,19);
  list_fieldnames_label->setFont(font);
  list_fieldnames_label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);
  list_fieldnames_label->setDisabled(true);

  //
  //  Generate Button
  //
  QPushButton *generate_button=new QPushButton(this,"generate_button");
  generate_button->
    setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  generate_button->setDefault(true);
  generate_button->setFont(font);
  generate_button->setText(tr("&Generate"));
  connect(generate_button,SIGNAL(clicked()),this,SLOT(generateData()));

  //
  //  Close Button
  //
  QPushButton *close_button=new QPushButton(this,"close_button");
  close_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  close_button->setFont(font);
  close_button->setText(tr("&Close"));
  connect(close_button,SIGNAL(clicked()),this,SLOT(closeData()));
}
QSize StatusBarItemClock::minimumSizeHint() const
{
    return sizeHint();
}
Example #24
0
/*!
    \reimp
*/
QSize QCheckBox::minimumSizeHint() const
{
    return sizeHint();
}
Example #25
0
ViewAdapters::ViewAdapters(RDStation *rdstation,
			   QWidget *parent,const char *name)
  : QDialog(parent,name,true)
{
  QString str1;
  QString str2;

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  setCaption(tr("Audio Resource Information"));

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",16,QFont::Bold);
  font.setPixelSize(16);
  QFont button_font=QFont("Helvetica",14,QFont::Bold);
  button_font.setPixelSize(14);

  //
  // Title
  //
  str1=tr("Audio Resources on");
  QLabel *label=
    new QLabel(QString().sprintf("%s %s",(const char *)str1,
				 (const char *)rdstation->name()),
				 this,"title_label");
  label->setGeometry(15,10,sizeHint().width()-20,16);
  label->setFont(font);

  //
  // Resource List
  //
  QTextEdit *text_edit=new QTextEdit(this,"adapter_edit");
  text_edit->setGeometry(10,28,sizeHint().width()-20,sizeHint().height()-98);
  text_edit->setReadOnly(true);
  QString text;
  if(rdstation->scanned()) {
    text+=tr("SUPPORTED AUDIO DRIVERS\n");
    if(!rdstation->driverVersion(RDStation::Hpi).isEmpty()) {
      text+=QString().sprintf("  AudioScience HPI [%s]\n",
			      (const char *)rdstation->driverVersion(RDStation::Hpi));
    }
    if(!rdstation->driverVersion(RDStation::Jack).isEmpty()) {
      text+=QString().sprintf("  JACK Audio Connection Kit [%s]\n",
			      (const char *)rdstation->driverVersion(RDStation::Jack));
    }
    if(!rdstation->driverVersion(RDStation::Alsa).isEmpty()) {
      text+=QString().sprintf("  Advanced Linux Sound Architecture (ALSA) [%s]\n",
			      (const char *)rdstation->driverVersion(RDStation::Alsa));
    }
    text+="\n";
    
    text+=tr("SUPPORTED IMPORT FORMATS\n");
    if(rdstation->haveCapability(RDStation::HaveFlac)) {
      text+=tr("    Free Lossless Audio Codec (FLAC)\n");
    }
    if(rdstation->haveCapability(RDStation::HaveMpg321)) {
      text+=tr("    MPEG Layer 1\n");
      text+=tr("    MPEG Layer 2\n");
      text+=tr("    MPEG Layer 3\n");
    }
    if(rdstation->haveCapability(RDStation::HaveMp4Decode)) {
      text+=tr("    MP-4/AAC\n");
    }
    if(rdstation->haveCapability(RDStation::HaveOgg123)) {
      text+=tr("    OggVorbis\n");
    }
    text+=tr("    PCM16 Linear\n");
    text+="\n";
    text+=tr("SUPPORTED EXPORT FORMATS\n");
    if(rdstation->haveCapability(RDStation::HaveFlac)) {
      text+=tr("    Free Lossless Audio Codec (FLAC)\n");
    }
    if(rdstation->haveCapability(RDStation::HaveTwoLame)) {
      text+=tr("    MPEG Layer 2\n");
    }
    if(rdstation->haveCapability(RDStation::HaveLame)) {
      text+=tr("    MPEG Layer 3\n");
    }
    if(rdstation->haveCapability(RDStation::HaveOggenc)) {
      text+=tr("    OggVorbis\n");
    }
    text+=tr("    PCM16 Linear\n");
    RDEncoderList *encoders=new RDEncoderList(rdstation->name());
    for(unsigned i=0;i<encoders->encoderQuantity();i++) {
      text+="    "+encoders->encoder(i)->name()+" [Custom]\n";
    }
    delete encoders;

    text+="\n";
    
    text+=tr("AUDIO ADAPTERS\n");
    for(int i=0;i<RD_MAX_CARDS;i++) {
      str1=QString(tr("Card"));
      str2=QString(tr("Not present"));
      if(rdstation->cardName(i).isEmpty()) {
	text+=QString().sprintf("  %s %d: %s\n\n",(const char *)str1,i,
				(const char *)str2);
      }
      else {
	text+=QString().sprintf("  %s %d: %s\n",(const char *)str1,i,
				(const char *)rdstation->cardName(i));
	switch(rdstation->cardDriver(i)) {
	    case RDStation::Hpi:
	      text+=QString(tr("      Driver: AudioScience HPI\n"));
	      break;
	      
	    case RDStation::Jack:
	      text+=QString(tr("      Driver: JACK Audio Connection Kit\n"));
	      break;
	      
	    case RDStation::Alsa:
	      text+=QString(
		tr("      Driver: Advanced Linux Sound Architecture (ALSA)\n"));
	      break;
	      
	    case RDStation::None:
	      text+=QString(tr("      Driver: UNKNOWN\n"));
	      break;
	}
	str1=QString(tr("Inputs:"));
	text+=QString().sprintf("      %s %d\n",(const char *)str1,
				rdstation->cardInputs(i));
	str1=QString(tr("Outputs:"));
	text+=QString().sprintf("      %s %d\n\n",(const char *)str1,
				rdstation->cardOutputs(i));
      }
    }
  }
  else {
    text=tr("NO DATA AVAILABLE\n\n");
    text+=tr("Please start the Rivendell daemons on this host (by executing, as user 'root', the command \"/etc/init.d/rivendell start\") in order to populate the audio resources database.");
  }
  text_edit->setText(text);

  //
  //  Close Button
  //
  QPushButton *button=new QPushButton(this,"close_button");
  button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			    80,50);
  button->setFont(button_font);
  button->setText(tr("&Close"));
  button->setDefault(true);
  connect(button,SIGNAL(clicked()),this,SLOT(closeData()));
}
Example #26
0
Dialog::Dialog(QWidget *parent)
  : QDialog(parent)
{
  rootLabel = new QLabel(tr("&root path:"));
  rootLineEdit = new QLineEdit;
  rootLabel->setBuddy(rootLineEdit);

  portLabel = new QLabel(tr("&port number:"));
  portLineEdit = new QLineEdit;
  portLineEdit->setValidator(new QIntValidator(1, 65535, this));
  portLabel->setBuddy(portLineEdit);

  velocityLabel = new QLabel(tr("&velocity (B/s):"));
  velocityLineEdit = new QLineEdit;
  velocityLineEdit->setValidator(new QIntValidator(1, 10240000, this));
  velocityLabel->setBuddy(velocityLineEdit);

  okButton = new QPushButton(tr("&ok"));
  okButton->setDefault(true);
  okButton->setEnabled(false);
  
  cancelButton = new QPushButton(tr("&cancel"));
  cancelButton->setEnabled(true);

  closeButton = new QPushButton(tr("&close"));
  closeButton->setEnabled(true);
 
  connect(rootLineEdit, SIGNAL(textChanged(const QString &)), this,
          SLOT(alterOkButtonStatus()));
  connect(portLineEdit, SIGNAL(textChanged(const QString &)), this,
          SLOT(alterOkButtonStatus()));
  connect(velocityLineEdit, SIGNAL(textChanged(const QString &)), this,
          SLOT(alterOkButtonStatus()));
  connect(okButton, SIGNAL(clicked()), this, SLOT(okClicked()));
  connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
  connect(closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));

  QHBoxLayout *rootHLayout = new QHBoxLayout;
  rootHLayout->addWidget(rootLabel);
  rootHLayout->addWidget(rootLineEdit);

  QHBoxLayout *portHLayout = new QHBoxLayout;
  portHLayout->addWidget(portLabel);
  portHLayout->addWidget(portLineEdit);
  
  QHBoxLayout *velocityHLayout = new QHBoxLayout;
  velocityHLayout->addWidget(velocityLabel);
  velocityHLayout->addWidget(velocityLineEdit);

  QHBoxLayout *buttonHLayout = new QHBoxLayout;
  buttonHLayout->addWidget(okButton);
  buttonHLayout->addWidget(cancelButton);
  buttonHLayout->addWidget(closeButton);
 
  QVBoxLayout *mainLayout = new QVBoxLayout;
  mainLayout->addLayout(rootHLayout);
  mainLayout->addLayout(portHLayout);
  mainLayout->addLayout(velocityHLayout);
  mainLayout->addLayout(buttonHLayout);
  setLayout(mainLayout);

  setWindowTitle(tr("Server configurations"));
  setFixedWidth(sizeHint().width());
}
Example #27
0
MainWidget::MainWidget(QWidget *parent,const char *name)
  :QWidget(parent,name)
{
  setCaption(tr("RDAlsaConfig"));

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());

  //
  // Generate Fonts
  //
  QFont font("Helvetica",12,QFont::Normal);
  font.setPixelSize(12);
  QFont label_font("Helvetica",12,QFont::Bold);
  label_font.setPixelSize(12);

  //
  // Available Devices
  //
  alsa_system_list=new QListBox(this);
  alsa_system_list->setFont(font);
  alsa_system_label=
    new QLabel(alsa_system_list,tr("Available Sound Devices"),this);
  alsa_system_label->setFont(label_font);
  alsa_system_label->setAlignment(AlignLeft|AlignVCenter);

  //
  // Up Button
  //
  alsa_up_button=
    new RDTransportButton(RDTransportButton::Up,this,"alsa_up_button");
  connect(alsa_up_button,SIGNAL(clicked()),this,SLOT(upData()));

  //
  // Down Button
  //
  alsa_down_button=
    new RDTransportButton(RDTransportButton::Down,this,"alsa_down_button");
  connect(alsa_down_button,SIGNAL(clicked()),this,SLOT(downData()));

  //
  // Selected Devices
  //
  alsa_config_list=new QListBox(this);
  alsa_config_list->setFont(font);
  alsa_config_label=new QLabel(alsa_config_list,tr("Active Sound Devices"),this);
  alsa_config_label->setFont(label_font);
  alsa_config_label->setAlignment(AlignLeft|AlignVCenter);

  //
  // Save Button
  //
  alsa_save_button=new QPushButton(tr("Save"),this);
  alsa_save_button->setFont(label_font);
  connect(alsa_save_button,SIGNAL(clicked()),this,SLOT(saveData()));

  //
  // Cancel Button
  //
  alsa_cancel_button=new QPushButton(tr("Cancel"),this);
  alsa_cancel_button->setFont(label_font);
  connect(alsa_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Load Available Devices and Configuration
  //
  alsa_alsa=new RDAlsa();
  alsa_alsa->load(alsa_filename);
  LoadList(alsa_system_list,alsa_config_list);

  //
  // Daemon Management
  //
  if(alsa_manage_daemons) {
    if(geteuid()!=0) {
      QMessageBox::warning(this,tr("RDAlsaConfig error"),
	     tr("The \"--manage-daemons\" switch requires root permissions."));
      exit(256);
    }
    if(system("/etc/init.d/rivendell status")==0) {
      int r=QMessageBox::warning(this,tr("RDAlsaConfig warning"),
	    tr("Rivendell audio will be interrupted while running this program.\nContinue?"),
				     QMessageBox::Yes,QMessageBox::No);
      if(r!=QMessageBox::Yes) {
	exit(256);
      }       
    }
  }
  StopDaemons();
}
Example #28
0
Login::Login(QString *username,QString *password,QWidget *parent,
	     const char *name)  : QDialog(parent,name,true)
{
  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  setCaption(tr("Login"));
  login_name=username;
  login_password=password;

  //
  // Create Fonts
  //
  QFont font=QFont("Helvetica",12,QFont::Bold);
  font.setPixelSize(12);

  //
  // Text Validator
  //
  RDTextValidator *validator=new RDTextValidator(this,"validator");

  //
  // OK Button
  //
  QPushButton *ok_button=new QPushButton(this,"ok_button");
  ok_button->setGeometry(10,60,100,55);
  ok_button->setFont(font);
  ok_button->setText(tr("&OK"));
  ok_button->setDefault(true);
  connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  // CANCEL Button
  //
  QPushButton *cancel_button=new QPushButton(this,"cancel_button");
  cancel_button->setGeometry(120,60,100,55);
  cancel_button->setFont(font);
  cancel_button->setText(tr("&Cancel"));
  connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Login Name
  //
  login_name_edit=new QLineEdit(this,"login_name_edit");
  login_name_edit->setGeometry(100,10,100,19);
  login_name_edit->setMaxLength(16);
  login_name_edit->setFocus();
  login_name_edit->setValidator(validator);
  QLabel *login_name_label=new QLabel(login_name_edit,tr("User &Name:"),this,
				       "login_name_label");
  login_name_label->setGeometry(10,10,85,19);
  login_name_label->setFont(font);
  login_name_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Login Password
  //
  login_password_edit=new QLineEdit(this,"login_password_edit");
  login_password_edit->setGeometry(100,31,100,19);
  login_password_edit->setMaxLength(16);
  login_password_edit->setEchoMode(QLineEdit::Password);
  login_password_edit->setValidator(validator);
  QLabel *login_password_label=new QLabel(login_password_edit,tr("&Password:"******"login_password_label");
  login_password_label->setGeometry(10,31,85,19);
  login_password_label->setFont(font);
  login_password_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

}
Example #29
0
color_swatch_t::color_swatch_t( QWidget *parent, const color_t& c) : QWidget( parent), background_( sizeHint(), QImage::Format_RGB32)
{
    setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding);
    setFocusPolicy( Qt::StrongFocus);
    valid_background_ = false;
    color_ = c;
}
QSize
PartitionLabelsView::minimumSizeHint() const
{
    return sizeHint();
}