Ejemplo n.º 1
0
HistorySizeWidget::HistorySizeWidget(QWidget* parent)
    : QWidget(parent)
{
    _ui = new Ui::HistorySizeWidget();
    _ui->setupUi(this);

    _ui->unlimitedWarningWidget->setVisible(false);
    _ui->unlimitedWarningWidget->setWordWrap(true);
    _ui->unlimitedWarningWidget->setCloseButtonVisible(false);
    _ui->unlimitedWarningWidget->setMessageType(KMessageWidget::Information);
    _ui->unlimitedWarningWidget->setText(i18nc("@info:status",
        "When using this option, the scrollback data will be written "
        "unencrypted to temporary files. Those temporary files will be "
        "deleted automatically when Konsole is closed in a normal manner.\n"
        "Use Settings->Configure Konsole->File Location to select the "
        "location of the temporary files."));

    // focus and select the spinner automatically when appropriate
    _ui->fixedSizeHistoryButton->setFocusProxy(_ui->historyLineSpinner);
    connect(_ui->fixedSizeHistoryButton , &QRadioButton::clicked , _ui->historyLineSpinner , &KPluralHandlingSpinBox::selectAll);

    QButtonGroup* modeGroup = new QButtonGroup(this);
    modeGroup->addButton(_ui->noHistoryButton);
    modeGroup->addButton(_ui->fixedSizeHistoryButton);
    modeGroup->addButton(_ui->unlimitedHistoryButton);
    connect(modeGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), this, &Konsole::HistorySizeWidget::buttonClicked);

    _ui->historyLineSpinner->setSuffix(ki18ncp("Unit of scrollback", " line", " lines"));
    this->setLineCount(HistorySizeWidget::DefaultLineCount);

    connect(_ui->historyLineSpinner, static_cast<void(KPluralHandlingSpinBox::*)(int)>(&KPluralHandlingSpinBox::valueChanged), this, &Konsole::HistorySizeWidget::historySizeChanged);
}
Ejemplo n.º 2
0
/*
 *  Constructs a dspTimePhasedDemandByPlannerCode as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
dspTimePhasedDemandByPlannerCode::dspTimePhasedDemandByPlannerCode(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

//  (void)statusBar();

  QButtonGroup* btngrpDisplayUnits = new QButtonGroup(this);
  btngrpDisplayUnits->addButton(_inventoryUnits);
  btngrpDisplayUnits->addButton(_capacityUnits);
  btngrpDisplayUnits->addButton(_altCapacityUnits);

  // signals and slots connections
  connect(_demand, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*,int)));
  connect(_query, SIGNAL(clicked()), this, SLOT(sFillList()));
  connect(_close, SIGNAL(clicked()), this, SLOT(close()));
  connect(_calendar, SIGNAL(newCalendarId(int)), _periods, SLOT(populate(int)));
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_submit, SIGNAL(clicked()), this, SLOT(sSubmit()));
  connect(_calendar, SIGNAL(select(ParameterList&)), _periods, SLOT(load(ParameterList&)));

  _plannerCode->setType(ParameterGroup::PlannerCode);

  _demand->addColumn(tr("Planner Code"), _itemColumn, Qt::AlignLeft,   true,  "plancode_code"   );
  _demand->addColumn(tr("Site"),         _whsColumn,  Qt::AlignCenter, true,  "warehous_code" );
  _demand->addColumn(tr("UOM"),          _uomColumn,  Qt::AlignLeft,   true,  "uom"   );

  if (!_metrics->boolean("EnableBatchManager"))
    _submit->hide();
}
Ejemplo n.º 3
0
void DkTifDialog::init() {

	isOk = false;
	setWindowTitle("TIF compression");
	//setFixedSize(270, 146);
	setLayout(new QVBoxLayout(this));

	//QWidget* buttonWidget = new QWidget(this);
	QGroupBox* buttonWidget = new QGroupBox(tr("TIF compression"), this);
	QVBoxLayout* vBox = new QVBoxLayout(buttonWidget);
	QButtonGroup* bGroup = new QButtonGroup(buttonWidget);
	noCompressionButton = new QRadioButton( tr("&no compression"), this);
	compressionButton = new QRadioButton(tr("&LZW compression (lossless)"), this);
	compressionButton->setChecked(true);
	bGroup->addButton(noCompressionButton);
	bGroup->addButton(compressionButton);

	vBox->addWidget(noCompressionButton);
	vBox->addWidget(compressionButton);

	// mButtons
	QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
	buttons->button(QDialogButtonBox::Ok)->setText(tr("&OK"));
	buttons->button(QDialogButtonBox::Cancel)->setText(tr("&Cancel"));
	connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
	connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));

	layout()->addWidget(buttonWidget);
	layout()->addWidget(buttons);
}
Ejemplo n.º 4
0
BaseTrackView::BaseTrackView(Controller::MainController *mainController, long trackID) :
    ui(new Ui::BaseTrackView),
    mainController(mainController),
    trackID(trackID),
    activated(true),
    narrowed(false),
    drawDbValue(true)
{
    ui->setupUi(this);
    QObject::connect(ui->muteButton, SIGNAL(clicked()), this, SLOT(onMuteClicked()));
    QObject::connect(ui->soloButton, SIGNAL(clicked()), this, SLOT(onSoloClicked()));
    QObject::connect(ui->levelSlider, SIGNAL(valueChanged(int)), this, SLOT(onFaderMoved(int)));
    //QObject::connect(ui->panSlider, SIGNAL(sliderMoved(int)), this, SLOT(onPanSliderMoved(int)));
    QObject::connect(ui->panSlider, SIGNAL(valueChanged(int)), this, SLOT(onPanSliderMoved(int)));
    QObject::connect(ui->buttonBoostZero, SIGNAL(clicked(bool)), this, SLOT(onBoostButtonClicked()));
    QObject::connect(ui->buttonBoostMinus12, SIGNAL(clicked(bool)), this, SLOT(onBoostButtonClicked()));
    QObject::connect(ui->buttonBoostPlus12, SIGNAL(clicked(bool)), this, SLOT(onBoostButtonClicked()));

    ui->panSlider->installEventFilter(this);
    ui->levelSlider->installEventFilter(this);
    ui->peaksDbLabel->installEventFilter(this);

    //add in static map
    trackViews.insert(trackID, this);

    QButtonGroup* boostButtonGroup = new QButtonGroup(this);
    boostButtonGroup->addButton(ui->buttonBoostMinus12);
    boostButtonGroup->addButton(ui->buttonBoostZero);
    boostButtonGroup->addButton(ui->buttonBoostPlus12);

    ui->buttonBoostZero->setChecked(true);

    setAttribute(Qt::WA_NoBackground);
}
Ejemplo n.º 5
0
HistorySizeWidget::HistorySizeWidget(QWidget* parent)
    : QWidget(parent)
{
    _ui = new Ui::HistorySizeWidget();
    _ui->setupUi(this);

    _ui->unlimitedWarningWidget->setVisible(false);
    _ui->unlimitedWarningWidget->setWordWrap(true);
    _ui->unlimitedWarningWidget->setCloseButtonVisible(false);
    _ui->unlimitedWarningWidget->setMessageType(KMessageWidget::Information);
    _ui->unlimitedWarningWidget->setText(i18nc("@info:status",
        "When using this option, the scrollback data will be written "
        "unencrypted to temporary files. Those temporary files will be "
        "deleted automatically when Konsole is closed in a normal manner."));

    // focus and select the spinner automatically when appropriate
    _ui->fixedSizeHistoryButton->setFocusProxy(_ui->historyLineSpinner);
    connect(_ui->fixedSizeHistoryButton , SIGNAL(clicked()) ,
            _ui->historyLineSpinner , SLOT(selectAll()));

    QButtonGroup* modeGroup = new QButtonGroup(this);
    modeGroup->addButton(_ui->noHistoryButton);
    modeGroup->addButton(_ui->fixedSizeHistoryButton);
    modeGroup->addButton(_ui->unlimitedHistoryButton);
    connect(modeGroup, SIGNAL(buttonClicked(QAbstractButton*)),
            this, SLOT(buttonClicked(QAbstractButton*)));

    _ui->historyLineSpinner->setSuffix(ki18ncp("Unit of scrollback", " line", " lines"));
    this->setLineCount(HistorySizeWidget::DefaultLineCount);

    connect(_ui->historyLineSpinner, SIGNAL(valueChanged(int)),
            this, SIGNAL(historySizeChanged(int)));
}
Ejemplo n.º 6
0
batchManager::batchManager(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(parent, fl)
{
  setupUi(this);
  if (name)
    setObjectName(name);

  QButtonGroup * buttonGroup = new QButtonGroup(this);
  buttonGroup->addButton(_currentUser);
  buttonGroup->addButton(_allUsers);
  buttonGroup->addButton(_selectedUser);

  connect(_autoUpdate,   SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_batch, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_cancel,       SIGNAL(clicked()),          this, SLOT(sCancel()));
  connect(_reschedule,   SIGNAL(clicked()),          this, SLOT(sReschedule()));
  connect(_showCompleted,SIGNAL(toggled(bool)),      this, SLOT(sFillList()));
  connect(_usr,          SIGNAL(newID(int)),         this, SLOT(sFillList()));
  connect(_view,         SIGNAL(clicked()),          this, SLOT(sView()));
  connect(buttonGroup,   SIGNAL(buttonClicked(int)), this, SLOT(sFillList()));

  _db = QSqlDatabase();
  
  _timer = new QTimer(this);

  _batch->addColumn( tr("User"),          _dateColumn, Qt::AlignLeft, true, "batch_user");
  _batch->addColumn( tr("Action"),        _itemColumn, Qt::AlignLeft, true, "batch_action");
  _batch->addColumn( tr("Scheduled"), _timeDateColumn, Qt::AlignLeft, true, "batch_scheduled");
  _batch->addColumn( tr("Run Status"),_timeDateColumn, Qt::AlignLeft, true, "runstatus");
  _batch->addColumn( tr("Completed"), _timeDateColumn, Qt::AlignLeft, true, "batch_completed");
  _batch->addColumn( tr("Exit Status"),            -1, Qt::AlignLeft, true, "exitstatus" );

  setDatabase(_db);
}
Ejemplo n.º 7
0
void ExportDialog::makeTimeGroupBox(){
  timeOutGb=new QGroupBox("Time Output");
  radioSingle=new QRadioButton(tr("Single"));
  radioAll=new QRadioButton(tr("All frames:  0  to  "));
  radioRange=new QRadioButton(tr("Range:"));
  minBox=new QSpinBox;
  maxBox=new QSpinBox;
  QLabel *toLb=new QLabel(tr(" to "));
  QButtonGroup buttonGroup;
  buttonGroup.addButton(radioSingle);
  buttonGroup.addButton(radioAll);
  buttonGroup.addButton(radioRange);
  radioSingle->setChecked(true);
  QHBoxLayout *hLayout=new QHBoxLayout;
  hLayout->addWidget(radioRange);
  hLayout->addWidget(minBox);
  hLayout->addWidget(toLb);
  hLayout->addWidget(maxBox);
  hLayout->addStretch(1);
  QVBoxLayout *vLayout=new QVBoxLayout;
  vLayout->addWidget(radioSingle);
  vLayout->addWidget(radioAll);
  vLayout->addLayout(hLayout);
  timeOutGb->setLayout(vLayout);
}
Ejemplo n.º 8
0
PatchView::PatchView(MainImpl* mi, Git* g) : Domain(mi, g, false) {

	patchTab = new Ui_TabPatch();
	patchTab->setupUi(container);
	SCRef ic(QString::fromUtf8(":/icons/resources/plusminus.png"));
	patchTab->buttonFilterPatch->setIcon(QIcon(ic));

	QButtonGroup* bg = new QButtonGroup(this);
	bg->addButton(patchTab->radioButtonParent, DIFF_TO_PARENT);
	bg->addButton(patchTab->radioButtonHead, DIFF_TO_HEAD);
	bg->addButton(patchTab->radioButtonSha, DIFF_TO_SHA);
	connect(bg, SIGNAL(buttonClicked(int)), this, SLOT(button_clicked(int)));

	patchTab->textBrowserDesc->setup(this);
	patchTab->textEditDiff->setup(this, git);
	patchTab->fileList->setup(this, git);

	connect(m(), SIGNAL(typeWriterFontChanged()),
	        patchTab->textEditDiff, SLOT(typeWriterFontChanged()));

	connect(m(), SIGNAL(changeFont(const QFont&)),
	       patchTab->fileList, SLOT(on_changeFont(const QFont&)));

	connect(patchTab->lineEditDiff, SIGNAL(returnPressed()),
	        this, SLOT(lineEditDiff_returnPressed()));

	connect(patchTab->fileList, SIGNAL(contextMenu(const QString&, int)),
	        this, SLOT(on_contextMenu(const QString&, int)));

	connect(patchTab->buttonFilterPatch, SIGNAL(clicked()),
	        this, SLOT(buttonFilterPatch_clicked()));
}
Ejemplo n.º 9
0
Archivo: kard.cpp Proyecto: KDE/kard
void Kard::optionsPreferences()
{
    if ( KConfigDialog::showDialog( "settings" ) ) {
        return; 
    }
    //KConfigDialog didn't find an instance of this dialog, so lets create it : 
    KConfigDialog* dialog = new KConfigDialog( this, "settings",  KardSettings::self() );
    dialog->setModal(true); //makes it modal even if it's not the default
    QWidget *generalSettingsDlg = new QWidget;
    ui_general.setupUi(generalSettingsDlg);
    QButtonGroup *groupTimer = new QButtonGroup;
    groupTimer->addButton(ui_general.slow, 0);
    groupTimer->addButton(ui_general.medium, 1);
    groupTimer->addButton(ui_general.quick, 2);
    connect(groupTimer, SIGNAL(buttonClicked(int)), this, SLOT(slotUpdateTimer(int)));
    ui_general.kcfg_LanguageCombobox->insertItems(0, m_sortedNames);
    ui_general.kcfg_LanguageCombobox->setCurrentIndex(m_languages.indexOf(KardSettings::selectedLanguage()));
    dialog->addPage(generalSettingsDlg, i18n("General"), "wizard");
    QWidget *themeSettingsDlg = new QWidget;
    ui_theme.setupUi(themeSettingsDlg);
    dialog->addPage(themeSettingsDlg, i18n("Theme"), "colors");
    connect(dialog, SIGNAL(settingsChanged(const QString &)), this, SLOT(slotUpdateSettings(const QString &)));
    dialog->addPage(new KGameThemeSelector(dialog, KardSettings::self(), KGameThemeSelector::NewStuffDisableDownload),
                        i18n("Theme"), "games-config-theme");
    dialog->show();
}
XYZTextEditor::XYZTextEditor(QWidget *parent) : QWidget(parent), m_ui(new Ui::XYZTextEditor) {
    m_ui->setupUi(this);
    setupTextActions();
    fontChanged(m_ui->textEdit->font());
    alignmentChanged(m_ui->textEdit->alignment());
    m_ui->textEdit->setFocus();
    textEdit = m_ui->textEdit;
    QButtonGroup *btnGroup = new QButtonGroup(this);
    btnGroup->addButton(m_ui->btnAlignCenter);
    btnGroup->addButton(m_ui->btnAlignJustify);
    btnGroup->addButton(m_ui->btnAlignLeft);
    btnGroup->addButton(m_ui->btnAlignRight);
    QObject::connect(m_ui->textEdit, SIGNAL(currentCharFormatChanged(const QTextCharFormat &)),
            this, SLOT(currentCharFormatChanged(const QTextCharFormat &)));
    QObject::connect(m_ui->textEdit, SIGNAL(cursorPositionChanged()), this, SLOT(cursorPositionChanged()));
    QObject::connect(m_ui->btnCut, SIGNAL(clicked()), m_ui->textEdit, SLOT(cut()));
    QObject::connect(m_ui->btnCopy, SIGNAL(clicked()), m_ui->textEdit, SLOT(copy()));
    QObject::connect(m_ui->btnPaste, SIGNAL(clicked()), m_ui->textEdit, SLOT(paste()));
    QObject::connect(m_ui->btnTextDirection, SIGNAL(clicked()), this, SLOT(textDirection()));

//    m_ui->textEdit->document()->defaultTextOption().setTextDirection(QApplication::layoutDirection());
//    QTextCursor cursor = m_ui->textEdit->textCursor();
//    QTextBlockFormat blockFmt = cursor.blockFormat();
//    if (QApplication::layoutDirection() == Qt::RightToLeft) {
//        blockFmt.setLayoutDirection(Qt::RightToLeft);
//    } else {
//        blockFmt.setLayoutDirection(Qt::LeftToRight);
//    }
//    cursor.setBlockFormat(blockFmt);

//    qDebug()<<m_ui->textEdit->document()->defaultTextOption().textDirection();
//    qDebug()<<m_ui->textEdit->toHtml();
}
Ejemplo n.º 11
0
MusicMessageBox::MusicMessageBox(QWidget *parent)
    : MusicAbstractMoveDialog(parent),
      ui(new Ui::MusicMessageBox)
{
    ui->setupUi(this);

    m_status = 0;
    ////////////////////////////////////////////////
    ui->topTitleCloseButton->setIcon(QIcon(":/share/searchclosed"));
    ui->topTitleCloseButton->setStyleSheet(MusicUIObject::MToolButtonStyle03);
    ui->topTitleCloseButton->setCursor(QCursor(Qt::PointingHandCursor));
    ui->topTitleCloseButton->setToolTip(tr("Close"));

    ui->confirmButton->setStyleSheet(MusicUIObject::MPushButtonStyle08);
    ui->cancelButton->setStyleSheet(MusicUIObject::MPushButtonStyle08);
    ui->confirmButton->setCursor(QCursor(Qt::PointingHandCursor));
    ui->cancelButton->setCursor(QCursor(Qt::PointingHandCursor));

    QButtonGroup *groupButton = new QButtonGroup(this);
    groupButton->addButton(ui->topTitleCloseButton, 0);
    groupButton->addButton(ui->confirmButton, 1);
    groupButton->addButton(ui->cancelButton, 2);
    connect(groupButton, SIGNAL(buttonClicked(int)), SLOT(buttonClicked(int)));

}
Ejemplo n.º 12
0
substituteList::substituteList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
  : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  QButtonGroup * showByButtonGroup = new QButtonGroup(this);
  showByButtonGroup->addButton(_byLeadTime);
  showByButtonGroup->addButton(_byDays);
  showByButtonGroup->addButton(_byDate);

  // signals and slots connections
  connect(_byDays, SIGNAL(toggled(bool)), _days, SLOT(setEnabled(bool)));
  connect(_byDate, SIGNAL(toggled(bool)), _date, SLOT(setEnabled(bool)));
  connect(_subs, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));
  connect(_subs, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
  connect(showByButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(sFillList()));
  connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
  connect(_item, SIGNAL(newId(int)), _warehouse, SLOT(findItemsites(int)));
  connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int)));

  _subs->addColumn(tr("Item Number"),  _itemColumn, Qt::AlignLeft,   true,  "item_number"  );
  _subs->addColumn(tr("Description"),  -1,          Qt::AlignLeft,   true,  "itemdescrip"  );
  _subs->addColumn(tr("QOH"),          _qtyColumn,  Qt::AlignRight,  true,  "qoh" );
  _subs->addColumn(tr("Norm. QOH"),    _qtyColumn,  Qt::AlignRight,  true,  "normqoh" );
  _subs->addColumn(tr("Availability"), _qtyColumn,  Qt::AlignRight,  true,  "available" );
  _subs->addColumn(tr("Norm. Avail."), _qtyColumn,  Qt::AlignRight,  true,  "normavailable" );

  //If not multi-warehouse hide whs control
  if (!_metrics->boolean("MultiWhs"))
  {
    _warehouseLit->hide();
    _warehouse->hide();
  }
}
Ejemplo n.º 13
0
WeatherMessageBox::WeatherMessageBox(QWidget *parent)
    : WeatherAbstractMoveDialog(parent),
    ui(new Ui::WeatherMessageBox)
{
    ui->setupUi(this);
    drawWindowRoundedRect(this);
    //set window radius

    m_status = 0;
    ui->background->setPixmap(QPixmap(":/image/background").scaled(size()));
    ////////////////////////////////////////////////
    ui->topTitleCloseButton->setIcon(QIcon(":/image/close1"));
    ui->topTitleCloseButton->setStyleSheet(WeatherUIObject::MToolButtonStyle01);
    ui->topTitleCloseButton->setCursor(QCursor(Qt::PointingHandCursor));
    ui->topTitleCloseButton->setToolTip(tr("Close"));

    ui->confirmButton->setStyleSheet(WeatherUIObject::MPushButtonStyle04);
    ui->cancelButton->setStyleSheet(WeatherUIObject::MPushButtonStyle04);
    ui->confirmButton->setCursor(QCursor(Qt::PointingHandCursor));
    ui->cancelButton->setCursor(QCursor(Qt::PointingHandCursor));

    QButtonGroup *groupButton = new QButtonGroup(this);
    groupButton->addButton(ui->topTitleCloseButton, 0);
    groupButton->addButton(ui->confirmButton, 1);
    groupButton->addButton(ui->cancelButton, 2);
    connect(groupButton, SIGNAL(buttonClicked(int)), SLOT(buttonClicked(int)));

}
Ejemplo n.º 14
0
TimeAnalysisWidget::TimeAnalysisWidget(QWidget *parent) :
    QWidget(parent),
    _ui(new Ui::TimeAnalysisWidget)
{
    _ui->setupUi(this);
    _ui->legendGroupBox->setLayout(new QFormLayout);

    // read data
    loadLowAndHighData(std::string(DATA_DIR) + "perDay.low");
    //
    initTransitionGraphs();

    //
    _ui->projectionWidget->setMainUI(this);
    _ui->projectionWidget->setRadiusFactor(_ui->radiusSlider->value());
    _ui->projectionWidget->setOpacity(_ui->opacitySlider->value());

    // Autoexclude the Selection Modes
    QButtonGroup *buttonGroup = new QButtonGroup;
    buttonGroup->addButton(_ui->singleSelection, 0);
    buttonGroup->addButton(_ui->groupSelection, 1);
    connect(buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(selectionModeChanges(int)));

    //
    fillScalarComboBox();
    _selectedScalar = _scalars[0];
    _ui->colorByComboBox->setCurrentIndex(_selectedScalar->index());

    connect(_ui->colorByComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSelectedScalar(int)));
    connect(_ui->projectionWidget,SIGNAL(selectionChanged(QList<int>)), _ui->calendarWidget,SLOT(updateSelectedDays(QList<int>)));
    connect(_ui->projectionWidget,SIGNAL(selectionChanged(QList<int>)), _ui->graphWidget,SLOT(updateSelectedDays(QList<int>)));
    connect(_ui->calendarWidget, SIGNAL(changedSelectedDays(QList<int>)), _ui->projectionWidget, SLOT(updateSelectedPoints(QList<int>)));

    updateLegend();
}
Ejemplo n.º 15
0
WITToolPanel::WITToolPanel(QWidget *parent)
	: QWidget(parent)
{
	QHBoxLayout *vbox = new QHBoxLayout();

    QButtonGroup *bgroup = new QButtonGroup();
    QPushButton *b1 = new QPushButton("Touch");
    QPushButton *b2 = new QPushButton("Surface");
    QPushButton *b3 = new QPushButton("Stats");
    QPushButton *b4 = new QPushButton("VOI");

    b1->setCheckable(true);
    b2->setCheckable(true);
    b3->setCheckable(true);
    b4->setCheckable(true);

    bgroup->addButton(b1);
    bgroup->addButton(b2);
    bgroup->addButton(b3);
    bgroup->addButton(b4);

    QHBoxLayout *hbox = new QHBoxLayout();
    hbox->addWidget(b1);
    hbox->addWidget(b2);
    hbox->addWidget(b3);
    hbox->addWidget(b4);

    hbox->addSpacerItem(new QSpacerItem(0,0,QSizePolicy::Expanding, QSizePolicy::Expanding));

    vbox->addLayout(hbox);

    setLayout(vbox);
}
ConfigAppearanceWidget::ConfigAppearanceWidget(QWidget *parent)
	: QWidget(parent)
{
	m_itemMargin = 10;

	ui.setupUi(this);

	QButtonGroup *buttonGroup = new QButtonGroup(this);
	buttonGroup->addButton(ui.standardAppearanceCheck);
	buttonGroup->addButton(ui.customAppearanceCheck);
	buttonGroup->setExclusive(true);
	connect(buttonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(toggleCustom()));

	QPalette palette = ui.itemTable->palette();
	QColor highlightBackgroundColor(QApplication::style()->standardPalette().color(QPalette::Normal, QPalette::AlternateBase));
	if (highlightBackgroundColor == QApplication::style()->standardPalette().color(QPalette::Normal, QPalette::Base))
		highlightBackgroundColor = highlightBackgroundColor.darker(110);
	palette.setColor(QPalette::Normal, QPalette::Highlight, highlightBackgroundColor);
	palette.setColor(QPalette::Normal, QPalette::HighlightedText, QPalette::Text);
	palette.setColor(QPalette::Inactive, QPalette::Highlight, highlightBackgroundColor);
	palette.setColor(QPalette::Inactive, QPalette::HighlightedText, QPalette::Text);
	palette.setColor(QPalette::Disabled, QPalette::Highlight, highlightBackgroundColor);
	ui.itemTable->setPalette(palette);
	m_itemHighlighted = -1;
	connect(ui.itemTable, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), this, SLOT(setItemHighlighted(QTableWidgetItem*)));

	connect(ui.fontButton, SIGNAL(clicked()), this, SLOT(showFontDialog()));
	connect(ui.colorButton, SIGNAL(clicked()), this, SLOT(showColorDialog()));
}
Ejemplo n.º 17
0
			QWidget* PackagesDelegate::GetLayout (const QModelIndex& index) const
			{
				if (!Row2Layout_.contains (index.row ()))
				{
					QToolButton *instRem = GetInstallRemove (index);
					QToolButton *update = GetUpdate (index);

					QButtonGroup *group = new QButtonGroup (Viewport_);
					group->addButton (instRem);
					group->addButton (update);

					QWidget *result = new QWidget (Viewport_);

					QHBoxLayout *layout = new QHBoxLayout (result);
					layout->addWidget (instRem);
					layout->addWidget (update);

					result->setLayout (layout);

					Row2Layout_ [index.row ()] = result;
				}
				else
				{
					bool isInstalled = index.data (PackagesModel::PMRInstalled).toBool ();
					bool isUpgradable = index.data (PackagesModel::PMRUpgradable).toBool ();

					if (isInstalled != WasInstalled_ [index])
						GetInstallRemove (index);

					if (isUpgradable != WasUpgradable_ [index])
						GetUpdate (index);
				}

				return Row2Layout_ [index.row ()];
			}
Ejemplo n.º 18
0
Login::Login(QDialog *parent/* =0 */, Qt::WindowFlags flags /* =0 */)
:QDialog(parent, flags)
{
        isSuccess = false;
        ui.setupUi(this);

        ui.countRadioButton->setChecked(true);
        ui.oneHoueLineEdit->setEnabled(false);
        ui.hoursLineEdit->setEnabled(false);
        ui.vipCheckBox->setChecked(false);
        ui.vipCardLineEdit->setEnabled(false);

        QButtonGroup group;
        group.addButton(ui.timeRadioButton);
        group.addButton(ui.countRadioButton);
        vipId = NOT_VIP;

        QObject::connect(ui.countRadioButton, SIGNAL(clicked()), this, SLOT(enableCount()));
        QObject::connect(ui.timeRadioButton, SIGNAL(clicked()), this, SLOT(enableHour()));
        QObject::connect(ui.vipCheckBox, SIGNAL(clicked()), this, SLOT(enableVIP()));
        QObject::connect(ui.hoursLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateTotal()));
        QObject::connect(ui.oneHoueLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateTotal()));
        QObject::connect(ui.countLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateTotal()));
        QObject::connect(ui.oneTimeLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateTotal()));
		QObject::connect(ui.okButton, SIGNAL(clicked()), this, SLOT(setXXX()));
}
Ejemplo n.º 19
0
/*
 *  Constructs a substituteList as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
substituteList::substituteList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
    setupUi(this);

    QButtonGroup * showByButtonGroup = new QButtonGroup(this);
    showByButtonGroup->addButton(_byLeadTime);
    showByButtonGroup->addButton(_byDays);
    showByButtonGroup->addButton(_byDate);

    // signals and slots connections
    connect(_byDays, SIGNAL(toggled(bool)), _days, SLOT(setEnabled(bool)));
    connect(_byDate, SIGNAL(toggled(bool)), _date, SLOT(setEnabled(bool)));
    connect(_subs, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));
    connect(_subs, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
    connect(showByButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(sFillList()));
    connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
    connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
    connect(_item, SIGNAL(newId(int)), _warehouse, SLOT(findItemsites(int)));
    connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int)));
    init();

    //If not multi-warehouse hide whs control
    if (!_metrics->boolean("MultiWhs"))
    {
      _warehouseLit->hide();
      _warehouse->hide();
    }
}
Ejemplo n.º 20
0
CompressDialog::CompressDialog(QWidget* parent)
	:QDialog(parent)
	, _compressThread(NULL)
{
	QVBoxLayout* vLayout = new QVBoxLayout(this);
	vLayout->setSpacing(1);
	vLayout->setContentsMargins(1, 1, 1, 1);
	QHBoxLayout* hLayout0 = new QHBoxLayout();
	hLayout0->setSpacing(1);
	hLayout0->setContentsMargins(1, 1, 1, 1);
	vLayout->addLayout(hLayout0);
	QButtonGroup* buttonGroup = new QButtonGroup(this);
	_utf8CodeTypeCheckBox = new QCheckBox(QWidget::tr("UTF8文件名"));
	buttonGroup->addButton(_utf8CodeTypeCheckBox, 0);
	hLayout0->addWidget(_utf8CodeTypeCheckBox);
	_gbkCodeTypeCheckBox = new QCheckBox(QWidget::tr("GBK文件名"));
	buttonGroup->addButton(_gbkCodeTypeCheckBox, 1);
	hLayout0->addWidget(_gbkCodeTypeCheckBox);
	_utf8CodeTypeCheckBox->setChecked(true);

	QHBoxLayout* hLayout1 = new QHBoxLayout();
	hLayout1->setSpacing(1);
	hLayout1->setContentsMargins(1, 1, 1, 1);
	vLayout->addLayout(hLayout1);
	_sourceDirEdit = new QLineEdit;
	_sourceDirEdit->setReadOnly(true);
	hLayout1->addWidget(_sourceDirEdit);
	_sdBtn = new QPushButton;
	_sdBtn->setText(QWidget::tr("源路径"));
	connect(_sdBtn, SIGNAL(clicked()), this, SLOT(slotSourceDirBtnClicked()));
	hLayout1->addWidget(_sdBtn);

	QHBoxLayout* hLayout2 = new QHBoxLayout();
	hLayout2->setSpacing(1);
	hLayout2->setContentsMargins(1, 1, 1, 1);
	vLayout->addLayout(hLayout2);
	_targetDirEdit = new QLineEdit;
	_targetDirEdit->setReadOnly(true);
	hLayout2->addWidget(_targetDirEdit);
	_tdBtn = new QPushButton;
	_tdBtn->setText(QWidget::tr("目标路径"));
	connect(_tdBtn, SIGNAL(clicked()), this, SLOT(slotTargetDirBtnClicked()));
	hLayout2->addWidget(_tdBtn);

	QHBoxLayout* hLayout3 = new QHBoxLayout();
	hLayout3->setSpacing(1);
	hLayout3->setContentsMargins(1, 1, 1, 1);
	vLayout->addLayout(hLayout3);
	_sBtn = new QPushButton;
	_sBtn->setText(QWidget::tr("开始"));
	connect(_sBtn, SIGNAL(clicked()), this, SLOT(slotStartBtnClicked()));
	hLayout3->addWidget(_sBtn);
	_eBtn = new QPushButton;
	_eBtn->setText(QWidget::tr("结束"));
	connect(_eBtn, SIGNAL(clicked()), this, SLOT(slotEndBtnClicked()));
	hLayout3->addWidget(_eBtn);

	_messageTextBrowser = new QTextBrowser;
	vLayout->addWidget(_messageTextBrowser);
}
Ejemplo n.º 21
0
void NinjamRoomWindow::createLayoutDirectionButtons(Qt::Orientation initialOrientation)
{
    horizontalLayoutButton = new QToolButton();
    horizontalLayoutButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
    horizontalLayoutButton->setIcon(QIcon(":/images/horizontal_layout.png"));
    horizontalLayoutButton->setObjectName(QStringLiteral("buttonHorizontalLayout"));
    horizontalLayoutButton->setCheckable(true);

    verticalLayoutButton = new QToolButton();
    verticalLayoutButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
    verticalLayoutButton->setIcon(QIcon(":/images/vertical_layout.png"));
    verticalLayoutButton->setObjectName(QStringLiteral("buttonVerticalLayout"));
    verticalLayoutButton->setCheckable(true);

    if(initialOrientation == Qt::Vertical)
        verticalLayoutButton->setChecked(true);
    else
        horizontalLayoutButton->setChecked(true);

    QHBoxLayout *buttonsLayout = new QHBoxLayout();
    buttonsLayout->setSpacing(0);
    buttonsLayout->setContentsMargins(0, 0, 0, 0);
    buttonsLayout->addWidget(verticalLayoutButton);
    buttonsLayout->addWidget(horizontalLayoutButton);

    QButtonGroup *buttonGroup = new QButtonGroup(this);
    buttonGroup->addButton(verticalLayoutButton);
    buttonGroup->addButton(horizontalLayoutButton);

    int licenceButtonIndex = ui->topLayout->indexOf(ui->licenceButton);
    ui->topLayout->insertLayout(licenceButtonIndex, buttonsLayout);

    connect( buttonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(toggleTracksLayoutOrientation(QAbstractButton*)));
}
Ejemplo n.º 22
0
void Window::initControlWidget () {
    controlWidget = new QGroupBox ();
    QVBoxLayout * layout = new QVBoxLayout (controlWidget);
    
    QGroupBox * previewGroupBox = new QGroupBox ("Preview", controlWidget);
    QVBoxLayout * previewLayout = new QVBoxLayout (previewGroupBox);
    
    QCheckBox * wireframeCheckBox = new QCheckBox ("Wireframe", previewGroupBox);
    connect (wireframeCheckBox, SIGNAL (toggled (bool)), viewer, SLOT (setWireframe (bool)));
    previewLayout->addWidget (wireframeCheckBox);
   
    QButtonGroup * modeButtonGroup = new QButtonGroup (previewGroupBox);
    modeButtonGroup->setExclusive (true);
    QRadioButton * flatButton = new QRadioButton ("Flat", previewGroupBox);
    QRadioButton * smoothButton = new QRadioButton ("Smooth", previewGroupBox);
    modeButtonGroup->addButton (flatButton, static_cast<int>(GLViewer::Flat));
    modeButtonGroup->addButton (smoothButton, static_cast<int>(GLViewer::Smooth));
    connect (modeButtonGroup, SIGNAL (buttonClicked (int)), viewer, SLOT (setRenderingMode (int)));
    previewLayout->addWidget (flatButton);
    previewLayout->addWidget (smoothButton);
    
    QPushButton * snapshotButton  = new QPushButton ("Save preview", previewGroupBox);
    connect (snapshotButton, SIGNAL (clicked ()) , this, SLOT (exportGLImage ()));
    previewLayout->addWidget (snapshotButton);

    layout->addWidget (previewGroupBox);
    
    QGroupBox * rayGroupBox = new QGroupBox ("Ray Tracing", controlWidget);
    QVBoxLayout * rayLayout = new QVBoxLayout (rayGroupBox);
    QPushButton * rayButton = new QPushButton ("Render", rayGroupBox);
    rayLayout->addWidget (rayButton);
    connect (rayButton, SIGNAL (clicked ()), this, SLOT (renderRayImage ()));
    QPushButton * showButton = new QPushButton ("Show", rayGroupBox);
    rayLayout->addWidget (showButton);
    connect (showButton, SIGNAL (clicked ()), this, SLOT (showRayImage ()));
    QPushButton * saveButton  = new QPushButton ("Save", rayGroupBox);
    connect (saveButton, SIGNAL (clicked ()) , this, SLOT (exportRayImage ()));
    rayLayout->addWidget (saveButton);

    layout->addWidget (rayGroupBox);
    
    QGroupBox * globalGroupBox = new QGroupBox ("Global Settings", controlWidget);
    QVBoxLayout * globalLayout = new QVBoxLayout (globalGroupBox);
    
    QPushButton * bgColorButton  = new QPushButton ("Background Color", globalGroupBox);
    connect (bgColorButton, SIGNAL (clicked()) , this, SLOT (setBGColor()));
    globalLayout->addWidget (bgColorButton);
    
    QPushButton * aboutButton  = new QPushButton ("About", globalGroupBox);
    connect (aboutButton, SIGNAL (clicked()) , this, SLOT (about()));
    globalLayout->addWidget (aboutButton);
    
    QPushButton * quitButton  = new QPushButton ("Quit", globalGroupBox);
    connect (quitButton, SIGNAL (clicked()) , qApp, SLOT (closeAllWindows()));
    globalLayout->addWidget (quitButton);

    layout->addWidget (globalGroupBox);

    layout->addStretch (0);
}
Ejemplo n.º 23
0
DlgPrefCrossfader::DlgPrefCrossfader(QWidget * parent, ConfigObject<ConfigValue> * _config)
        : QWidget(parent)
        , m_COTMode(ControlObject::getControl(ConfigKey(CONFIG_KEY, "xFaderMode")))
        , m_COTCurve(ControlObject::getControl(ConfigKey(CONFIG_KEY, "xFaderCurve")))
        , m_COTCalibration(ControlObject::getControl(ConfigKey(CONFIG_KEY, "xFaderCalibration")))
        , m_COTReverse(ControlObject::getControl(ConfigKey(CONFIG_KEY, "xFaderReverse"))) {
    config = _config;
    m_pxfScene = NULL;

    m_transform = 0;
    m_cal = 0;
    m_xFaderMode = MIXXX_XFADER_ADDITIVE;

    setupUi(this);

    connect(PushButtonReset,	  SIGNAL(clicked(bool)), this,	SLOT(setDefaults()));

    QButtonGroup crossfaderModes;
    crossfaderModes.addButton(radioButtonAdditive);
    crossfaderModes.addButton(radioButtonConstantPower);

    loadSettings();

    connect(SliderXFader,         SIGNAL(valueChanged(int)), this, SLOT(slotUpdateXFader()));
    connect(SliderXFader,         SIGNAL(sliderMoved(int)), this,  SLOT(slotUpdateXFader()));
    connect(SliderXFader,         SIGNAL(sliderReleased()), this,  SLOT(slotUpdateXFader()));
    connect(SliderXFader,         SIGNAL(sliderReleased()), this,  SLOT(slotApply()));

    //Update the crossfader curve graph and other setings when the crossfader mode is changed.
    connect(radioButtonAdditive,        SIGNAL(clicked(bool)), this, SLOT(slotUpdate()));
    connect(radioButtonConstantPower,   SIGNAL(clicked(bool)), this, SLOT(slotUpdate()));
}
Ejemplo n.º 24
0
void tst_QButtonGroup::checkedButton()
{
    QButtonGroup buttons;
    buttons.setExclusive(false);
    QPushButton pb1;
    pb1.setCheckable(true);
    QPushButton pb2;
    pb2.setCheckable(true);
    buttons.addButton(&pb1);
    buttons.addButton(&pb2, 23);

    QVERIFY(buttons.checkedButton() == 0);
    pb1.setChecked(true);
    QVERIFY(buttons.checkedButton() == &pb1);
    pb2.setChecked(true);
    QVERIFY(buttons.checkedButton() == &pb2);
    pb2.setChecked(false);
    QVERIFY(buttons.checkedButton() == &pb1);
    pb1.setChecked(false);
    QVERIFY(buttons.checkedButton() == 0);

    buttons.setExclusive(true);
    QVERIFY(buttons.checkedButton() == 0);
    pb1.setChecked(true);
    QVERIFY(buttons.checkedButton() == &pb1);
    pb2.setChecked(true);
    QVERIFY(buttons.checkedButton() == &pb2);
    // checked button cannot be unchecked
    pb2.setChecked(false);
    QVERIFY(buttons.checkedButton() == &pb2);
}
Ejemplo n.º 25
0
QWidget* PreferencesDialog::createRecordingTab(QWidget* parent)
{
	QWidget* widget = new QWidget(parent);
	QVBoxLayout* vbox = new QVBoxLayout(widget);
	//
	QButtonGroup* group = new QButtonGroup(vbox);
	QRadioButton* radio = new QRadioButton(tr("Automatically &record all calls"), widget);
	group->addButton(radio, AUTO_RECORD_ON);
	vbox->addWidget(radio);
	radio = new QRadioButton(tr("&Ask for every call"), widget);
	group->addButton(radio, AUTO_RECORD_ASK);
	vbox->addWidget(radio);
	radio = new QRadioButton(tr("Do &not automatically record calls"), widget);
	group->addButton(radio, AUTO_RECORD_OFF);
	vbox->addWidget(radio);
	//
	int auto_rec = settings.autoRecordGlobal();
	group->button(auto_rec)->setChecked(true);
	//
	connect(group, SIGNAL(buttonClicked(int)), &settings, SLOT(setAutoRecordGlobal(int)));

	QPushButton* button = new QPushButton(tr("Edit &per caller preferences"), widget);
	connect(button, SIGNAL(clicked(bool)), this, SLOT(editPerCallerPreferences()));
	vbox->addWidget(button);

	QCheckBox* check = new QCheckBox(tr("Show &balloon notification when recording starts"), widget);
	check->setChecked(settings.guiNotify());
	connect(button, SIGNAL(toggled(bool)), &settings, SLOT(setGuiNotify(bool)));
	vbox->addWidget(check);

	vbox->addStretch();
	return widget;
}
Ejemplo n.º 26
0
void MusicSettingWidget::initDownloadWidget()
{
    ui->downloadDirButton->setStyleSheet(MusicUIObject::MPushButtonStyle05);
    ui->downloadLrcDirButton->setStyleSheet(MusicUIObject::MPushButtonStyle05);
    ui->downloadDirButton->setCursor(QCursor(Qt::PointingHandCursor));
    ui->downloadLrcDirButton->setCursor(QCursor(Qt::PointingHandCursor));
    ui->downloadCacheAutoRadioBox->setStyleSheet(MusicUIObject::MRadioButtonStyle01);
    ui->downloadCacheManRadioBox->setStyleSheet(MusicUIObject::MRadioButtonStyle01);
    ui->downloadFullRadioBox->setStyleSheet(MusicUIObject::MRadioButtonStyle01);
    ui->downloadLimitRadioBox->setStyleSheet(MusicUIObject::MRadioButtonStyle01);

    ui->downloadServerComboBox->setItemDelegate(new QStyledItemDelegate(ui->downloadServerComboBox));
    ui->downloadServerComboBox->setStyleSheet(MusicUIObject::MComboBoxStyle01 + MusicUIObject::MItemView01);
    ui->downloadServerComboBox->view()->setStyleSheet(MusicUIObject::MScrollBarStyle01);
    ui->downloadLimitSpeedComboBox->setItemDelegate(new QStyledItemDelegate(ui->downloadLimitSpeedComboBox));
    ui->downloadLimitSpeedComboBox->setStyleSheet(MusicUIObject::MComboBoxStyle01 + MusicUIObject::MItemView01);
    ui->downloadLimitSpeedComboBox->view()->setStyleSheet(MusicUIObject::MScrollBarStyle01);
    ui->uploadLimitSpeedComboBox->setItemDelegate(new QStyledItemDelegate(ui->uploadLimitSpeedComboBox));
    ui->uploadLimitSpeedComboBox->setStyleSheet(MusicUIObject::MComboBoxStyle01 + MusicUIObject::MItemView01);
    ui->uploadLimitSpeedComboBox->view()->setStyleSheet(MusicUIObject::MScrollBarStyle01);

    ui->downloadSpinBox->setRange(1024, 5*1024);
    ui->downloadDirEdit->setText(MUSIC_DOWNLOAD_AL);
    ui->downloadLrcDirEdit->setText(LRC_DOWNLOAD_AL);
    QStringList downloadSpeed;
    downloadSpeed << "100" << "200" << "300" << "400" << "500" << "600"
                  << "700" << "800" << "900" << "1000" << "1100" << "1200";
    ui->downloadLimitSpeedComboBox->addItems(downloadSpeed);
    ui->uploadLimitSpeedComboBox->addItems(downloadSpeed);

    ui->downloadServerComboBox->addItem(QIcon(":/server/wangyiyun"), tr("wangyiMusic"));
    ui->downloadServerComboBox->addItem(QIcon(":/server/aiyinyue"), tr("dianxinMusic"));
    ui->downloadServerComboBox->addItem(QIcon(":/server/qq"), tr("qqMusic"));
    ui->downloadServerComboBox->addItem(QIcon(":/server/xiami"), tr("xiamiMusic"));
    ui->downloadServerComboBox->addItem(QIcon(":/server/ttdongting"), tr("ttpodMusic"));
    ui->downloadServerComboBox->addItem(QIcon(":/server/baidu"), tr("baiduMusic"));
    ui->downloadServerComboBox->addItem(QIcon(":/server/kuwo"), tr("kuwoMusic"));
    ui->downloadServerComboBox->addItem(QIcon(":/server/kugou"), tr("kuhouMusic"));
    ui->downloadServerComboBox->addItem(QIcon(":/server/duomi"), tr("duomiMusic"));

    /////////////////////////////////////////////////////////////
    QButtonGroup *buttonGroup = new QButtonGroup(this);
    buttonGroup->addButton(ui->downloadCacheAutoRadioBox, 0);
    buttonGroup->addButton(ui->downloadCacheManRadioBox, 1);
    connect(buttonGroup, SIGNAL(buttonClicked(int)), SLOT(downloadGroupCached(int)));

    QButtonGroup *buttonGroup2 = new QButtonGroup(this);
    buttonGroup2->addButton(ui->downloadFullRadioBox, 0);
    buttonGroup2->addButton(ui->downloadLimitRadioBox, 1);
    connect(buttonGroup2, SIGNAL(buttonClicked(int)), SLOT(downloadGroupSpeedLimit(int)));

    QButtonGroup *buttonGroup3 = new QButtonGroup(this);
    buttonGroup3->addButton(ui->downloadDirButton, 0);
    buttonGroup3->addButton(ui->downloadLrcDirButton, 1);
    connect(buttonGroup3, SIGNAL(buttonClicked(int)), SLOT(downloadDirSelected(int)));

    ui->downloadCacheAutoRadioBox->click();
    ui->downloadFullRadioBox->click();
}
Ejemplo n.º 27
0
ConfigureRecorder::ConfigureRecorder( QualitySetting *_qualities, MediaRecorderPluginList *_plugins, QWidget *parent, Qt::WFlags f )
    : QDialog( parent, f )
    , qualities( _qualities )
    , plugins( _plugins )
    , quality( CustomQuality )
{
    // Create the UI.
    conf = new Ui::ConfigureRecorderBase();
    conf->setupUi( this );
    setObjectName( "settings" );     // To display the correct help page.

    // Load the default quality settings.
    int qual;
    for ( qual = 0; qual < MaxQualities; ++qual ) {
        qualities[qual].frequency = DefaultQualities[qual].frequency;
        qualities[qual].channels = DefaultQualities[qual].channels;
        qualities[qual].mimeType = DefaultQualities[qual].mimeType;
        qualities[qual].formatTag = DefaultQualities[qual].formatTag;
    }

    // Load configuration overrides.
    loadConfig();

    // Populate the list of sample rates.
    conf->sampleRate->addItem( tr("8 kHz") );
    conf->sampleRate->addItem( tr("11 kHz") );
    conf->sampleRate->addItem( tr("22 kHz") );
    conf->sampleRate->addItem( tr("44 kHz") );

    // Populate the list of formats.
    if ( plugins != 0 ) {
        uint numPlugins = plugins->count();
        for ( uint plugin = 0; plugin < numPlugins; ++plugin ) {
            conf->format->addItem( plugins->formatNameAt( plugin ) );
        }
    }

    // Group Quality settings buttons
    QButtonGroup*   qualitybuttonGroup = new QButtonGroup(this);
    qualitybuttonGroup->addButton(conf->voiceQuality, VoiceQuality);
    qualitybuttonGroup->addButton(conf->musicQuality, MusicQuality);
    qualitybuttonGroup->addButton(conf->cdQuality, CDQuality);
    qualitybuttonGroup->addButton(conf->customQuality, CustomQuality);

    connect(qualitybuttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(setQuality(int)));

    // Group channel setting buttons
    QButtonGroup*   channelButtonGroup = new QButtonGroup(this);
    channelButtonGroup->addButton(conf->monoChannels, 0);
    channelButtonGroup->addButton(conf->stereoChannels, 1);

    connect(channelButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(setChannels(int)));

    // Hook up interesting signals.
    connect( conf->sampleRate, SIGNAL(activated(int)),
             this, SLOT(setSampleRate(int)) );
    connect( conf->format, SIGNAL(activated(int)),
             this, SLOT(setFormat(int)) );
}
Ejemplo n.º 28
0
TransparencyDialog::TransparencyDialog( QWidget * parent, ViewerRendererWidget * vrw )
  : QDialog( parent )
  , m_renderer( vrw )
{
  DP_ASSERT( m_renderer );

  setWindowTitle( "Transparency Settings" );
  setWindowFlags( windowFlags() & ~Qt::WindowContextHelpButtonHint );

  m_restoreTransparencyMode = m_renderer->getTransparencyMode();
  QRadioButton * noneButton = new QRadioButton( "None" );
  noneButton->setChecked( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::NONE );
  QRadioButton * sortedBlendedButton = new QRadioButton( "Sorted Blended" );
  sortedBlendedButton->setChecked( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::SORTED_BLENDED );
  QRadioButton * orderIndependentClosestListButton = new QRadioButton( "Order Independent Closest List" );
  orderIndependentClosestListButton->setChecked( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_CLOSEST_LIST );
  QRadioButton * orderIndependentAllButton = new QRadioButton( "Order Independent All" );
  orderIndependentAllButton->setChecked( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_ALL );

  QButtonGroup * buttonGroup = new QButtonGroup();
  buttonGroup->addButton( noneButton, static_cast<int>(dp::sg::renderer::rix::gl::TransparencyMode::NONE) );
  buttonGroup->addButton( sortedBlendedButton, static_cast<int>(dp::sg::renderer::rix::gl::TransparencyMode::SORTED_BLENDED) );
  buttonGroup->addButton( orderIndependentClosestListButton, static_cast<int>(dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_CLOSEST_LIST) );
  buttonGroup->addButton( orderIndependentAllButton, static_cast<int>(dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_ALL) );
  connect( buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(buttonClicked(int)) );

  m_restoreLayers = m_renderer->getOITDepth();
  m_layersBox = new QSpinBox();
  m_layersBox->setMinimum( 1 );
  m_layersBox->setValue( m_restoreLayers );
  m_layersBox->setEnabled( ( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_CLOSEST_ARRAY )
                        || ( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_CLOSEST_LIST ) );
  connect( m_layersBox, SIGNAL(valueChanged(int)), this, SLOT(layersChanged(int)) );
  QFormLayout * layersLayout = new QFormLayout;
  layersLayout->addRow( "Transparency Layers", m_layersBox );

  QFrame * separatorLine = new QFrame;
  separatorLine->setFrameShape( QFrame::HLine );
  separatorLine->setFrameShadow( QFrame::Sunken );

  QDialogButtonBox * dbb = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
  dbb->button( QDialogButtonBox::Ok )->setDefault ( true );
  connect( dbb, SIGNAL(accepted()), this, SLOT(accept()) );
  connect( dbb, SIGNAL(rejected()), this, SLOT(reject()) );

  QVBoxLayout * vLayout = new QVBoxLayout();
  vLayout->addWidget( noneButton );
  vLayout->addWidget( sortedBlendedButton );
  vLayout->addWidget( orderIndependentClosestListButton );
  vLayout->addLayout( layersLayout );
  vLayout->addWidget( orderIndependentAllButton );
  vLayout->addWidget( separatorLine );
  vLayout->addWidget( dbb );

  setLayout( vLayout );
  adjustSize();
  setMinimumSize( size() );
  setMaximumSize( size() );
}
Ejemplo n.º 29
0
void tst_QButtonGroup::exclusiveWithActions()
{
    QDialog dlg(0);
    QHBoxLayout layout(&dlg);
    QAction *action1 = new QAction("Action 1", &dlg);
    action1->setCheckable(true);
    QAction *action2 = new QAction("Action 2", &dlg);
    action2->setCheckable(true);
    QAction *action3 = new QAction("Action 3", &dlg);
    action3->setCheckable(true);
    QToolButton *toolButton1 = new QToolButton(&dlg);
    QToolButton *toolButton2 = new QToolButton(&dlg);
    QToolButton *toolButton3 = new QToolButton(&dlg);
    toolButton1->setDefaultAction(action1);
    toolButton2->setDefaultAction(action2);
    toolButton3->setDefaultAction(action3);
    layout.addWidget(toolButton1);
    layout.addWidget(toolButton2);
    layout.addWidget(toolButton3);
    QButtonGroup *buttonGroup = new QButtonGroup( &dlg );
    buttonGroup->setExclusive(true);
    buttonGroup->addButton(toolButton1, 1);
    buttonGroup->addButton(toolButton2, 2);
    buttonGroup->addButton(toolButton3, 3);
    dlg.show();

    QTest::mouseClick(toolButton1, Qt::LeftButton);
    QVERIFY(toolButton1->isChecked());
    QVERIFY(action1->isChecked());
    QVERIFY(!toolButton2->isChecked());
    QVERIFY(!toolButton3->isChecked());
    QVERIFY(!action2->isChecked());
    QVERIFY(!action3->isChecked());

    QTest::mouseClick(toolButton2, Qt::LeftButton);
    QVERIFY(toolButton2->isChecked());
    QVERIFY(action2->isChecked());
    QVERIFY(!toolButton1->isChecked());
    QVERIFY(!toolButton3->isChecked());
    QVERIFY(!action1->isChecked());
    QVERIFY(!action3->isChecked());

    QTest::mouseClick(toolButton3, Qt::LeftButton);
    QVERIFY(toolButton3->isChecked());
    QVERIFY(action3->isChecked());
    QVERIFY(!toolButton1->isChecked());
    QVERIFY(!toolButton2->isChecked());
    QVERIFY(!action1->isChecked());
    QVERIFY(!action2->isChecked());

    QTest::mouseClick(toolButton2, Qt::LeftButton);
    QVERIFY(toolButton2->isChecked());
    QVERIFY(action2->isChecked());
    QVERIFY(!toolButton1->isChecked());
    QVERIFY(!toolButton3->isChecked());
    QVERIFY(!action1->isChecked());
    QVERIFY(!action3->isChecked());
}
Ejemplo n.º 30
0
OverwriteDialog::OverwriteDialog()
	: Dialog(TApp::instance()->getMainWindow(), true)
{
	setModal(true);
	setWindowTitle(tr("Warning!"));

	QButtonGroup *buttonGroup = new QButtonGroup(this);
	buttonGroup->setExclusive(true);
	bool ret = connect(buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(onButtonClicked(int)));

	beginVLayout();

	m_label = new QLabel(this);
	addWidget(m_label);

	m_keep = new QRadioButton(tr("Keep existing file"), this);
	buttonGroup->addButton(m_keep);
	addWidget(m_keep);

	m_overwrite = new QRadioButton(tr("Overwrite the existing file with the new one"), this);
	buttonGroup->addButton(m_overwrite);
	addWidget(m_overwrite);

	m_rename = new QRadioButton(tr("Rename the new file adding the suffix"), this);
	buttonGroup->addButton(m_rename);

	m_suffix = new LineEdit("_1", this);
	m_suffix->setFixedWidth(25);
	m_suffix->setEnabled(false);

	QHBoxLayout *boxLayout = new QHBoxLayout();
	boxLayout->setMargin(0);
	boxLayout->setSpacing(0);
	boxLayout->addWidget(m_rename);
	boxLayout->addWidget(m_suffix);
	boxLayout->setAlignment(m_rename, Qt::AlignLeft);
	boxLayout->setAlignment(m_suffix, Qt::AlignLeft);
	addLayout(boxLayout);

	endVLayout();

	m_okBtn = new QPushButton(QString(tr("Apply")), this);
	ret = ret && connect(m_okBtn, SIGNAL(clicked()), this, SLOT(accept()));
	addButtonBarWidget(m_okBtn);

	m_okToAllBtn = new QPushButton(QString(tr("Apply to All")), this);
	ret = ret && connect(m_okToAllBtn, SIGNAL(clicked()), this, SLOT(applyToAll()));
	addButtonBarWidget(m_okToAllBtn);

	m_cancelBtn = new QPushButton(QString(tr("Cancel")), this);
	ret = ret && connect(m_cancelBtn, SIGNAL(clicked()), this, SLOT(cancel()));
	addButtonBarWidget(m_cancelBtn);

	assert(ret);

	reset();
	m_keep->setChecked(true);
}