Example #1
0
void ThumbFinder::ShowMenu()
{
    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
    MythDialogBox *menuPopup = new MythDialogBox(tr("Menu"), popupStack, "actionmenu");

    if (menuPopup->Create())
        popupStack->AddScreen(menuPopup);

    menuPopup->SetReturnEvent(this, "action");

    menuPopup->AddButton(tr("Exit, Save Thumbnails"), SLOT(savePressed()));
    menuPopup->AddButton(tr("Exit, Don't Save Thumbnails"), SLOT(cancelPressed()));
}
FixtureControlWidget::FixtureControlWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::FixtureControlWidget)
{
    ui->setupUi(this);
    /* Fixtures should be in World coordinates */
    ui->locationWidget->setPresentationStyle(true);

    QObject::connect(ui->loadPushButton, SIGNAL(released()), this, SLOT(loadPressed()));
    QObject::connect(ui->savePushButton, SIGNAL(released()), this, SLOT(savePressed()));


    QObject::connect(ui->locationWidget, SIGNAL(paramsChanged())     , this, SIGNAL(paramsChanged()));
    QObject::connect(ui->nameEdit      , SIGNAL(textChanged(QString)), this, SIGNAL(paramsChanged()));

}
Example #3
0
bool ThumbFinder::Create(void)
{
    bool foundtheme = false;

    // Load the theme for this screen
    foundtheme = LoadWindowFromXML("mythburn-ui.xml", "thumbfinder", this);

    if (!foundtheme)
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_frameImage, "frameimage", &err);
    UIUtilE::Assign(this, m_positionImage, "positionimage", &err);
    UIUtilE::Assign(this, m_imageGrid, "thumblist", &err);
    UIUtilE::Assign(this, m_saveButton, "save_button", &err);
    UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err);
    UIUtilE::Assign(this, m_frameButton, "frame_button", &err);
    UIUtilE::Assign(this, m_seekAmountText, "seekamount", &err);
    UIUtilE::Assign(this, m_currentPosText, "currentpos", &err);

    if (err)
    {
        VERBOSE(VB_IMPORTANT, "Cannot load screen 'mythburn'");
        return false;
    }

    connect(m_imageGrid, SIGNAL(itemSelected(MythUIButtonListItem *)),
            this, SLOT(gridItemChanged(MythUIButtonListItem *)));

    connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(savePressed()));
    connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(cancelPressed()));

    connect(m_frameButton, SIGNAL(Clicked()), this, SLOT(updateThumb()));

    BuildFocusList();

    SetFocusWidget(m_imageGrid);

    return true;
}
Example #4
0
EditAllergenWid::EditAllergenWid(QString rootdir, IndexItem olditem_a, QWidget *parent) :
    QWidget(parent)
{
    //model_old = model_a;
    old_item=olditem_a;
    path = rootdir;
    model = new Allergen();
    XAllergen *xml = new XAllergen(model,old_item.getLocation());
    xml->readData();
    u = new EditUpper(model->getName());
    old=model->getName();
    m=new EditMiddle();
    m->setType(model->getType());
    b=new EditBottom();
    layout = new QVBoxLayout(this);
    layout->addWidget(u);
    layout->addWidget(m);
    layout->addWidget(b);
    connect(b,SIGNAL(resetPressed()),this,SLOT(performReset()));
    connect(b,SIGNAL(savePressed()),this,SLOT(performSave()));

}
/**
* Called when saved is pressed and emits a savedPressed signal for the viewport
* \sa DkDocAnalysisViewPort::saveMagicCutPressed
**/
void DkMagicCutDialog::savePressed() {

	/*QString defaultName = QString("_%1").arg((int)(magicCut->getBoundingRect()->x+magicCut->getBoundingRect()->width/2));
	defaultName.append(QString("_%1").arg((int)(magicCut->getBoundingRect()->y+magicCut->getBoundingRect()->height/2)));
	*/
	//int xCoord = (int)(magicCut->getBoundingRect()->x+magicCut->getBoundingRect()->width/2);
	//int yCoord = (int)(magicCut->getBoundingRect()->y+magicCut->getBoundingRect()->height/2);

	//int xCoord = (int)(magicCut->getBoundingRect()->x);
	//int yCoord = (int)(magicCut->getBoundingRect()->y);
	//int width = (int)(magicCut->getBoundingRect()->width);
	//int height = (int)(magicCut->getBoundingRect()->height);
	int xCoord = roiRect->x;
	int yCoord = roiRect->y;
	int width = roiRect->width;
	int height = roiRect->height;

	emit savePressed(imgQt, xCoord, yCoord, height, width);

	isSaved = true;
	this->close();
}
/**
* Creates the image manipulation dialog layout
* \sa DkBoundingBoxSliderWidget
**/
void DkMagicCutDialog::createLayout() {

	// bottom widget - buttons	
	QWidget* bottomWidget = new QWidget(this);
	QHBoxLayout* bottomWidgetHBoxLayout = new QHBoxLayout(bottomWidget);

	//QWidget* browseWidget = new QWidget(this);
	//browseWidget->setFixedWidth(previewWidth + previewMargin);
	//QHBoxLayout* browseWidgetLayout = new QHBoxLayout(browseWidget);
	//lineEditPath = new QLineEdit();
	//lineEditPath->setFixedWidth(previewWidth);
	//QPushButton* buttonBrowse = new QPushButton(tr("&Browse..."));
	//connect(buttonBrowse, SIGNAL(clicked()), this, SLOT(browsePressed()));

	QPushButton* buttonSave = new QPushButton(tr("&Save"));
	buttonSave->setDefault(true);
	connect(buttonSave, SIGNAL(clicked()), this, SLOT(savePressed()));
	QPushButton* buttonCancel = new QPushButton(tr("&Cancel"));
	connect(buttonCancel, SIGNAL(clicked()), this, SLOT(cancelPressed()));

	QSpacerItem* spacer = new QSpacerItem(1,1, QSizePolicy::Expanding, QSizePolicy::Expanding);
	
	//browseWidgetLayout->addWidget(lineEditPath);
	//browseWidgetLayout->addWidget(buttonBrowse);

	
	//bottomWidgetHBoxLayout->addWidget(lineEditPath);
	//bottomWidgetHBoxLayout->addWidget(buttonBrowse);
	//bottomWidgetHBoxLayout->addWidget(browseWidget);
	bottomWidgetHBoxLayout->addItem(spacer);
	bottomWidgetHBoxLayout->addWidget(buttonSave);
	bottomWidgetHBoxLayout->addWidget(buttonCancel);	
	
	// central widget - preview image
	QWidget* centralWidget = new QWidget(this);
	previewLabel = new QLabel(centralWidget);
	previewLabel->setGeometry(QRect(QPoint(previewMargin, previewMargin), QSize(previewWidth, previewHeight)));

	// east widget - sliders
	QWidget* eastWidget = new QWidget(this);
	eastWidget->setMinimumWidth(toolsWidth);
	eastWidget->setMaximumWidth(toolsWidth);
	eastWidget->setContentsMargins(0,5,5,0);

	BBslider = new DkBoundingBoxSliderWidget(eastWidget, this);

	//QVBoxLayout* toolsLayout = new QVBoxLayout(eastWidget);
	//toolsLayout->setContentsMargins(0,0,0,0);
	QGridLayout* toolsLayout = new QGridLayout(eastWidget);

	toolsLayout->addWidget(BBslider, 1, 1, 1, 2);

	toolsLayout->addWidget(new QLabel(tr("Apply Mask: ")), 2, 1);
	QCheckBox* cbMask = new QCheckBox(this);
	toolsLayout->addWidget(cbMask, 2, 2);

	eastWidget->setLayout(toolsLayout);
	
	BorderLayout* borderLayout = new BorderLayout;
	borderLayout->addWidget(bottomWidget, BorderLayout::South);
	borderLayout->addWidget(centralWidget, BorderLayout::Center);
	borderLayout->addWidget(eastWidget, BorderLayout::East);
	this->setSizeGripEnabled(false);

	this->setLayout(borderLayout);


	connect(cbMask, SIGNAL(stateChanged(int)), this, SLOT(applyMaskChecked(int)));
}