Example #1
0
s32 FASTCALL OnLoad(emu_info* em)
{
	memcpy(&eminf,em,sizeof(eminf));

	LoadSettings();

	config_scmi=eminf.AddMenuItem(em->RootMenu,-1,L"Config",handle_Config,0);
	config_stami=eminf.AddMenuItem(em->RootMenu,-1,L"Limit Speed && Sync audio",handle_SA,settings.LimitFPS==1);
	config_stami2=eminf.AddMenuItem(em->RootMenu,-1,L"Sync Audio",handle_SA2,settings.LimitFPS==2);
	eminf.AddMenuItem(em->RootMenu,-1,L"DSP Emulation",handle_DSP,settings.DSPEnabled);
	eminf.AddMenuItem(em->RootMenu,-1,L"Mute CDDA",handle_MCDDA,settings.CDDAMute);
	eminf.AddMenuItem(em->RootMenu,-1,L"Mute Sound",handle_GS,settings.GlobalMute);
	

	eminf.AddMenuItem(em->RootMenu,-1,0,0,0);
	eminf.AddMenuItem(em->RootMenu,-1,L"About",handle_About,0);

	eminf.AddMenuItem(em->DebugMenu,-1,L"AICA SGC Debugger",handle_ShowASD,0);
	return rv_ok;
}
BOOL CPPgDirectories::OnInitDialog()
{
	CWaitCursor curWait; // initialization of that dialog may take a while..
	CPropertyPage::OnInitDialog();
	InitWindowStyles(this);
	m_ShareSelector.Init();	

	((CEdit*)GetDlgItem(IDC_INCFILES))->SetLimitText(509);
	((CEdit*)GetDlgItem(IDC_TEMPFILES))->SetLimitText(509);
	m_ctlUncPaths.InsertColumn(0, GetResString(IDS_UNCFOLDERS), LVCFMT_LEFT, 280, -1); 
	m_ctlUncPaths.SetExtendedStyle(LVS_EX_FULLROWSELECT);

	GetDlgItem(IDC_SELTEMPDIRADD)->ShowWindow(thePrefs.IsExtControlsEnabled()?SW_SHOW:SW_HIDE);

	LoadSettings();
	Localize();

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
void CDownloadClientsCtrl::Init()
{
	SetPrefsKey(_T("DownloadClientsCtrl"));
	SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);

	InsertColumn(0,	GetResString(IDS_QL_USERNAME),		LVCFMT_LEFT,  DFLT_CLIENTNAME_COL_WIDTH);
	InsertColumn(1,	GetResString(IDS_CD_CSOFT),			LVCFMT_LEFT,  DFLT_CLIENTSOFT_COL_WIDTH);
	InsertColumn(2,	GetResString(IDS_FILE),				LVCFMT_LEFT,  DFLT_FILENAME_COL_WIDTH);
	InsertColumn(3,	GetResString(IDS_DL_SPEED),			LVCFMT_RIGHT, DFLT_DATARATE_COL_WIDTH);
	InsertColumn(4, GetResString(IDS_AVAILABLEPARTS),	LVCFMT_LEFT,  DFLT_PARTSTATUS_COL_WIDTH);
	InsertColumn(5,	GetResString(IDS_CL_TRANSFDOWN),	LVCFMT_RIGHT, DFLT_SIZE_COL_WIDTH);
	InsertColumn(6,	GetResString(IDS_CL_TRANSFUP),		LVCFMT_RIGHT, DFLT_SIZE_COL_WIDTH);
	InsertColumn(7,	GetResString(IDS_META_SRCTYPE),		LVCFMT_LEFT,  100);

	SetAllIcons();
	Localize();
	LoadSettings();
	SetSortArrow();
	SortItems(SortProc, GetSortItem() + (GetSortAscending() ? 0 : 100));
}
CMemcardManager::CMemcardManager(wxWindow* parent)
	: wxDialog(parent, wxID_ANY, _("Memory Card Manager"), wxDefaultPosition, wxDefaultSize,
	           wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX | wxRESIZE_BORDER | wxMAXIMIZE_BOX)
{
	memoryCard[SLOT_A] = nullptr;
	memoryCard[SLOT_B] = nullptr;

	mcmSettings.twoCardsLoaded = false;
	if (!LoadSettings())
	{
		itemsPerPage = 16;
		mcmSettings.usePages = true;
		for (int i = COLUMN_BANNER; i < NUMBER_OF_COLUMN; i++)
		{
			mcmSettings.column[i] = (i <= COLUMN_FIRSTBLOCK) ? true : false;
		}
	}
	maxPages = (128 / itemsPerPage) - 1;
	CreateGUIControls();
}
Example #5
0
void CPlayer::OnLogin()
{
    LoadSettings();
    SetFakeValues();

    LoadCountryData();

    SetWChat(GetSetting(Settings::SETTING_UINT_WCHAT));

    if (!NativeTeam())
        SetFakeOnNextTick();

    if (GetTotalPlayedTime() < 1)
    {
        m_Played_time[PLAYED_TIME_TOTAL] += 1;
        m_Played_time[PLAYED_TIME_LEVEL] += 1;

        OnFirstLogin();
    }
}
bool CServerListCtrl::Init()
{
	SetPrefsKey(_T("ServerListCtrl"));
	SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);

	CToolTipCtrl* tooltip = GetToolTips();
	if (tooltip) {
		m_tooltip->SubclassWindow(*tooltip);
		tooltip->ModifyStyle(0, TTS_NOPREFIX);
		tooltip->SetDelayTime(TTDT_AUTOPOP, 20000);
		//tooltip->SetDelayTime(TTDT_INITIAL, thePrefs.GetToolTipDelay()*1000);
	}

	InsertColumn(0, GetResString(IDS_SL_SERVERNAME),LVCFMT_LEFT, 150);
	InsertColumn(1, GetResString(IDS_IP),			LVCFMT_LEFT, 140);
	InsertColumn(2, GetResString(IDS_DESCRIPTION),	LVCFMT_LEFT, 150);
	InsertColumn(3, GetResString(IDS_PING),			LVCFMT_RIGHT, 50);
	InsertColumn(4, GetResString(IDS_UUSERS),		LVCFMT_RIGHT, 60);
	InsertColumn(5, GetResString(IDS_MAXCLIENT),	LVCFMT_RIGHT, 60);
	InsertColumn(6, GetResString(IDS_PW_FILES) ,	LVCFMT_RIGHT, 60);
	InsertColumn(7, GetResString(IDS_PREFERENCE),	LVCFMT_LEFT,  50);
	InsertColumn(8, GetResString(IDS_UFAILED),		LVCFMT_RIGHT, 50);
	InsertColumn(9, GetResString(IDS_STATICSERVER),	LVCFMT_LEFT,  50);
	InsertColumn(10,GetResString(IDS_SOFTFILES),	LVCFMT_RIGHT, 60);
	InsertColumn(11,GetResString(IDS_HARDFILES),	LVCFMT_RIGHT, 60, -1, true);
	InsertColumn(12,GetResString(IDS_VERSION),		LVCFMT_LEFT,  50, -1, true);
	InsertColumn(13,GetResString(IDS_IDLOW),		LVCFMT_RIGHT, 60);
	InsertColumn(14,GetResString(IDS_OBFUSCATION),  LVCFMT_RIGHT, 50);

	SetAllIcons();
	Localize();
	LoadSettings();

	// Barry - Use preferred sort order from preferences
	SetSortArrow();
	SortItems(SortProc, MAKELONG(GetSortItem(), (GetSortAscending() ? 0 : 0x0001)));

	ShowServerCount();

	return true;
} 
bool CServerListCtrl::Init(CServerList* in_list)
{
	server_list = in_list;
	ModifyStyle(0,LVS_SINGLESEL|LVS_REPORT);
	ModifyStyle(LVS_SINGLESEL|LVS_LIST|LVS_ICON|LVS_SMALLICON,LVS_REPORT); //here the CListCtrl is set to report-style
	SetExtendedStyle(GetExtendedStyle() | LVS_EX_INFOTIP);

	InsertColumn(0, GetResString(IDS_SL_SERVERNAME),LVCFMT_LEFT, 150);
	InsertColumn(1, GetResString(IDS_IP),			LVCFMT_LEFT, 140);
	InsertColumn(2, GetResString(IDS_DESCRIPTION),	LVCFMT_LEFT, 150);
	InsertColumn(3, GetResString(IDS_PING),			LVCFMT_RIGHT, 50);
	InsertColumn(4, GetResString(IDS_UUSERS),		LVCFMT_RIGHT, 50);
	InsertColumn(5, GetResString(IDS_MAXCLIENT),	LVCFMT_RIGHT, 50);
	InsertColumn(6, GetResString(IDS_PW_FILES) ,	LVCFMT_RIGHT, 50);
	InsertColumn(7, GetResString(IDS_PREFERENCE),	LVCFMT_LEFT,  60);
	InsertColumn(8, GetResString(IDS_UFAILED),		LVCFMT_RIGHT, 50);
//==> simplify Serverwindow [shadow2004]
#if defined(SRVWND1)
	InsertColumn(9, GetResString(IDS_STATICSERVER),	LVCFMT_LEFT,  50);
	InsertColumn(10,GetResString(IDS_SOFTFILES),	LVCFMT_RIGHT, 50);
	InsertColumn(11,GetResString(IDS_HARDFILES),	LVCFMT_RIGHT, 50);
	InsertColumn(12,GetResString(IDS_VERSION),		LVCFMT_LEFT,  50);
	InsertColumn(13,GetResString(IDS_IDLOW),		LVCFMT_RIGHT, 50);
#else //SRVWND1
	InsertColumn(9,GetResString(IDS_IDLOW),		LVCFMT_RIGHT, 50);
#endif //SRVWND1
//<== simplify Serverwindow [shadow2004]
	SetAllIcons();
	Localize();
	LoadSettings(CPreferences::tableServer);

	// Barry - Use preferred sort order from preferences
	int iSortItem = thePrefs.GetColumnSortItem(CPreferences::tableServer);
	bool bSortAscending = thePrefs.GetColumnSortAscending(CPreferences::tableServer);
	SetSortArrow(iSortItem, bSortAscending);
	SortItems(SortProc, MAKELONG(iSortItem, (bSortAscending ? 0 : 0x0001)));

	ShowServerCount();

	return true;
} 
void CQueueListCtrl::Init()
{
	SetPrefsKey(_T("QueueListCtrl"));
	SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);

	InsertColumn(0, GetResString(IDS_QL_USERNAME),	LVCFMT_LEFT, DFLT_CLIENTNAME_COL_WIDTH);
	InsertColumn(1, GetResString(IDS_FILE),			LVCFMT_LEFT, DFLT_FILENAME_COL_WIDTH);
	InsertColumn(2, GetResString(IDS_FILEPRIO),		LVCFMT_LEFT, DFLT_PRIORITY_COL_WIDTH);
	InsertColumn(3, GetResString(IDS_QL_RATING),	LVCFMT_LEFT,  60);
	InsertColumn(4, GetResString(IDS_SCORE),		LVCFMT_LEFT,  60);
	InsertColumn(5, GetResString(IDS_ASKED),		LVCFMT_LEFT,  60);
	InsertColumn(6, GetResString(IDS_LASTSEEN),		LVCFMT_LEFT, 110);
	InsertColumn(7, GetResString(IDS_ENTERQUEUE),	LVCFMT_LEFT, 110);
	InsertColumn(8, GetResString(IDS_BANNED),		LVCFMT_LEFT,  60);
	InsertColumn(9, GetResString(IDS_UPSTATUS),		LVCFMT_LEFT, DFLT_PARTSTATUS_COL_WIDTH);
	InsertColumn(10,GetResString(IDS_CD_CSOFT),		LVCFMT_LEFT,  90);	//Xman version see clientversion in every window
	InsertColumn(11, GetResString(IDS_UPDOWNUPLOADLIST),	LVCFMT_LEFT,  90); //Xman show complete up/down in queuelist

	// ==> push small files [sivka] - Stulle
	InsertColumn(12,GetResString(IDS_SMALL),LVCFMT_LEFT,40,12);
	// <== push small files [sivka] - Stulle

	// ==> push rare file - Stulle
	InsertColumn(13,GetResString(IDS_RARE),LVCFMT_LEFT,40,13);
	// <== push rare file - Stulle

	SetAllIcons();
	Localize();
	LoadSettings();

	//Xman client percentage
	CFont* pFont = GetFont();
	LOGFONT lfFont = {0};
	pFont->GetLogFont(&lfFont);
	lfFont.lfHeight = 11;
	m_fontBoldSmaller.CreateFontIndirect(&lfFont);
	//Xman end

	SetSortArrow();
	SortItems(SortProc, GetSortItem() + (GetSortAscending() ? 0 : 100));
}
/////////////////////////////////////////////////////////////////////
// fe_MultiplayerSetup::Init() //                  \author Logan Jones
////////////////////////////////                     \date 04-24-2003
//
//===================================================================
// Parameters:
//  const char* strGameName   - 
//  const char* strPlayerName - 
//  const char* strPassword   - 
//
void fe_MultiplayerSetup::Init( const char* strGameName, const char* strPlayerName, const char* strPassword )
{
	if( strGameName ) // Start the server
		strcpy( m_GameName, strGameName ),
		strcpy( m_Password, strPassword ),
		//AddNewPlayer( NextPlayer++, ~0, strPlayerName ),
		Players[NextPlayer].Create( strPlayerName, NextPlayer, ~0, NULL, GetColor(), this ),
		net.StartServer( m_GameName, strlen(m_GameName) + 1 ),
		++NextPlayer,++PlayerCount,
		GetGadget("SYNCHING")->SetVisible(FALSE),
		GetGadget("battlestart")->SetVisible(FALSE),
		LoadSettings();
	else // Login to the server
		m_GameName[0] = '\0',
		GetGadget("battlestart")->SetVisible(),
		GetGadget("Start")->SetActive(FALSE),
		net.Write().Write( 0, 4 + strlen(strPlayerName) + 1 )
			<< (UINT32)fems_ClientLogin
			<< (UINT32)std_NameHash(strPassword)
			<< strPlayerName;
}
Example #10
0
NoiseGate::NoiseGate()
    : micSource(NULL)
    , filter(NULL)
    , settings(NULL)
    , config()
    , isDisabledFromConfig(false)
    //, isEnabled() // Initialized in LoadDefaults()
    //, openThreshold()
    //, closeThreshold()
    //, attackTime()
    //, holdTime()
    //, releaseTime()
{
    LoadDefaults();
    config.Open(OBSGetPluginDataPath() + CONFIG_FILENAME, true);
    LoadSettings();

    // Create settings pane
    settings = new NoiseGateSettings(this);
    OBSAddSettingsPane(settings);
}
/*
	Loads the default values expected for Configuration.  This will also load the settings from a file if the configuration file exists
*/
void Configuration::LoadDefaults()
{
	DSoundCnt = 0;
	SelectedDSound = 0;

	safe_strcpy(Configuration::configAudioLogFolder, 499, "D:\\");
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) && !defined(_XBOX)
	strcpy_s(Configuration::configAudioLogFolder, 500, "D:\\");
	strcpy_s(Configuration::configDevice, 100, "");
#else
	strcpy(Configuration::configAudioLogFolder, "D:\\");
	strcpy(Configuration::configDevice, "");
#endif
	// TODO: Query the system and get defaults (windows only?)
	configFrequency = 48000; // Not implemented -- needs testing
	configBitRate   = 24;    // Not implemented -- needs testing
	configBufferLevel = 2;  // NewAudio only - How many frames to buffer
	configBufferFPS = 90;   // NewAudio only - How much data to frame per second
	configBackendFPS = 90;  // NewAudio only - How much data to frame per second
	LoadSettings();	
}
Example #12
0
MainWindow::MainWindow(const char* name, BRect frame, BMessage* settings)
	:
	BWindow(frame, name,
		B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
		B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE
		| B_WILL_ACCEPT_FIRST_CLICK | B_NO_WORKSPACE_ACTIVATION
		| B_AUTO_UPDATE_SIZE_LIMITS | B_SAME_POSITION_IN_ALL_WORKSPACES,
		B_ALL_WORKSPACES),
	fSettings(settings),
	fPadView(new PadView("pad view")),
	fLastID(0),
	fNamePanelFrame(-1000.0, -1000.0, -900.0, -900.0),
	fAutoRaise(false),
	fShowOnAllWorkspaces(true)
{
	if (!LoadSettings(settings))
		_AddEmptyButtons();

	SetLayout(new BGroupLayout(B_HORIZONTAL));
	AddChild(fPadView);
}
Example #13
0
Feeder::Feeder(BHandler *target)
	: BLooper("feeder"),
	  fMonitorRemovableDevices(false),
	  fQueryList(1),
	  fIndexQueue(10),
	  fDeleteQueue(10),
	  fExcludeList(1),
	  fVolumeList(1),
	  fUpdateInterval(30 * 1000000)

{
	BMessage settings('sett') ;
	if (load_settings(&settings) == B_OK)
		LoadSettings(&settings) ;

	fTarget = target ;
	fMessageRunner = new BMessageRunner(fTarget,
		new BMessage(BEACON_UPDATE_INDEX), fUpdateInterval) ;
	
	Run() ;
}
Example #14
0
	// Attempts to open the specified file and read in formatted data. If an error occurs
	// while attempting to read from the file, will throw a FileReadException. If there is a syntax
	// error, will throw a SettingsFileSyntaxError with one of these types:
	// SettingsFile::SyntaxError::BAD_VARIABLE_NAME if there is a problem with the variable name; or
	// SettingsFile::SyntaxError::BAD_VALUE if there is a problem with a variable's value.
	SettingsFile::SettingsFile(const std::string& file_name)
	{
		std::ifstream file;
		// First, tell the file not to throw any exceptions.
		file.exceptions(std::ios_base::goodbit);
		// Now attempt to open the specified file name for reading.
		file.open(file_name.c_str(), std::ios_base::in);
		// Check to see if the file was successfully opened. If not, then throw a FileReadException.
		if(file.fail() == true)
		{
			file.close();
			throw FileNotFoundException(file_name);
		}
		// At this point, the file should be ready for reading. Read the file into memory.
		StringVector lines;
		LoadFileToString(file, lines, file_name);
		// Close the file.
		file.close();
		// Load the settings from the file.
		LoadSettings(lines, file_name);
	}
Example #15
0
void CKadSearchListCtrl::Init()
{
	SetPrefsKey(_T("KadSearchListCtrl"));
	SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);

	InsertColumn(colNum,			GetResString(IDS_NUMBER),		LVCFMT_LEFT,  60);
	InsertColumn(colKey,			GetResString(IDS_KEY),			LVCFMT_LEFT, DFLT_HASH_COL_WIDTH);
	InsertColumn(colType,			GetResString(IDS_TYPE),			LVCFMT_LEFT, 100);
	InsertColumn(colName,			GetResString(IDS_SW_NAME),		LVCFMT_LEFT, DFLT_FILENAME_COL_WIDTH);
	InsertColumn(colStop,			GetResString(IDS_STATUS),		LVCFMT_LEFT, 100);
	InsertColumn(colLoad,			GetResString(IDS_THELOAD),		LVCFMT_LEFT, 100);
	InsertColumn(colPacketsSent,	GetResString(IDS_PACKSENT),		LVCFMT_LEFT, 100);
	InsertColumn(colResponses,		GetResString(IDS_RESPONSES),	LVCFMT_LEFT, 100);
	
	SetAllIcons();
	Localize();

	LoadSettings();
	SetSortArrow();
	SortItems(SortProc, MAKELONG(GetSortItem(), (GetSortAscending() ? 0 : 0x0001)));
}
Example #16
0
MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) :
	QMainWindow(parent, flags)
{
	setMinimumSize(QSize(300, 200));
	setWindowTitle(TITLE);
	setDockNestingEnabled(true);
	resize(850, 650);

	// Set QMainWindow in the center of desktop
	QRect rect = geometry();
	rect.moveCenter(QApplication::desktop()->availableGeometry().center());
	setGeometry(rect);

	_mainDescTextBox = new QspTextBox(this);
	setCentralWidget(_mainDescTextBox);

	CreateDockWindows();
	CreateMenuBar();

	LoadSettings();
}
Example #17
0
void CAddon::UpdateSetting(const std::string& key, const std::string& value)
{
  if (key.empty() || !LoadSettings(false))
    return;

  // try to get the setting
  auto setting = m_settings->GetSetting(key);

  // if the setting doesn't exist, try to add it
  if (setting == nullptr)
  {
    setting = m_settings->AddSetting(key, value);
    if (setting == nullptr)
    {
      CLog::Log(LOGERROR, "CAddon[%s]: failed to add undefined setting \"%s\"", ID().c_str(), key.c_str());
      return;
    }
  }

  setting->FromString(value);
}
Example #18
0
BOOL CPPgSecurity::OnApply()
{
	TCHAR buffer[510];
	if(GetDlgItem(IDC_FILTERLEVEL)->GetWindowTextLength())
	{
		GetDlgItem(IDC_FILTERLEVEL)->GetWindowText(buffer,4);
		thePrefs.filterlevel=_tstoi(buffer);
	}

	thePrefs.filterserverbyip = (uint8)IsDlgButtonChecked(IDC_FILTERSERVERBYIPFILTER);
	thePrefs.msgonlyfriends = (uint8)IsDlgButtonChecked(IDC_MSGONLYFRIENDS);
	thePrefs.msgsecure = (uint8)IsDlgButtonChecked(IDC_MSGONLYSEC);
	thePrefs.m_bAdvancedSpamfilter = IsDlgButtonChecked(IDC_ADVSPAMFILTER);
	thePrefs.m_bUseSecureIdent = IsDlgButtonChecked(IDC_USESECIDENT);
	thePrefs.m_bRunAsUser = (uint8)IsDlgButtonChecked(IDC_RUNASUSER);

	GetDlgItem(IDC_FILTER)->GetWindowText(thePrefs.messageFilter,ARRSIZE(thePrefs.messageFilter));

	CString strCommentFilters;
	GetDlgItem(IDC_COMMENTFILTER)->GetWindowText(strCommentFilters);
	strCommentFilters.MakeLower();
	CString strNewCommentFilters;
	int curPos = 0;
	CString strFilter(strCommentFilters.Tokenize(_T("|"), curPos));
	while (!strFilter.IsEmpty())
	{
		strFilter.Trim();
		if (!strNewCommentFilters.IsEmpty())
			strNewCommentFilters += _T('|');
		strNewCommentFilters += strFilter;
		strFilter = strCommentFilters.Tokenize(_T("|"), curPos);
	}
	thePrefs.commentFilter = strNewCommentFilters;
	if (thePrefs.commentFilter != strCommentFilters)
		SetDlgItemText(IDC_COMMENTFILTER, thePrefs.commentFilter);

	LoadSettings();
	SetModified(FALSE);
	return CPropertyPage::OnApply();
}
Example #19
0
BOOL CPPgSecurity::OnInitDialog()
{
	CPropertyPage::OnInitDialog();
	InitWindowStyles(this);

	LoadSettings();
	Localize();

	if (thePrefs.GetUseAutocompletion()) {
		if (!m_pacIPFilterURL) {
			m_pacIPFilterURL = new CCustomAutoComplete();
			m_pacIPFilterURL->AddRef();
			if (m_pacIPFilterURL->Bind(::GetDlgItem(m_hWnd, IDC_UPDATEURL), ACO_UPDOWNKEYDROPSLIST | ACO_AUTOSUGGEST | ACO_FILTERPREFIXES ))
				m_pacIPFilterURL->LoadList(thePrefs.GetMuleDirectory(EMULE_CONFIGDIR) + IPFILTERUPDATEURL_STRINGS_PROFILE);
		}
		SetDlgItemText(IDC_UPDATEURL,m_pacIPFilterURL->GetItem(0));
		if (theApp.m_fontSymbol.m_hObject) {
			GetDlgItem(IDC_DD)->SetFont(&theApp.m_fontSymbol);
			GetDlgItem(IDC_DD)->SetWindowText(_T("6")); // show a down-arrow
		}
	}
	else
		GetDlgItem(IDC_DD)->ShowWindow(SW_HIDE);

	//Xman auto update IPFilter
	CString url;
	GetDlgItemText(IDC_UPDATEURL,url);
	//in case we don't use Auto-completion we have to take the prefs-value
	if (url.IsEmpty())
		SetDlgItemText(IDC_UPDATEURL, thePrefs.GetAutoUpdateIPFilter_URL());
	else
	{
		//in case we use the auto-completion we must update the prefs-value 
		thePrefs.SetAutoUpdateIPFilter_URL(url);
	}
	//Xman end

	return TRUE;  // return TRUE unless you set the focus to a control
				  // EXCEPTION: OCX Property Pages should return FALSE
}
Example #20
0
BOOL CPPgSecurity::OnApply()
{
	bool bIPFilterSettingsChanged = false;

	TCHAR buffer[510];
	if (GetDlgItem(IDC_FILTERLEVEL)->GetWindowTextLength()) {
		GetDlgItem(IDC_FILTERLEVEL)->GetWindowText(buffer, 4);
		int iNewFilterLevel = _tstoi(buffer);
		if (iNewFilterLevel >= 0 && (UINT)iNewFilterLevel != thePrefs.filterlevel) {
			thePrefs.filterlevel = iNewFilterLevel;
			bIPFilterSettingsChanged = IsDlgButtonChecked(IDC_FILTERSERVERBYIPFILTER)!=0;
		}
	}
	if (!thePrefs.filterserverbyip && IsDlgButtonChecked(IDC_FILTERSERVERBYIPFILTER)!=0)
		bIPFilterSettingsChanged = true;
	thePrefs.filterserverbyip = IsDlgButtonChecked(IDC_FILTERSERVERBYIPFILTER)!=0;
	if (bIPFilterSettingsChanged)
		theApp.emuledlg->serverwnd->serverlistctrl.RemoveAllFilteredServers();

	thePrefs.m_bUseSecureIdent = IsDlgButtonChecked(IDC_USESECIDENT)!=0;
	thePrefs.m_bRunAsUser = IsDlgButtonChecked(IDC_RUNASUSER)!=0;

	thePrefs.m_bCryptLayerRequested = IsDlgButtonChecked(IDC_ENABLEOBFUSCATION) != 0;
	thePrefs.m_bCryptLayerRequired = IsDlgButtonChecked(IDC_ONLYOBFUSCATED) != 0;
	thePrefs.m_bCryptLayerSupported = IsDlgButtonChecked(IDC_DISABLEOBFUSCATION) == 0;

	thePrefs.m_bEnableSearchResultFilter = IsDlgButtonChecked(IDC_SEARCHSPAMFILTER) != 0;


	if (IsDlgButtonChecked(IDC_SEESHARE1))
		thePrefs.m_iSeeShares = vsfaEverybody;
	else if (IsDlgButtonChecked(IDC_SEESHARE2))
		thePrefs.m_iSeeShares = vsfaFriends;
	else
		thePrefs.m_iSeeShares = vsfaNobody;

	LoadSettings();
	SetModified(FALSE);
	return CPropertyPage::OnApply();
}
Example #21
0
bool WabbitemuApp::OnInit()
{
	wxImage::AddHandler(new wxPNGHandler);
	//stolen from the windows version
	ParseCommandLineArgs();

	memset(frames, 0, sizeof(frames));
	LPCALC lpCalc = calc_slot_new();
	LoadSettings(lpCalc);
	
	WabbitemuFrame *frame;
	int result = rom_load(lpCalc, lpCalc->rom_path);
	if (result == TRUE) {
		frame = gui_frame(lpCalc);
	} else {
		calc_slot_free(lpCalc);
		BOOL loadedRom = FALSE;
		if (parsedArgs.num_rom_files > 0) {
			for (int i = 0; i < parsedArgs.num_rom_files; i++) {
				if (rom_load(lpCalc, parsedArgs.rom_files[i])) {
					gui_frame(lpCalc);
					loadedRom = TRUE;
					break;
				}
			}
		}
		if (!loadedRom) {
			bool success = DoRomWizard();
			if (!success) {
				return FALSE;
			}
		}
	}
	LoadCommandlineFiles((INT_PTR) lpCalc, LoadToLPCALC);
	timer = new wxTimer();
	timer->Connect(wxEVT_TIMER, (wxObjectEventFunction) &WabbitemuApp::OnTimer);
	timer->Start(TPF, false);
	return TRUE;
}
Example #22
0
MidiPlayerWindow::MidiPlayerWindow()
    : BWindow(BRect(0, 0, 1, 1), B_TRANSLATE("MidiPlayer"), B_TITLED_WINDOW,
              B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS)
{
    playing = false;
    scopeEnabled = true;
    reverb = B_REVERB_BALLROOM;
    volume = 75;
    windowX = -1;
    windowY = -1;
    inputId = -1;
    instrLoaded = false;

    be_synth->SetSamplingRate(44100);

    bridge = new SynthBridge;
    //bridge->Register();

    CreateViews();
    LoadSettings();
    InitControls();
}
void EnhancementsWidget::SaveSettings()
{
  if (m_block_save)
    return;

  bool is_ssaa = m_aa_combo->currentText().endsWith(QStringLiteral("SSAA"));

  int aa_value = m_aa_combo->currentIndex();

  if (aa_value == 0)
  {
    aa_value = 1;
  }
  else
  {
    if (aa_value > m_msaa_modes)
      aa_value -= m_msaa_modes;
    aa_value = std::pow(2, aa_value);
  }
  Config::SetBaseOrCurrent(Config::GFX_MSAA, static_cast<unsigned int>(aa_value));

  Config::SetBaseOrCurrent(Config::GFX_SSAA, is_ssaa);

  Config::SetBaseOrCurrent(Config::GFX_ENHANCE_POST_SHADER,
                           m_pp_effect->currentText().toStdString());

  PostProcessingShaderConfiguration pp_shader;
  if (Config::Get(Config::GFX_ENHANCE_POST_SHADER) != "(off)")
  {
    pp_shader.LoadShader(Config::Get(Config::GFX_ENHANCE_POST_SHADER));
    m_configure_pp_effect->setEnabled(pp_shader.HasOptions());
  }
  else
  {
    m_configure_pp_effect->setEnabled(false);
  }

  LoadSettings();
}
Example #24
0
// Window constructor
dlgConfig::dlgConfig(launchercfg_t *cfg, wxWindow *parent, wxWindowID id)
{
    // Set up the dialog and its widgets
    wxXmlResource::Get()->LoadDialog(this, parent, _T("dlgConfig"));

    m_ChkCtrlGetListOnStart = wxStaticCast(FindWindow(Id_ChkCtrlGetListOnStart), wxCheckBox);
    m_ChkCtrlShowBlockedServers = wxStaticCast(FindWindow(Id_ChkCtrlShowBlockedServers), wxCheckBox);

    m_LstCtrlWadDirectories = wxStaticCast(FindWindow(Id_LstCtrlWadDirectories), wxListBox);

    m_DirCtrlChooseWadDir = wxStaticCast(FindWindow(Id_DirCtrlChooseWadDir), wxDirPickerCtrl);
    m_DirCtrlChooseOdamexPath = wxStaticCast(FindWindow(Id_DirCtrlChooseOdamexPath), wxDirPickerCtrl);

    m_TxtCtrlMasterTimeout = wxStaticCast(FindWindow(Id_TxtCtrlMasterTimeout), wxTextCtrl);
    m_TxtCtrlServerTimeout = wxStaticCast(FindWindow(Id_TxtCtrlServerTimeout), wxTextCtrl);
    m_TxtCtrlExtraCmdLineArgs = wxStaticCast(FindWindow(Id_TxtCtrlExtraCmdLineArgs), wxTextCtrl);

    // Load current configuration from global configuration structure
    cfg_file = cfg;

    LoadSettings();
}
Example #25
0
//---------------------------------------------------------------------------
__fastcall TParallelPort::TParallelPort(TComponent* Owner)
        : TForm(Owner)
{
        TIniFile *ini;

        ComPortList->Items->Add("Nothing");
        ComPortList->Items->Add("FILE...");
        ComPortList->Items->Add("TCP/IP...");
        if (access("nocomport",0)) EnumeratePorts(ComPortList->Items,"COM");
        if (access("nocomport",0)) EnumeratePorts(ComPortList->Items,"LPT");
        ComPortList->ItemIndex=0;
        BaudRate->ItemIndex=0;
        DataBits->ItemIndex=3;
        StopBits->ItemIndex=0;
        Parity->ItemIndex=0;

        ComPortListChange(NULL);

        ini = new TIniFile(zx81.inipath);
        LoadSettings(ini);
        delete ini;
}
Example #26
0
// SpaceBall_Create():
LWInstance SpaceBall_Create( void *data, void *context, LWError *error ) {
  // Check for LWSN; if so, exit now
  unsigned long sysid = ( unsigned long )global( LWSYSTEMID_GLOBAL, GFUSE_TRANSIENT );
  if( (sysid & LWSYS_TYPEBITS) != LWSYS_LAYOUT )
    return &instance_count;

  if( instance_count > 0 ) {
    *error = "SpaceBall Error:  Only one instance of the driver can be activate at a time";
    return NULL;
  }

  instance_count++;

  // Get some globals
  command         = (LWCommandFunc   *)global( "LW Command Interface",   GFUSE_ACQUIRE );
  instance_update = (LWInstUpdate    *)global( LWINSTUPDATE_GLOBAL,      GFUSE_ACQUIRE );
  hdi             = (HostDisplayInfo *)global( LWHOSTDISPLAYINFO_GLOBAL, GFUSE_ACQUIRE );
  message         = (LWMessageFuncs  *)global( LWMESSAGEFUNCS_GLOBAL,    GFUSE_ACQUIRE );

  // Hijack Layout's window function
  orig_window_proc = (WNDPROC)SetWindowLong( hdi->window, GWL_WNDPROC, (long)SpaceBallWindowProc );

  // Load Settings
  LoadSettings();

  // Initialize the SpaceBall drivers
  SiInitialize();
  SiOpenWinInit (&oData, hdi->window);
  SiSetUiMode(hdl, (open_config_on_startup ? SI_UI_ALL_CONTROLS : SI_UI_NO_CONTROLS ) );
  hdl = SiOpen ("Lightwave 3D (Layout)", SI_ANY_DEVICE, SI_NO_MASK, SI_EVENT, &oData);
  if( hdl == SI_NO_HANDLE)  {
    SpaceBall_End();
    *error = "SpaceBall Error:  Couldn't open spaceball drivers";
    return NULL;
  }

  error = NULL;
  return &instance_count;
}
Example #27
0
// 初期化処理
bool CEqualizer::Initialize()
{
	// INIファイル名の取得
	::GetModuleFileName(g_hinstDLL,m_szIniFileName,MAX_PATH);
	::PathRenameExtension(m_szIniFileName,TEXT(".ini"));

	// ウィンドウクラスの登録
	WNDCLASS wc;
	wc.style=0;
	wc.lpfnWndProc=WndProc;
	wc.cbClsExtra=0;
	wc.cbWndExtra=0;
	wc.hInstance=g_hinstDLL;
	wc.hIcon=NULL;
	wc.hCursor=::LoadCursor(NULL,IDC_ARROW);
	wc.hbrBackground=NULL;
	wc.lpszMenuName=NULL;
	wc.lpszClassName=EQUALIZER_WINDOW_CLASS;
	if (::RegisterClass(&wc)==0)
		return false;

	// イコライザ初期化
	m_BandPass.Initialize(m_FreqTable,NUM_FREQUENCY-1,48000);

	// コマンドを登録
	m_pApp->RegisterCommand(1, L"Enable", L"イコライザOn/Off");

	// イベントコールバック関数を登録
	m_pApp->SetEventCallback(EventCallback,this);

	bool fEnable=::GetPrivateProfileInt(TEXT("Settings"),TEXT("Enable"),0,m_szIniFileName)!=0;
	if (fEnable) {
		LoadSettings();
		EnableEqualizer(true);
	}

	return true;
}
Example #28
0
extern "C" int __declspec(dllexport) Load(void)
{
#ifdef _DEBUG
	_OutputDebugString(_T("Entering Load dll"));
#endif

	mir_getLP(&pluginInfo);
	mir_getCLI();

	hExceptionsMutex = CreateMutex(NULL, FALSE, _T("ExceptionsMutex"));

	LoadSettings();
	connExceptions = LoadSettingsConnections();

	PROTOCOLDESCRIPTOR pd = { 0 };
	pd.cbSize = sizeof(pd);
	pd.szName = PLUGINNAME;
	pd.type = PROTOTYPE_PROTOCOL;
	Proto_RegisterModule(&pd);

	//set all contacts to offline
	for (MCONTACT hContact = db_find_first(PLUGINNAME); hContact != NULL; hContact = db_find_next(hContact, PLUGINNAME))
		db_set_w(hContact, PLUGINNAME, "status", ID_STATUS_OFFLINE);

	CreateProtoServiceFunction(PLUGINNAME, PS_GETCAPS, GetCaps);
	CreateProtoServiceFunction(PLUGINNAME, PS_GETNAME, GetName);
	CreateProtoServiceFunction(PLUGINNAME, PS_LOADICON, TMLoadIcon);
	CreateProtoServiceFunction(PLUGINNAME, PS_SETSTATUS, SetStatus);
	CreateProtoServiceFunction(PLUGINNAME, PS_GETSTATUS, GetStatus);

	SkinAddNewSoundEx(PLUGINNAME_NEWSOUND, PLUGINNAME, LPGEN("New Connection Notification"));
	hOptInit = HookEvent(ME_OPT_INITIALISE, ConnectionNotifyOptInit);//register service to hook option call
	assert(hOptInit);
	hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, modulesloaded);//hook event that all plugins are loaded
	assert(hHookModulesLoaded);
	hHookPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, preshutdown);
	return 0;
}
Example #29
0
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
	static bool patched = false;
	srand((uint)time(0));

	// If we're being loaded from the command line while FLHook is running then
	// set_scCfgFile will not be empty so load the settings as FLHook only
	// calls load settings on FLHook startup and .rehash.
	if (fdwReason == DLL_PROCESS_ATTACH)
	{
		if (set_scCfgFile.length()>0)
			LoadSettings();

		if (!patched)
		{
			patched = true;
			PatchCallAddr((char*)hModServer, 0x6c547, (char*)HkCb_UpdateFileNaked);
			PatchCallAddr((char*)hModServer, 0x6c9cd, (char*)HkCb_UpdateFileNaked);
		}
	}
	else if (fdwReason == DLL_PROCESS_DETACH)
	{
		if (patched)
		{
			patched = false;
			{
				BYTE patch[] = { 0xE8, 0x84, 0x07, 0x00, 0x00 };
				WriteProcMem((char*)hModServer + 0x6c547, patch, 5);
			}

			{
				BYTE patch[] = { 0xE8, 0xFE, 0x2, 0x00, 0x00 };
				WriteProcMem((char*)hModServer + 0x6c9cd, patch, 5);
			}
		}
	}
	return true;
}
// Window constructor
dlgConfig::dlgConfig(launchercfg_t *cfg, wxWindow *parent, wxWindowID id)
{
    // Set up the dialog and its widgets
    wxXmlResource::Get()->LoadDialog(this, parent, _T("dlgConfig"));

    m_ChkCtrlGetListOnStart = XRCCTRL(*this, "Id_ChkCtrlGetListOnStart", wxCheckBox);
    m_ChkCtrlShowBlockedServers = XRCCTRL(*this, "Id_ChkCtrlShowBlockedServers", wxCheckBox);
    m_ChkCtrlEnableBroadcasts = XRCCTRL(*this, "Id_ChkCtrlEnableBroadcasts", wxCheckBox);

    m_LstCtrlWadDirectories = XRCCTRL(*this, "Id_LstCtrlWadDirectories", wxListBox);

    m_DirCtrlChooseOdamexPath = XRCCTRL(*this, "Id_DirCtrlChooseOdamexPath", wxDirPickerCtrl);

    m_SpnCtrlMasterTimeout = XRCCTRL(*this, "Id_SpnCtrlMasterTimeout", wxSpinCtrl);
    m_SpnCtrlServerTimeout = XRCCTRL(*this, "Id_SpnCtrlServerTimeout", wxSpinCtrl);
    m_SpnCtrlRetry = XRCCTRL(*this, "Id_SpnCtrlRetry", wxSpinCtrl);
    m_TxtCtrlExtraCmdLineArgs = XRCCTRL(*this, "Id_TxtCtrlExtraCmdLineArgs", wxTextCtrl);

    m_SpnCtrlPQGood = XRCCTRL(*this, "Id_SpnCtrlPQGood", wxSpinCtrl);
    m_SpnCtrlPQPlayable = XRCCTRL(*this, "Id_SpnCtrlPQPlayable", wxSpinCtrl);
    m_SpnCtrlPQLaggy = XRCCTRL(*this, "Id_SpnCtrlPQLaggy", wxSpinCtrl);

    m_StcBmpPQGood = XRCCTRL(*this, "Id_StcBmpPQGood", wxStaticBitmap);
    m_StcBmpPQPlayable = XRCCTRL(*this, "Id_StcBmpPQPlayable", wxStaticBitmap);
    m_StcBmpPQLaggy = XRCCTRL(*this, "Id_StcBmpPQLaggy", wxStaticBitmap);
    m_StcBmpPQBad = XRCCTRL(*this, "Id_StcBmpPQBad", wxStaticBitmap);

    // Ping quality icons
    m_StcBmpPQGood->SetBitmap(wxXmlResource::Get()->LoadBitmap(wxT("bullet_green")));
    m_StcBmpPQPlayable->SetBitmap(wxXmlResource::Get()->LoadBitmap(wxT("bullet_orange")));
    m_StcBmpPQLaggy->SetBitmap(wxXmlResource::Get()->LoadBitmap(wxT("bullet_red")));
    m_StcBmpPQBad->SetBitmap(wxXmlResource::Get()->LoadBitmap(wxT("bullet_gray")));

    // Load current configuration from global configuration structure
    cfg_file = cfg;

    LoadSettings();
}