Exemplo n.º 1
0
	SettingsTab::SettingsTab (QWidget *parent)
	: QWidget (parent)
	, Toolbar_ (new QToolBar (tr ("Settings bar")))
	, ActionBack_ (new QAction (tr ("Back"), this))
	, ActionApply_ (new QAction (tr ("Apply"), this))
	, ActionCancel_ (new QAction (tr ("Cancel"), this))
	, CurrentIHS_ (0)
	{
		Ui_.setupUi (this);
		Ui_.ListContents_->setLayout (new QVBoxLayout);
		Ui_.DialogContents_->setLayout (new QVBoxLayout);
		
		ActionBack_->setProperty ("ActionIcon", "back");
		connect (ActionBack_,
				SIGNAL (triggered ()),
				this,
				SLOT (handleBackRequested ()));
		
		ActionApply_->setProperty ("ActionIcon", "apply");
		connect (ActionApply_,
				SIGNAL (triggered ()),
				this,
				SLOT (handleApply ()));
		
		ActionCancel_->setProperty ("ActionIcon", "cancel");
		connect (ActionCancel_,
				SIGNAL (triggered ()),
				this,
				SLOT (handleCancel ()));
	}
Exemplo n.º 2
0
LRESULT CALLBACK LineEditDialog::dlgProc(HWND hDlg,
                                         UINT message,
                                         WPARAM wParam,
                                         LPARAM lParam) {
  switch (message) {
    case WM_INITDIALOG:
      handleInitDialogMsg(hDlg);
      return FALSE;
    case WM_DESTROY:
      break;
    case WM_COMMAND:
      switch (LOWORD(wParam)) {
        case IDC_ASM:
          if (HIWORD(wParam) == EN_CHANGE) {
            handleAssemblyChange(hDlg);
          }
          break;
        case IDOK:
          handleOK(hDlg);
          break;
        case IDCANCEL:
          handleCancel(hDlg);
          break;
      }
      return FALSE;
    default:
      return FALSE; 
  }
  return TRUE;
}
Exemplo n.º 3
0
bool SelectDestination::Create(void)
{
    bool foundtheme = false;

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

    if (!foundtheme)
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_createISOCheck, "makeisoimage_check", &err);
    UIUtilE::Assign(this, m_doBurnCheck, "burntodvdr_check", &err);
    UIUtilE::Assign(this, m_doBurnText, "burntodvdr_text", &err);
    UIUtilE::Assign(this, m_eraseDvdRwCheck, "erasedvdrw_check", &err);
    UIUtilE::Assign(this, m_eraseDvdRwText, "erasedvdrw_text", &err);
    UIUtilE::Assign(this, m_nextButton, "next_button", &err);
    UIUtilE::Assign(this, m_prevButton, "prev_button", &err);
    UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err);
    UIUtilE::Assign(this, m_destinationSelector, "destination_selector", &err);
    UIUtilE::Assign(this, m_destinationText, "destination_text", &err);
    UIUtilE::Assign(this, m_findButton, "find_button", &err);
    UIUtilE::Assign(this, m_filenameEdit, "filename_edit", &err);
    UIUtilE::Assign(this, m_freespaceText, "freespace_text", &err);

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'selectdestination'");
        return false;
    }

    connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(handleNextPage()));
    connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(handlePrevPage()));
    connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(handleCancel()));

    connect(m_destinationSelector, SIGNAL(itemSelected(MythUIButtonListItem*)),
            this, SLOT(setDestination(MythUIButtonListItem*)));

    for (int x = 0; x < ArchiveDestinationsCount; x++)
    {
        MythUIButtonListItem *item = new 
            MythUIButtonListItem(m_destinationSelector, tr(ArchiveDestinations[x].name));
        item->SetData(qVariantFromValue(ArchiveDestinations[x].type));
    }
    connect(m_findButton, SIGNAL(Clicked()), this, SLOT(handleFind()));

    connect(m_filenameEdit, SIGNAL(LosingFocus()), this,
            SLOT(filenameEditLostFocus()));

    BuildFocusList();

    SetFocusWidget(m_nextButton);

    loadConfiguration();

    return true;
}
Exemplo n.º 4
0
bool ExportNative::Create(void)
{
    bool foundtheme = false;

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

    if (!foundtheme)
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_nextButton, "next_button", &err);
    UIUtilE::Assign(this, m_prevButton, "prev_button", &err);
    UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err);

    UIUtilE::Assign(this, m_titleText, "progtitle", &err);
    UIUtilE::Assign(this, m_datetimeText, "progdatetime", &err);
    UIUtilE::Assign(this, m_descriptionText, "progdescription", &err);
    UIUtilE::Assign(this, m_filesizeText, "filesize", &err);
    UIUtilE::Assign(this, m_nofilesText, "nofiles", &err);
    UIUtilE::Assign(this, m_sizeBar, "size_bar", &err);
    UIUtilE::Assign(this, m_archiveButtonList, "archivelist", &err);
    UIUtilE::Assign(this, m_addrecordingButton, "addrecording_button", &err);
    UIUtilE::Assign(this, m_addvideoButton, "addvideo_button", &err);

    UIUtilW::Assign(this, m_maxsizeText, "maxsize");
    UIUtilW::Assign(this, m_minsizeText, "minsize");
    UIUtilW::Assign(this, m_currsizeText, "currentsize");
    UIUtilW::Assign(this, m_currsizeErrText, "currentsize_error");

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'exportnative'");
        return false;
    }

    connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(handleNextPage()));
    connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(handlePrevPage()));
    connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(handleCancel()));


    getArchiveList();
    connect(m_archiveButtonList, SIGNAL(itemSelected(MythUIButtonListItem *)),
            this, SLOT(titleChanged(MythUIButtonListItem *)));

    connect(m_addrecordingButton, SIGNAL(Clicked()), this, SLOT(handleAddRecording()));
    connect(m_addvideoButton, SIGNAL(Clicked()), this, SLOT(handleAddVideo()));

    BuildFocusList();

    SetFocusWidget(m_nextButton);

    loadConfiguration();

    return true;
}
/**
 *	@brief	Handles UIComponent event.
 *	@param[in]	componentID	component ID
 *	@param[in]	eventCode	event code
 *	@param[in]	param1		parameter 1
 *	@param[in]	param2		parameter 2
 */
void SelectLanguageDlg::HandleUICEvent(SInt32 componentID, int eventCode, SInt32 /* param1 */, void* /* param2 */)
{
#define HANDLE_EVENT(cid, evt, handler)		\
	if (cid == componentID && evt == eventCode)	handler

	HANDLE_EVENT(CID_OKButton,				UICE_ButtonClicked,			handleOK());
	HANDLE_EVENT(CID_CancelButton,			UICE_ButtonClicked,			handleCancel());

#undef HANDLE_EVENT
}
Exemplo n.º 6
0
QtSpellCheckerWindow::QtSpellCheckerWindow(SettingsProvider* settings, QWidget* parent) : QDialog(parent) {
	settings_ = settings;
	ui_.setupUi(this);
#ifdef HAVE_HUNSPELL
	ui_.hunspellOptions->show();
#else
	ui_.hunspellOptions->hide();
	QTimer::singleShot(0, this, SLOT(shrinkWindow()));
#endif
	connect(ui_.spellChecker, SIGNAL(toggled(bool)), this, SLOT(handleChecker(bool)));
	connect(ui_.cancel, SIGNAL(clicked()), this, SLOT(handleCancel()));
	connect(ui_.apply, SIGNAL(clicked()), this, SLOT(handleApply()));
	connect(ui_.pathButton, SIGNAL(clicked()), this, SLOT(handlePathButton()));
	setFromSettings();
}
Exemplo n.º 7
0
/**
 *	@brief	Handles UIComponent event.
 *	@param[in]	componentID	component ID
 *	@param[in]	eventCode	event code
 *	@param[in]	param1		parameter 1
 *	@param[in]	param2		parameter 2
 */
void EditKeymapDlg::HandleUICEvent(SInt32 componentID, int eventCode, SInt32 /* param1 */, void* /* param2 */)
{
#define HANDLE_EVENT(cid, evt, handler)		\
	if (cid == componentID && evt == eventCode)	handler

	HANDLE_EVENT(CID_NameTextEdit,			UICE_TextChanged,		handleNameTextEditChanged());
	HANDLE_EVENT(CID_FunctionListBox,		UICE_SelectionChanged,	handleFunctionListBoxSelectionChanged());
	HANDLE_EVENT(CID_CurrentKeysListBox,	UICE_SelectionChanged,	handleCurrentKeysListBoxSelectionChanged());
	HANDLE_EVENT(CID_KeyInput,				UICE_TextChanged,		handleKeyInputChanged());
	HANDLE_EVENT(CID_AssignButton,			UICE_ButtonClicked,		handleAssignButtonClicked());
	HANDLE_EVENT(CID_RemoveButton,			UICE_ButtonClicked,		handleRemoveButtonClicked());
	HANDLE_EVENT(CID_OKButton,				UICE_ButtonClicked,		handleOK());
	HANDLE_EVENT(CID_CancelButton,			UICE_ButtonClicked,		handleCancel());

#undef HANDLE_EVENT
}
void
QvisRecentPathRemovalWindow::CreateWindowContents()
{
    // Create the widgets needed to remove the paths.
    removalControlsGroup = new QGroupBox(central);
    removalControlsGroup->setTitle(tr("Select paths to remove"));
    topLayout->addWidget(removalControlsGroup, 5);

    QVBoxLayout *innerTopLayout = new QVBoxLayout(removalControlsGroup);
    
    // Create the listbox that lets us select the paths to remove.
    removalListBox = new QListWidget(removalControlsGroup);
    removalListBox->setSelectionMode(QAbstractItemView::MultiSelection);
    innerTopLayout->addWidget(removalListBox);

    // Create the pushbuttons that actually call the removal routines.
    QHBoxLayout *hLayout = new QHBoxLayout();
    innerTopLayout->addLayout(hLayout);
    hLayout->setSpacing(5);
    removeButton = new QPushButton(tr("Remove"), removalControlsGroup);
    connect(removeButton, SIGNAL(clicked()),
            this, SLOT(removePaths()));
    hLayout->addWidget(removeButton);
    removeAllButton = new QPushButton(tr("Remove all"), removalControlsGroup);
    connect(removeAllButton, SIGNAL(clicked()),
            this, SLOT(removeAllPaths()));
    hLayout->addWidget(removeAllButton);
    invertSelectionButton = new QPushButton(tr("Invert selection"), removalControlsGroup);
    connect(invertSelectionButton, SIGNAL(clicked()),
            this, SLOT(invertSelection()));
    hLayout->addWidget(invertSelectionButton);    

    // Create the ok and cancel buttons.
    QHBoxLayout *buttonLayout = new QHBoxLayout();
    topLayout->addLayout(buttonLayout);
    buttonLayout->addStretch(10);
    okButton = new QPushButton(tr("Ok"), central);
    connect(okButton, SIGNAL(clicked()),
            this, SLOT(applyDismiss()));
    buttonLayout->addWidget(okButton);
    cancelButton = new QPushButton(tr("Cancel"), central);
    connect(cancelButton, SIGNAL(clicked()),
            this, SLOT(handleCancel()));
    buttonLayout->addWidget(cancelButton);
}
Exemplo n.º 9
0
Setting::Setting(MainWindow *m,int l,QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Setting)
{
    mWind=m;
    ui->setupUi(this);
    ui->normal->setChecked(true);
    if(l==0)
        ui->easy->setChecked(true);
    else if(l==1)
        ui->normal->setChecked(true);
    else
        ui->hard->setChecked(true);
    QStyle *style=this->style();
    (ui->chooseFile)->setIcon(style->standardPixmap(QStyle::SP_FileDialogStart));
    connect(ui->chooseFile,SIGNAL(clicked()),this,SLOT(handleFileChoose()));
    connect(ui->confirmButton,SIGNAL(clicked()),this,SLOT(handleConfirm()));
    connect(ui->cancelButton,SIGNAL(clicked()),this,SLOT(handleCancel()));
}
Exemplo n.º 10
0
MojErr MojServiceMessage::reply()
{
	MojErr err = replyImpl();
	MojErrCheck(err);
	err = writer().reset();
	MojErrCheck(err);

	if (++m_numReplies == 1) {
		if (m_cancelSignal.connected()) {
			err = enableSubscription();
			MojErrCheck(err);
		} else {
			// remove subscription
			err = handleCancel();
			MojErrCheck(err);
		}
	}
	return MojErrNone;
}
void GuiPreferences::addEvents(void)
{
  connect(m_cancelBtn, SIGNAL(clicked()), this, SLOT(handleCancel()));

  switch(m_formType) {
  case ChangeMonitoringSettings:
    QObject::connect(m_applySettingBtn, SIGNAL(clicked()),  this, SLOT(applyChanges()));
    connect(m_addAsSourceBtn, SIGNAL(clicked()), this, SLOT(addAsSource()));
    connect(m_deleteSourceBtn, SIGNAL(clicked()), this, SLOT(deleteSource()));
    connect(m_showAuthInfoChkbx, SIGNAL(stateChanged(int)), this, SLOT(setAuthChainVisibility(int)));
    break;
  case ChangePassword:
    connect(m_changePwdBtn, SIGNAL(clicked()),  this, SLOT(changePasswd()));
    break;
  case ShowAbout:
    break;
  case BasicLoginForm:
    break;
  default:
    break;
  }
}
Exemplo n.º 12
0
static int
handleWMCommand(HWND hDlg, LPARAM lParam, WPARAM wParam)
{
   switch (LOWORD(wParam))
			{
		    case DD_J1: type = 1; tool=joint; hCurrentPen = drawPen[1]; break;
  			 case DD_J2: type = 2; tool=joint; hCurrentPen = drawPen[2]; break;
	     case DD_J3: type = 3; tool=joint; hCurrentPen = drawPen[3]; break;
     	case DD_J4: type = 4; tool=joint; hCurrentPen = drawPen[4]; break;
	     case DD_J5: type = 5; tool=joint; hCurrentPen = drawPen[5]; break;
	     case DD_J6: type = 6; tool=joint; hCurrentPen = drawPen[6]; break;
	     case DD_J7: type = 7; tool=joint; hCurrentPen = drawPen[7]; break;
	     case DD_J8: type = 8; tool=joint; hCurrentPen = drawPen[8]; break;
  				case DD_FP: type = 0; tool=fixedpoint; hCurrentPen = drawPen[1]; break;
     	case DD_MP: type = 1; tool=measpoint; hCurrentPen = drawPen[1]; break;
	   		case DD_LP: type = 2; tool=loadpoint; hCurrentPen = drawPen[1]; break;
  				case DD_HP: type = 3; tool=holepoint; hCurrentPen = drawPen[1]; break;
				
	    	case DD_BOLT1:
         handleRockbolts(hDlg);
      break;

	   		case DD_GRON:
         handleGridOn(hdc,jp,nLines,pp,nPoints);
	   		break;

	   		case DD_GROFF:
	       	handleGridOff(hdc,jp,nLines,pp,nPoints);
	  			break;

	   		case DD_REMJ:
         handleRemoveJoints(hDlg,hdc,jp);
 					break;

  				case DD_REMP:
         handleRemovePoints(hDlg,hdc,pp);
 					break;

     /* Handles changing grid spacing? 
      * TODO: Collapse this into a single callable function. 
      */
	 				case IDC_GRID:
	   	   	if (grid)
	   		   { 
		         	handleGridOff(hdc,jp,nLines,pp,nPoints);
	         		grid=TRUE;
	      		}			
		      	gridSp=changeGridSpacing(hDlg,lParam,wParam);

			      if (grid)
		      	{ 
		         	handleGridOn(hdc,jp,nLines,pp,nPoints);			
	      		}
 					break;

	 				case IDCANCEL:
	      		handleCancel(hDlg);
				  return FALSE;

				  case IDOK:
	       	return(handleSave(hDlg));

   }  /* end switch wParam */

}  /* close handleWMCommand() */
Exemplo n.º 13
0
void QtSoftUpdatePrompt::display( const SoftUpdateInfo& suInfo )
{
    _refreshTimerId = 0;

    //Set prompt.
    QString labelText = "";
    QString imagePath = ":pics/auto_updater_recommended.png";

    //Determine text.
    if ( suInfo.getDescription() == "" )
    {
        if ( suInfo.isMandatory() )
        {
            labelText = s_defMandatory;
        }
        else if ( suInfo.isRecommended() )
        {
            labelText = s_defRecommended;
        }
        else
        {
            assert(false);		//New option?
            labelText = s_defRecommended;
        }
    }
    else
    {
        labelText = suInfo.getDescription().c_str();
    }

    //Determine Image
    if ( suInfo.isMandatory() )
    {
        imagePath = ":pics/auto_updater_mandatory.png";
    }
    else if ( suInfo.isRecommended() )
    {
        imagePath = ":pics/auto_updater_recommended.png";
    }
    else
    {
        assert(false);		//New option?
        imagePath = ":pics/auto_updater_recommended.png";
    }

    //Update UI.
    QString labelText2 = labelText.arg( suInfo.getVersion().c_str() );

    _ui->lblPrompt->setText(labelText2);
    _ui->lblIcon->setPixmap( QPixmap(imagePath) );

    //Hide checkbox as needed.
    if ( suInfo.isMandatory() )
    {
        _ui->checkBox->setEnabled( false );
        _ui->checkBox->hide();
    }

    //Hide download text and progress bar until user clicks Install Now.
    _ui->lblDownloading->hide();
    _ui->progressBar->hide();

    SAFE_CONNECT(_ui->installButton, SIGNAL(clicked()), SLOT(handleInstall()) );
    SAFE_CONNECT(_ui->cancelButton,  SIGNAL(clicked()), SLOT(handleCancel() ) );

    //Modal for mandatory, modeless for recommended.
    if ( suInfo.isMandatory() )
    {
        exec();
    }
    else
    {
        show();
    }
}