• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dialog函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中dialog函数的典型用法代码示例。如果您正苦于以下问题:C++ dialog函数的具体用法?C++ dialog怎么用?C++ dialog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了dialog函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: dialog

void MainWindow::openDeleteCategory(){
    deleteCategoryDialog dialog(this, m_database);
    dialog.exec();
    ui->comboBox_categorie->clear();
    this->genrateCategorie();
}
开发者ID:fschmidt,项目名称:C--4J,代码行数:6,代码来源:mainwindow.cpp


示例2: dialog

void MainWindow::open()
{
    FindFileDialog dialog(textViewer, assistant);
    dialog.exec();
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:5,代码来源:mainwindow.cpp


示例3: m

void NoteCanvas::menu(const QPoint&) {
  Q3PopupMenu m(0);
  Q3PopupMenu fontsubm(0);
  
  m.insertItem(new MenuTitle(TR("Note"), m.font()), -1);
  m.insertSeparator();
  m.insertItem(TR("Upper"), 0);
  m.insertItem(TR("Lower"), 1);
  m.insertItem(TR("Go up"), 7);
  m.insertItem(TR("Go down"), 8);
  m.insertSeparator();
  m.insertItem(TR("Edit"), 2);
  m.insertSeparator();
  m.insertItem(TR("Color of text"), 6);
  m.insertItem(TR("Font"), &fontsubm);  
  init_font_menu(fontsubm, the_canvas(), 10);
  m.insertItem(TR("Edit drawing settings"), 3);
  if (linked()) {
    m.insertSeparator();
    m.insertItem(TR("Select linked items"), 4);
  }
  m.insertSeparator();
  m.insertItem(TR("Remove from diagram"),5);

  int index = m.exec(QCursor::pos());
  
  switch (index) {
  case 0:
    upper();
    modified();	// call package_modified()
    return;
  case 1:
    lower();
    modified();	// call package_modified()
    return;
  case 7:
    z_up();
    modified();	// call package_modified()
    return;
  case 8:
    z_down();
    modified();	// call package_modified()
    return;
  case 2:
    open();
    // modified then package_modified already called
    return;
  case 3:
    edit_drawing_settings();
    return;
  case 4:
    the_canvas()->unselect_all();
    select_associated();
    return;
  case 5:
    delete_it();
    break;
  case 6:
    for (;;) {
      ColorSpecVector co(1);
      
      co[0].set(TR("color"), &fg_c);
      
      SettingsDialog dialog(0, &co, TRUE, FALSE,
			    TR("Text color dialog"));
      
      dialog.raise();
      if (dialog.exec() != QDialog::Accepted)
	return;
      
      // force son reaffichage
      hide();
      show();
      canvas()->update();
      
      if (!dialog.redo())
	break;
      else
	package_modified();
    }
    break;
  default:
    if (index >= 10) {
      itsfont = (UmlFont) (index - 10);
      modified();
    }
    return;
  }
  
  package_modified();
}
开发者ID:kralf,项目名称:bouml,代码行数:91,代码来源:NoteCanvas.cpp


示例4: dialog

bool EditConfigWindow::editParameter(ConfigMap::Parameter& parameter)
{
    EditParameterDialog dialog(parameter, this);

    return dialog.exec() == 1;
}
开发者ID:ComEngineering,项目名称:AirCoolControl_Desktop,代码行数:6,代码来源:EditConfigWindow.cpp


示例5: WXUNUSED

void CGameListCtrl::OnCompressGCM(wxCommandEvent& WXUNUSED (event))
{
	const GameListItem *iso = GetSelectedISO();
	if (!iso)
		return;

	wxString path;

	std::string FileName, FilePath, FileExtension;
	SplitPath(iso->GetFileName(), &FilePath, &FileName, &FileExtension);

	do
	{
		if (iso->IsCompressed())
		{
			wxString FileType;
			if (iso->GetPlatform() == GameListItem::WII_DISC)
				FileType = _("All Wii ISO files (iso)") + "|*.iso";
			else
				FileType = _("All GameCube GCM files (gcm)") + "|*.gcm";

			path = wxFileSelector(
					_("Save decompressed GCM/ISO"),
					StrToWxStr(FilePath),
					StrToWxStr(FileName) + FileType.After('*'),
					wxEmptyString,
					FileType + "|" + wxGetTranslation(wxALL_FILES),
					wxFD_SAVE,
					this);
		}
		else
		{
			path = wxFileSelector(
					_("Save compressed GCM/ISO"),
					StrToWxStr(FilePath),
					StrToWxStr(FileName) + ".gcz",
					wxEmptyString,
					_("All compressed GC/Wii ISO files (gcz)") +
						wxString::Format("|*.gcz|%s", wxGetTranslation(wxALL_FILES)),
					wxFD_SAVE,
					this);
		}
		if (!path)
			return;
	} while (wxFileExists(path) &&
			wxMessageBox(
				wxString::Format(_("The file %s already exists.\nDo you wish to replace it?"), path.c_str()),
				_("Confirm File Overwrite"),
				wxYES_NO) == wxNO);

	bool all_good = false;

	{
	wxProgressDialog dialog(
		iso->IsCompressed() ? _("Decompressing ISO") : _("Compressing ISO"),
		_("Working..."),
		1000,
		this,
		wxPD_APP_MODAL |
		wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME |
		wxPD_SMOOTH
		);


	if (iso->IsCompressed())
		all_good = DiscIO::DecompressBlobToFile(iso->GetFileName(),
				WxStrToStr(path), &CompressCB, &dialog);
	else
		all_good = DiscIO::CompressFileToBlob(iso->GetFileName(),
				WxStrToStr(path),
				(iso->GetPlatform() == GameListItem::WII_DISC) ? 1 : 0,
				16384, &CompressCB, &dialog);
	}

	if (!all_good)
		WxUtils::ShowErrorDialog(_("Dolphin was unable to complete the requested action."));

	Update();
}
开发者ID:diegobill,项目名称:dolphin,代码行数:79,代码来源:GameListCtrl.cpp


示例6: wxPanel


//.........这里部分代码省略.........
		m_reflector->SetSelection(0);
	} else {
		wxString name = reflector;
		name.SetChar(LONG_CALLSIGN_LENGTH - 1U, wxT(' '));
		bool res = m_reflector->SetStringSelection(name);
		if (!res)
			m_reflector->SetSelection(0);
	}

	m_channel = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1));
	m_channel->Append(wxT("A"));
	m_channel->Append(wxT("B"));
	m_channel->Append(wxT("C"));
	m_channel->Append(wxT("D"));
	m_channel->Append(wxT("E"));
	m_channel->Append(wxT("F"));
	m_channel->Append(wxT("G"));
	m_channel->Append(wxT("H"));
	m_channel->Append(wxT("I"));
	m_channel->Append(wxT("J"));
	m_channel->Append(wxT("K"));
	m_channel->Append(wxT("L"));
	m_channel->Append(wxT("M"));
	m_channel->Append(wxT("N"));
	m_channel->Append(wxT("O"));
	m_channel->Append(wxT("P"));
	m_channel->Append(wxT("Q"));
	m_channel->Append(wxT("R"));
	m_channel->Append(wxT("S"));
	m_channel->Append(wxT("T"));
	m_channel->Append(wxT("U"));
	m_channel->Append(wxT("V"));
	m_channel->Append(wxT("W"));
	m_channel->Append(wxT("X"));
	m_channel->Append(wxT("Y"));
	m_channel->Append(wxT("Z"));
	sizer->Add(m_channel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
	res = m_channel->SetStringSelection(reflector.Right(1U));
	if (!res)
		m_channel->SetSelection(0);
#endif

	SetAutoLayout(true);

	SetSizer(sizer);
}


CStarNetSet::~CStarNetSet()
{
}

bool CStarNetSet::Validate()
{
	int n = m_band->GetCurrentSelection();
	if (n == wxNOT_FOUND) {
		wxMessageDialog dialog(this, _("The StarNet Band is not set"), m_title + _(" Error"), wxICON_ERROR);
		dialog.ShowModal();
		return false;
	}

	n = m_userTimeout->GetCurrentSelection();
	if (n == wxNOT_FOUND) {
		wxMessageDialog dialog(this, _("The StarNet user timeout is not set"), m_title + _(" Error"), wxICON_ERROR);
		dialog.ShowModal();
		return false;
	}

	n = m_groupTimeout->GetCurrentSelection();
	if (n == wxNOT_FOUND) {
		wxMessageDialog dialog(this, _("The StarNet group timeout is not set"), m_title + _(" Error"), wxICON_ERROR);
		dialog.ShowModal();
		return false;
	}

	n = m_callsignSwitch->GetCurrentSelection();
	if (n == wxNOT_FOUND) {
		wxMessageDialog dialog(this, _("The MYCALL Setting is not set"), m_title + _(" Error"), wxICON_ERROR);
		dialog.ShowModal();
		return false;
	}

	n = m_txMsgSwitch->GetCurrentSelection();
	if (n == wxNOT_FOUND) {
		wxMessageDialog dialog(this, _("The TX Message switch is not set"), m_title + _(" Error"), wxICON_ERROR);
		dialog.ShowModal();
		return false;
	}

#if defined(DEXTRA_LINK) || defined(DCS_LINK)
	n = m_reflector->GetCurrentSelection();
	if (n == wxNOT_FOUND) {
		wxMessageDialog dialog(this, _("The StarNet reflector link is not set"), m_title + _(" Error"), wxICON_ERROR);
		dialog.ShowModal();
		return false;
	}
#endif

	return true;
}
开发者ID:NJ08512,项目名称:OpenDV,代码行数:101,代码来源:StarNetSet.cpp


示例7: dialog

// }}}
// {{{ void MainFrame::OnPreferences(wxCommandEvent &event)
void MainFrame::OnPreferences(wxCommandEvent &event) {
	PrefDialog dialog(this, -1, _("Preferences"));
	dialog.ShowModal();
}
开发者ID:LawnGnome,项目名称:dubnium,代码行数:6,代码来源:MainFrame.cpp


示例8: portableIniFile

// Portable installations are assumed to be run in either administrator rights mode, or run
// from "insecure media" such as a removable flash drive.  In these cases, the default path for
// PCSX2 user documents becomes ".", which is the current working directory.
//
// Portable installation mode is typically enabled via the presence of an INI file in the
// same directory that PCSX2 is installed to.
//
wxConfigBase* Pcsx2App::TestForPortableInstall()
{
	InstallationMode = InstallMode_Registered;

	const wxFileName portableIniFile( GetPortableIniPath() );
	const wxDirName portableDocsFolder( portableIniFile.GetPath() );

	if (Startup.PortableMode || portableIniFile.FileExists())
	{
		wxString FilenameStr = portableIniFile.GetFullPath();
		if (Startup.PortableMode)
			Console.WriteLn( L"(UserMode) Portable mode requested via commandline switch!" );
		else
			Console.WriteLn( L"(UserMode) Found portable install ini @ %s", WX_STR(FilenameStr) );

		// Just because the portable ini file exists doesn't mean we can actually run in portable
		// mode.  In order to determine our read/write permissions to the PCSX2, we must try to
		// modify the configured documents folder, and catch any ensuing error.

		std::unique_ptr<wxFileConfig> conf_portable( OpenFileConfig( portableIniFile.GetFullPath() ) );
		conf_portable->SetRecordDefaults(false);

		while( true )
		{
			wxString accessFailedStr, createFailedStr;
			if (TestUserPermissionsRights( portableDocsFolder, createFailedStr, accessFailedStr )) break;
		
			wxDialogWithHelpers dialog( NULL, AddAppName(_("Portable mode error - %s")) );

			wxTextCtrl* scrollText = new wxTextCtrl(
				&dialog, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
				wxTE_READONLY | wxTE_MULTILINE | wxTE_WORDWRAP
			);

			if (!createFailedStr.IsEmpty())
				scrollText->AppendText( createFailedStr + L"\n" );

			if (!accessFailedStr.IsEmpty())
				scrollText->AppendText( accessFailedStr + L"\n" );

			dialog += dialog.Heading( _("PCSX2 has been installed as a portable application but cannot run due to the following errors:" ) );
			dialog += scrollText | pxExpand.Border(wxALL, 16);
			dialog += 6;
			dialog += dialog.Text( GetMsg_PortableModeRights() );
			
			// [TODO] : Add url for platform-relevant user permissions tutorials?  (low priority)

			wxWindowID result = pxIssueConfirmation( dialog,
				MsgButtons().Retry().Cancel().Custom(_("Switch to User Documents Mode"), "switchmode")
			);
			
			switch (result)
			{
				case wxID_CANCEL:
					throw Exception::StartupAborted( L"User canceled portable mode due to insufficient user access/permissions." );

				case wxID_RETRY:
					// do nothing (continues while loop)
				break;
				
				case pxID_CUSTOM:
					wxDialogWithHelpers dialog2( NULL, AddAppName(_("%s is switching to local install mode.")) );
					dialog2 += dialog2.Heading( _("Try to remove the file called \"portable.ini\" from your installation directory manually." ) );
					dialog2 += 6;
					pxIssueConfirmation( dialog2, MsgButtons().OK() );
					
					return NULL;
			}

		}
	
		// Success -- all user-based folders have write access.  PCSX2 should be able to run error-free!
		// Force-set the custom documents mode, and set the 

		InstallationMode = InstallMode_Portable;
		DocsFolderMode = DocsFolder_Custom;
		CustomDocumentsFolder = portableDocsFolder;
		return conf_portable.release();
	}
	
	return NULL;
}
开发者ID:AdmiralCurtiss,项目名称:pcsx2,代码行数:89,代码来源:AppUserMode.cpp


示例9: dialog

void CloudView::showServerStatusDialog()
{
    ServerStatusDialog dialog(this);
    dialog.exec();
}
开发者ID:haiwen,项目名称:seafile-client,代码行数:5,代码来源:cloud-view.cpp


示例10: dialog

void MainWindow::on_actionAbout_triggered()
{
    std::unique_ptr<AboutDialog> dialog(new AboutDialog(this));
    dialog->exec();
}
开发者ID:RattleInGlasses,项目名称:ps_cg,代码行数:5,代码来源:mainwindow.cpp


示例11: getKnob

void
KnobGui::linkTo(int dimension)
{
    
    KnobPtr thisKnob = getKnob();
    assert(thisKnob);
    EffectInstance* isEffect = dynamic_cast<EffectInstance*>(thisKnob->getHolder());
    if (!isEffect) {
        return;
    }
    
    
    for (int i = 0; i < thisKnob->getDimension(); ++i) {
        
        if (i == dimension || dimension == -1) {
            std::string expr = thisKnob->getExpression(dimension);
            if (!expr.empty()) {
                Dialogs::errorDialog(tr("Param Link").toStdString(),tr("This parameter already has an expression set, edit or clear it.").toStdString());
                return;
            }
        }
    }
    
    LinkToKnobDialog dialog( shared_from_this(),_imp->copyRightClickMenu->parentWidget() );

    if ( dialog.exec() ) {
        KnobPtr  otherKnob = dialog.getSelectedKnobs();
        if (otherKnob) {
            if ( !thisKnob->isTypeCompatible(otherKnob) ) {
                Dialogs::errorDialog( tr("Param Link").toStdString(), tr("Types incompatibles!").toStdString() );

                return;
            }
            
            

            for (int i = 0; i < thisKnob->getDimension(); ++i) {
                std::pair<int,KnobPtr > existingLink = thisKnob->getMaster(i);
                if (existingLink.second) {
                    std::string err( tr("Cannot link ").toStdString() );
                    err.append( thisKnob->getLabel() );
                    err.append( " \n " + tr("because the knob is already linked to ").toStdString() );
                    err.append( existingLink.second->getLabel() );
                    Dialogs::errorDialog(tr("Param Link").toStdString(), err);

                    return;
                }
                
            }
            
            EffectInstance* otherEffect = dynamic_cast<EffectInstance*>(otherKnob->getHolder());
            if (!otherEffect) {
                return;
            }
            
            std::stringstream expr;
            boost::shared_ptr<NodeCollection> thisCollection = isEffect->getNode()->getGroup();
            NodeGroup* otherIsGroup = dynamic_cast<NodeGroup*>(otherEffect);
            if (otherIsGroup == thisCollection.get()) {
                expr << "thisGroup"; // make expression generic if possible
            } else {
                expr << otherEffect->getNode()->getFullyQualifiedName();
            }
            expr << "." << otherKnob->getName() << ".get()";
            if (otherKnob->getDimension() > 1) {
                expr << "[dimension]";
            }
            
            thisKnob->beginChanges();
            for (int i = 0; i < thisKnob->getDimension(); ++i) {
                if (i == dimension || dimension == -1) {
                    thisKnob->setExpression(i, expr.str(), false, false);
                }
            }
            thisKnob->endChanges();


            thisKnob->getHolder()->getApp()->triggerAutoSave();
        }
    }
}
开发者ID:JamesLinus,项目名称:Natron,代码行数:81,代码来源:KnobGui20.cpp


示例12: beforeBrowsing

void PathChooser::slotBrowse()
{
    emit beforeBrowsing();

    QString predefined = path();
    if ((predefined.isEmpty() || !QFileInfo(predefined).isDir())
            && !m_d->m_initialBrowsePathOverride.isNull()) {
        predefined = m_d->m_initialBrowsePathOverride;
        if (!QFileInfo(predefined).isDir())
            predefined.clear();
    }

    // Prompt for a file/dir
    QString newPath;
    switch (m_d->m_acceptingKind) {
    case PathChooser::Directory:
    case PathChooser::ExistingDirectory:
        newPath = QFileDialog::getExistingDirectory(this,
                makeDialogTitle(tr("Choose Directory")), predefined);
        break;
    case PathChooser::ExistingCommand:
    case PathChooser::Command:
        newPath = QFileDialog::getOpenFileName(this,
                makeDialogTitle(tr("Choose Executable")), predefined,
                m_d->m_dialogFilter);
        break;
    case PathChooser::File: // fall through
        newPath = QFileDialog::getOpenFileName(this,
                makeDialogTitle(tr("Choose File")), predefined,
                m_d->m_dialogFilter);
        break;
    case PathChooser::Any: {
        QFileDialog dialog(this);
        dialog.setFileMode(QFileDialog::AnyFile);
        dialog.setWindowTitle(makeDialogTitle(tr("Choose File")));
        QFileInfo fi(predefined);
        if (fi.exists())
            dialog.setDirectory(fi.absolutePath());
        // FIXME: fix QFileDialog so that it filters properly: lib*.a
        dialog.setNameFilter(m_d->m_dialogFilter);
        if (dialog.exec() == QDialog::Accepted) {
            // probably loop here until the *.framework dir match
            QStringList paths = dialog.selectedFiles();
            if (!paths.isEmpty())
                newPath = paths.at(0);
        }
        break;
        }

    default:
        break;
    }

    // Delete trailing slashes unless it is "/"|"\\", only
    if (!newPath.isEmpty()) {
        newPath = QDir::toNativeSeparators(newPath);
        if (newPath.size() > 1 && newPath.endsWith(QDir::separator()))
            newPath.truncate(newPath.size() - 1);
        setPath(newPath);
    }

    emit browsingFinished();
    m_d->m_lineEdit->triggerChanged();
}
开发者ID:renatofilho,项目名称:QtCreator,代码行数:64,代码来源:pathchooser.cpp


示例13: printer

void PharmacyReceipt::on_printButton_clicked()
{
	QPrinter       printer( QPrinter::PrinterResolution );
	QPrintDialog   dialog( &printer, this );
	if ( dialog.exec() == QDialog::Accepted ) print( &printer );
}
开发者ID:wangfeilong321,项目名称:his,代码行数:6,代码来源:pharmacyreceipt.cpp


示例14: WXUNUSED

void MyFrame::OnTestDialog(wxCommandEvent& WXUNUSED(event))
{
    MyDialog dialog( wxT("Test") );
    dialog.ShowModal();
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:5,代码来源:popup.cpp


示例15: LOG

void IECommandExecutor::DispatchCommand() {
  LOG(TRACE) << "Entering IECommandExecutor::DispatchCommand";

  Response response(this->session_id_);
  CommandHandlerMap::const_iterator found_iterator = 
      this->command_handlers_.find(this->current_command_.command_type());

  if (found_iterator == this->command_handlers_.end()) {
    LOG(WARN) << "Unable to find command handler for " << this->current_command_.command_type();
    response.SetErrorResponse(501, "Command not implemented");
  } else {
    BrowserHandle browser;
    int status_code = SUCCESS;
    if (this->current_command_.command_type() != webdriver::CommandType::NewSession) {
      // There should never be a modal dialog or alert to check for if the command
      // is the "newSession" command.
      status_code = this->GetCurrentBrowser(&browser);
      if (status_code == SUCCESS) {
        bool alert_is_active = false;
        HWND alert_handle = browser->GetActiveDialogWindowHandle();
        if (alert_handle != NULL) {
          // Found a window handle, make sure it's an actual alert,
          // and not a showModalDialog() window.
          vector<char> window_class_name(34);
          ::GetClassNameA(alert_handle, &window_class_name[0], 34);
          if (strcmp(ALERT_WINDOW_CLASS, &window_class_name[0]) == 0) {
            alert_is_active = true;
          } else {
            LOG(WARN) << "Found alert handle does not have a window class consistent with an alert";
          }
        } else {
          LOG(DEBUG) << "No alert handle is found";
        }
        if (alert_is_active) {
          Alert dialog(browser, alert_handle);
          std::string command_type = this->current_command_.command_type();
          if (command_type == webdriver::CommandType::GetAlertText ||
              command_type == webdriver::CommandType::SendKeysToAlert ||
              command_type == webdriver::CommandType::AcceptAlert ||
              command_type == webdriver::CommandType::DismissAlert) {
            LOG(DEBUG) << "Alert is detected, and the sent command is valid";
          } else {
            LOG(DEBUG) << "Unexpected alert is detected, and the sent command is invalid when an alert is present";
            std::string alert_text = dialog.GetText();
            if (this->unexpected_alert_behavior_ == ACCEPT_UNEXPECTED_ALERTS) {
              LOG(DEBUG) << "Automatically accepting the alert";
              dialog.Accept();
            } else if (this->unexpected_alert_behavior_ == DISMISS_UNEXPECTED_ALERTS || command_type == webdriver::CommandType::Quit) {
              // If a quit command was issued, we should not ignore an unhandled
              // alert, even if the alert behavior is set to "ignore".
              LOG(DEBUG) << "Automatically dismissing the alert";
              if (dialog.is_standard_alert()) {
                dialog.Dismiss();
              } else {
                // The dialog was non-standard. The most common case of this is
                // an onBeforeUnload dialog, which must be accepted to continue.
                dialog.Accept();
              }
            }
            if (command_type != webdriver::CommandType::Quit) {
              // To keep pace with what Firefox does, we'll return the text of the
              // alert in the error response.
              Json::Value response_value;
              response_value["message"] = "Modal dialog present";
              response_value["alert"]["text"] = alert_text;
              response.SetResponse(EMODALDIALOGOPENED, response_value);
              this->serialized_response_ = response.Serialize();
              return;
            } else {
              LOG(DEBUG) << "Quit command was issued. Continuing with command after automatically closing alert.";
            }
          }
        }
      } else {
        LOG(WARN) << "Unable to find current browser";
      }
    }
	  CommandHandlerHandle command_handler = found_iterator->second;
    command_handler->Execute(*this, this->current_command_, &response);

    status_code = this->GetCurrentBrowser(&browser);
    if (status_code == SUCCESS) {
      this->is_waiting_ = browser->wait_required();
      if (this->is_waiting_) {
        if (this->page_load_timeout_ >= 0) {
          this->wait_timeout_ = clock() + (this->page_load_timeout_ / 1000 * CLOCKS_PER_SEC);
        }
        ::PostMessage(this->m_hWnd, WD_WAIT, NULL, NULL);
      }
    } else {
      if (this->current_command_.command_type() != webdriver::CommandType::Quit) {
        LOG(WARN) << "Unable to get current browser";
      }
    }
  }

  this->serialized_response_ = response.Serialize();
}
开发者ID:AlexandraChiorean,项目名称:Selenium2,代码行数:98,代码来源:IECommandExecutor.cpp


示例16: AEInstallEventHandler


//.........这里部分代码省略.........
            );
            if (path_to_error[0]) {
                strDialogMessage += _(" at ");
                strDialogMessage += wxString::FromUTF8(path_to_error);
            }
            strDialogMessage += _(")");
            
            fprintf(stderr, "%s\n", (const char*)strDialogMessage.utf8_str());
        }

        wxMessageDialog* pDlg = new wxMessageDialog(
                                    NULL, 
                                    strDialogMessage, 
                                    m_pSkinManager->GetAdvanced()->GetApplicationName(), 
                                    wxOK
                                    );

        pDlg->ShowModal();
        if (pDlg)
            pDlg->Destroy();

        return false;
    }
#endif      // SANDBOX


#ifdef __WXMSW__
    // Perform any last minute checks that should keep the manager
    // from starting up.
    wxString strRebootPendingFile = 
        GetRootDirectory() + wxFileName::GetPathSeparator() + wxT("RebootPending.txt");
    
    if (wxFile::Exists(strRebootPendingFile)) {
        wxMessageDialog dialog(
            NULL,
            _("A reboot is required in order for BOINC to run properly.\nPlease reboot your computer and try again."),
            _("BOINC Manager"),
            wxOK|wxICON_ERROR
        );

        dialog.ShowModal();
        return false;
    }
#endif

    // Detect if BOINC Manager is already running, if so, bring it into the
    // foreground and then exit.
    if (!m_bMultipleInstancesOK) {
        if (DetectDuplicateInstance()) {
            return false;
        }
    }

    // Initialize the main document
    m_pDocument = new CMainDocument();
    wxASSERT(m_pDocument);

    m_pDocument->OnInit();


    // Is there a condition in which the Simple GUI should not be used?
    if (BOINC_SIMPLEGUI == m_iGUISelected) {
        // Screen too small?
        if (wxGetDisplaySize().GetHeight() < 600) {
            m_iGUISelected = BOINC_ADVANCEDGUI;
        }
开发者ID:AltroCoin,项目名称:altrocoin,代码行数:67,代码来源:BOINCGUIApp.cpp


示例17: dialog

bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
{
    sm_abortIt = false;
    sm_abortWindow = NULL;

    if (!printout)
    {
        sm_lastError = wxPRINTER_ERROR;
        return false;
    }

    if (m_printDialogData.GetMinPage() < 1)
        m_printDialogData.SetMinPage(1);
    if (m_printDialogData.GetMaxPage() < 1)
        m_printDialogData.SetMaxPage(9999);

    // Create a suitable device context
    wxPrinterDC *dc = NULL;
    if (prompt)
    {
        wxMacPrintDialog dialog(parent, & m_printDialogData);
        if (dialog.ShowModal() == wxID_OK)
        {
            dc = wxDynamicCast(dialog.GetPrintDC(), wxPrinterDC);
            wxASSERT(dc);
            m_printDialogData = dialog.GetPrintDialogData();
        }
    }
    else
    {
        dc = new wxPrinterDC( m_printDialogData.GetPrintData() ) ;
    }

    // May have pressed cancel.
    if (!dc || !dc->IsOk())
    {
        delete dc;
        return false;
    }

    // on the mac we have always pixels as addressing mode with 72 dpi
    printout->SetPPIScreen(72, 72);

    PMResolution res;
    PMPrinter printer;
    wxOSXPrintData* nativeData = (wxOSXPrintData*)
          (m_printDialogData.GetPrintData().GetNativeData());

    if (PMSessionGetCurrentPrinter(nativeData->GetPrintSession(), &printer) == noErr)
    {
        if (PMPrinterGetOutputResolution( printer, nativeData->GetPrintSettings(), &res) == -9589 /* kPMKeyNotFound */ )
        {
            res.hRes = res.vRes = 300;
        }
    }
    else
    {
        // fallback
        res.hRes = res.vRes = 300;
    }
    printout->SetPPIPrinter(int(res.hRes), int(res.vRes));

    // Set printout parameters
    printout->SetDC(dc);

    int w, h;
    dc->GetSize(&w, &h);
    printout->SetPageSizePixels((int)w, (int)h);
    printout->SetPaperRectPixels(dc->GetPaperRect());
    wxCoord mw, mh;
    dc->GetSizeMM(&mw, &mh);
    printout->SetPageSizeMM((int)mw, (int)mh);

    // Create an abort window
    wxBeginBusyCursor();

    printout->OnPreparePrinting();

    // Get some parameters from the printout, if defined
    int fromPage, toPage;
    int minPage, maxPage;
    printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage);

    if (maxPage == 0)
    {
        sm_lastError = wxPRINTER_ERROR;
        return false;
    }

    // Only set min and max, because from and to will be
    // set by the user
    m_printDialogData.SetMinPage(minPage);
    m_printDialogData.SetMaxPage(maxPage);

    printout->OnBeginPrinting();

    bool keepGoing = true;

    if (!printout->OnBeginDocument(m_printDialogData.GetFromPage(), m_printDialogData.GetToPage()))
    {
//.........这里部分代码省略.........
开发者ID:Annovae,项目名称:Dolphin-Core,代码行数:101,代码来源:printmac.cpp


示例18: listing

void TimetableGenerateForm::stopHighest()
{
	if(!simulation_running){
		return;
	}

	simulation_running=false;

	myMutex.lock();
	gen.abortOptimization=true;
	myMutex.unlock();

	myMutex.lock();

	Solution& c=highestStageSolution;

	//needed to find the conflicts strings
	QString tmp;
	c.fitness(gt.rules, &tmp);

	TimetableExport::getStudentsTimetable(c);
	TimetableExport::getTeachersTimetable(c);
	TimetableExport::getRoomsTimetable(c);

	//update the string representing the conflicts
	conflictsStringTitle=TimetableGenerateForm::tr("Conflicts", "Title of dialog");
	conflictsString="";
	conflictsString+=TimetableGenerateForm::tr("Total conflicts:");
	conflictsString+=" ";
	conflictsString+=CustomFETString::number(c.conflictsTotal);
	conflictsString+="\n";
	conflictsString+=TimetableGenerateForm::tr("Conflicts listing (in decreasing order):");
	conflictsString+="\n";

	foreach(QString t, c.conflictsDescriptionList)
		conflictsString+=t+"\n";

	TimetableExport::writeHighestStageResults(this);

	QString s=TimetableGenerateForm::tr("Simulation interrupted! FET could not find a timetable."
	 " Maybe you can consider lowering the constraints.");

	s+=" ";
	
	QString kk;
	kk=FILE_SEP;
	if(INPUT_FILENAME_XML=="")
		kk.append("unnamed");
	else{
		kk.append(INPUT_FILENAME_XML.right(INPUT_FILENAME_XML.length()-INPUT_FILENAME_XML.lastIndexOf(FILE_SEP)-1));

		if(kk.right(4)==".fet")
			kk=kk.left(kk.length()-4);
	}
	kk.append("-highest");

	s+=TimetableGenerateForm::tr("The partial highest-stage results were saved in the directory %1")
	 .arg(QDir::toNativeSeparators(OUTPUT_DIR+FILE_SEP+"timetables"+kk));

	s+="\n\n";

	s+=TimetableGenerateForm::tr("Additional information relating impossible to schedule activities:");
	s+="\n\n";

	s+=tr("FET managed to schedule correctly the first %1 most difficult activities."
	 " You can see initial order of placing the activities in the generate dialog. The activity which might cause problems"
	 " might be the next activity in the initial order of evaluation. This activity is listed below:")
	 .arg(maxActivitiesPlaced);
	 
	s+="\n\n";
	
	s+=tr("Please check constraints related to following possibly problematic activity (or teacher(s), or students set(s)):");
	s+="\n";
	s+="-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ";
	s+="\n";
	
	if(maxActivitiesPlaced>=0 && maxActivitiesPlaced<gt.rules.nInternalActivities 
	 && initialOrderOfActivitiesIndices[maxActivitiesPlaced]>=0 && initialOrderOfActivitiesIndices[maxActivitiesPlaced]<gt.rules.nInternalActivities){
		int ai=initialOrderOfActivitiesIndices[maxActivitiesPlaced];

		s+=TimetableGenerateForm::tr("Id: %1 (%2)", "%1 is id of activity, %2 is detailed description of activity")
			.arg(gt.rules.internalActivitiesList[ai].id)
			.arg(getActivityDetailedDescription(gt.rules, gt.rules.internalActivitiesList[ai].id));
	}
	else
		s+=tr("Difficult activity cannot be computed - please report possible bug");

	s+="\n";

	myMutex.unlock();

	//show the message in a dialog
	QDialog dialog(this);

	dialog.setWindowTitle(TimetableGenerateForm::tr("Generation stopped (highest stage)", "The title of a dialog, meaning that the generation of the timetable was stopped "
		"and highest stage timetable written."));

	QVBoxLayout* vl=new QVBoxLayout(&dialog);
	QPlainTextEdit* te=new QPlainTextEdit();
	te->setPlainText(s);
//.........这里部分代码省略.........
开发者ID:vanyog,项目名称:FET,代码行数:101,代码来源:timetablegenerateform.cpp


示例19: ClearIsoFiles

void CGameListCtrl::ScanForISOs()
{
	ClearIsoFiles();

	CFileSearch::XStringVector Directories(SConfig::GetInstance().m_ISOFolder);

	if (SConfig::GetInstance().m_RecursiveISOFolder)
	{
		for (u32 i = 0; i < Directories.size(); i++)
		{
			File::FSTEntry FST_Temp;
			File::ScanDirectoryTree(Directories[i], FST_Temp);
			for (auto& Entry : FST_Temp.children)
			{
				if (Entry.isDirectory)
				{
					bool duplicate = false;
					for (auto& Directory : Directories)
					{
						if (Directory == Entry.physicalName)
						{
							duplicate = true;
							break;
						}
					}
					if (!duplicate)
						Directories.push_back(Entry.physicalName);
				}
			}
		}
	}

	CFileSearch::XStringVector Extensions;

	if (SConfig::GetInstance().m_ListGC)
		Extensions.push_back("*.gcm");
	if (SConfig::GetInstance().m_ListWii || SConfig::GetInstance().m_ListGC)
	{
		Extensions.push_back("*.iso");
		Extensions.push_back("*.ciso");
		Extensions.push_back("*.gcz");
		Extensions.push_back("*.wbfs");
	}
	if (SConfig::GetInstance().m_ListWad)
		Extensions.push_back("*.wad");

	CFileSearch FileSearch(Extensions, Directories);
	const CFileSearch::XStringVector& rFilenames = FileSearch.GetFileNames();

	if (rFilenames.size() > 0)
	{
		wxProgressDialog dialog(
			_("Scanning for ISOs"),
			_("Scanning..."),
			(int)rFilenames.size() - 1,
			this,
			wxPD_APP_MODAL |
			wxPD_AUTO_HIDE |
			wxPD_CAN_ABORT |
			wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME |
			wxPD_SMOOTH // - makes updates as small as possible (down to 1px)
			);

		for (u32 i = 0; i < rFilenames.size(); i++)
		{
			std::string FileName;
			SplitPath(rFilenames[i], nullptr, &FileName, nullptr);

			// Update with the progress (i) and the message
			dialog.Update(i, wxString::Format(_("Scanning %s"),
				StrToWxStr(FileName)));
			if (dialog.WasCancelled())
				break;

			auto iso_file = std::make_unique<GameListItem>(rFilenames[i]);

			if (iso_file->IsValid())
			{
				bool list = true;

				switch(iso_file->GetPlatform())
				{
					case GameListItem::WII_DISC:
						if (!SConfig::GetInstance().m_ListWii)
							list = false;
						break;
					case GameListItem::WII_WAD:
						if (!SConfig::GetInstance().m_ListWad)
							list = false;
						break;
					default:
						if (!SConfig::GetInstance().m_ListGC)
							list = false;
						break;
				}

				switch(iso_file->GetCountry())
				{
					case DiscIO::IVolume::COUNTRY_TAIWAN:
						if (!SConfig::GetInstance().m_ListTaiwan)
//.........这里部分代码省略.........
开发者ID:diegobill,项目名称:dolphin,代码行数:101,代码来源:GameListCtrl.cpp


示例20: wxColour

bool DefaultDetail::IsValid()
{
#if 1
    wxColour REQUIRED_COL = wxColour(230, 250, 255);
    wxColour VALID_COL = wxColour(255, 255, 255);
    wxColour NOT_VALID_COL = wxColour(255, 255, 135);

    wxGrid* grid = GetView();

    int maxrows = GetNumberRows();
    int maxcols = GetNumberCols();
    bool m_valid = true;
    int error_count = 0;

    int first_error_row = -1;
    int first_error_col = -1;

    wxProgressDialog dialog(VALIDATING_DETAIL_PROCESS_TITLE,
                            VALIDATING_DETAIL_PROCESS_MESSAGES,
                            maxrows, 
                            GetView(),
                            wxPD_AUTO_HIDE |
                            wxPD_APP_MODAL );
    for (int i=0; i<maxrows; i++) {

//------ dialog update
        if ( i % (maxrows/20 + 1) == 0 ) {
            dialog.Update(i);
        }

        for (int j=0; j<maxcols; j++) {
            ElementDescriptor* ed = GetColumnDescriptor(j);
            wxString value = GetValue(i, j);                

// ----- convert to Upper Case
            if ( ed->GetType().Cmp("text") == 0 ) {
                SetValue(i, j, value.Upper());
            }

//------ remove last <CR> or <LF>
            if ( (GetValue(i, j).Last() == '\r') || (GetValue(i, j).Last() == '\n')) {
                SetValue(i, j, GetValue(i, j).RemoveLast());
            }

//------ parsing dates
            if ( (ed->GetType().Cmp("date")==0)||(ed->GetType().Cmp("longdate")==0) ) {
                wxDateTime date;
                if ( value.Cmp("  /  /    ")==0 ) {
                    grid->SetCellValue(i, j, "");
                } else if ( date.ParseFormat(value, "%m/%d/%Y") ) {
                    grid->SetCellValue(i, j, date.Format("%m/%d/%Y"));
                };
            }

//------ Verification
            if ( !ed->IsValid( GetValue(i, j) ) ) {
                grid->SetCellBackgroundColour(i, j, NOT_VALID_COL);
                m_valid = false;
                error_count++;
                if ( error_count > MAX_ERRORS ) {
                    break;
                }
            } else {
                if ( grid->GetCellBackgroundColour(i, j) == NOT_VALID_COL ) {
                    if ( ed->IsRequired() ) {
                        grid->SetCellBackgroundColour(i, j, REQUIRED_COL);
                    } else {
                        grid->SetCellBackgroundColour(i, j, VALID_COL);
                    }
                }
            }

//------ goto first error
            if ( (error_ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dialog_clear函数代码示例发布时间:2022-05-30
下一篇:
C++ dial函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap