void DkAdvancedPreference::createLayout() {

	// load RAW radio buttons
	QVector<QRadioButton*> loadRawButtons;
	loadRawButtons.resize(DkSettings::raw_thumb_end);
	loadRawButtons[DkSettings::raw_thumb_always] = new QRadioButton(tr("Always Load JPG if Embedded"), this);
	loadRawButtons[DkSettings::raw_thumb_if_large] = new QRadioButton(tr("Load JPG if it Fits the Screen Resolution"), this);
	loadRawButtons[DkSettings::raw_thumb_never] = new QRadioButton(tr("Always Load RAW Data"), this);

	// check wrt the current settings
	loadRawButtons[Settings::param().resources().loadRawThumb]->setChecked(true);

	QButtonGroup* loadRawButtonGroup = new QButtonGroup(this);
	loadRawButtonGroup->setObjectName("loadRaw");
	loadRawButtonGroup->addButton(loadRawButtons[DkSettings::raw_thumb_always], DkSettings::raw_thumb_always);
	loadRawButtonGroup->addButton(loadRawButtons[DkSettings::raw_thumb_if_large], DkSettings::raw_thumb_if_large);
	loadRawButtonGroup->addButton(loadRawButtons[DkSettings::raw_thumb_never], DkSettings::raw_thumb_never);

	QCheckBox* cbFilterRaw = new QCheckBox(tr("Apply Noise Filtering to RAW Images"), this);
	cbFilterRaw->setObjectName("filterRaw");
	cbFilterRaw->setToolTip(tr("If checked, a noise filter is applied which reduced color noise"));
	cbFilterRaw->setChecked(Settings::param().resources().filterRawImages);

	DkGroupWidget* loadRawGroup = new DkGroupWidget(tr("RAW Loader Settings"), this);
	loadRawGroup->addWidget(loadRawButtons[DkSettings::raw_thumb_always]);
	loadRawGroup->addWidget(loadRawButtons[DkSettings::raw_thumb_if_large]);
	loadRawGroup->addWidget(loadRawButtons[DkSettings::raw_thumb_never]);
	loadRawGroup->addSpace();
	loadRawGroup->addWidget(cbFilterRaw);

	// file loading
	QCheckBox* cbSaveDeleted = new QCheckBox(tr("Ask to Save Deleted Files"), this);
	cbSaveDeleted->setObjectName("saveDeleted");
	cbSaveDeleted->setToolTip(tr("If checked, nomacs asked to save files which were deleted by other applications"));
	cbSaveDeleted->setChecked(Settings::param().global().askToSaveDeletedFiles);

	QCheckBox* cbIgnoreExif = new QCheckBox(tr("Ignore Exif Orientation when Loading"), this);
	cbIgnoreExif->setObjectName("ignoreExif");
	cbIgnoreExif->setToolTip(tr("If checked, images are NOT rotated with respect to their Exif orientation"));
	cbIgnoreExif->setChecked(Settings::param().metaData().ignoreExifOrientation);

	QCheckBox* cbSaveExif = new QCheckBox(tr("Save Exif Orientation"), this);
	cbSaveExif->setObjectName("saveExif");
	cbSaveExif->setToolTip(tr("If checked, orientation is written to the Exif rather than rotating the image Matrix\n") +
		tr("NOTE: this allows for rotating JPGs without loosing information."));
	cbSaveExif->setChecked(Settings::param().metaData().saveExifOrientation);

	DkGroupWidget* loadFileGroup = new DkGroupWidget(tr("File Loading/Saving"), this);
	loadFileGroup->addWidget(cbSaveDeleted);
	loadFileGroup->addWidget(cbIgnoreExif);
	loadFileGroup->addWidget(cbSaveExif);

	QVBoxLayout* layout = new QVBoxLayout(this);
	layout->addWidget(loadRawGroup);
	layout->addWidget(loadFileGroup);
}
    toSGATracePrefs(toTool *tool, QWidget* parent = 0, const char* name = 0)
            : QGroupBox(parent), toSettingTab("trace.html"), Tool(tool)
    {
        if (name)
            setObjectName(name);

        QVBoxLayout *vbox = new QVBoxLayout;
        vbox->setSpacing(6);
        vbox->setContentsMargins(11, 11, 11, 11);

        setLayout(vbox);

        setTitle(qApp->translate("toSGATracePrefs", "SGA Trace"));

        AutoUpdate = new QCheckBox(this);
        AutoUpdate->setText(qApp->translate("toSGATracePrefs", "&Auto update"));
        AutoUpdate->setToolTip(qApp->translate("toSGATracePrefs",
                                               "Update automatically after change of schema."));
        vbox->addWidget(AutoUpdate);

        QSpacerItem *spacer = new QSpacerItem(
            20,
            20,
            QSizePolicy::Minimum,
            QSizePolicy::Expanding);
        vbox->addItem(spacer);

//         if (!Tool->config(CONF_AUTO_UPDATE, "Yes").isEmpty())
//             AutoUpdate->setChecked(true);
        AutoUpdate->setChecked(toConfigurationSingle::Instance().autoUpdate());
    }
void DrugEnginesPreferences::setDataToUi()
{
    // Get all IDrugEngine objects
    QList<DrugsDB::IDrugEngine *> engines = pluginManager()->getObjects<DrugsDB::IDrugEngine>();
    QGridLayout *scrollLayout = qobject_cast<QGridLayout*>(ui->scrollAreaWidgetContents->layout());
    scrollLayout->setSpacing(24);
    for(int i=0; i < engines.count(); ++i) {
        DrugsDB::IDrugEngine *engine = engines.at(i);
        // Create widget
//        QWidget *w = new QWidget(this);
//        QGridLayout *l = new QGridLayout(w);
//        w->setLayout(l);
//        l->setMargin(0);
        // with checkbox
        QCheckBox *box = new QCheckBox(this);
        box->setText(engine->shortName() + ", " + engine->name());
        box->setToolTip(engine->tooltip());
        box->setChecked(engine->isActive());
        box->setIcon(engine->icon());
        // and a small explanation
//        QTextBrowser *browser = new QTextBrowser(w);
//        browser->setText(engines.at(i));
        scrollLayout->addWidget(box, i, 0);
        connect(box, SIGNAL(clicked(bool)), engine, SLOT(setActive(bool)));
    }
    QSpacerItem *s = new QSpacerItem(20,20, QSizePolicy::Expanding, QSizePolicy::Expanding);
    scrollLayout->addItem(s, engines.count()+1, 0);
}
QWidget* RuleDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
    Q_UNUSED(option)

    QWidget *editor = new QWidget(parent);
    KLineEdit *ruleLineEdit = new KLineEdit(editor);
    ruleLineEdit->setToolTip(i18n("Expression"));

    KComboBox *matchComboBox = new KComboBox(editor);
    matchComboBox->setToolTip(i18n("Match Mode"));
    matchComboBox->addItem(i18n("Ignore"));
    matchComboBox->addItem(i18n("Regular expression"));
    matchComboBox->addItem(i18n("Partial match"));
    matchComboBox->addItem(i18n("Exact match"));

    QCheckBox *requiredCheckBox = new QCheckBox(editor);
    requiredCheckBox->setToolTip(i18n("Required"));

    QHBoxLayout *layout = new QHBoxLayout(editor);
    layout->addWidget(ruleLineEdit);
    layout->addWidget(matchComboBox);
    layout->addWidget(requiredCheckBox);
    layout->setMargin(0);

    setEditorData(editor, index);

    return editor;
}
Example #5
0
//加载完成
void SearchThread::slot_LoadFinished( QNetworkReply *replay )
{
	QTextCodec *codec = QTextCodec::codecForName("utf8");		//转换成utf8编码格式
	QString searchStr = codec->toUnicode(replay->readAll());
	if (searchStr == "")
	{
		emit sig_SearchTimeout();	//搜索超时
		return;
	}
	searchStr = QUrl::fromPercentEncoding(searchStr.toAscii());	//百分比编码

	//解析Json
	QJson::Parser parser;
	bool ok;
	QVariantMap result = parser.parse(searchStr.toUtf8(), &ok).toMap();
	if (!ok)
	{
		qDebug() << "转换成QVariantMap失败";
		return;
	}

	//搜索到的数量
	m_nMusicNum = result["total"].toInt();
	emit sig_SearchNum(m_nMusicNum);

	//得到结果数组
	QVariantList resultList = result["results"].toList();
	foreach (QVariant var, resultList)
	{
		QVariantMap resultMap = var.toMap();	//得到每一项的map

		//歌曲名
		QCheckBox *musicNameCheckBox = new QCheckBox(resultMap["song_name"].toString());
		musicNameCheckBox->setObjectName(tr("musicNameCheckBox"));
		musicNameCheckBox->setToolTip(resultMap["song_name"].toString());
		musicNameCheckBox->setFont(QFont("微软雅黑", 10));
		musicNameCheckBox->setStyleSheet("QCheckBox{color:white;}"
			"QCheckBox::indicator{width:10px;height:10px;border: 1px solid white;border-radius:2px}"
			"QCheckBox::indicator:checked {image: url(:/app/images/checked2.png);}");

		//艺人
		QTableWidgetItem *artistItem = new QTableWidgetItem(resultMap["artist_name"].toString());
		artistItem->setTextAlignment(Qt::AlignCenter);
		artistItem->setToolTip(resultMap["artist_name"].toString());
		artistItem->setFont(QFont("微软雅黑", 10));

		//专辑
		QTableWidgetItem *albumItem = new QTableWidgetItem("《" + resultMap["album_name"].toString() + "》");
		albumItem->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
		albumItem->setToolTip("《" + resultMap["album_name"].toString() + "》");
		albumItem->setFont(QFont("微软雅黑", 10));

		//插入播放列表
		int currentRows = m_searchList->rowCount();//返回列表中的行数
		m_searchList->insertRow(currentRows);//从播放列表中的当前行插入
		m_searchList->setCellWidget(currentRows, 0, musicNameCheckBox);
		m_searchList->setItem(currentRows, 1, artistItem);
		m_searchList->setItem(currentRows, 2, albumItem);
	}
Example #6
0
QWidget* PropertyEditor::createWidgetForBool(const QString& name, bool value, const QString &detail, QWidget* parent)
{
    mProperties[name] = value;
    QCheckBox *box = new QCheckBox(QObject::tr(name.toUtf8().constData()), parent);
    if (!detail.isEmpty())
        box->setToolTip(detail);
    box->setObjectName(name);
    box->setChecked(value);
    connect(box, SIGNAL(clicked(bool)), SLOT(onBoolChange(bool)));
    return box;
}
Example #7
0
LogWidget::LogWidget(QWidget *parent) : QWidget(parent), lines(0)
{
    logActive = true;
    logMidiActive = false;

    logText = new QTextEdit(this);
    logText->setFontFamily("Courier");
    logText->setReadOnly(true);
    textColor = logText->textColor();
    
    QCheckBox *enableLog = new QCheckBox(this);
    enableLog->setText(tr("&Enable Log"));
    enableLog->setToolTip(tr("Enable MIDI event logging"));
    QObject::connect(enableLog, SIGNAL(toggled(bool)), this,
            SLOT(enableLogToggle(bool)));
    enableLog->setChecked(logActive);
    
    QCheckBox *logMidiClock = new QCheckBox(this);
    logMidiClock->setText(tr("Log &MIDI Clock"));
    logMidiClock->setToolTip(
            tr("Enable logging of MIDI realtime clock events"));
    QObject::connect(logMidiClock, SIGNAL(toggled(bool)), this,
            SLOT(logMidiToggle(bool)));
    logMidiClock->setChecked(logMidiActive);
    
    QPushButton *clearButton = new QPushButton(tr("&Clear"), this);
    clearButton->setToolTip(tr("Clear all logged MIDI events"));
    QObject::connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));

    QHBoxLayout *buttonBoxLayout = new QHBoxLayout;
    buttonBoxLayout->addWidget(enableLog);
    buttonBoxLayout->addWidget(logMidiClock);
    buttonBoxLayout->addStretch(10);
    buttonBoxLayout->addWidget(clearButton);

    QVBoxLayout *logWidgetLayout = new QVBoxLayout;
    logWidgetLayout->addWidget(logText);
    logWidgetLayout->addLayout(buttonBoxLayout);

    setLayout(logWidgetLayout);
}
void PropertyEditingTable::fill(QDomElement xml,
	QMap<QString, QString> values) {
QDomNodeList exprops = xml.elementsByTagName("property");
setRowCount(exprops.count());
for (int k = 0; k < exprops.count(); k++) {
	QDomElement exprop = exprops.at(k).toElement();

	QTableWidgetItem *item;

	item = new QTableWidgetItem(exprop.attribute("title"));
	QString propDesc = exprop.attribute("description");
	item->setFlags(Qt::ItemIsEnabled);
	if (!propDesc.isEmpty())
		item->setToolTip(propDesc);
	setItem(k, 0, item);

	QString val = exprop.attribute("default");
	QString propKey = exprop.attribute("name");
	QString propType = exprop.attribute("type");

	if (values.contains(propKey))
		val = values[propKey];

	PropDesc pdesc;
	pdesc.name=propKey;
	pdesc.type=propType;
	pdesc.value=val;
	props.append(pdesc);

	if (propType == "boolean") {
		QCheckBox *cb = new QCheckBox("");
		cb->setChecked(val.toInt() != 0);
		if (!propDesc.isEmpty())
			cb->setToolTip(propDesc);
		setCellWidget(k, 1, cb);
	} else {
		item = new QTableWidgetItem(val);
		if (!propDesc.isEmpty())
			item->setToolTip(propDesc);
		setItem(k, 1, item);
	}

	if ((propType == "dir")||(propType == "file")) {
		QPushButton *bt = new QPushButton("Browse");
		mapper->setMapping(bt, k);
		connect(bt, SIGNAL(clicked()), mapper, SLOT(map()));
		setCellWidget(k, 2, bt);
	}

  }
  horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);

}
Example #9
0
QCheckBox *OptionsPopup::createCheckboxForCommand(Id id)
{
    QAction *action = ActionManager::command(id)->action();
    QCheckBox *checkbox = new QCheckBox(action->text());
    checkbox->setToolTip(action->toolTip());
    checkbox->setChecked(action->isChecked());
    checkbox->setEnabled(action->isEnabled());
    checkbox->installEventFilter(this); // enter key handling
    QObject::connect(checkbox, &QCheckBox::clicked, action, &QAction::setChecked);
    QObject::connect(action, &QAction::changed, this, &OptionsPopup::actionChanged);
    m_checkboxMap.insert(action, checkbox);
    return checkbox;
}
Example #10
0
std::pair<QWidget *, QWidget *> CSMPrefs::BoolSetting::makeWidgets (QWidget *parent)
{
    QCheckBox *widget = new QCheckBox (QString::fromUtf8 (getLabel().c_str()), parent);
    widget->setCheckState (mDefault ? Qt::Checked : Qt::Unchecked);

    if (!mTooltip.empty())
    {
        QString tooltip = QString::fromUtf8 (mTooltip.c_str());
        widget->setToolTip (tooltip);
    }

    connect (widget, SIGNAL (stateChanged (int)), this, SLOT (valueChanged (int)));

    return std::make_pair (static_cast<QWidget *> (0), widget);
}
Example #11
0
/*
 * The class constructor
 */
PixelView::PixelView(QWidget *parent, const char *name, Qt::WindowFlags fl)
  : QWidget(parent, fl)
{
  int i, j, iz = B3DNINT(App->cvi->zmouse);
  setAttribute(Qt::WA_DeleteOnClose);
  setAttribute(Qt::WA_AlwaysShowToolTips);
  QVBoxLayout *vBox = new QVBoxLayout(this);
  vBox->setSpacing(3);

  // Make the mouse report box
  QHBoxLayout *hBox = diaHBoxLayout(vBox);
  mMouseLabel = diaLabel(" ", this, hBox);
  hBox->addStretch();
  hBox->setSpacing(5);

  mFileValBox = diaCheckBox("File value", this, hBox);
  diaSetChecked(mFileValBox, fromFile);
  connect(mFileValBox, SIGNAL(toggled(bool)), this, 
          SLOT(fromFileToggled(bool)));
  mFileValBox->setToolTip("Show value from file, not byte value from memory"
                ", at mouse position");
  mFileValBox->setEnabled(fileReadable(App->cvi, iz));

  QCheckBox *gbox = diaCheckBox("Grid", this, hBox);
  diaSetChecked(gbox, showButs);
  connect(gbox, SIGNAL(toggled(bool)), this, SLOT(showButsToggled(bool)));
  gbox->setToolTip("Show buttons with values from file or memory)");

  hBox = diaHBoxLayout(vBox);
  mGridValBox = diaCheckBox("Grid value from file", this, hBox);
  diaSetChecked(mGridValBox, gridFromFile);
  connect(mGridValBox, SIGNAL(toggled(bool)), this, 
          SLOT(gridFileToggled(bool)));
  mGridValBox->setToolTip("Show value from file, not byte value from memory"
                ", in each button");
  mGridValBox->setEnabled(fileReadable(App->cvi, iz));

  mConvertBox = NULL;
  if (App->cvi->rgbStore) {
    mConvertBox = diaCheckBox("Convert RGB to gray scale", this, hBox);
    diaSetChecked(mConvertBox, convertRGB);
    connect(mConvertBox, SIGNAL(toggled(bool)), this, 
            SLOT(convertToggled(bool)));
    mConvertBox->setToolTip("Show luminance values instead of RGB triplets"
                  );
  }
Example #12
0
/**
 * Constructor.
 */
DocWindow::DocWindow(UMLDoc * doc, QWidget *parent)
    : QWidget(parent),
      m_pUMLObject(0),
      m_pUMLScene(0),
      m_pUMLDoc(doc),
      m_pUMLWidget(0),
      m_pAssocWidget(0),
      m_Showing(st_Project),
      m_focusEnabled(false)
{
    //setup visual display
    QGridLayout* statusLayout = new QGridLayout();
    m_typeLabel = createPixmapLabel();
    m_typeLabel->setToolTip(i18n("Documentation type"));
    statusLayout->addWidget(m_typeLabel, 0, 0, 1, 1);
    m_nameLabel = new QLabel(this);
    m_nameLabel->setFrameStyle(QFrame::Panel | QFrame::Raised);
    m_nameLabel->setAlignment(Qt::AlignHCenter);
    statusLayout->addWidget(m_nameLabel, 0, 1, 1, 4);
    QCheckBox *box = new QCheckBox();
    box->setToolTip(i18n("Activate documentation edit after focus change."));
    connect(box, SIGNAL(stateChanged(int)), this, SLOT(slotFocusEnabledChanged(int)));
    statusLayout->addWidget(box, 0, 5, 1, 1);
    m_modifiedWidget = new ModifiedWidget(this);
    statusLayout->addWidget(m_modifiedWidget, 0, 6, 1, 1);
    m_docTE = new KTextEdit(this);
    m_docTE->setText(QString());
    setFocusProxy(m_docTE);
    //m_docTE->setWordWrapMode(QTextEdit::WidgetWidth);
    QVBoxLayout* docLayout = new QVBoxLayout(this);
    docLayout->addLayout(statusLayout);
    docLayout->addWidget(m_docTE);
    docLayout->setMargin(0);

    connect(m_docTE, SIGNAL(textChanged()), this, SLOT(slotTextChanged()));
}
Example #13
0
void DkGeneralPreference::createLayout() {

	// color settings
	DkColorChooser* highlightColorChooser = new DkColorChooser(QColor(0, 204, 255), tr("Highlight Color"), this);
	highlightColorChooser->setObjectName("highlightColor");
	highlightColorChooser->setColor(&Settings::param().display().highlightColor);
	connect(highlightColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkColorChooser* iconColorChooser = new DkColorChooser(QColor(219, 89, 2, 255), tr("Icon Color"), this);
	iconColorChooser->setObjectName("iconColor");
	iconColorChooser->setColor(&Settings::param().display().iconColor);
	connect(iconColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkColorChooser* bgColorChooser = new DkColorChooser(QColor(100, 100, 100, 255), tr("Background Color"), this);
	bgColorChooser->setObjectName("backgroundColor");
	bgColorChooser->setColor(&Settings::param().display().bgColor);
	connect(bgColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkColorChooser* fullscreenColorChooser = new DkColorChooser(QColor(86,86,90), tr("Fullscreen Color"), this);
	fullscreenColorChooser->setObjectName("fullscreenColor");
	fullscreenColorChooser->setColor(&Settings::param().slideShow().backgroundColor);
	connect(fullscreenColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkColorChooser* fgdHUDColorChooser = new DkColorChooser(QColor(255, 255, 255, 255), tr("HUD Foreground Color"), this);
	fgdHUDColorChooser->setObjectName("fgdHUDColor");
	fgdHUDColorChooser->setColor(&Settings::param().display().hudFgdColor);
	connect(fgdHUDColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkColorChooser* bgHUDColorChooser = new DkColorChooser(QColor(0, 0, 0, 100), tr("HUD Background Color"), this);
	bgHUDColorChooser->setObjectName("bgHUDColor");
	bgHUDColorChooser->setColor((Settings::param().app().appMode == DkSettings::mode_frameless) ?
		&Settings::param().display().bgColorFrameless : &Settings::param().display().hudBgColor);
	connect(bgHUDColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkGroupWidget* colorGroup = new DkGroupWidget(tr("Color Settings"), this);
	colorGroup->addWidget(highlightColorChooser);
	colorGroup->addWidget(iconColorChooser);
	colorGroup->addWidget(bgColorChooser);
	colorGroup->addWidget(fullscreenColorChooser);
	colorGroup->addWidget(fgdHUDColorChooser);
	colorGroup->addWidget(bgHUDColorChooser);

	// default pushbutton
	QPushButton* defaultSettings = new QPushButton(tr("Reset All Settings"));
	defaultSettings->setObjectName("defaultSettings");
	defaultSettings->setMaximumWidth(300);

	DkGroupWidget* defaultGroup = new DkGroupWidget(tr("Default Settings"), this);
	defaultGroup->addWidget(defaultSettings);

	// the left column (holding all color settings)
	QWidget* leftColumn = new QWidget(this);
	leftColumn->setMinimumWidth(400);

	QVBoxLayout* leftColumnLayout = new QVBoxLayout(leftColumn);
	leftColumnLayout->setAlignment(Qt::AlignTop);
	leftColumnLayout->addWidget(colorGroup);
	leftColumnLayout->addWidget(defaultGroup);

	// checkboxes
	QCheckBox* cbRecentFiles = new QCheckBox(tr("Show Recent Files on Start-Up"), this);
	cbRecentFiles->setObjectName("showRecentFiles");
	cbRecentFiles->setToolTip(tr("Show the History Panel on Start-Up"));
	cbRecentFiles->setChecked(Settings::param().app().showRecentFiles);

	QCheckBox* cbLogRecentFiles = new QCheckBox(tr("Log Recent Files"), this);
	cbLogRecentFiles->setObjectName("logRecentFiles");
	cbLogRecentFiles->setToolTip(tr("If checked, recent files will be saved."));
	cbLogRecentFiles->setChecked(Settings::param().global().logRecentFiles);

	QCheckBox* cbLoopImages = new QCheckBox(tr("Loop Images"), this);
	cbLoopImages->setObjectName("loopImages");
	cbLoopImages->setToolTip(tr("Start with the first image in a folder after showing the last."));
	cbLoopImages->setChecked(Settings::param().global().loop);

	QCheckBox* cbZoomOnWheel = new QCheckBox(tr("Mouse Wheel Zooms"), this);
	cbZoomOnWheel->setObjectName("zoomOnWheel");
	cbZoomOnWheel->setToolTip(tr("If checked, the mouse wheel zooms - otherwise it is used to switch between images."));
	cbZoomOnWheel->setChecked(Settings::param().global().zoomOnWheel);

	QCheckBox* cbDoubleClickForFullscreen = new QCheckBox(tr("Double Click Opens Fullscreen"), this);
	cbDoubleClickForFullscreen->setObjectName("doubleClickForFullscreen");
	cbDoubleClickForFullscreen->setToolTip(tr("If checked, a double click on the canvas opens the fullscreen mode."));
	cbDoubleClickForFullscreen->setChecked(Settings::param().global().doubleClickForFullscreen);

	QCheckBox* cbShowBgImage = new QCheckBox(tr("Show Background Image"), this);
	cbShowBgImage->setObjectName("showBgImage");
	cbShowBgImage->setToolTip(tr("If checked, the nomacs logo is shown in the bottom right corner."));
	cbShowBgImage->setChecked(Settings::param().global().showBgImage);

	QCheckBox* cbSwitchModifier = new QCheckBox(tr("Switch CTRL with ALT"), this);
	cbSwitchModifier->setObjectName("switchModifier");
	cbSwitchModifier->setToolTip(tr("If checked, CTRL + Mouse is switched with ALT + Mouse."));
	cbSwitchModifier->setChecked(Settings::param().sync().switchModifier);

	QCheckBox* cbEnableNetworkSync = new QCheckBox(tr("Enable LAN Sync"), this);
	cbEnableNetworkSync->setObjectName("networkSync");
	cbEnableNetworkSync->setToolTip(tr("If checked, syncing in your LAN is enabled."));
	cbEnableNetworkSync->setChecked(Settings::param().sync().enableNetworkSync);

	QCheckBox* cbCloseOnEsc = new QCheckBox(tr("Close on ESC"), this);
	cbCloseOnEsc->setObjectName("closeOnEsc");
	cbCloseOnEsc->setToolTip(tr("Close nomacs if ESC is pressed."));
	cbCloseOnEsc->setChecked(Settings::param().app().closeOnEsc);

	QCheckBox* cbCheckForUpdates = new QCheckBox(tr("Check For Updates"), this);
	cbCheckForUpdates->setObjectName("checkForUpdates");
	cbCheckForUpdates->setToolTip(tr("Check for updates on start-up."));
	cbCheckForUpdates->setChecked(Settings::param().sync().checkForUpdates);

	DkGroupWidget* generalGroup = new DkGroupWidget(tr("General"), this);
	generalGroup->addWidget(cbRecentFiles);
	generalGroup->addWidget(cbLogRecentFiles);
	generalGroup->addWidget(cbLoopImages);
	generalGroup->addWidget(cbZoomOnWheel);
	generalGroup->addWidget(cbDoubleClickForFullscreen);
	generalGroup->addWidget(cbSwitchModifier);
	generalGroup->addWidget(cbEnableNetworkSync);
	generalGroup->addWidget(cbCloseOnEsc);
	generalGroup->addWidget(cbCheckForUpdates);
	generalGroup->addWidget(cbShowBgImage);

	// language
	QComboBox* languageCombo = new QComboBox(this);
	languageCombo->setObjectName("languageCombo");
	languageCombo->setToolTip(tr("Choose your preferred language."));
	DkUtils::addLanguages(languageCombo, mLanguages);
	languageCombo->setCurrentIndex(mLanguages.indexOf(Settings::param().global().language));

	QLabel* translateLabel = new QLabel("<a href=\"http://www.nomacs.org/how-to-translate-nomacs/\">How-to translate nomacs</a>", this);
	translateLabel->setToolTip(tr("Info on how to translate nomacs."));
	translateLabel->setOpenExternalLinks(true);

	DkGroupWidget* languageGroup = new DkGroupWidget(tr("Language"), this);
	languageGroup->addWidget(languageCombo);
	languageGroup->addWidget(translateLabel);

	// the right column (holding all checkboxes)
	QWidget* cbWidget = new QWidget(this);
	QVBoxLayout* cbLayout = new QVBoxLayout(cbWidget);
	cbLayout->setAlignment(Qt::AlignTop);
	cbLayout->addWidget(generalGroup);

	// add language
	cbLayout->addWidget(languageGroup);

	QHBoxLayout* contentLayout = new QHBoxLayout(this);
	contentLayout->setAlignment(Qt::AlignLeft);
	contentLayout->addWidget(leftColumn);
	contentLayout->addWidget(cbWidget);

}
void AccountsListDelegate::updateItemWidgets(const QList<QWidget *> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const
{
    // draws:
    //                   AccountName
    // Checkbox | Icon |              | ConnectionIcon | ConnectionState
    //                   errorMessage

    if (!index.isValid()) {
        return;
    }

    Q_ASSERT(widgets.size() == 6);

    // Get the widgets
    QCheckBox* checkbox = qobject_cast<QCheckBox*>(widgets.at(0));
    ChangeIconButton* changeIconButton = qobject_cast<ChangeIconButton*>(widgets.at(1));
    QLabel *statusTextLabel = qobject_cast<QLabel*>(widgets.at(2));
    QLabel *statusIconLabel = qobject_cast<QLabel*>(widgets.at(3));
    EditDisplayNameButton *displayNameButton = qobject_cast<EditDisplayNameButton*>(widgets.at(4));
    QLabel *connectionErrorLabel = qobject_cast<QLabel*>(widgets.at(5));

    Q_ASSERT(checkbox);
    Q_ASSERT(changeIconButton);
    Q_ASSERT(statusTextLabel);
    Q_ASSERT(statusIconLabel);
    Q_ASSERT(displayNameButton);
    Q_ASSERT(connectionErrorLabel);


    bool isSelected(itemView()->selectionModel()->isSelected(index) && itemView()->hasFocus());
    bool isEnabled(index.data(KTp::AccountsListModel::EnabledRole).toBool());
    KIcon accountIcon(index.data(Qt::DecorationRole).value<QIcon>());
    KIcon statusIcon(index.data(KTp::AccountsListModel::ConnectionStateIconRole).value<QIcon>());
    QString statusText(index.data(KTp::AccountsListModel::ConnectionStateDisplayRole).toString());
    QString displayName(index.data(Qt::DisplayRole).toString());
    QString connectionError(index.data(KTp::AccountsListModel::ConnectionErrorMessageDisplayRole).toString());
    Tp::AccountPtr account(index.data(KTp::AccountsListModel::AccountRole).value<Tp::AccountPtr>());

    if (!account->isEnabled()) {
      connectionError = i18n("Click checkbox to enable");
    }

    QRect outerRect(0, 0, option.rect.width(), option.rect.height());
    QRect contentRect = outerRect.adjusted(m_hpadding,m_vpadding,-m_hpadding,-m_vpadding); //add some padding


    // checkbox
    if (isEnabled) {
        checkbox->setChecked(true);;
        checkbox->setToolTip(i18n("Disable account"));
    } else {
        checkbox->setChecked(false);
        checkbox->setToolTip(i18n("Enable account"));
    }

    int checkboxLeftMargin = contentRect.left();
    int checkboxTopMargin = (outerRect.height() - checkbox->height()) / 2;
    checkbox->move(checkboxLeftMargin, checkboxTopMargin);


    // changeIconButton
    changeIconButton->setIcon(accountIcon);
    changeIconButton->setAccount(account);
    // At the moment (KDE 4.8.1) decorationSize is not passed from KWidgetItemDelegate
    // through the QStyleOptionViewItem, therefore we leave default size unless
    // the user has a more recent version.
    if (option.decorationSize.width() > -1) {
        changeIconButton->setButtonIconSize(option.decorationSize.width());
    }

    int changeIconButtonLeftMargin = checkboxLeftMargin + checkbox->width();
    int changeIconButtonTopMargin = (outerRect.height() - changeIconButton->height()) / 2;
    changeIconButton->move(changeIconButtonLeftMargin, changeIconButtonTopMargin);


    // statusTextLabel
    QFont statusTextFont = option.font;
    QPalette statusTextLabelPalette = option.palette;
    if (isEnabled) {
        statusTextLabel->setEnabled(true);
        statusTextFont.setItalic(false);
    } else {
        statusTextLabel->setDisabled(true);
        statusTextFont.setItalic(true);
    }
    if (isSelected) {
        statusTextLabelPalette.setColor(QPalette::Text, statusTextLabelPalette.color(QPalette::Active, QPalette::HighlightedText));
    }
    statusTextLabel->setPalette(statusTextLabelPalette);
    statusTextLabel->setFont(statusTextFont);
    statusTextLabel->setText(statusText);
    statusTextLabel->setFixedSize(statusTextLabel->fontMetrics().boundingRect(statusText).width(),
                                  statusTextLabel->height());
    int statusTextLabelLeftMargin = contentRect.right() - statusTextLabel->width();
    int statusTextLabelTopMargin = (outerRect.height() - statusTextLabel->height()) / 2;
    statusTextLabel->move(statusTextLabelLeftMargin, statusTextLabelTopMargin);


    // statusIconLabel
    statusIconLabel->setPixmap(statusIcon.pixmap(KIconLoader::SizeSmall));
    statusIconLabel->setFixedSize(statusIconLabel->minimumSizeHint());
    int statusIconLabelLeftMargin = contentRect.right() - statusTextLabel->width() - statusIconLabel->width() - 6;
    int statusIconLabelTopMargin = (outerRect.height() - statusIconLabel->height()) / 2;
    statusIconLabel->move(statusIconLabelLeftMargin, statusIconLabelTopMargin);


    QRect innerRect = contentRect.adjusted(changeIconButton->geometry().right() - contentRect.left(),
                                           0,
                                           -statusTextLabel->width() - statusIconLabel->width() - 6,
                                           0); // rect containing account name and error message


    // displayNameButton
    QFont displayNameButtonFont = option.font;
    QPalette displayNameButtonPalette = option.palette;
    if (isEnabled) {
        displayNameButtonPalette.setColor(QPalette::WindowText, displayNameButtonPalette.color(QPalette::Active, QPalette::Text));
        displayNameButtonFont.setBold(true);
    } else {
        displayNameButtonFont.setItalic(true);
        // NOTE: Flat QPushButton use WindowText instead of ButtonText for button text color
        displayNameButtonPalette.setColor(QPalette::WindowText, displayNameButtonPalette.color(QPalette::Disabled, QPalette::Text));
    }
    if (isSelected) {
        // Account is selected
        displayNameButtonPalette.setColor(QPalette::WindowText, displayNameButtonPalette.color(QPalette::Active, QPalette::HighlightedText));
    }
    displayNameButton->setFont(displayNameButtonFont);
    displayNameButton->setPalette(displayNameButtonPalette);

    QString displayNameButtonText = displayNameButton->fontMetrics().elidedText(displayName,
                                                                                Qt::ElideRight,
                                                                                innerRect.width() - (m_hpadding*2));
    displayNameButton->setText(displayNameButtonText);
    displayNameButton->setFixedSize(displayNameButton->fontMetrics().boundingRect(displayNameButtonText).width() + (m_hpadding*2),
                                    displayNameButton->minimumSizeHint().height());
    displayNameButton->setAccount(account);

    int displayNameButtonLeftMargin = innerRect.left();
    int displayNameButtonTopMargin = innerRect.top();
    displayNameButton->move(displayNameButtonLeftMargin, displayNameButtonTopMargin);


    // connectionErrorLabel
    QFont connectionErrorLabelFont = option.font;
    QPalette connectionErrorLabelPalette = option.palette;
    if (isEnabled) {
        connectionErrorLabelPalette.setColor(QPalette::WindowText, connectionErrorLabelPalette.color(QPalette::Active, QPalette::Text));
    } else {
        connectionErrorLabelFont.setItalic(true);
        connectionErrorLabelPalette.setColor(QPalette::Text, connectionErrorLabelPalette.color(QPalette::Disabled, QPalette::Text));
    }
    if (isSelected) {
        // Account is selected
        connectionErrorLabelPalette.setColor(QPalette::Text, connectionErrorLabelPalette.color(QPalette::Active, QPalette::HighlightedText));
    }
    connectionErrorLabel->setFont(connectionErrorLabelFont);
    connectionErrorLabel->setPalette(connectionErrorLabelPalette);

    QString connectionErrorLabelText = connectionErrorLabel->fontMetrics().elidedText(connectionError,
                                                                                      Qt::ElideRight,
                                                                                      innerRect.width() - (m_hpadding*2));
    connectionErrorLabel->setText(connectionErrorLabelText);
    connectionErrorLabel->setFixedSize(connectionErrorLabel->fontMetrics().boundingRect(connectionErrorLabelText).width(),
                                       displayNameButton->height());

    int connectionErrorLabelLeftMargin = innerRect.left() + m_hpadding;
    int connectionErrorLabelTopMargin = contentRect.bottom() - displayNameButton->height();
    connectionErrorLabel->move(connectionErrorLabelLeftMargin, connectionErrorLabelTopMargin);
}
Example #15
0
    void setupUi(QWidget *q)
    {
        groupBoxGeneral = new QGroupBox(q);
        groupBoxGeneral->setTitle(GdbOptionsPage::tr("General"));

        labelGdbWatchdogTimeout = new QLabel(groupBoxGeneral);
        labelGdbWatchdogTimeout->setText(GdbOptionsPage::tr("GDB timeout:"));
        labelGdbWatchdogTimeout->setToolTip(GdbOptionsPage::tr(
            "This is the number of seconds Qt Creator will wait before\n"
            "it terminates a non-responsive GDB process. The default value of 20 seconds\n"
            "should be sufficient for most applications, but there are situations when\n"
            "loading big libraries or listing source files takes much longer than that\n"
            "on slow machines. In this case, the value should be increased."));

        spinBoxGdbWatchdogTimeout = new QSpinBox(groupBoxGeneral);
        spinBoxGdbWatchdogTimeout->setToolTip(labelGdbWatchdogTimeout->toolTip());
        spinBoxGdbWatchdogTimeout->setSuffix(GdbOptionsPage::tr("sec"));
        spinBoxGdbWatchdogTimeout->setLayoutDirection(Qt::LeftToRight);
        spinBoxGdbWatchdogTimeout->setMinimum(20);
        spinBoxGdbWatchdogTimeout->setMaximum(1000000);
        spinBoxGdbWatchdogTimeout->setSingleStep(20);
        spinBoxGdbWatchdogTimeout->setValue(20);

        checkBoxSkipKnownFrames = new QCheckBox(groupBoxGeneral);
        checkBoxSkipKnownFrames->setText(GdbOptionsPage::tr("Skip known frames when stepping"));
        checkBoxSkipKnownFrames->setToolTip(GdbOptionsPage::tr(
            "Allows 'Step Into' to compress several steps into one step\n"
            "for less noisy debugging. For example, the atomic reference\n"
            "counting code is skipped, and a single 'Step Into' for a signal\n"
            "emission ends up directly in the slot connected to it."));

        checkBoxUseMessageBoxForSignals = new QCheckBox(groupBoxGeneral);
        checkBoxUseMessageBoxForSignals->setText(GdbOptionsPage::tr(
            "Show a message box when receiving a signal"));
        checkBoxUseMessageBoxForSignals->setToolTip(GdbOptionsPage::tr(
            "This will show a message box as soon as your application\n"
            "receives a signal like SIGSEGV during debugging."));

        checkBoxAdjustBreakpointLocations = new QCheckBox(groupBoxGeneral);
        checkBoxAdjustBreakpointLocations->setText(GdbOptionsPage::tr(
            "Adjust breakpoint locations"));
        checkBoxAdjustBreakpointLocations->setToolTip(GdbOptionsPage::tr(
            "GDB allows setting breakpoints on source lines for which no code \n"
            "was generated. In such situations the breakpoint is shifted to the\n"
            "next source code line for which code was actually generated.\n"
            "This option reflects such temporary change by moving the breakpoint\n"
            "markers in the source code editor."));

        checkBoxUseDynamicType = new QCheckBox(groupBoxGeneral);
        checkBoxUseDynamicType->setText(GdbOptionsPage::tr(
            "Use dynamic object type for display"));
        checkBoxUseDynamicType->setToolTip(GdbOptionsPage::tr(
            "This specifies whether the dynamic or the static type of objects will be"
            "displayed. Choosing the dynamic type might be slower."));

        checkBoxLoadGdbInit = new QCheckBox(groupBoxGeneral);
        checkBoxLoadGdbInit->setText(GdbOptionsPage::tr("Load .gdbinit file on startup"));
        checkBoxLoadGdbInit->setToolTip(GdbOptionsPage::tr(
            "This allows or inhibits reading the user's default\n"
            ".gdbinit file on debugger startup."));

        checkBoxWarnOnReleaseBuilds = new QCheckBox(groupBoxGeneral);
        checkBoxWarnOnReleaseBuilds->setText(GdbOptionsPage::tr(
            "Warn when debugging \"Release\" builds"));
        checkBoxWarnOnReleaseBuilds->setToolTip(GdbOptionsPage::tr(
            "Show a warning when starting the debugger "
            "on a binary with insufficient debug information."));

        labelDangerous = new QLabel(GdbOptionsPage::tr(
            "The options below should be used with care."));

        checkBoxTargetAsync = new QCheckBox(groupBoxGeneral);
        checkBoxTargetAsync->setText(GdbOptionsPage::tr(
            "Use asynchronous mode to control the inferior"));

        checkBoxAutoEnrichParameters = new QCheckBox(groupBoxGeneral);
        checkBoxAutoEnrichParameters->setText(GdbOptionsPage::tr(
            "Use common locations for debug information"));
        checkBoxAutoEnrichParameters->setToolTip(GdbOptionsPage::tr(
            "This adds common paths to locations of debug information\n"
            "at debugger startup."));

        checkBoxBreakOnWarning = new QCheckBox(groupBoxGeneral);
        checkBoxBreakOnWarning->setText(GdbOptionsPage::tr("Stop when a qWarning is issued"));

        checkBoxBreakOnFatal = new QCheckBox(groupBoxGeneral);
        checkBoxBreakOnFatal->setText(GdbOptionsPage::tr("Stop when a qFatal is issued"));

        checkBoxBreakOnAbort = new QCheckBox(groupBoxGeneral);
        checkBoxBreakOnAbort->setText(GdbOptionsPage::tr("Stop when abort() is called"));

        checkBoxEnableReverseDebugging = new QCheckBox(groupBoxGeneral);
        checkBoxEnableReverseDebugging->setText(GdbOptionsPage::tr("Enable reverse debugging"));
        checkBoxEnableReverseDebugging->setToolTip(GdbOptionsPage::tr(
            "<html><head/><body><p>Selecting this enables reverse debugging.</p><.p>"
            "<b>Note:</b> This feature is very slow and unstable on the GDB side."
            "It exhibits unpredictable behavior when going backwards over system "
            "calls and is very likely to destroy your debugging session.</p><body></html>"));

        checkBoxAttemptQuickStart = new QCheckBox(groupBoxGeneral);
        checkBoxAttemptQuickStart->setText(GdbOptionsPage::tr("Attempt quick start"));
        checkBoxAttemptQuickStart->setToolTip(GdbOptionsPage::tr("Checking this option "
            "will postpone reading debug information as long as possible. This can result "
            "in faster startup times at the price of not being able to set breakpoints "
            "by file and number."));

        groupBoxStartupCommands = new QGroupBox(q);
        groupBoxStartupCommands->setTitle(GdbOptionsPage::tr("Additional Startup Commands"));

        textEditStartupCommands = new QTextEdit(groupBoxStartupCommands);
        textEditStartupCommands->setAcceptRichText(false);

        /*
        groupBoxPluginDebugging = new QGroupBox(q);
        groupBoxPluginDebugging->setTitle(GdbOptionsPage::tr(
            "Behavior of Breakpoint Setting in Plugins"));

        radioButtonAllPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging);
        radioButtonAllPluginBreakpoints->setText(GdbOptionsPage::tr(
            "Always try to set breakpoints in plugins automatically"));
        radioButtonAllPluginBreakpoints->setToolTip(GdbOptionsPage::tr(
            "This is the slowest but safest option."));

        radioButtonSelectedPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging);
        radioButtonSelectedPluginBreakpoints->setText(GdbOptionsPage::tr(
            "Try to set breakpoints in selected plugins"));

        radioButtonNoPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging);
        radioButtonNoPluginBreakpoints->setText(GdbOptionsPage::tr(
            "Never set breakpoints in plugins automatically"));

        lineEditSelectedPluginBreakpointsPattern = new QLineEdit(groupBoxPluginDebugging);

        labelSelectedPluginBreakpoints = new QLabel(groupBoxPluginDebugging);
        labelSelectedPluginBreakpoints->setText(GdbOptionsPage::tr(
            "Matching regular expression: "));
        */

        QFormLayout *formLayout = new QFormLayout(groupBoxGeneral);
        formLayout->addRow(labelGdbWatchdogTimeout, spinBoxGdbWatchdogTimeout);
        formLayout->addRow(checkBoxSkipKnownFrames);
        formLayout->addRow(checkBoxUseMessageBoxForSignals);
        formLayout->addRow(checkBoxAdjustBreakpointLocations);
        formLayout->addRow(checkBoxUseDynamicType);
        formLayout->addRow(checkBoxLoadGdbInit);
        formLayout->addRow(checkBoxWarnOnReleaseBuilds);
        formLayout->addRow(new QLabel(QString()));
        formLayout->addRow(labelDangerous);
        formLayout->addRow(checkBoxTargetAsync);
        formLayout->addRow(checkBoxAutoEnrichParameters);
        formLayout->addRow(checkBoxBreakOnWarning);
        formLayout->addRow(checkBoxBreakOnFatal);
        formLayout->addRow(checkBoxBreakOnAbort);
        formLayout->addRow(checkBoxEnableReverseDebugging);
        formLayout->addRow(checkBoxAttemptQuickStart);

        QGridLayout *startLayout = new QGridLayout(groupBoxStartupCommands);
        startLayout->addWidget(textEditStartupCommands, 0, 0, 1, 1);

        //QHBoxLayout *horizontalLayout = new QHBoxLayout();
        //horizontalLayout->addItem(new QSpacerItem(10, 10, QSizePolicy::Preferred, QSizePolicy::Minimum));
        //horizontalLayout->addWidget(labelSelectedPluginBreakpoints);
        //horizontalLayout->addWidget(lineEditSelectedPluginBreakpointsPattern);

        QGridLayout *gridLayout = new QGridLayout(q);
        gridLayout->addWidget(groupBoxGeneral, 0, 0);
        gridLayout->addWidget(groupBoxStartupCommands, 0, 1);

        //gridLayout->addWidget(groupBoxStartupCommands, 0, 1, 1, 1);
        //gridLayout->addWidget(radioButtonAllPluginBreakpoints, 0, 0, 1, 1);
        //gridLayout->addWidget(radioButtonSelectedPluginBreakpoints, 1, 0, 1, 1);

        //gridLayout->addLayout(horizontalLayout, 2, 0, 1, 1);
        //gridLayout->addWidget(radioButtonNoPluginBreakpoints, 3, 0, 1, 1);
        //gridLayout->addWidget(groupBoxPluginDebugging, 1, 0, 1, 2);
    }
Example #16
0
Piano::Piano(QWidget *parent) :
    QWidget(parent)
{
    init_log();
    QPalette Pal(palette());
    Pal.setColor(QPalette::Background, QColor::fromRgb(240, 240, 240));
    setAutoFillBackground(true);
    setPalette(Pal);

    showing = false; //displaying the scorebox

    b_names_dip = false;
    b_racc_disp = false;
    notes = new QVector<Touche*>();
    notes_jouees = new QVector<QString>();
    setFixedSize(800, 310);

    QPushButton *raccButt= new QPushButton(QString(""),this);
    raccButt->setToolTip(QString("Affiche les raccourcis clavier pour le piano"));
    QPushButton *noteNames = new QPushButton(QString(""),this);
    noteNames->setToolTip(QString("Affiche le nom des notes sur le piano"));

    QCheckBox *checkB = new QCheckBox(QString("options affichage"),this);
    checkB->setToolTip(QString("Affiche/cache les options d'affiche du piano"));
    QPushButton *retour = new QPushButton(QString(""),this);
    checkB->setChecked(true);
    retour->move(740,0);
    retour->setStyleSheet("border-image: url(:/new/prefix1/undo.png)");
    retour->setToolTip(QString("Annule la dernière note jouée"));
    retour->resize(50,50);
    QPushButton *solution = new QPushButton(QString("Solution"),this);
    solution->setToolTip(QString("Aide: Indique la note suivante sur le piano"));
    solution->move(0,10);
    checkB->move(0,282);
    Touche* doM = new Touche(this, QString("tab"),QString("Do"));
    int sizeT= 38;//doM->width();
    //QMessageBox::information(new QWidget(),QString("taille "),QString::number(sizeT));

    int hauteur = 100;
    int nT =3;
    raccButt->move(0,hauteur+50);
    raccButt->setFixedSize(140,50);
    raccButt->setStyleSheet("border-image: url(:/img/clavier.svg.png);"
                            );



    noteNames->move(660,hauteur +50);
    noteNames->setFixedSize(140,50);
    noteNames->setStyleSheet("border-image: url(:/img/doremi);"
                            "border-width: 2px;");

    doM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* reM = new Touche(this, QString("A"),QString("Ré"));
    reM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* miM = new Touche(this, QString("Z"),QString("Mi"));
    miM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* faM = new Touche(this, QString("E"),QString("Fa"));
    faM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* solM = new Touche(this, QString("R"),QString("Sol"));
    solM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* laM = new Touche(this, QString("T"),QString("La"));
    laM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* siM = new Touche(this, QString("Y"),QString("si"));
    siM->move(sizeT*nT,hauteur);
    nT+=1;

    Touche* dom = new Touche(this, QString("U"),QString("Do"));
    dom->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* rem = new Touche(this, QString("I"),QString("Ré"));
    rem->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* mim = new Touche(this, QString("O"),QString("Mi"));
    mim->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* fam = new Touche(this, QString("P"),QString("Fa"));
    fam->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* solm = new Touche(this, QString(/*"dead_circumflex"*/"16781906"),QString("Sol"));
    solm->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* lam = new Touche(this, QString("$"),QString("La"));
    lam->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* sim = new Touche(this, QString("Return"),QString("si"));
    sim->move(sizeT*nT,hauteur);


    nT=4;


    Touche* doMD = new Touche(this, QString("&"),QString("Do#"));
    doMD->black();
    doMD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* reMD = new Touche(this, QString("é"),QString("Ré#"));
    reMD->black();
    reMD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=2;
    Touche* faMD = new Touche(this, QString("'"),QString("Fa#"));
    faMD->black();
    faMD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* solMD = new Touche(this, QString("("),QString("Sol#"));
    solMD->black();
    solMD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* laMD = new Touche(this, QString("-"),QString("La#"));
    laMD->black();
    laMD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=2;

    Touche* domD = new Touche(this, QString("_"),QString("Do#"));
    domD->black();
    domD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* remD = new Touche(this, QString("ç"),QString("Ré#"));
    remD->black();
    remD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=2;
    Touche* famD = new Touche(this, QString(")"),QString("Fa#"));
    famD->black();
    famD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* solmD = new Touche(this, QString("="),QString("Sol#"));
    solmD->black();
    solmD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* lamD = new Touche(this, QString("Backspace"),QString("La#"));
    lamD->black();
    lamD->move(sizeT*nT-sizeT/4,hauteur);







     QObject::connect(doM, SIGNAL(clicked()), this, SLOT(play_doM()));notes->append(doM);
     QObject::connect(reM, SIGNAL(clicked()), this, SLOT(play_reM()));notes->append(reM);
     QObject::connect(miM, SIGNAL(clicked()), this, SLOT(play_miM()));notes->append(miM);
     QObject::connect(faM, SIGNAL(clicked()), this, SLOT(play_faM()));notes->append(faM);
     QObject::connect(solM, SIGNAL(clicked()), this, SLOT(play_solM()));notes->append(solM);
     QObject::connect(laM, SIGNAL(clicked()), this, SLOT(play_laM()));notes->append(laM);
     QObject::connect(siM, SIGNAL(clicked()), this, SLOT(play_siM()));notes->append(siM);

     QObject::connect(dom, SIGNAL(clicked()), this, SLOT(play_dom()));notes->append(dom);
     QObject::connect(rem, SIGNAL(clicked()), this, SLOT(play_rem()));notes->append(rem);
     QObject::connect(mim, SIGNAL(clicked()), this, SLOT(play_mim()));notes->append(mim);
     QObject::connect(fam, SIGNAL(clicked()), this, SLOT(play_fam()));notes->append(fam);
     QObject::connect(solm, SIGNAL(clicked()), this, SLOT(play_solm()));notes->append(solm);
     QObject::connect(lam, SIGNAL(clicked()), this, SLOT(play_lam()));notes->append(lam);
     QObject::connect(sim, SIGNAL(clicked()), this, SLOT(play_sim()));notes->append(sim);

     QObject::connect(doMD, SIGNAL(clicked()), this, SLOT(play_doMD()));notes->append(doMD);
     QObject::connect(reMD, SIGNAL(clicked()), this, SLOT(play_reMD()));notes->append(reMD);

     QObject::connect(faMD, SIGNAL(clicked()), this, SLOT(play_faMD()));notes->append(faMD);
     QObject::connect(solMD, SIGNAL(clicked()), this, SLOT(play_solMD()));notes->append(solMD);
     QObject::connect(laMD, SIGNAL(clicked()), this, SLOT(play_laMD()));notes->append(laMD);

     QObject::connect(domD, SIGNAL(clicked()), this, SLOT(play_domD()));notes->append(domD);
     QObject::connect(remD, SIGNAL(clicked()), this, SLOT(play_remD()));notes->append(remD);

     QObject::connect(famD, SIGNAL(clicked()), this, SLOT(play_famD()));notes->append(famD);
     QObject::connect(solmD, SIGNAL(clicked()), this, SLOT(play_solmD()));notes->append(solmD);
     QObject::connect(lamD, SIGNAL(clicked()), this, SLOT(play_lamD()));notes->append(lamD);


     QObject::connect(raccButt, SIGNAL(clicked()), this, SLOT(display_racc()));
     QObject::connect(noteNames, SIGNAL(clicked()), this, SLOT(display_names()));
     QObject::connect(checkB, SIGNAL(toggled(bool)), this, SLOT(checking(bool)));
     QObject::connect(retour, SIGNAL(clicked()), this, SLOT(retour_arriere()));



}
MouseSettingsPage::MouseSettingsPage(AntiMicroSettings *settings, QWidget *parent) :
    QWizardPage(parent)
{
    this->settings = settings;

    setTitle(tr("Mouse Settings"));
    setSubTitle(tr("Customize settings used for mouse emulation"));
    QVBoxLayout *tempMainLayout = new QVBoxLayout;
    setLayout(tempMainLayout);

#ifdef Q_OS_WIN
    QCheckBox *disablePrecision = new QCheckBox(tr("Disable Enhance Pointer Precision"));
    disablePrecision->setToolTip(tr("Disable the \"Enhanced Pointer Precision\" Windows setting\n"
                                    "while antimicro is running. Disabling \"Enhanced Pointer Precision\"\n"
                                    "will allow mouse movement within antimicro to be more\n"
                                    "precise."));
    tempMainLayout->addWidget(disablePrecision);
    tempMainLayout->addSpacerItem(new QSpacerItem(10, 10));
    registerField("disableEnhancePrecision", disablePrecision);
#endif

    QGroupBox *smoothingGroupBox = new QGroupBox(tr("Smoothing"));
    smoothingGroupBox->setCheckable(true);
    smoothingGroupBox->setChecked(false);
    registerField("mouseSmoothing", smoothingGroupBox, "checked", SIGNAL(toggled(bool)));

    layout()->addWidget(smoothingGroupBox);

    QVBoxLayout *tempVLayout = new QVBoxLayout;

    QHBoxLayout *tempHLayout = new QHBoxLayout;
    QLabel *tempLabel = new QLabel(tr("History Buffer:"));
    QSpinBox *tempSpinBox = new QSpinBox;
    tempSpinBox->setMinimum(1);
    tempSpinBox->setMaximum(30);
    tempSpinBox->setValue(10);
    tempLabel->setBuddy(tempSpinBox);
    registerField("historyBuffer", tempSpinBox);

    tempHLayout->addWidget(tempLabel);
    tempHLayout->addWidget(tempSpinBox);
    tempVLayout->addLayout(tempHLayout);

    tempHLayout = new QHBoxLayout;
    tempLabel = new QLabel(tr("Weight Modifier:"));
    QDoubleSpinBox *tempDoubleSpinBox = new QDoubleSpinBox;
    tempDoubleSpinBox->setMinimum(0.0);
    tempDoubleSpinBox->setMaximum(1.0);
    tempDoubleSpinBox->setValue(0.20);
    tempDoubleSpinBox->setSingleStep(0.10);
    tempLabel->setBuddy(tempDoubleSpinBox);
    registerField("weightModifier", tempDoubleSpinBox);

    tempHLayout->addWidget(tempLabel);
    tempHLayout->addWidget(tempDoubleSpinBox);
    tempVLayout->addLayout(tempHLayout);

    smoothingGroupBox->setLayout(tempVLayout);

    tempHLayout = new QHBoxLayout;
    tempLabel = new QLabel(tr("Refresh Rate:"));
    QComboBox *tempComboBox = new QComboBox;

    for (int i = 1; i <= JoyButton::MAXIMUMMOUSEREFRESHRATE; i++)
    {
        tempComboBox->addItem(QString("%1 ms").arg(i), i);
    }

    int refreshIndex = tempComboBox->findData(JoyButton::getMouseRefreshRate());
    if (refreshIndex >= 0)
    {
        tempComboBox->setCurrentIndex(refreshIndex);
    }

    tempComboBox->setToolTip(tr("The refresh rate is the amount of time that will elapse\n"
                                "in between mouse events. Please be cautious when\n"
                                "editing this setting as it will cause the program to use\n"
                                "more CPU power. Setting this value too low can cause\n"
                                "system instability. Please test the setting before using\n"
                                "it unattended."));
    tempLabel->setBuddy(tempComboBox);
    registerField("mouseRefreshRate", tempComboBox);

    tempHLayout->addWidget(tempLabel);
    tempHLayout->addWidget(tempComboBox);
    tempMainLayout->addSpacerItem(new QSpacerItem(10, 10));
    tempMainLayout->addLayout(tempHLayout);
}
Example #18
0
QWidget *  QCamVesta::buildGUI(QWidget * parent) {
   QWidget * remoteCTRL=QCamV4L2::buildGUI(parent);

   //QHGroupBox* vestaCtrl=new QHGroupBox("Vesta controls",remoteCTRL);
   QGridBox * sliders= new QGridBox(/*vestaCtrl*/VctrlBox,Qt::Vertical,3);
   /*
   QHBox * sliders=new QHBox(remoteCTRL);
   QVBox * left = new QVBox(sliders);
   QVBox * right = new QVBox(sliders);
   */
   if (QCamUtilities::expertMode()) {
      QCheckBox * backLight = new QCheckBox(tr("Back Light"),sliders);
      connect(backLight,SIGNAL(toggled(bool)),this,SLOT(setBackLight(bool)));
      backLight->setToolTip(tr("In case the object you are viewing with the camera is\n"
                       "in front of a bright background (for example, a window\n"
                       "or some bright lights), the automatic exposure unit may\n"
                       "make the image too dark. In that case you can turn the\n"
                       "backlight compensation mode off"));
      QCheckBox * flicker = new QCheckBox(tr("Anti-flicker"),sliders);
      connect(flicker,SIGNAL(toggled(bool)),this,SLOT(setFlicker(bool)));
      flicker->setToolTip(tr("Suppress 'flickering' of the image when light with a fluo tube"));
   }
   remoteCTRLgama_=new QCamSlider(tr("Gamma"),false,sliders);
   // not very clean...but works
   remoteCTRLgama_->setMinValue(0);
   remoteCTRLgama_->setMaxValue(32);
   remoteCTRLgama_->setToolTip(tr("Low gamma implies less contrasts"));
   remoteCTRLgain_=new QCamSlider(tr("Gain"),true,sliders);
   remoteCTRLgain_->setToolTip(tr("More Gain implies more noise in the images"));
   remoteCTRLexposure_=new QCamSlider(tr("Exp."),true,sliders,0,65535,true);
   remoteCTRLexposure_->setToolTip(tr("More exposure reduce noise in images.\n"
                 "(manual exposure setting don't work on type 740\n"
                 "if automatic gain is activated).")
      );
   if (QCamUtilities::expertMode()) {
      remoteCTRLcompression_=new QCamSlider(tr("Comp."),false,sliders,0,3);
      remoteCTRLnoiseRemoval_=new QCamSlider(tr("Noise"),false,sliders,0,3);
      remoteCTRLsharpness_=new QCamSlider(tr("Sharp."),false,sliders,0,65535);

      connect(this,SIGNAL(compressionChange(int)),remoteCTRLcompression_,SLOT(setValue(int)));
      connect(remoteCTRLcompression_,SIGNAL(valueChange(int)),this,SLOT(setCompression(int)));
      connect(this,SIGNAL(noiseRemovalChange(int)),remoteCTRLnoiseRemoval_,SLOT(setValue(int)));
      connect(remoteCTRLnoiseRemoval_,SIGNAL(valueChange(int)),this,SLOT(setNoiseRemoval(int)));

      remoteCTRLnoiseRemoval_->setToolTip(tr("Dynamic Noise removal (0=none, 3=high) (0 give brighter image)"));

      connect(this,SIGNAL(sharpnessChange(int)),remoteCTRLsharpness_,SLOT(setValue(int)));
      connect(remoteCTRLsharpness_,SIGNAL(valueChange(int)),this,SLOT(setSharpness(int)));
      remoteCTRLsharpness_->setToolTip(tr("Shaprness enhancement (0=none, 65536=high) (low value blurs image)"));
   }

   int wbValue[]={PWC_WB_AUTO, PWC_WB_INDOOR, PWC_WB_OUTDOOR, PWC_WB_FL, PWC_WB_MANUAL};
   const char *wbLabel[]={"Auto", "In","Out","Neon","Manual"};
   remoteCTRLWhiteBalance_=new QCamRadioBox("White Balance",VctrlBox,5,wbValue,wbLabel,5);

   QWidget* whiteBalanceGroup=new QWidget();
   QHBoxLayout* whiteBalanceGroup_layout= new QHBoxLayout();
   whiteBalanceGroup->setLayout(whiteBalanceGroup_layout);

   connect(remoteCTRLWhiteBalance_,SIGNAL(change(int)),this,SLOT(setWhiteBalanceMode(int)));
   connect(this,SIGNAL(whiteBalanceModeChange(int)),remoteCTRLWhiteBalance_,SLOT(update(int)));

   QCheckBox * liveWBupdateB = new QCheckBox(tr("live"),whiteBalanceGroup);
   connect(liveWBupdateB,SIGNAL(toggled(bool)),this,SLOT(setLiveWhiteBalance(bool)));
   liveWBupdateB->setToolTip(tr("Live Update of red/blue value in automatic mode"));
   whiteBalanceGroup_layout->addWidget(liveWBupdateB);

   remoteCTRLWBred_ = new QCamSlider(tr("red bal."),false,whiteBalanceGroup,0,65535);
   whiteBalanceGroup_layout->addWidget(remoteCTRLWBred_);
   connect(this,SIGNAL(whiteBalanceRedChange(int)),remoteCTRLWBred_,SLOT(setValue(int)));
   connect(remoteCTRLWBred_,SIGNAL(valueChange(int)),this,SLOT(setWhiteBalanceRed(int)));

   remoteCTRLWBblue_ = new QCamSlider(tr("blue bal."),false,whiteBalanceGroup,0,65535);
   whiteBalanceGroup_layout->addWidget(remoteCTRLWBblue_);
   connect(this,SIGNAL(whiteBalanceBlueChange(int)),remoteCTRLWBblue_,SLOT(setValue(int)));
   connect(remoteCTRLWBblue_,SIGNAL(valueChange(int)),this,SLOT(setWhiteBalanceBlue(int)));

   remoteCTRLWhiteBalance_->layout()->addWidget(whiteBalanceGroup);

   remoteCTRLWBred_->setEnabled(false);
   remoteCTRLWBblue_->setEnabled(false);
   remoteCTRLWhiteBalance_->show();

   exposureTimeLeft_=NULL;
   connect(this,SIGNAL(gainChange(int)),remoteCTRLgain_,SLOT(setValue(int)));
   connect(remoteCTRLgain_,SIGNAL(valueChange(int)),this,SLOT(setGain(int)));

   /*
     connect(this,SIGNAL(exposureChange(int)),remoteCTRLexposure_,
     SLOT(setValue(int)));
   */
   connect(remoteCTRLexposure_,SIGNAL(valueChange(int)),this,SLOT(setExposure(int)));
   connect(this,SIGNAL(gamaChange(int)),remoteCTRLgama_,SLOT(setValue(int)));
   connect(remoteCTRLgama_,SIGNAL(valueChange(int)),this,SLOT(setGama(int)));

   QCamHBox* settings=new QCamHBox(VctrlBox);
   settings->setToolTip(tr("save/restore settings of gain,exposure & white balance"));

   QPushButton* saveSettingsB =new QPushButton(tr("save"),settings);
   saveSettingsB->setToolTip(tr("Save User settings (gain,exposure & white balance)"));
   connect(saveSettingsB,SIGNAL(released()),this,SLOT(saveSettings()));

   QPushButton* restoreSettingsB =new QPushButton(tr("restore"),settings);
   restoreSettingsB->setToolTip(tr("Restore User settings"));
   connect(restoreSettingsB,SIGNAL(released()),this,SLOT(restoreSettings()));

   QPushButton* restoreFactorySettingsB =new QPushButton(tr("factory"),settings);
   restoreFactorySettingsB->setToolTip(tr("Restore factory default settings"));
   connect(restoreFactorySettingsB,SIGNAL(released()),this,SLOT(restoreFactorySettings()));

   remoteCTRLframeRate_ =new QCamHGroupBox(tr("fps / long exposure"),remoteCTRL);
   int frameRate[]={5,10,15,20,25,30};
   remoteCTRLframeRate2_=new QCamComboBox("fps",remoteCTRLframeRate_,6,frameRate,NULL);
   remoteCTRLframeRate2_->setToolTip(tr("Camera frame rate"));
   connect(this,SIGNAL(frameRateChange(int)),remoteCTRLframeRate2_,SLOT(update(int)));
   connect(remoteCTRLframeRate2_,SIGNAL(change(int)),this,SLOT(setFrameRate(int)));
   remoteCTRLframeRate2_->show();

   int scModeTable[]={SCmodNone,SCmodPPort2,SCmodLed,SCmodSerial};
   const char* scModeLabel[]={"SC mod : None","SC mod : // port","SC mod : TUC led","SC mod : serial"};
   SCmodSelector_ = new QCamComboBox("SC mod",remoteCTRLframeRate_,4,scModeTable,scModeLabel);
   SCmodSelector_->setToolTip(tr("Long exposure device"));
   connect(SCmodSelector_,SIGNAL(change(int)),this,SLOT(setSCmod(int)));

   initRemoteControlLongExposure(remoteCTRLframeRate_);

   setBestQuality();
   refreshPictureSettings();

   remoteCTRL->show();

   return remoteCTRL;
}
Example #19
0
SongEditorWindow::SongEditorWindow(SlideGroup *g, QWidget *parent) : 
	AbstractSlideGroupEditor(g,parent),
	m_slideGroup(0),
	m_editWin(0),
	m_syncToDatabase(true),
	m_arrModel(0)
{
	setAttribute(Qt::WA_DeleteOnClose,true);
	
	QWidget *centerWidget = new QWidget(this);
	
	QVBoxLayout * vbox = new QVBoxLayout(centerWidget);
	
	// Title editor
	QHBoxLayout * hbox1 = new QHBoxLayout();
	QLabel *label = new QLabel("&Title: ");
	hbox1->addWidget(label);
	
	m_title = new QLineEdit();
	
	label->setBuddy(m_title);
	hbox1->addWidget(m_title);
	
	vbox->addLayout(hbox1);
	
	// Default arrangement
	QHBoxLayout *hbox2 = new QHBoxLayout();
	label = new QLabel("Default Arrangement: ");
	hbox2->addWidget(label);
	
	m_defaultArrangement = new QLineEdit();
	m_defaultArrangement->setReadOnly(true);
	
	QPalette p = m_defaultArrangement->palette();
	p.setColor(QPalette::Base, Qt::lightGray);
	m_defaultArrangement->setPalette(p);

	hbox2->addWidget(m_defaultArrangement);
	
	vbox->addLayout(hbox2);

	// My arrangement
	QHBoxLayout *hbox3 = new QHBoxLayout();
	label = new QLabel("&Arrangement:");
	hbox3->addWidget(label);
	
	//m_arrangement = new QLineEdit();
	//m_arrangement->setReadOnly(false);
	m_arrangement = new QComboBox();
	m_arrangement->setEditable(true);
	m_arrangement->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
	connect(m_arrangement, SIGNAL(editTextChanged(const QString&)), this, SLOT(arrTextChanged(const QString&)));
	connect(m_arrangement, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(arrCurrentIndexChanged(const QString&)));
	connect(m_arrangement, SIGNAL(activated(const QString &)), this, SLOT(arrActivated(const QString&)));
	label->setBuddy(m_arrangement);
	hbox3->addWidget(m_arrangement);
	
	QPushButton *btn = new QPushButton("Default");
	btn->setIcon(QIcon(":/data/stock-undo.png"));
	btn->setToolTip("Reset arrangement to default arrangement (above)");
	connect(btn, SIGNAL(clicked()), this, SLOT(resetArr()));
	hbox3->addWidget(btn);
	
	
	btn = new QPushButton("Show/Hide List");
	btn->setCheckable(true);
	btn->setIcon(QIcon(":/data/stock-find-and-replace.png"));
	btn->setToolTip("Show/hide the arrangement drag-and-drop list");
	connect(btn, SIGNAL(toggled(bool)), this, SLOT(arrListViewToggled(bool)));
	hbox3->addWidget(btn);
	
	QPushButton *listBtn = btn;
	
	vbox->addLayout(hbox3);


	setWindowIcon(QIcon(":/data/icon-d.png"));
	
	QFont font;
	font.setFamily("Courier");
	font.setFixedPitch(true);
	font.setPointSize(10);
	
	//QHBoxLayout *editorHBox = new QHBoxLayout();
	//editorHBox->setContentsMargins(0,0,0,0);
	QSplitter *editorHBox = new QSplitter();
	
	m_editor = new MyQTextEdit;
	m_editor->setFont(font);
	editorHBox->addWidget(m_editor);
	connect(m_editor, SIGNAL(textChanged()), this, SLOT(editTextChanged()));
	//m_editor->setAcceptRichText(false);
	
	m_highlighter = new SongEditorHighlighter(m_editor->document());
	
	// Arrangement preview box
	m_arrangementPreview = new MyQTextEdit;
	m_arrangementPreview->setFont(font);
	m_arrangementPreview->setReadOnly(true);
	
	QPalette p2 = m_arrangementPreview->palette();
	p2.setColor(QPalette::Base, Qt::lightGray);
	m_arrangementPreview->setPalette(p2);

	editorHBox->addWidget(m_arrangementPreview);
	//m_editor->setAcceptRichText(false);
	
	(void*)new SongEditorHighlighter(m_arrangementPreview->document());
	
	// List view
	m_arrModel = new ArrangementListModel();
	connect(m_arrModel, SIGNAL(blockListChanged(QStringList)), this, SLOT(arrModelChange(QStringList)));
	
	QListView *arrListView = new QListView();
	
	arrListView->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding));
	arrListView->setViewMode(QListView::ListMode);
	arrListView->setWrapping(false);
	arrListView->setFlow(QListView::TopToBottom);
	
	arrListView->setMovement(QListView::Free);
	arrListView->setWordWrap(true);
	arrListView->setSelectionMode(QAbstractItemView::ExtendedSelection);
	arrListView->setDragEnabled(true);
	arrListView->setAcceptDrops(true);
	arrListView->setDropIndicatorShown(true);
	
	arrListView->setModel(m_arrModel);
	m_arrListView = arrListView;
	
	editorHBox->addWidget(arrListView);
	
	editorHBox->setStretchFactor(0,10);
	editorHBox->setStretchFactor(1,10);
	editorHBox->setStretchFactor(2,1);
	
	//vbox->addWidget(m_editor);
	//vbox->addLayout(editorHBox);
	vbox->addWidget(editorHBox);
	
	QHBoxLayout * hboxBottom = new QHBoxLayout();
	
	m_tmplEditButton = new QPushButton("Edit &Template...");
	m_tmplEditButton->setIcon(QIcon(":data/stock-select-color.png"));
	m_tmplEditButton->setToolTip("Edit the template associated with this song arrangement");
	connect(m_tmplEditButton, SIGNAL(clicked()), this, SLOT(editSongTemplate()));
	hboxBottom->addWidget(m_tmplEditButton);
	
	QPushButton *tmplResetButton = new QPushButton("");
	tmplResetButton->setIcon(QIcon(":data/stock-undo.png"));
	tmplResetButton->setToolTip("Reset template on this song to use the current template set in the main Song Browser");
	connect(tmplResetButton, SIGNAL(clicked()), this, SLOT(resetSongTemplate()));
	hboxBottom->addWidget(tmplResetButton);
	
	hboxBottom->addStretch();
	
	m_syncBox = new QCheckBox("S&ync Changes to DB");
	m_syncBox->setToolTip("If checked, saving changes will update the master song database as well as the copy of the song in this document");
	m_syncBox->setChecked(true);
	connect(m_syncBox, SIGNAL(toggled(bool)), this, SLOT(setSyncToDatabase(bool)));
	
	hboxBottom->addWidget(m_syncBox);
	
	QCheckBox *showArrPreviewCb = new QCheckBox("Arrangement Preview");
	showArrPreviewCb->setToolTip("Show/hide arrangement preview window");
	showArrPreviewCb->setChecked(true);
	connect(showArrPreviewCb, SIGNAL(toggled(bool)), this, SLOT(showArrPreview(bool)));
	
	hboxBottom->addWidget(showArrPreviewCb);
	
	
	btn = new QPushButton("&Save Song");
	btn->setIcon(QIcon(":data/stock-save.png"));
	connect(btn, SIGNAL(clicked()), this, SLOT(accepted()));
	hboxBottom->addWidget(btn);
	
	btn = new QPushButton("&Cancel");
	connect(btn, SIGNAL(clicked()), this, SLOT(close()));
	hboxBottom->addWidget(btn);
	
	vbox->addLayout(hboxBottom);
	
	//setLayout(vbox);
	setCentralWidget(centerWidget);
	
	resize(500,600);
	
	QSettings set;
	bool flag = set.value("songdb/arrlistview",true).toBool();
	arrListViewToggled(flag);
	listBtn->setChecked(flag);
	
	flag = set.value("songdb/arrpreview",true).toBool();
	showArrPreviewCb->setChecked(flag);
	showArrPreview(flag);
	
	
	
	
		
// 	m_editWin = new SlideEditorWindow();
// 	connect(m_editWin, SIGNAL(closed()), this, SLOT(editorWindowClosed()));
//	}
	
}
Example #20
0
void DkDisplayPreference::createLayout() {

	// zoom settings
	QCheckBox* invertZoom = new QCheckBox(tr("Invert mouse wheel behaviour for zooming"), this);
	invertZoom->setObjectName("invertZoom");
	invertZoom->setToolTip(tr("If checked, the mouse wheel behaviour is inverted while zooming."));
	invertZoom->setChecked(Settings::param().display().invertZoom);

	QLabel* interpolationLabel = new QLabel(tr("Show pixels if zoom level is above"), this);

	QSpinBox* sbInterpolation = new QSpinBox(this);
	sbInterpolation->setObjectName("interpolationBox");
	sbInterpolation->setToolTip(tr("nomacs will not interpolate images if the zoom level is larger."));
	sbInterpolation->setSuffix("%");
	sbInterpolation->setMinimum(0);
	sbInterpolation->setMaximum(10000);
	sbInterpolation->setValue(Settings::param().display().interpolateZoomLevel);

	DkGroupWidget* zoomGroup = new DkGroupWidget(tr("Zoom"), this);
	zoomGroup->addWidget(invertZoom);
	zoomGroup->addWidget(interpolationLabel);
	zoomGroup->addWidget(sbInterpolation);

	// keep zoom radio buttons
	QVector<QRadioButton*> keepZoomButtons;
	keepZoomButtons.resize(DkSettings::zoom_end);
	keepZoomButtons[DkSettings::zoom_always_keep] = new QRadioButton(tr("Always keep zoom"), this);
	keepZoomButtons[DkSettings::zoom_keep_same_size] = new QRadioButton(tr("Keep zoom if the size is the same"), this);
	keepZoomButtons[DkSettings::zoom_keep_same_size]->setToolTip(tr("If checked, the zoom level is only kept, if the image loaded has the same level as the previous."));
	keepZoomButtons[DkSettings::zoom_never_keep] = new QRadioButton(tr("Never keep zoom"), this);

	QCheckBox* cbZoomToFit = new QCheckBox(tr("Always zoom to fit"), this);
	cbZoomToFit->setObjectName("zoomToFit");
	cbZoomToFit->setChecked(Settings::param().display().zoomToFit);

	// check wrt the current settings
	keepZoomButtons[Settings::param().display().keepZoom]->setChecked(true);

	QButtonGroup* keepZoomButtonGroup = new QButtonGroup(this);
	keepZoomButtonGroup->setObjectName("keepZoom");
	keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_always_keep], DkSettings::zoom_always_keep);
	keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_keep_same_size], DkSettings::zoom_keep_same_size);
	keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_never_keep], DkSettings::zoom_never_keep);

	DkGroupWidget* keepZoomGroup = new DkGroupWidget(tr("When Displaying New Images"), this);
	keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_always_keep]);
	keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_keep_same_size]);
	keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_never_keep]);
	keepZoomGroup->addWidget(cbZoomToFit);
	
	// icon size
	QSpinBox* sbIconSize = new QSpinBox(this);
	sbIconSize->setObjectName("iconSizeBox");
	sbIconSize->setToolTip(tr("Define the icon size in pixel."));
	sbIconSize->setSuffix(" px");
	sbIconSize->setMinimum(16);
	sbIconSize->setMaximum(1024);
	sbIconSize->setValue(Settings::param().display().iconSize);

	DkGroupWidget* iconGroup = new DkGroupWidget(tr("Icon Size"), this);
	iconGroup->addWidget(sbIconSize);

	// slideshow
	QLabel* fadeImageLabel = new QLabel(tr("Image Transition"), this);

	QComboBox* cbTransition = new QComboBox(this);
	cbTransition->setObjectName("transition");
	cbTransition->setToolTip(tr("Choose a transition when loading a new image"));

	for (int idx = 0; idx < DkSettings::trans_end; idx++) {

		QString str = tr("Unknown Transition");

		switch (idx) {
		case DkSettings::trans_appear:	str = tr("Appear"); break;
		case DkSettings::trans_swipe:	str = tr("Swipe");	break;
		case DkSettings::trans_fade:	str = tr("Fade");	break;
		}

		cbTransition->addItem(str);
	}
	cbTransition->setCurrentIndex(Settings::param().display().transition);

	QDoubleSpinBox* fadeImageBox = new QDoubleSpinBox(this);
	fadeImageBox->setObjectName("fadeImageBox");
	fadeImageBox->setToolTip(tr("Define the image transition speed."));
	fadeImageBox->setSuffix(" sec");
	fadeImageBox->setMinimum(0.0);
	fadeImageBox->setMaximum(3);
	fadeImageBox->setSingleStep(.2);
	fadeImageBox->setValue(Settings::param().display().animationDuration);

	QCheckBox* cbAlwaysAnimate = new QCheckBox(tr("Always Animate Image Loading"), this);
	cbAlwaysAnimate->setObjectName("alwaysAnimate");
	cbAlwaysAnimate->setToolTip(tr("If unchecked, loading is only animated if nomacs is fullscreen"));
	cbAlwaysAnimate->setChecked(Settings::param().display().alwaysAnimate);

	QLabel* displayTimeLabel = new QLabel(tr("Display Time"), this);
	
	QDoubleSpinBox* displayTimeBox = new QDoubleSpinBox(this);
	displayTimeBox->setObjectName("displayTimeBox");
	displayTimeBox->setToolTip(tr("Define the time an image is displayed."));
	displayTimeBox->setSuffix(" sec");
	displayTimeBox->setMinimum(0.0);
	displayTimeBox->setMaximum(30);
	displayTimeBox->setSingleStep(.2);
	displayTimeBox->setValue(Settings::param().slideShow().time);

	DkGroupWidget* slideshowGroup = new DkGroupWidget(tr("Slideshow"), this);
	slideshowGroup->addWidget(fadeImageLabel);
	slideshowGroup->addWidget(cbTransition);
	slideshowGroup->addWidget(fadeImageBox);
	slideshowGroup->addWidget(cbAlwaysAnimate);
	slideshowGroup->addWidget(displayTimeLabel);
	slideshowGroup->addWidget(displayTimeBox);

	// left column
	QWidget* leftWidget = new QWidget(this);
	QVBoxLayout* leftLayout = new QVBoxLayout(leftWidget);
	leftLayout->setAlignment(Qt::AlignTop);
	leftLayout->addWidget(zoomGroup);
	leftLayout->addWidget(keepZoomGroup);
	leftLayout->addWidget(iconGroup);
	leftLayout->addWidget(slideshowGroup);

	// right column
	QWidget* rightWidget = new QWidget(this);
	QVBoxLayout* rightLayout = new QVBoxLayout(rightWidget);
	rightLayout->setAlignment(Qt::AlignTop);

	QHBoxLayout* layout = new QHBoxLayout(this);
	layout->setAlignment(Qt::AlignLeft);

	layout->addWidget(leftWidget);
	layout->addWidget(rightWidget);
}
Example #21
0
ACLEditor::ACLEditor(int channelid, const MumbleProto::ACL &mea, QWidget *p) : QDialog(p) {
	QLabel *l;

	bAddChannelMode = false;

	iChannel = channelid;
	Channel *pChannel = Channel::get(iChannel);
	if (pChannel == NULL) {
		g.l->log(Log::Warning, tr("Failed: Invalid channel"));
		QDialog::reject();
		return;
	}

	msg = mea;

	setupUi(this);

	qcbChannelTemporary->hide();

	iId = mea.channel_id();
	setWindowTitle(tr("Mumble - Edit %1").arg(Channel::get(iId)->qsName));

	qlChannelID->setText(tr("ID: %1").arg(iId));

	qleChannelName->setText(pChannel->qsName);
	if (channelid == 0)
		qleChannelName->setEnabled(false);

	rteChannelDescription->setText(pChannel->qsDesc);

	qsbChannelPosition->setRange(INT_MIN, INT_MAX);
	qsbChannelPosition->setValue(pChannel->iPosition);

	QGridLayout *grid = new QGridLayout(qgbACLpermissions);

	l = new QLabel(tr("Deny"), qgbACLpermissions);
	grid->addWidget(l, 0, 1);
	l = new QLabel(tr("Allow"), qgbACLpermissions);
	grid->addWidget(l, 0, 2);

	int idx = 1;
	for (int i = 0; i < ((iId == 0) ? 30 : 16); ++i) {
		ChanACL::Perm perm = static_cast<ChanACL::Perm>(1 << i);
		QString name = ChanACL::permName(perm);

		if (! name.isEmpty()) {
			QCheckBox *qcb;
			l = new QLabel(name, qgbACLpermissions);
			grid->addWidget(l, idx, 0);
			qcb = new QCheckBox(qgbACLpermissions);
			qcb->setToolTip(tr("Deny %1").arg(name));
			qcb->setWhatsThis(tr("This revokes the %1 privilege. If a privilege is both allowed and denied, it is denied.<br />%2").arg(name).arg(ChanACL::whatsThis(perm)));
			connect(qcb, SIGNAL(clicked(bool)), this, SLOT(ACLPermissions_clicked()));
			grid->addWidget(qcb, idx, 1);

			qlACLDeny << qcb;

			qcb = new QCheckBox(qgbACLpermissions);
			qcb->setToolTip(tr("Allow %1").arg(name));
			qcb->setWhatsThis(tr("This grants the %1 privilege. If a privilege is both allowed and denied, it is denied.<br />%2").arg(name).arg(ChanACL::whatsThis(perm)));
			connect(qcb, SIGNAL(clicked(bool)), this, SLOT(ACLPermissions_clicked()));
			grid->addWidget(qcb, idx, 2);

			qlACLAllow << qcb;

			qlPerms << perm;

			++idx;
		}
	}
Example #22
0
/** Puts the controls that go on the second line, the workspace
 *  list and save commands, on to the layout that's passed to it
 *  @param lineTwo :: the layout on to which the controls will be placed
 *  @param defSavs the formats to save into, sets the check boxes to be checked
 */
void SaveWorkspaces::setupLine2(
    QHBoxLayout *const lineTwo,
    const QHash<const QCheckBox *const, QString> &defSavs) {
  m_workspaces = new QListWidget();
  auto ws = AnalysisDataService::Instance().getObjectNames();
  auto it = ws.begin(), wsEnd = ws.end();
  for (; it != wsEnd; ++it) {
    Workspace *wksp = FrameworkManager::Instance().getWorkspace(*it);
    if (dynamic_cast<MatrixWorkspace *>(
            wksp)) { // only include matrix workspaces, not groups or tables
      m_workspaces->addItem(QString::fromStdString(*it));
    }
  }
  // allow users to select more than one workspace in the list
  m_workspaces->setSelectionMode(QAbstractItemView::ExtendedSelection);
  connect(m_workspaces, SIGNAL(currentRowChanged(int)), this,
          SLOT(setFileName(int)));

  QPushButton *save = new QPushButton("Save");
  connect(save, SIGNAL(clicked()), this, SLOT(saveSel()));
  QPushButton *cancel = new QPushButton("Cancel");
  connect(cancel, SIGNAL(clicked()), this, SLOT(close()));

  QCheckBox *saveRKH = new QCheckBox("RKH (1D/2D)");
  QCheckBox *saveNXcanSAS = new QCheckBox("NXcanSAS (1D/2D)");
  QCheckBox *saveCan = new QCheckBox("CanSAS (1D)");

  // link the save option tick boxes to their save algorithm
  m_savFormats.insert(saveRKH, "SaveRKH");
  m_savFormats.insert(saveNXcanSAS, "SaveNXcanSAS");
  m_savFormats.insert(saveCan, "SaveCanSAS1D");
  setupFormatTicks(defSavs);

  m_append = new QCheckBox("Append");

  // place controls into the layout, which places them on the form and takes
  // care of deleting them
  QVBoxLayout *ly_saveConts = new QVBoxLayout;
  ly_saveConts->addWidget(save);
  ly_saveConts->addWidget(cancel);
  ly_saveConts->addWidget(m_append);
  ly_saveConts->addStretch();

  QVBoxLayout *ly_saveFormats = new QVBoxLayout;
  ly_saveFormats->addWidget(saveRKH);
  ly_saveFormats->addWidget(saveNXcanSAS);
  ly_saveFormats->addWidget(saveCan);
  QGroupBox *gb_saveForms = new QGroupBox(tr("Save Formats"));
  gb_saveForms->setLayout(ly_saveFormats);
  ly_saveConts->addWidget(gb_saveForms);

  lineTwo->addWidget(m_workspaces);
  lineTwo->addLayout(ly_saveConts);

  m_workspaces->setToolTip("Select one or more workspaces");
  const QString formatsTip =
      "Some formats support appending multiple workspaces in one file";
  gb_saveForms->setToolTip(formatsTip);
  save->setToolTip(formatsTip);
  cancel->setToolTip(formatsTip);
  saveNXcanSAS->setToolTip(formatsTip);
  saveCan->setToolTip(formatsTip);
  saveRKH->setToolTip(formatsTip);
  m_append->setToolTip(formatsTip);
}
Example #23
0
VPiano::VPiano() : QMainWindow()
{
	QWidget *central = new QWidget(this);
	QVBoxLayout *vb = new QVBoxLayout;
	QHBoxLayout *octaves = new QHBoxLayout;

	QSignalMapper *octaveSignalMapper = new QSignalMapper(this);

	for(int i = 0; i < 9; i++)
	{
		QString title;
		title.setNum(i);
		QPushButton *o = new QPushButton(title, central);
		o->setFixedSize(fontMetrics().width(title)*4, o->height());
		QString shortcut;
		shortcut.setNum(i+1);
		o->setShortcut(QKeySequence(QString("F") + shortcut));
		octaves->addWidget(o);

		connect(o, SIGNAL(clicked()), octaveSignalMapper, SLOT(map()));
		octaveSignalMapper->setMapping(o, i);
	}

	OctaveRangeWidget *octRange = new OctaveRangeWidget(central);
	octaves->addWidget(octRange);

	QSlider *velocity = new QSlider(Qt::Horizontal, central);
	velocity->setMinimum(1);
	velocity->setMaximum(127);
	velocity->setValue(96); // TODO: read prev value from config
	velocity->setToolTip(tr("Velocity"));
	octaves->addWidget(velocity);

	QSpinBox *channel = new QSpinBox(central);
	channel->setPrefix(tr("Ch ", "Midi Channel number"));
	channel->setMinimum(0);
	channel->setMaximum(127);
	channel->setValue(0); // TODO: read prev value from config
	channel->setToolTip(tr("Select MIDI channel number to send messages to"));
	octaves->addWidget(channel);

	vb->addLayout(octaves);

	QHBoxLayout *keyarea = new QHBoxLayout;

	KeyboardWidget *kw = new KeyboardWidget(central);
	keyarea->addWidget(kw);

	QVBoxLayout *rightside = new QVBoxLayout;

	QSlider *pitchWheel = new QSlider(Qt::Vertical, central);
	pitchWheel->setMinimum(-64);
	pitchWheel->setMaximum(63);
	pitchWheel->setValue(0); // TODO: read prev value from config
	pitchWheel->setToolTip(tr("Pitch wheel"));

	rightside->addWidget(pitchWheel);

	QCheckBox *porta = new QCheckBox(central);
	porta->setToolTip(tr("Enable portamento"));

	rightside->addWidget(porta);
	keyarea->addLayout(rightside);

	vb->addLayout(keyarea);

	central->setLayout(vb);
	setCentralWidget(central);
	setWindowTitle(tr("Virtual MIDI keyboard"));

	// TODO: connect pitchWheel
	connect(octaveSignalMapper, SIGNAL(mapped(int)), kw, SLOT(octaveSelected(int)));
	connect(channel, SIGNAL(valueChanged(int)), kw, SLOT(midiChannelSelected(int)));
	connect(kw, SIGNAL(highlightOctaves(int,int)), octRange, SLOT(highlightOctaves(int,int)));

	kw->octaveSelected(0); // TODO: use value read from config
}
Example #24
0
void Clamp::customizeGUI(void) {

	QGridLayout *customlayout = DefaultGUIModel::getLayout(); 
	customlayout->setColumnStretch(1,1);

	//overall GUI layout with a "horizontal box" copied from DefaultGUIModel
	QGroupBox *plotBox = new QGroupBox("FI Plot");
	QHBoxLayout *plotBoxLayout = new QHBoxLayout;
	plotBox->setLayout(plotBoxLayout);

	QPushButton *clearButton = new QPushButton("&Clear");
	QPushButton *linearfitButton = new QPushButton("Linear &Fit");
	QPushButton *savePlotButton = new QPushButton("Screenshot");
	QPushButton *printButton = new QPushButton("Print");
	QPushButton *saveDataButton = new QPushButton("Save Data");
	plotBoxLayout->addWidget(clearButton);
	plotBoxLayout->addWidget(linearfitButton);
	plotBoxLayout->addWidget(printButton);
	plotBoxLayout->addWidget(savePlotButton);
	plotBoxLayout->addWidget(saveDataButton);
	QLineEdit *eqnLine = new QLineEdit("Linear Equation");
	eqnLine->setText("Y = c0 + c1 * X");
	eqnLine->setFrame(false);
	splot = new ScatterPlot(this);

	// Connect buttons to functions
	QObject::connect(clearButton, SIGNAL(clicked()), splot, SLOT(clear()));
	QObject::connect(clearButton, SIGNAL(clicked()), this, SLOT(clearData()));
	QObject::connect(savePlotButton, SIGNAL(clicked()), this, SLOT(exportSVG()));
	QObject::connect(printButton, SIGNAL(clicked()), this, SLOT(print()));
	QObject::connect(saveDataButton, SIGNAL(clicked()), this, SLOT(saveFIData()));
	QObject::connect(linearfitButton, SIGNAL(clicked()), this, SLOT(fitData()));
	clearButton->setToolTip("Clear");
	savePlotButton->setToolTip("Save screenshot");
	saveDataButton->setToolTip("Save data");
	linearfitButton->setToolTip("Perform linear least-squares regression");
	printButton->setToolTip("Print plot");

	plotBox->hide();
	eqnLine->hide();
//	splot->setMinimumSize(450, 270);
	splot->hide();
	customlayout->addWidget(plotBox, 0, 1, 1, 1);
	customlayout->addWidget(eqnLine, 10, 1, 1, 1);
	customlayout->addWidget(splot, 1, 1, 3, 1);

	QGroupBox *modeBox = new QGroupBox("Clamp Mode");
	QHBoxLayout *modeBoxLayout = new QHBoxLayout;
	modeBox->setLayout(modeBoxLayout);
	QButtonGroup *modeButtons = new QButtonGroup;
	modeButtons->setExclusive(true);
	QRadioButton *stepButton = new QRadioButton("Step");
	modeBoxLayout->addWidget(stepButton);
	modeButtons->addButton(stepButton);
	stepButton->setEnabled(true);
	QRadioButton *rampButton = new QRadioButton("Ramp"); 
	modeBoxLayout->addWidget(rampButton);
	modeButtons->addButton(rampButton);
	stepButton->setChecked(true);
	QObject::connect(modeButtons,SIGNAL(buttonClicked(int)),this,SLOT(updateClampMode(int)));
	stepButton->setToolTip("Set mode to current steps");
	rampButton->setToolTip("Set mode to triangular current ramps");
	customlayout->addWidget(modeBox, 0, 0);

	QHBoxLayout *optionBoxLayout = new QHBoxLayout;
	QGroupBox *optionBoxGroup = new QGroupBox;
	QCheckBox *randomCheckBox = new QCheckBox("Randomize");
	optionBoxLayout->addWidget(randomCheckBox);
	QCheckBox *plotFICheckBox = new QCheckBox("Plot FI Curve");
	optionBoxLayout->addWidget(plotFICheckBox);
	QObject::connect(randomCheckBox,SIGNAL(toggled(bool)),this,SLOT(togglerandom(bool)));
	QObject::connect(plotFICheckBox,SIGNAL(toggled(bool)),eqnLine,SLOT(setVisible(bool)));
	QObject::connect(plotFICheckBox,SIGNAL(toggled(bool)),splot,SLOT(setVisible(bool)));
	QObject::connect(plotFICheckBox,SIGNAL(toggled(bool)),plotBox,SLOT(setVisible(bool)));
	QObject::connect(plotFICheckBox,SIGNAL(toggled(bool)),this,SLOT(toggleFIplot(bool)));
	QObject::connect(plotFICheckBox,SIGNAL(toggled(bool)),this,SLOT(resizeMe()));
	randomCheckBox->setToolTip("Randomize input amplitudes within a cycle");
	plotFICheckBox->setToolTip("Show/Hide FI plot area");
	optionBoxGroup->setLayout(optionBoxLayout);
	customlayout->addWidget(optionBoxGroup, 3, 0);

	QObject::connect(DefaultGUIModel::pauseButton,SIGNAL(toggled(bool)),savePlotButton,SLOT(setEnabled(bool)));
	QObject::connect(DefaultGUIModel::pauseButton,SIGNAL(toggled(bool)),printButton,SLOT(setEnabled(bool)));
	QObject::connect(DefaultGUIModel::pauseButton,SIGNAL(toggled(bool)),saveDataButton,SLOT(setEnabled(bool)));
	QObject::connect(DefaultGUIModel::pauseButton,SIGNAL(toggled(bool)),linearfitButton,SLOT(setEnabled(bool)));
	QObject::connect(DefaultGUIModel::pauseButton,SIGNAL(toggled(bool)),DefaultGUIModel::modifyButton,SLOT(setEnabled(bool)));
	DefaultGUIModel::pauseButton->setToolTip("Start/Stop current clamp protocol");
	DefaultGUIModel::modifyButton->setToolTip("Commit changes to parameter values");
	DefaultGUIModel::unloadButton->setToolTip("Close module");

	QObject::connect(this,SIGNAL(newDataPoint(double,double)),splot,SLOT(appendPoint(double,double)));
	QObject::connect(this,SIGNAL(setFIRange(double, double, double, double)),splot,SLOT(setAxes(double, double, double, double)));
	QObject::connect(this,SIGNAL(setPlotMode(bool)),plotFICheckBox,SLOT(setChecked(bool)));
	QObject::connect(this,SIGNAL(setStepMode(bool)),plotFICheckBox,SLOT(setEnabled(bool)));
	QObject::connect(this,SIGNAL(setStepMode(bool)),plotBox,SLOT(setEnabled(bool)));
	QObject::connect(this,SIGNAL(drawFit(double*, double*, int)),splot,SLOT(appendLine(double*, double*, int)));
	QObject::connect(this,SIGNAL(setEqnMsg(const QString &)), eqnLine,SLOT(setText(const QString &)));

	setLayout(customlayout);
}