コード例 #1
0
void SecurityPasswordDialog::OnChange(OpWidget *widget, BOOL changed_by_mouse)
{

	// if we add a new password, make sure to inform the user about required quality of password
	if (m_callback && m_callback->GetMode() == OpSSLListener::SSLSecurityPasswordCallback::NewPassword)
	{
		OpString newpassword;
		OpString confirmpassword;

		GetWidgetText("Password_edit", newpassword);
		GetWidgetText("Confirm_password_edit", confirmpassword);

		m_ok_enabled = newpassword.Compare(confirmpassword) == 0 && ChangeMasterPasswordDialog::CheckPasswordPolicy(&confirmpassword);
		EnableButton(0, m_ok_enabled);

		if(ChangeMasterPasswordDialog::CheckPasswordPolicy(&newpassword))
		{
			SetWidgetText("Password_info_label",Str::SI_MSG_SECURE_ASK_NEW_PASSWORD_AGAIN);	
		}
		else
		{
			SetWidgetText("Password_info_label", Str::SI_MSG_SECURE_ASK_UPDATE_PASSWORD);		
		}
	}

	Dialog::OnChange(widget, changed_by_mouse);
}
コード例 #2
0
ファイル: GoToPageDialog.cpp プロジェクト: prestocore/browser
void GoToPageDialog::OnInit()
{ 
	OpAddressDropDown* dropdown = (OpAddressDropDown*) GetWidgetByName("Address_field");
	OpEdit* nickedit = (OpEdit*) GetWidgetByName("Nick_field");
	if( dropdown && nickedit)
	{
		if(m_is_nick)
		{
			SetWidgetText("label_for_Address_field", Str::DI_IDM_NICKNAME_LABEL );

			dropdown->SetVisibility(FALSE);
	        nickedit->SetFocus(FOCUS_REASON_OTHER);

			// Catch Enter press in edit field.
			OpInputAction* action = OP_NEW(OpInputAction, (OpInputAction::ACTION_GO));
			nickedit->SetAction(action);
		}		
		else
		{
			nickedit->SetVisibility(FALSE);
			dropdown->SetInvokeActionOnClick(TRUE);
			dropdown->SetMaxNumberOfColumns(2);
			dropdown->SetTabMode(FALSE);
			dropdown->SetEnableDropdown(SupportsExternalCompositing());
			dropdown->SetText(directHistory->GetFirst());
		}
	}
}
コード例 #3
0
void ValidateSourceDialog::OnInit()
{
	SetWidgetText("Window_title", WindowCommanderProxy::GetWindowTitle(m_window_commander));

	OpMultilineEdit* edit = (OpMultilineEdit*)GetWidgetByName("Description_label");
	if(edit)
	{
		edit->SetLabelMode();
	}
}
コード例 #4
0
void GroupPropertiesDialog::OnInit()
{
	HotlistManager::ItemData item_data;
	g_hotlist_manager->GetItemValue( m_group, item_data );

	SetWidgetText("Name_edit", item_data.name.CStr());

	// Dialog caption
	OpString title;
	g_languageManager->GetString(Str::D_PROPERTIES_DIALOG_CAPTION, title);

	SetTitle(title.CStr());

	OpTreeView* treeview = (OpTreeView*)GetWidgetByName("Group_treeview");

	if (treeview)
	{
		OpString str;

		g_languageManager->GetString(Str::D_GROUP_NAME, str);
		m_group_model.SetColumnData(0, str.CStr());
		g_languageManager->GetString(Str::D_GROUP_ADDRESS, str);
		m_group_model.SetColumnData(1, str.CStr());

		GroupModelItem* group = (GroupModelItem*)m_group;

		UINT32 count = group->GetItemCount();

		UINT32 j = 0;
		for (UINT32 i = 0; i < count; i++)
		{
			UINT32 id = group->GetItemByPosition(i);

			HotlistModelItem* item = g_hotlist_manager->GetItemByID(id);
			if (item)
			{
				HotlistManager::ItemData item_data;

				g_hotlist_manager->GetItemValue( item, item_data );
				m_group_model.AddItem(item_data.name.CStr());
				m_group_model.SetItemData(j++, 1, item_data.mail.CStr(), item_data.image.CStr());
			}
		}

		treeview->SetTreeModel(&m_group_model);
		treeview->SetColumnWeight(0,60);
		treeview->SetSelectedItem(0);
	}
}
コード例 #5
0
ファイル: nhistory.c プロジェクト: MaddTheSane/MacBoard
void
ClearHistoryMemo ()
{
    SetWidgetText(&historyOptions[0], "", HistoryDlg);
}
コード例 #6
0
ファイル: nengineoutput.c プロジェクト: Jvlythical/ECS40
void
DoClearMemo (int which)
{
      SetWidgetText(&engoutOptions[STRIDE*which + MEMO], "", -1);
}
コード例 #7
0
void ReportSiteProblemDialog::OnInit()
{
	OpDropDown* dropdown = GetWidgetByName<OpDropDown>("Category_dropdown", WIDGET_TYPE_DROPDOWN);
	if (dropdown)
	{
		OpString loc_str;
		g_languageManager->GetString(Str::D_REPORT_SITE_UNSPECIFIED, loc_str);
		dropdown->AddItem(loc_str.CStr());
		g_languageManager->GetString(Str::D_REPORT_SITE_MINOR, loc_str);
		dropdown->AddItem(loc_str.CStr());
		g_languageManager->GetString(Str::D_REPORT_SITE_MAJOR, loc_str);
		dropdown->AddItem(loc_str.CStr());
		g_languageManager->GetString(Str::D_REPORT_SITE_UNUSABLE, loc_str);
		dropdown->AddItem(loc_str.CStr());
	}

	DesktopWindow* dw = (DesktopWindow*)GetParentDesktopWindow();
	DocumentDesktopWindow* ddw = NULL;

	SetWidgetReadOnly("Configuration_edit", TRUE);

	OpEdit* address_edit = GetWidgetByName<OpEdit>("Page_address_edit", WIDGET_TYPE_EDIT);
	if (address_edit)
	{
		address_edit->SetReadOnly(TRUE);
		address_edit->SetForceTextLTR(TRUE);
	}

	OpWidget* widget = GetWidgetByName("Advanced_group");
	if (widget)
		widget->SetVisibility(FALSE);

	m_encoding.Set(UNI_L("default"));
	m_strict_mode = FALSE;

	if (dw && dw->GetType() == WINDOW_TYPE_DOCUMENT)
	{
		ddw = (DocumentDesktopWindow*)dw;

		OpWindowCommander* wc = ddw->GetWindowCommander();
		if (wc)
		{
			SetWidgetText("Page_address_edit", wc->GetCurrentURL(FALSE));

			if (WindowCommanderProxy::GetForceEncoding(wc))
			{
				m_encoding.Set(WindowCommanderProxy::GetForceEncoding(wc));
			}
			if (WindowCommanderProxy::HasCSSModeFULL(wc))
			{
				m_document_mode.Set("Author");
			}
			else
			{
				m_document_mode.Set("User");
			}

			switch (wc->GetImageMode())
			{
			case OpDocumentListener::ALL_IMAGES:
				m_images.Set("All");
				break;

			case OpDocumentListener::LOADED_IMAGES:
				m_images.Set("Cached");
				break;

			case OpDocumentListener::NO_IMAGES:
				m_images.Set("None");
				break;
			}

			m_strict_mode = WindowCommanderProxy::IsInStrictMode(wc);
		}
	}

	char *useragentstr = (char *) g_memory_manager->GetTempBuf();
	/* int ua_str_len = */ g_uaManager->GetUserAgentStr(useragentstr, 128, NULL);

	if (useragentstr && *useragentstr)
		m_user_agent.Set(useragentstr);

	OpString on;
	OpString off;
	on.Set("On");
	off.Set("Off");

	BOOL block_all = g_pcdoc->GetIntegerPref(PrefsCollectionDoc::IgnoreTarget);
	BOOL unrequested = g_pcjs->GetIntegerPref(PrefsCollectionJS::IgnoreUnrequestedPopups);
	BOOL background = g_pcjs->GetIntegerPref(PrefsCollectionJS::TargetDestination) == POPUP_WIN_BACKGROUND;
	m_plugins = g_pcdisplay->GetIntegerPref(PrefsCollectionDisplay::PluginsEnabled);
	m_javascript = g_pcjs->GetIntegerPref(PrefsCollectionJS::EcmaScriptEnabled);
	COOKIE_MODES cookie_mode = (COOKIE_MODES)g_pcnet->GetIntegerPref(PrefsCollectionNetwork::CookiesEnabled);
	m_referrer_logging = g_pcnet->GetIntegerPref(PrefsCollectionNetwork::ReferrerEnabled);

	BOOL http, https, ftp, gopher, wais, auto_proxy;

	http = g_pcnet->GetIntegerPref(PrefsCollectionNetwork::UseHTTPProxy);
	https= g_pcnet->GetIntegerPref(PrefsCollectionNetwork::UseHTTPSProxy);
	ftp  = g_pcnet->GetIntegerPref(PrefsCollectionNetwork::UseFTPProxy);
#ifdef GOPHER_SUPPORT
	gopher=g_pcnet->GetIntegerPref(PrefsCollectionNetwork::UseGopherProxy);
#endif
#ifdef WAIS_SUPPORT
	wais = g_pcnet->GetIntegerPref(PrefsCollectionNetwork::UseWAISProxy);
#endif
#ifdef SUPPORT_AUTO_PROXY_CONFIGURATION
	auto_proxy = g_pcnet->GetIntegerPref(PrefsCollectionNetwork::AutomaticProxyConfig);
#endif

	m_proxy = http || https || ftp || gopher || wais
#ifdef SUPPORT_AUTO_PROXY_CONFIGURATION
		|| auto_proxy
#endif
		;

	OpString proxy;
	TRAPD(rc, g_pcnet->GetStringPrefL(PrefsCollectionNetwork::HTTPProxy, proxy));
	if (OpStatus::IsSuccess(rc))
	{
		m_proxy = m_proxy && proxy.Length();
	}

	// Cookie handling
	DWORD flag = 0;

	if(cookie_mode != COOKIE_NONE)
		flag |= 0x01;

#ifdef _ASK_COOKIE
	if(g_pcnet->GetIntegerPref(PrefsCollectionNetwork::DisplayReceivedCookies))
		flag |= 0x04;
#endif

	if (flag == 0x00)
		m_cookie_normal.Set("Refuse");
	if (flag == 0x05)
		m_cookie_normal.Set("Display");
	if (flag == 0x03)
		m_cookie_normal.Set("Filter");
	if(flag == 0x01)
		m_cookie_normal.Set("Accept");

	if (cookie_mode == COOKIE_NONE || cookie_mode == COOKIE_NO_THIRD_PARTY)
		m_cookie_third_party.Set("Refuse");
	if (cookie_mode == COOKIE_WARN_THIRD_PARTY)
		m_cookie_third_party.Set("Display");
	if (cookie_mode == COOKIE_ALL)
		m_cookie_third_party.Set("Accept");

	m_cookies = cookie_mode != COOKIE_NONE;
	m_cookies3 = cookie_mode == COOKIE_ALL;

	OpString text;

	text.Set("User Agent:");
	text.Append(m_user_agent);
	text.Append("\r\nBuild number:");
	text.Append(VER_BUILD_NUMBER_STR);
	text.Append("\r\nPopups:");
	if (block_all)
	{
		m_popups.Set("all");
		text.Append("Block all");
	}
	else if (unrequested)
	{
		m_popups.Set("unwanted");
		text.Append("Block unwanted");
	}
	else if (background)
	{
		m_popups.Set("background");
		text.Append("Open in background");
	}
	else
	{
		m_popups.Set("none");
		text.Append("Allow");
	}
	text.Append("\r\nJava:");
	text.Append(m_java ? on : off);
	text.Append("\r\nPlug-ins:");
	text.Append(m_plugins ? on : off);
	text.Append("\r\nJavaScript:");
	text.Append(m_javascript ? on : off);
//	text.Append("\r\nCookies:");
//	text.Append(m_cookies ? on : off);
	text.Append("\r\nReferrer logging:");
	text.Append(m_referrer_logging ? on : off);
	text.Append("\r\nProxy:");
	text.Append(m_proxy ? on : off);
	text.Append("\r\nEncoding setting:");
	text.Append(m_encoding);
	text.Append("\r\nDisplay mode:");
//	text.Append(m_document_mode);
//	text.Append(", ");
	text.Append(m_strict_mode ? "Strict" : "Quirks");
	text.Append("\r\nLoad images:");
	text.Append(m_images);
	text.Append("\r\nNormal cookies:");
	text.Append(m_cookie_normal);
	text.Append("\r\nThird party cookies:");
	text.Append(m_cookie_third_party);

	SetWidgetText("Configuration_edit", text.CStr());
}
コード例 #8
0
void CookieEditDialog::OnInit()
{
	if( m_cookie )
	{
		OpString yes, no;
		g_languageManager->GetString(Str::DI_IDYES, yes);
		g_languageManager->GetString(Str::DI_IDNO, no);

		SetWidgetText("Server_edit", m_server_name.CStr() );
		SetWidgetText("Name_edit", m_cookie->Name().CStr() );
		SetWidgetText("Value_edit", m_cookie->Value().CStr() );

		if (m_cookie->Expires())
		{
			SetTime( (OpEdit*)GetWidgetByName("Expire_date_edit"), m_cookie->Expires(), TRUE );
			SetTime( (OpEdit*)GetWidgetByName("Expire_time_edit"), m_cookie->Expires(), FALSE );
		}
		if (m_cookie->GetLastUsed())
		{
			SetTime( (OpEdit*)GetWidgetByName("Last_visited_date_edit"), m_cookie->GetLastUsed(), TRUE );
			SetTime( (OpEdit*)GetWidgetByName("Last_visited_time_edit"), m_cookie->GetLastUsed(), FALSE );
		}
		SetWidgetText("To_creator_edit", m_cookie->SendOnlyToServer() ? yes.CStr() : no.CStr() );
		SetWidgetText("Secure_edit", m_cookie->Secure() ? yes.CStr() : no.CStr() );
		OpString temp_var;
		temp_var.AppendFormat(UNI_L("%d"), m_cookie->Version());
		SetWidgetText("Version_edit", temp_var.CStr() );

		OpEdit* edit = (OpEdit*)GetWidgetByName("Server_edit");
		if( edit )
			edit->SetReadOnly(TRUE);
		edit = (OpEdit*)GetWidgetByName("To_creator_edit");
		if( edit )
			edit->SetReadOnly(TRUE);
		edit = (OpEdit*)GetWidgetByName("Secure_edit");
		if( edit )
			edit->SetReadOnly(TRUE);
		edit = (OpEdit*)GetWidgetByName("Version_edit");
		if( edit )
			edit->SetReadOnly(TRUE);

		edit = (OpEdit*)GetWidgetByName("Name_edit");
		if( edit )
		{
			edit->SetFocus(FOCUS_REASON_OTHER);
			edit->SetCaretPos( edit->GetTextLength() );
		}
	}

	if(m_readonly)
	{
		SetWidgetReadOnly("Server_edit", TRUE);
		SetWidgetReadOnly("Name_edit", TRUE);
		SetWidgetReadOnly("Value_edit", TRUE);
		SetWidgetReadOnly("Expire_date_edit", TRUE);
		SetWidgetReadOnly("Expire_time_edit", TRUE);
		SetWidgetReadOnly("Last_visited_date_edit", TRUE);
		SetWidgetReadOnly("Last_visited_time_edit", TRUE);
		SetWidgetReadOnly("To_creator_edit", TRUE);
		SetWidgetReadOnly("Secure_edit", TRUE);
		SetWidgetReadOnly("Version_edit", TRUE);
		SetWidgetReadOnly("Server_edit", TRUE);
	}
}