Пример #1
0
/////////////////////////////////////////////////////////////////////////////
//
// ENTRY:
//
// PURPOSE:    Set the VKey Ctrl/Alt/Shift check boxes
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
PostBSetVKey( zVIEW vSubtask )
{
   zULONG ulLth = sizeof( zACCEL_DEF );
   zVIEW  vHotkey;
   zACCEL_DEF ac;

   GetViewByName( &vHotkey, "KZHKEYSO", vSubtask, zLEVEL_ANY );
   if ( vHotkey &&
        CheckExistenceOfEntity( vHotkey, "Hotkey" ) > zCURSOR_UNCHANGED )
   {
      GetBlobFromAttribute( &ac, &ulLth, vHotkey, "Hotkey", "KeyCombo" );
      SetCtrlState( vSubtask, "Ctrl", zCONTROL_STATUS_CHECKED, ac.fCtrl );
      SetCtrlState( vSubtask, "Alt", zCONTROL_STATUS_CHECKED, ac.fAlt );
      SetCtrlState( vSubtask, "Shift", zCONTROL_STATUS_CHECKED, ac.fShift );
//    if ( CheckExistenceOfEntity( vHotkey, "Operation" ) > zCURSOR_UNCHANGED )
//    {
//       zPCHAR pch;
//
//       GetAddrForAttribute( &pch, vHotkey, "Operation", "DLL_Name" );
//       SetCtrlText( vSubtask, "DLL_Name", pch );
//    }
   }

   return( 0 );
}
Пример #2
0
bool COptionsPageEdit::LoadPage()
{
	bool failure = false;

	COptions* pOptions = COptions::Get();

	wxString editor = pOptions->GetOption(OPTION_EDIT_DEFAULTEDITOR);
	if (editor.empty() || editor[0] == '0')
		SetRCheck(XRCID("ID_DEFAULT_NONE"), true, failure);
	else if (editor[0] == '1')
		SetRCheck(XRCID("ID_DEFAULT_TEXT"), true, failure);
	else
	{
		if (editor[0] == '2')
			editor = editor.Mid(1);

		SetRCheck(XRCID("ID_DEFAULT_CUSTOM"), true, failure);
		SetText(XRCID("ID_EDITOR"), editor, failure);
	}

	if (pOptions->GetOptionVal(OPTION_EDIT_ALWAYSDEFAULT))
		SetRCheck(XRCID("ID_USEDEFAULT"), true, failure);
	else
		SetRCheck(XRCID("ID_USEASSOCIATIONS"), true, failure);

	SetCheckFromOption(XRCID("ID_EDIT_TRACK_LOCAL"), OPTION_EDIT_TRACK_LOCAL, failure);

	if (!failure)
		SetCtrlState();

	return !failure;
}
Пример #3
0
void CUsersDlg::OnSelchangeUserlist()
{
	m_insideSelchange = true;
	if (!Validate()) {
		m_insideSelchange = false;
		return;
	}
	m_insideSelchange = false;

	if (m_olduser != LB_ERR) {
		int oldindex = m_cUserlist.GetItemData(m_olduser);
		t_user & user = m_UsersList[oldindex];
		SaveUser(user);
	}
	int nItem = m_cUserlist.GetCurSel();
	if (nItem != LB_ERR) {
		m_olduser = nItem;
		int index = m_cUserlist.GetItemData(nItem);
		VERIFY(m_pGeneralPage->DisplayUser(&m_UsersList[index]));
		VERIFY(m_pSpeedLimitPage->DisplayUser(&m_UsersList[index]));
		VERIFY(m_pSharedFoldersPage->DisplayUser(&m_UsersList[index]));
		VERIFY(m_pIpFilterPage->DisplayUser(&m_UsersList[index]));
	}
	else {
		VERIFY(m_pGeneralPage->DisplayUser(NULL));
		VERIFY(m_pSpeedLimitPage->DisplayUser(NULL));
		VERIFY(m_pSharedFoldersPage->DisplayUser(0));
		VERIFY(m_pIpFilterPage->DisplayUser(0));
	}
	m_pGeneralPage->UpdateData(FALSE);

	SetCtrlState();
}
Пример #4
0
bool CFilterDialog::Create(CMainFrame* parent)
{
	m_pMainFrame = parent;

	if (!Load(parent, _T("ID_FILTER")))
		return false;

	XRCCTRL(*this, "ID_LOCALFILTERS", wxCheckListBox)->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(CFilterDialog::OnMouseEvent), 0, this);
	XRCCTRL(*this, "ID_LOCALFILTERS", wxCheckListBox)->Connect(wxID_ANY, wxEVT_KEY_DOWN, wxKeyEventHandler(CFilterDialog::OnKeyEvent), 0, this);
	XRCCTRL(*this, "ID_REMOTEFILTERS", wxCheckListBox)->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(CFilterDialog::OnMouseEvent), 0, this);
	XRCCTRL(*this, "ID_REMOTEFILTERS", wxCheckListBox)->Connect(wxID_ANY, wxEVT_KEY_DOWN, wxKeyEventHandler(CFilterDialog::OnKeyEvent), 0, this);

	DisplayFilters();

	wxChoice* pChoice = XRCCTRL(*this, "ID_SETS", wxChoice);
	wxString name = _("Custom filter set");
	pChoice->Append(_T("<") + name + _T(">"));
	for (unsigned int i = 1; i < m_filterSets.size(); i++)
		pChoice->Append(m_filterSets[i].name);
	pChoice->SetSelection(m_currentFilterSet);
	SetCtrlState();

	GetSizer()->Fit(this);

	return true;
}
bool COptionsPageDateFormatting::LoadPage()
{
	bool failure = false;

	const wxString& dateFormat = m_pOptions->GetOption(OPTION_DATE_FORMAT);
	if (dateFormat == _T("1"))
		SetRCheck(XRCID("ID_DATEFORMAT_ISO"), true, failure);
	else if (dateFormat[0] == '2')
	{
		SetRCheck(XRCID("ID_DATEFORMAT_CUSTOM"), true, failure);
		SetText(XRCID("ID_CUSTOM_DATEFORMAT"), dateFormat.Mid(1), failure);
	}
	else
		SetRCheck(XRCID("ID_DATEFORMAT_DEFAULT"), true, failure);

	const wxString& timeFormat = m_pOptions->GetOption(OPTION_TIME_FORMAT);
	if (timeFormat == _T("1"))
		SetRCheck(XRCID("ID_TIMEFORMAT_ISO"), true, failure);
	else if (timeFormat[0] == '2')
	{
		SetRCheck(XRCID("ID_TIMEFORMAT_CUSTOM"), true, failure);
		SetText(XRCID("ID_CUSTOM_TIMEFORMAT"), timeFormat.Mid(1), failure);
	}
	else
		SetRCheck(XRCID("ID_TIMEFORMAT_DEFAULT"), true, failure);

	if (!failure)
		SetCtrlState();

	return !failure;
}
BOOL CGroupsDlgSharedFolders::OnInitDialog() 
{
	CSAPrefsSubDlg::OnInitDialog();
	
	m_cDirs.InsertColumn(0, _T("Directories"), LVCFMT_LEFT, 120);
	m_cDirs.InsertColumn(1, _T("Aliases"), LVCFMT_LEFT, 200);
	UpdateData(FALSE);
	
	m_imagelist.Create(16, 16, ILC_MASK, 3, 3);
	HICON icon;
	icon = AfxGetApp()->LoadIcon(IDI_EMPTY);
	m_imagelist.Add(icon);
	DestroyIcon(icon);
	icon = AfxGetApp()->LoadIcon(IDI_HOME);
	m_imagelist.Add(icon);
	DestroyIcon(icon);
	
	m_cDirs.SetImageList(&m_imagelist, LVSIL_SMALL);

	m_cDirs.SetExtendedStyle(LVS_EX_FULLROWSELECT);
			
	SetCtrlState();

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX-Propertypages should return FALSE
}
Пример #7
0
bool COptionsPageProxy::LoadPage()
{
	bool failure = false;

	SetTextFromOption(XRCID("ID_PROXY_HOST"), OPTION_PROXY_HOST, failure);
	SetTextFromOption(XRCID("ID_PROXY_PORT"), OPTION_PROXY_PORT, failure);
	SetTextFromOption(XRCID("ID_PROXY_USER"), OPTION_PROXY_USER, failure);
	SetTextFromOption(XRCID("ID_PROXY_PASS"), OPTION_PROXY_PASS, failure);

	int type = m_pOptions->GetOptionVal(OPTION_PROXY_TYPE);
	switch (type)
	{
	default:
	case 0:
		SetRCheck(XRCID("ID_PROXYTYPE_NONE"), true, failure);
		break;
	case 1:
		SetRCheck(XRCID("ID_PROXYTYPE_HTTP"), true, failure);
		break;
	case 2:
		SetRCheck(XRCID("ID_PROXYTYPE_SOCKS5"), true, failure);
		break;
	}

	if (!failure)
		SetCtrlState();

	return !failure;
}
Пример #8
0
bool COptionsPageLogging::LoadPage()
{
	bool failure = false;

	SetCheck(XRCID("ID_TIMESTAMPS"), m_pOptions->GetOptionVal(OPTION_MESSAGELOG_TIMESTAMP) ? true : false, failure);

	const wxString filename = m_pOptions->GetOption(OPTION_LOGGING_FILE);
	SetCheck(XRCID("ID_LOGFILE"), !filename.empty(), failure);
	SetText(XRCID("ID_FILENAME"), filename, failure);

	int limit = m_pOptions->GetOptionVal(OPTION_LOGGING_FILE_SIZELIMIT);
	if (limit < 0 || limit > 2000)
		limit = 0;
	SetCheck(XRCID("ID_DOLIMIT"), limit > 0, failure);
	if (!failure)
		XRCCTRL(*this, "ID_LIMIT", wxTextCtrl)->SetMaxLength(4);

	wxString v;
	if (limit > 0)
		v = wxString::Format(_T("%d"), limit);
	SetText(XRCID("ID_LIMIT"), v, failure);

	if (!failure)
		SetCtrlState();

	return !failure;
}
void CGroupsDlgSharedFolders::OnItemchangedDirs(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	
	t_group *pGroup = m_pOwner->GetCurrentGroup();
	if (!pGroup)
		return;
	
	int nItem = pNMListView->iItem;
	POSITION selpos = m_cDirs.GetFirstSelectedItemPosition();
	if (selpos)
	{
		if (m_cDirs.GetNextSelectedItem(selpos)!=nItem)
			return;
	}
	int index = pNMListView->lParam;
	if (nItem != -1)
	{
		m_bFilesRead = pGroup->permissions[index].bFileRead;
		m_bFilesWrite = pGroup->permissions[index].bFileWrite;
		m_bFilesDelete = pGroup->permissions[index].bFileDelete;
		m_bFilesAppend = pGroup->permissions[index].bFileAppend;
		m_bDirsCreate = pGroup->permissions[index].bDirCreate;
		m_bDirsDelete = pGroup->permissions[index].bDirDelete;
		m_bDirsList = pGroup->permissions[index].bDirList;
		m_bDirsSubdirs = pGroup->permissions[index].bDirSubdirs;
		m_bAutoCreate = pGroup->permissions[index].bAutoCreate;
	}
	UpdateData(FALSE);

	SetCtrlState();	
	*pResult = 0;
}
Пример #10
0
bool COptionsPageFtpProxy::LoadPage()
{
	bool failure = false;

	SetTextFromOption(XRCID("ID_PROXY_HOST"), OPTION_FTP_PROXY_HOST, failure);
	SetTextFromOption(XRCID("ID_PROXY_USER"), OPTION_FTP_PROXY_USER, failure);
	SetTextFromOption(XRCID("ID_PROXY_PASS"), OPTION_FTP_PROXY_PASS, failure);

	int type = m_pOptions->GetOptionVal(OPTION_FTP_PROXY_TYPE);
	switch (type)
	{
	default:
	case 0:
		SetRCheck(XRCID("ID_PROXYTYPE_NONE"), true, failure);
		break;
	case 1:
		SetRCheck(XRCID("ID_PROXYTYPE_USER"), true, failure);
		break;
	case 2:
		SetRCheck(XRCID("ID_PROXYTYPE_SITE"), true, failure);
		break;
	case 3:
		SetRCheck(XRCID("ID_PROXYTYPE_OPEN"), true, failure);
		break;
	case 4:
		SetRCheck(XRCID("ID_PROXYTYPE_CUSTOM"), true, failure);
		SetTextFromOption(XRCID("ID_LOGINSEQUENCE"), OPTION_FTP_PROXY_CUSTOMLOGINSEQUENCE, failure);
		break;
	}

	if (!failure)
		SetCtrlState();

	return !failure;
}
Пример #11
0
/////////////////////////////////////////////////////////////////////////////
//
//    OPERATION: SironCreateDataModel
//
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT /*GLOBAL */  OPERATION
SironCreateDataModel( zVIEW vSubtask,
                      zPVIEW pvERD )
{
   zVIEW  vERD_Window;
   zVIEW  vTaskLPLR;

   GetViewByName( &vTaskLPLR, "TaskLPLR", vSubtask, zLEVEL_TASK );

   ActivateEmptyMetaOI( vSubtask, pvERD, zSOURCE_ERD_META,
                        zSINGLE | zLEVEL_APPLICATION );

   // Build Root Instance
   CreateMetaEntity( vSubtask, *pvERD, "EntpER_Model", zPOS_AFTER );
   SetAttributeFromAttribute( *pvERD, "EntpER_Model", "Name", vTaskLPLR, "LPLR", "Name" );
   SetAttributeFromString( *pvERD, "EntpER_Model", "Desc", "Siron Catalogs DataModel" );
   SetNameForView( *pvERD, "TZEREMDO", vSubtask, zLEVEL_TASK );

   // Data Model exists, enable ERD Control
   GetParentWindow( &vERD_Window, vSubtask );
   SetCtrlState( vERD_Window, "ERD", zCONTROL_STATUS_ENABLED, TRUE );

   // Set window Title with check out state
   SetTitleWithCheckOutState( vERD_Window, "Data Model", "TZEREMDO", *pvERD,
                              "EntpER_Model", zSOURCE_ERD_META );
   return( 0 );
} // SironCreateDataModel
void CGroupsDlgSharedFolders::OnDirmenuRemove() 
{
t_group *pGroup = m_pOwner->GetCurrentGroup();
	if (!pGroup)
		return;
	
	POSITION selpos;
	selpos=m_cDirs.GetFirstSelectedItemPosition();
	if (!selpos)
		return;
	int nItem=m_cDirs.GetNextSelectedItem(selpos);
	int index=m_cDirs.GetItemData(nItem);
	m_cDirs.DeleteItem(nItem);
	int i=0;
	for (std::vector<t_directory>::iterator iter=pGroup->permissions.begin(); iter != pGroup->permissions.end(); iter++, i++)
		if (i==index)
		{
			pGroup->permissions.erase(iter);
			break;
		}
	for (i = 0; i < m_cDirs.GetItemCount(); i++)
	{
		int data = m_cDirs.GetItemData(i);
		if (data > index)
		{
			m_cDirs.SetItemData(i, data - 1);
		}
	}
	SetCtrlState();
}
bool COptionsPageConnectionSFTP::LoadPage()
{
	wxListCtrl* pKeys = XRCCTRL(*this, "ID_KEYS", wxListCtrl);
	if (!pKeys)
		return false;
	pKeys->InsertColumn(0, _("Filename"), wxLIST_FORMAT_LEFT, 150);
	pKeys->InsertColumn(1, _("Comment"), wxLIST_FORMAT_LEFT, 100);
	pKeys->InsertColumn(2, _("Data"), wxLIST_FORMAT_LEFT, 350);
	
	// Generic wxListCtrl has gross minsize
	wxSize size = pKeys->GetMinSize();
	size.x = 1;
	pKeys->SetMinSize(size);

	wxString keyFiles = m_pOptions->GetOption(OPTION_SFTP_KEYFILES);
	wxStringTokenizer tokens(keyFiles, _T("\n"), wxTOKEN_DEFAULT);
	while (tokens.HasMoreTokens())
		AddKey(tokens.GetNextToken(), true);

	bool failure = false;

	SetCtrlState();

	return !failure;
}
Пример #14
0
//:   VIEW TZZOLODO  REGISTERED AS TZZOLODO
zOPER_EXPORT zSHORT OPERATION
PostBuild( zVIEW     vSubtask )
{
   zVIEW     TZZOLODO = 0; 
   zSHORT    RESULT; 
   //:SHORT nIsCheckedOut
   zSHORT    nIsCheckedOut = 0; 

   RESULT = GetViewByName( &TZZOLODO, "TZZOLODO", vSubtask, zLEVEL_TASK );

   //:nIsCheckedOut = ComponentIsCheckedOut( vSubtask, TZZOLODO, zSOURCE_LOD_META )
   nIsCheckedOut = ComponentIsCheckedOut( vSubtask, TZZOLODO, zSOURCE_LOD_META );

   //:SetCtrlState( vSubtask, "pbSetXtoOne", zCONTROL_STATUS_ENABLED, nIsCheckedOut )
   SetCtrlState( vSubtask, "pbSetXtoOne", zCONTROL_STATUS_ENABLED, (zLONG) nIsCheckedOut );
   //:SetCtrlState( vSubtask, "pbRemoveAll", zCONTROL_STATUS_ENABLED, nIsCheckedOut )
   SetCtrlState( vSubtask, "pbRemoveAll", zCONTROL_STATUS_ENABLED, (zLONG) nIsCheckedOut );
   return( 0 );
// END
} 
BOOL CGroupsDlgGeneral::OnInitDialog() 
{
	CSAPrefsSubDlg::OnInitDialog();
	
	UpdateData(FALSE);
	
	SetCtrlState();

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX-Propertypages should return FALSE
}
Пример #16
0
void CSearchDialog::OnStateChange(CState* pState, enum t_statechange_notifications notification, const wxString& data, const void* data2)
{
	if (notification == STATECHANGE_REMOTE_DIR)
		ProcessDirectoryListing();
	else if (notification == STATECHANGE_REMOTE_IDLE)
	{
		if (pState->IsRemoteIdle())
			m_searching = false;
		SetCtrlState();
	}
}
Пример #17
0
BOOL CUsersDlgSpeedLimit::OnInitDialog() 
{
	CSAPrefsSubDlg::OnInitDialog();
	
	// TODO: Add extra initialization here
	SetCtrlState();

	ShowSpeedLimit( m_DownloadRulesListCtrl, m_DownloadSpeedLimits);
	ShowSpeedLimit( m_UploadRulesListCtrl, m_UploadSpeedLimits);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Пример #18
0
void CFilterEditDialog::OnFilterSelect(wxCommandEvent& event)
{
	int item = m_pFilterListCtrl->GetSelection();
	if (item == -1)
	{
		m_currentSelection = -1;
		SetCtrlState(false);
		return;
	}
	else
		SetCtrlState(true);

	if (item == m_currentSelection)
		return;

	if (m_currentSelection != -1)
	{
		wxASSERT((unsigned int)m_currentSelection < m_filters.size());

		if (!Validate())
			return;

		SaveFilter(m_filters[m_currentSelection]);
	}

	m_currentSelection = item;
	m_pFilterListCtrl->SetSelection(item); // In case SaveFilter has renamed an item
	CFilter filter = m_filters[item];
	EditFilter(filter);

	XRCCTRL(*this, "ID_CASE", wxCheckBox)->SetValue(filter.matchCase);

	XRCCTRL(*this, "ID_FILES", wxCheckBox)->SetValue(filter.filterFiles);
	XRCCTRL(*this, "ID_DIRS", wxCheckBox)->SetValue(filter.filterDirs);

	XRCCTRL(*this, "ID_NAME", wxTextCtrl)->SetValue(filter.name);
}
Пример #19
0
void CFilterDialog::OnSaveAs(wxCommandEvent& event)
{
	CInputDialog dlg;
	dlg.Create(this, _("Enter name for filterset"), _("Please enter a unique name for this filter set"));
	if (dlg.ShowModal() != wxID_OK)
		return;

	wxString name = dlg.GetValue();
	if (name == _T(""))
	{
		wxMessageBox(_("No name for the filterset given."), _("Cannot save filterset"), wxICON_INFORMATION);
		return;
	}
	wxChoice* pChoice = XRCCTRL(*this, "ID_SETS", wxChoice);

	CFilterSet set;
	int old_pos = pChoice->GetSelection();
	if (old_pos > 0)
		set = m_filterSets[old_pos];
	else
		set = m_filterSets[0];

	int pos = pChoice->FindString(name);
	if (pos != wxNOT_FOUND)
	{
		if (wxMessageBox(_("Given filterset name already exists, overwrite filter set?"), _("Filter set already exists"), wxICON_QUESTION | wxYES_NO) != wxYES)
			return;
	}

	if (pos == wxNOT_FOUND)
	{
		pos = m_filterSets.size();
		m_filterSets.push_back(set);
		pChoice->Append(name);
	}
	else
		m_filterSets[pos] = set;

	m_filterSets[pos].name = name;

	pChoice->SetSelection(pos);
	m_currentFilterSet = pos;

	SetCtrlState();

	GetSizer()->Fit(this);
}
BOOL CUsersDlgGeneral::OnInitDialog() 
{
	CSAPrefsSubDlg::OnInitDialog();
	
	m_bNeedpass = FALSE;
	m_Pass = _T("");
	UpdateData(FALSE);
	
	m_cGroup.AddString(_T("<none>"));
	for (CUsersDlg::t_GroupsList::iterator iter = m_pOwner->m_GroupsList.begin(); iter != m_pOwner->m_GroupsList.end(); iter++)
		m_cGroup.AddString(iter->group);

	SetCtrlState();

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben
}
bool COptionsPageInterface::LoadPage()
{
	bool failure = false;

	SetCheckFromOption(XRCID("ID_FILEPANESWAP"), OPTION_FILEPANE_SWAP, failure);
	SetChoice(XRCID("ID_FILEPANELAYOUT"), m_pOptions->GetOptionVal(OPTION_FILEPANE_LAYOUT), failure);

	SetChoice(XRCID("ID_MESSAGELOGPOS"), m_pOptions->GetOptionVal(OPTION_MESSAGELOG_POSITION), failure);

#ifndef __WXMAC__
	SetCheckFromOption(XRCID("ID_MINIMIZE_TRAY"), OPTION_MINIMIZE_TRAY, failure);
#endif

	SetCheckFromOption(XRCID("ID_PREVENT_IDLESLEEP"), OPTION_PREVENT_IDLESLEEP, failure);
	
	SetCheckFromOption(XRCID("ID_SPEED_DISPLAY"), OPTION_SPEED_DISPLAY, failure);

	if (!CPowerManagement::IsSupported())
		XRCCTRL(*this, "ID_PREVENT_IDLESLEEP", wxCheckBox)->Hide();

	if (m_pOptions->OptionFromFzDefaultsXml(OPTION_DEFAULT_KIOSKMODE) || m_pOptions->GetOptionVal(OPTION_DEFAULT_KIOSKMODE) == 2)
	{
		XRCCTRL(*this, "ID_DONT_SAVE_PASSWORDS", wxCheckBox)->SetValue(true);
		XRCCTRL(*this, "ID_DONT_SAVE_PASSWORDS", wxCheckBox)->Disable();
	}
	else
		SetCheckFromOption(XRCID("ID_DONT_SAVE_PASSWORDS"), OPTION_DEFAULT_KIOSKMODE, failure);

	SetCheckFromOption(XRCID("ID_INTERFACE_SITEMANAGER_ON_STARTUP"), OPTION_INTERFACE_SITEMANAGER_ON_STARTUP, failure);
	
	// Start of @td
	SetCheckFromOption(XRCID("ID_ENCRYPT_PASSWORDS"), OPTION_ENCRYPT_PASSWORDS, failure);
	wxString stars = wxString(DEFAULTVALUE, wxConvUTF8);
	SetText(XRCID("ID_MASTER_PASSWORD"), stars, failure); // @TODO : Better display...
	// End of @td
	
	if (!failure)
	{
		SetCtrlState();
	}

	return !failure;
}
bool COptionsPageConnectionActive::LoadPage()
{
	bool failure = false;
	SetCheckFromOption(XRCID("ID_LIMITPORTS"), OPTION_LIMITPORTS, failure);
	SetTextFromOption(XRCID("ID_LOWESTPORT"), OPTION_LIMITPORTS_LOW, failure);
	SetTextFromOption(XRCID("ID_HIGHESTPORT"), OPTION_LIMITPORTS_HIGH, failure);

	SetRCheck(XRCID("ID_ACTIVEMODE1"), m_pOptions->GetOptionVal(OPTION_EXTERNALIPMODE) == 0, failure);
	SetRCheck(XRCID("ID_ACTIVEMODE2"), m_pOptions->GetOptionVal(OPTION_EXTERNALIPMODE) == 1, failure);
	SetRCheck(XRCID("ID_ACTIVEMODE3"), m_pOptions->GetOptionVal(OPTION_EXTERNALIPMODE) == 2, failure);

	SetTextFromOption(XRCID("ID_ACTIVEIP"), OPTION_EXTERNALIP, failure);
	SetTextFromOption(XRCID("ID_ACTIVERESOLVER"), OPTION_EXTERNALIPRESOLVER, failure);
	SetCheckFromOption(XRCID("ID_NOEXTERNALONLOCAL"), OPTION_NOEXTERNALONLOCAL, failure);

	if (!failure)
		SetCtrlState();

	return !failure;
}
Пример #23
0
bool CFilterEditDialog::Create(wxWindow* parent, const std::vector<CFilter>& filters, const std::vector<CFilterSet>& filterSets)
{
	bool has_foreign_type = false;
	for (std::vector<CFilter>::const_iterator iter = filters.begin(); iter != filters.end(); iter++)
	{
		const CFilter& filter = *iter;
		if (!filter.HasConditionOfType(filter_foreign))
			continue;

		has_foreign_type = true;
		break;
	}

	if (!Load(parent, _T("ID_EDITFILTER")))
		return false;

	int conditions = filter_name | filter_size | filter_path | filter_meta;
	if (has_foreign_type)
		conditions |= filter_foreign;
	if (!CreateListControl(conditions))
		return false;
	
	m_pFilterListCtrl = XRCCTRL(*this, "ID_FILTERS", wxListBox);
	if (!m_pFilterListCtrl)
		return false;
	m_currentSelection = -1;

	m_filters = filters;
	m_filterSets = filterSets;
	for (std::vector<CFilter>::const_iterator iter = filters.begin(); iter != filters.end(); iter++)
		m_pFilterListCtrl->Append(iter->name);

	m_pWindowStateManager = new CWindowStateManager(this);
	m_pWindowStateManager->Restore(OPTION_FILTEREDIT_SIZE, wxSize(750, 500));

	Layout();

	SetCtrlState(false);

	return true;
}
Пример #24
0
void CFilterEditDialog::OnDelete(wxCommandEvent& event)
{
	int item = m_pFilterListCtrl->GetSelection();
	if (item == -1)
		return;

	m_currentSelection = -1;
	m_pFilterListCtrl->Delete(item);
	m_filters.erase(m_filters.begin() + item);

	// Remote filter from all filter sets
	for (std::vector<CFilterSet>::iterator iter = m_filterSets.begin(); iter != m_filterSets.end(); iter++)
	{
		CFilterSet& set = *iter;
		set.local.erase(set.local.begin() + item);
		set.remote.erase(set.remote.begin() + item);
	}

	ClearFilter(true);
	SetCtrlState(false);
}
Пример #25
0
BOOL CUsersDlg::OnInitDialog()
{
	CSAPrefsDialog::OnInitDialog();

	m_olduser = LB_ERR;

	m_cUserlist.ResetContent();

	for (unsigned int i = 0;i < m_UsersList.size(); ++i) {
		int index=m_cUserlist.AddString(m_UsersList[i].user);
		m_cUserlist.SetItemData(index, i);
	}

	if (m_UsersList.size()) {
		m_cUserlist.SetCurSel(0);
		OnSelchangeUserlist();
	}

	SetCtrlState();

	return TRUE;  // return TRUE unless you set the focus to a control
				  // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben
}
Пример #26
0
void CFilterDialog::OnDeleteSet(wxCommandEvent& event)
{
	wxChoice* pChoice = XRCCTRL(*this, "ID_SETS", wxChoice);
	int pos = pChoice->GetSelection();
	if (pos == -1)
		return;

	if (!pos) {
		wxMessageBoxEx(_("This filter set cannot be removed."));
		return;
	}

	m_filterSets[0] = m_filterSets[pos];

	pChoice->Delete(pos);
	m_filterSets.erase(m_filterSets.begin() + pos);
	wxASSERT(!m_filterSets.empty());

	pChoice->SetSelection(0);
	m_currentFilterSet = 0;

	SetCtrlState();
}
Пример #27
0
bool CSearchDialog::Load()
{
	if (!wxDialogEx::Load(m_parent, _T("ID_SEARCH")))
		return false;

	/* XRCed complains if adding a status bar to a dialog, so do it here instead */
	CFilelistStatusBar* pStatusBar = new CFilelistStatusBar(this);
	pStatusBar->SetEmptyString(_("No search results"));

	GetSizer()->Add(pStatusBar, 0, wxGROW);

	if (!CreateListControl(filter_name | filter_size | filter_path | filter_date))
		return false;

	m_results = new CSearchDialogFileList(this, m_pState, 0);
	ReplaceControl(XRCCTRL(*this, "ID_RESULTS", wxWindow), m_results);

	m_results->SetFilelistStatusBar(pStatusBar);

	const CServerPath path = m_pState->GetRemotePath();
	if (!path.IsEmpty())
		XRCCTRL(*this, "ID_PATH", wxTextCtrl)->ChangeValue(path.GetPath());

	SetCtrlState();

	m_pWindowStateManager = new CWindowStateManager(this);
	m_pWindowStateManager->Restore(OPTION_SEARCH_SIZE, wxSize(750, 500));

	Layout();

	LoadConditions();
	EditFilter(m_search_filter);
	XRCCTRL(*this, "ID_CASE", wxCheckBox)->SetValue(m_search_filter.matchCase);

	return true;
}
void CGroupsDlgSharedFolders::OnFilesWrite() 
{
	UpdateData(TRUE);
	SetCtrlState();	
}
void COptionsPageConnectionSFTP::OnSelChanged(wxListEvent& event)
{
	SetCtrlState();
}
Пример #30
0
void COptionsPageEdit::OnRadioButton(wxCommandEvent& event)
{
	SetCtrlState();
}