void UpdateMsgDlgWidgets(UIStatusWnd *wnd, int type) { GtkWidget *window = UI_DIALOG(wnd->msg_dlg)->window; int i = 0; while(msg_table[i].type != -1){ if(type == msg_table[i].type){ SetDialogTitle(window, _(msg_table[i].title)); SetTextToLabel(window, "MsgDlg_label", _(msg_table[i].message)); switch(msg_table[i].btn_type){ case BTN_TYPE_NONE: HideWidget(window, "MsgDlg_OK_button"); HideWidget(window, "MsgDlg_Cancel_button"); break; case BTN_TYPE_OK: HideWidget(window, "MsgDlg_Cancel_button"); break; case BTN_TYPE_CANCEL: HideWidget(window, "MsgDlg_OK_button"); break; } wnd->msg_dlg->type = type; break; } i++; } }
int32 OToolBox :: AddWidget (ODataWidget *pODataWidget ) { QPushButton *tButton = NULL; BEGINSEQ if(!pODataWidget) ERROR if(!pODataWidget->WidgetQ()) ERROR items.push_back(pODataWidget); sizes.push_back(pODataWidget->WidgetQ()->rect().height()); tButton = new QPushButton(SZ2QS("-"), this); tButton->setCheckable(true); toggler->addButton(tButton,items.size()-1); stack->addWidget(tButton); stack->addWidget(pODataWidget->WidgetQ()); //TODO:settings HideWidget(items.size()-1); RECOVER ENDSEQ return(items.size()-1); }
void CamSettingsPage::HideProperty( PropertyType property ) { Gtk::HScale* pHScale1 = m_widgetPropArray[property].pHScale1; Gtk::HScale* pHScale2 = m_widgetPropArray[property].pHScale2; Gtk::CheckButton* pAuto = m_widgetPropArray[property].pAuto; Gtk::CheckButton* pOnOff = m_widgetPropArray[property].pOnOff; Gtk::CheckButton* pOnePush = m_widgetPropArray[property].pOnePush; Gtk::SpinButton* pSpin1 = m_widgetPropArray[property].pSpinButton1; Gtk::SpinButton* pSpin2 = m_widgetPropArray[property].pSpinButton2; Gtk::Label* pLabel1 = m_widgetPropArray[property].pLabel1; Gtk::Label* pLabel2 = m_widgetPropArray[property].pLabel2; HideWidget(pHScale1); HideWidget(pHScale2); HideWidget(pAuto); HideWidget(pOnOff); HideWidget(pOnePush); HideWidget(pSpin1); HideWidget(pSpin2); HideWidget( pLabel1 ); HideWidget( pLabel2 ); }
void OToolBox :: slotToggle (int index ) { QAbstractButton *b; BEGINSEQ if(index<0 ||(unsigned int)index>=items.size()) ERROR if(!items[index] || !items[index]->WidgetQ()) ERROR if(!(b = GetButton(index) ) ) ERROR if(items[index]->WidgetQ()->isHidden()){ ShowWidget(index); b->setChecked(true); }else{ HideWidget(index); b->setChecked(false); } RECOVER ENDSEQ }
void AirspaceWarningMonitor::Check() { const auto &calculated = CommonInterface::Calculated(); if (widget == nullptr && calculated.airspace_warnings.latest == last) return; /* there's a new airspace warning */ last = calculated.airspace_warnings.latest; auto *airspace_warnings = GetAirspaceWarnings(); if (airspace_warnings == nullptr) { HideWidget(); return; } if (!HasPointer()) { /* "classic" list-only view for devices without touch screen */ if (dlgAirspaceWarningVisible()) /* already visible */ return; // un-blank the display, play a sound ResetUserIdle(); PlayResource(_T("IDR_WAV_BEEPBWEEP")); // show airspace warnings dialog if (CommonInterface::GetUISettings().enable_airspace_warning_dialog) dlgAirspaceWarningsShowModal(*airspace_warnings, true); return; } const AbstractAirspace *airspace = nullptr; AirspaceWarning::State state; AirspaceInterceptSolution solution; { const ProtectedAirspaceWarningManager::Lease lease(*airspace_warnings); auto w = lease->begin(); if (w != lease->end() && w->IsAckExpired()) { airspace = &w->GetAirspace(); state = w->GetWarningState(); solution = w->GetSolution(); } } if (airspace == nullptr) { HideWidget(); return; } if (CommonInterface::GetUISettings().enable_airspace_warning_dialog) { /* show airspace warning */ if (widget != nullptr) { if (widget->Update(*airspace, state, solution)) return; HideWidget(); } widget = new AirspaceWarningWidget(*this, *airspace_warnings, *airspace, state, solution); PageActions::SetCustomBottom(widget); } // un-blank the display, play a sound ResetUserIdle(); PlayResource(_T("IDR_WAV_BEEPBWEEP")); }
int ExecJobMode() { char *job; int print = 1; SpecialInfo* special = NULL; if(g_config_file_data != NULL){ special = g_config_file_data->special_list; } job = GetCurrOpt(g_cngplp_data, ID_CNJOBEXECMODE, NULL); if(job != NULL){ if(strcmp(job, "print") == 0){ print = 1; }else if(strcmp(job, "store") == 0){ print = 1; }else if(strcmp(job, "secured") == 0){ if((g_cngplp_data != NULL) && (NULL == g_cngplp_data->file_name)){ HideWidget("DocName_label"); HideWidget("DocName_entry"); }else{ char *file = NULL; file = GetOptionList(g_cngplp_data, ID_SECURED_DOCNAME); ShowWidget("DocName_label"); ShowWidget("DocName_entry"); if(file != NULL){ SetTextEntry("DocName_entry", file); free(file); } } ShowDialog("IdPassWdDlg", 1); while(special != NULL){ if(0 == strcasecmp(special->name, "IdPassWdDlg")){ if(!special->print){ memFree(job); return 0; } break; } special = special->next; } }else if(strcmp(job, "hold") == 0){ print = 1; } memFree(job); } const int special_func = GetCurrOptInt(ID_SPECIAL_FUNC, 0); if(special_func != 0){ int job_account; int active_job; int is_color = 0; char *active_color; job_account = GetCurrOptInt(ID_JOBACCOUNT, 0); if(job_account != 0){ active_job = GetCurrOptInt(ID_DISABLE_JOBACCOUNT_BW, 0); active_color = GetCurrOpt(g_cngplp_data, ID_CNCOLORMODE, NULL); if(active_color != NULL){ if(strcmp(active_color, "mono") != 0){ is_color = 1; } memFree(active_color); } if(!((active_job == 1) && (is_color == 0))){ ShowWidget("JobAccountPassWD_label"); ShowWidget("JobAccountPassWD_entry"); ShowDialog("JobAccountDlg", 1); while(special != NULL){ if(0 == strcasecmp(special->name, "JobAccountDlg")){ if(!special->print){ return 0; }else{ return 1; } } special = special->next; } } } } return print; }