int GUI_Confirmation_HIG(const char *button_confirm, const char *primary, const char *secondary_format)
	{
		QString alertString;

		if (beQuiet)
		{
			printf("Info: %s\n", primary);
			return 0;
		}

		if (!secondary_format)
			alertString = "<big><b>" + QString::fromUtf8(primary) + "</b></big>";
		else
		{	
			alertString = "<big><b>" + QString::fromUtf8(primary) + "</b></big><br><br>" + QString::fromUtf8(secondary_format);
			alertString.replace("\n", "<br>");
		}

		QMessageBox::StandardButton reply;

		reply = QMessageBox::question(qtLastRegisteredDialog(), QString::fromUtf8(QT_TR_NOOP("Confirmation")),
			alertString, QMessageBox::Yes | QMessageBox::No);

		if (reply == QMessageBox::Yes)
			return 1;

		return 0; 
	}
	/**
	\fn GUI_Alternate(char *title,char *choice1,char *choice2)
	\brief Popup a dialog box name title with 2 buttons (choice1/choice2)
	\return 0 if first is selected, 1 if second
	*/
int      GUI_Alternate(const char *title,const char *choice1,const char *choice2)
	{
		if (beQuiet)
		{
			printf("Alternate<%s>: %s or %s\n", title,choice1,choice2);
			return 0;
		}

		QMessageBox box(qtLastRegisteredDialog());

		box.setWindowTitle(QString::fromUtf8(QT_TR_NOOP("Question?")));
		box.addButton(QString::fromUtf8(choice1),QMessageBox::YesRole);
		box.addButton(QString::fromUtf8(choice2),QMessageBox::NoRole);

		if (title)
			box.setText(QString::fromUtf8(title));
		else
			box.setText(QObject::tr("Question"));

		box.setIcon(QMessageBox::Question);

		if (box.exec() == 0)
			return 1;
		else
			return 0;
	}
Example #3
0
DIA_workingQt4::DIA_workingQt4(const char *title) : DIA_workingBase(title)
{
	workWindow *wind = new workWindow(qtLastRegisteredDialog());
	qtRegisterDialog(wind);
        _priv=(void *)wind;
	wind->setWindowTitle(title);
	postCtor();  
}
uint8_t DIA_about(void)
{
	Ui_aboutWindow dialog(qtLastRegisteredDialog());
	qtRegisterDialog(&dialog);

	dialog.exec();

	qtUnregisterDialog(&dialog);

	return 1;
}
DIA_progressIndexing::DIA_progressIndexing(const char *name)
{
        dialog=new Ui_indexingDialog(qtLastRegisteredDialog(), name);
		qtRegisterDialog(dialog);
        clock.reset();
        aborted=0;
	_nextUpdate=0;
        dialog->show();
        UI_purge();

}
uint8_t DIA_pluginManager(void)
{
	Ui_pluginManagerWindow dialog(qtLastRegisteredDialog());
	qtRegisterDialog(&dialog);

	if (dialog.exec() == QDialog::Accepted)
		dialog.save();

	qtUnregisterDialog(&dialog);

	return 1;
}
Example #7
0
/**
      \fn     DIA_getCropParams
      \brief  Handle crop dialog
*/
bool DIA_getContrast(ADM_coreVideoFilter *in,contrast *param)
{
    uint8_t ret=0;
    Ui_contrastWindow dialog(qtLastRegisteredDialog(), param,in);
    qtRegisterDialog(&dialog);

    if(dialog.exec()==QDialog::Accepted)
    {
        dialog.gather(param); 
        ret=1;
    }

    qtUnregisterDialog(&dialog);
    return ret;
}
Example #8
0
/**
      \fn     DIA_getCropParams
      \brief  Handle crop dialog
*/
uint8_t DIA_getASharp(asharp *param, ADM_coreVideoFilter *in)
{
        uint8_t ret=0;
        
        Ui_asharpWindow dialog(qtLastRegisteredDialog(), param,in);
		qtRegisterDialog(&dialog);

        if(dialog.exec()==QDialog::Accepted)
        {
            dialog.gather(param); 
            ret=1;
        }

		qtUnregisterDialog(&dialog);
        return ret;
}
Example #9
0
/**
    \fn     DIA_job
    \brief  
*/
uint8_t  DIA_job(uint32_t nb, char **name)
{
  uint8_t r=0;
  jobsWindow jobswindow(qtLastRegisteredDialog(), nb,name);

  qtRegisterDialog(&jobswindow);
     
     if(jobswindow.exec()==QDialog::Accepted)
     {
       r=1;
     }

	 qtUnregisterDialog(&jobswindow);

     return r;
}
int DIA_colorSel(uint8_t *r, uint8_t *g, uint8_t *b)
{
	QColor initialColor = QColor(*r, *g, *b);
	QColor color = QColorDialog::getColor(initialColor, qtLastRegisteredDialog());

	if (color.isValid())
	{
		*r = color.red();
		*g = color.green();
		*b = color.blue();

		return 1;
	}

	return 0;
}
Example #11
0
/**
      \fn     DIA_getMpDelogo
      \brief  Handle delogo dialog
*/
bool DIA_getMpDelogo(delogo *param, ADM_coreVideoFilter *in)
{
        bool ret=false;
        
        Ui_mpdelogoWindow dialog(qtLastRegisteredDialog(), param,in);
		qtRegisterDialog(&dialog);

        if(dialog.exec()==QDialog::Accepted)
        {
            dialog.gather(param); 
            ret=true;
        }

        qtUnregisterDialog(&dialog);
        return ret;
}
Example #12
0
void DIA_Calculator(uint32_t *sizeInMeg, uint32_t *avgBitrate)
{
    if (!avifileinfo)
        return;

    calculatorDialog dialog(qtLastRegisteredDialog());
    qtRegisterDialog(&dialog);

    if (dialog.exec() == QDialog::Accepted)
        videoCodecSetFinalSize(dialog.videoSize());

    qtUnregisterDialog(&dialog);

    *sizeInMeg = dialog.videoSize();
    *avgBitrate = dialog.videoBitrate();
}
uint8_t DIA_getMPdelogo(MPDELOGO_PARAM *param, AVDMGenericVideoStream *in)
{
	uint8_t ret = 0;

	Ui_mpdelogoWindow dialog(qtLastRegisteredDialog(), param, in);
	qtRegisterDialog(&dialog);

	if(dialog.exec() == QDialog::Accepted)
	{
		dialog.gather(param); 
		ret = 1;
	}

	qtUnregisterDialog(&dialog);

	return ret;
}
/**
      \fn     DIA_getCropParams
      \brief  Handle crop dialog
*/
uint8_t DIA_contrast(AVDMGenericVideoStream *in,CONTRAST_PARAM *param)
{
        uint8_t ret=0;
        
        Ui_contrastWindow dialog(qtLastRegisteredDialog(), param,in);
		qtRegisterDialog(&dialog);

        if(dialog.exec()==QDialog::Accepted)
        {
            dialog.gather(param); 
            ret=1;
        }

		qtUnregisterDialog(&dialog);

        return ret;
}
/**
      \fn     DIA_vobsub
      \brief  Dialog to select vobsub file, language and shift. 
*/
uint8_t DIA_vobsub(vobSubParam *param)
{
        uint8_t ret=0;
        Ui_vobsubWindow dialog(qtLastRegisteredDialog(), param);

		qtRegisterDialog(&dialog);

        if(dialog.exec()==QDialog::Accepted)
        {
        	dialog.gather();
            ret=1;
        }

		qtUnregisterDialog(&dialog);

        return ret;
}
/**
      \fn     DIA_getChromaShift
      \brief  Handle crop dialog
*/
uint8_t DIA_getChromaShift( AVDMGenericVideoStream *in,CHROMASHIFT_PARAM    *param )
{
        uint8_t ret=0;
        
        Ui_chromaShiftWindow dialog(qtLastRegisteredDialog(), param,in);
		qtRegisterDialog(&dialog);

        if(dialog.exec()==QDialog::Accepted)
        {
            dialog.gather(param); 
            ret=1;
        }

		qtUnregisterDialog(&dialog);

        return ret;
}
	int GUI_Question(const char *alertstring)
	{
		QMessageBox::StandardButton reply;

		if (beQuiet)
		{
			printf("Question: %s\n", alertstring);
			return 0;
		}

		reply = QMessageBox::question(qtLastRegisteredDialog(), QString::fromUtf8(QT_TR_NOOP("Question")),
			QString::fromUtf8(alertstring), QMessageBox::Yes | QMessageBox::No);

		if (reply==QMessageBox::Yes)
			return 1;

		return 0;
	}
Example #18
0
/**
      \fn     DIA_getEQ2Param
      \brief  Handle MPlayer EQ2 flyDialog
*/
uint8_t DIA_getEQ2Param(Eq2_Param *param, AVDMGenericVideoStream *in)
{
        uint8_t ret=0;
        
        Ui_eq2Window dialog(qtLastRegisteredDialog(), param,in);

		qtRegisterDialog(&dialog);

        if(dialog.exec()==QDialog::Accepted)
        {
            dialog.gather(param); 
            ret=1;
        }

		qtUnregisterDialog(&dialog);

        return ret;
}
	void GUI_Error_HIG(const char *primary, const char *secondary_format)
	{
		uint32_t msglvl=2;
		QString alertString;

		prefs->get(MESSAGE_LEVEL,&msglvl);

		if(msglvl==ADM_LOG_NONE) 
		{
			printf("Error :%s\n",primary);
			return;
		}

		if(! secondary_format)
			alertString = "<big><b>" + QString::fromUtf8(primary) + "</b></big>";
		else
		{
			alertString = "<big><b>" + QString::fromUtf8(primary) + "</b></big><br><br>" + QString::fromUtf8(secondary_format);
			alertString.replace("\n", "<br>");
		}

		QMessageBox::critical(qtLastRegisteredDialog(), QString::fromUtf8(QT_TR_NOOP("Info")),
			alertString, QMessageBox::Ok);
	}
	void GUI_Info(const char *alertstring)
	{
		QMessageBox::information(qtLastRegisteredDialog(), QString::fromUtf8(QT_TR_NOOP("Info")),
			QString::fromUtf8(alertstring), QMessageBox::Ok );
	}
	void GUI_Alert(const char *alertstring)
	{
		QMessageBox::critical(qtLastRegisteredDialog(), QString::fromUtf8(QT_TR_NOOP("Alert")),
			QString::fromUtf8(alertstring), QMessageBox::Ok );
	}
/**
 *         \fn qt4DiaFactoryRunTabs
 */
uint8_t qt4DiaFactoryRunTabs(const char *title,uint32_t nb,diaElemTabs **tabs)
{
    QDialog dialog(qtLastRegisteredDialog());

        qtRegisterDialog(&dialog);
  
  ADM_assert(title);
  ADM_assert(nb);
  ADM_assert(tabs);
  
  dialog.setWindowTitle(QString::fromUtf8(title));

  QVBoxLayout *vboxLayout = new QVBoxLayout();
  QGridLayout *layout = new QGridLayout();
  QSpacerItem *spacer = new QSpacerItem(20, 16, QSizePolicy::Minimum, QSizePolicy::Fixed);
  QTabWidget *wtabs = new QTabWidget();
  QDialogButtonBox *buttonBox = new QDialogButtonBox();

    buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);

     QObject::connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
     QObject::connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));

     for(int i=0;i<nb;i++)
     {
        ADM_assert(tabs[i]);
        insertTab(i,tabs[i],wtabs);
      }

         vboxLayout->addLayout(layout);
     vboxLayout->addWidget(wtabs,0,0);
         vboxLayout->addItem(spacer);
     vboxLayout->addWidget(buttonBox,1,0);

         dialog.setLayout(vboxLayout);

         // Expand to see all tabs but still allow the window to be resized smaller
         wtabs->setUsesScrollButtons(false);
         dialog.adjustSize();
         wtabs->setUsesScrollButtons(true);

  if(dialog.exec()==QDialog::Accepted)
  {
      // Read tabs
       for(int tab=0;tab<nb;tab++)
     {
        ADM_assert(tabs[tab]);
        diaElemTabs *myTab=tabs[tab];
        for(int i=0;i<myTab->nbElems;i++)
        {
          myTab->dias[i]->getMe();
        }
    
      }
           qtUnregisterDialog(&dialog);

      return 1;
  }

  qtUnregisterDialog(&dialog);

  return 0;
  
}
uint8_t qt4DiaFactoryRun(const char *title,uint32_t nb,diaElem **elems)
{
  QDialog dialog(qtLastRegisteredDialog());
  qtRegisterDialog(&dialog);
  
  ADM_assert(title);
  ADM_assert(nb);
  ADM_assert(elems);
  
  dialog.setWindowTitle(QString::fromUtf8(title));
  
  QSpacerItem *spacer = new QSpacerItem(20, 16, QSizePolicy::Minimum, QSizePolicy::Fixed);
  QDialogButtonBox *buttonBox = new QDialogButtonBox();
  QVBoxLayout *vboxLayout = new QVBoxLayout();
  QLayout *layout = NULL;
  int currentLayout = 0;

 int  v=0;

 for(int i=0;i<nb;i++)
 {
         ADM_assert(elems[i]);

         if (elems[i]->getRequiredLayout() != currentLayout)
         {
                 if (layout)
                         vboxLayout->addLayout(layout);

                 switch (elems[i]->getRequiredLayout())
                 {
                         case FAC_QT_GRIDLAYOUT:
                                 layout = new QGridLayout();
                                 break;
                         case FAC_QT_VBOXLAYOUT:
                                 layout = new QVBoxLayout();
                                 break;
                 }

                 currentLayout = elems[i]->getRequiredLayout();
                 v = 0;
         }

         elems[i]->setMe( (void *)&dialog,layout,v);
         v+=elems[i]->getSize();
 }

   for(int i=0;i<nb;i++)
  {
    ADM_assert(elems[i]);
     elems[i]->finalize(); 
  }

  // Add buttons
   buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);

   QObject::connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
   QObject::connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));

   if (layout)
           vboxLayout->addLayout(layout);

   vboxLayout->addItem(spacer);
   vboxLayout->addWidget(buttonBox);

   dialog.setLayout(vboxLayout);

  if(dialog.exec()==QDialog::Accepted)
  {
     for(int i=0;i<nb;i++)
     {
        ADM_assert(elems[i]);
        elems[i]->getMe(); 
    
      }

         qtUnregisterDialog(&dialog);

    return 1;
  }

  qtUnregisterDialog(&dialog);

  return 0;
  
}