Exemplo n.º 1
0
VisionMainFrame::VisionMainFrame(QWidget *parent)
    : QMainWindow(parent)
{
    setup_ui();
    setup_action();

    out_info(PZ_INFO, QString::fromLocal8Bit("好吧,欢迎实用illusion配置转换工具,用于读取转换配置。"));
    out_info(PZ_INFO, QString::fromLocal8Bit("这个图标来自illusion 公司的一个著名软件。"));

}
Exemplo n.º 2
0
static void
pdm_dialog_init (PdmDialog *dialog)
{	
	GaleonEmbedShell *shell;
	PdmActionInfo *cookies;
	PdmActionInfo *passwords;
	PdmActionInfo *cookie_sites;
	PdmActionInfo *image_sites;
	PdmActionInfo *password_sites;
	PdmActionInfo *popup_sites;
	GtkWidget *cookies_tv;
	GtkWidget *passwords_tv;
	GtkWidget *cookie_sites_tv;
	GtkWidget *image_sites_tv;
	GtkWidget *password_sites_tv;
	GtkWidget *popup_sites_tv;
	GtkWidget *remove_block_button;
	
	shell = galeon_shell_get_embed_shell (galeon_shell);
	
	dialog->priv = PDM_DIALOG_GET_PRIVATE (dialog);
	dialog->priv->cookies = NULL;
	dialog->priv->passwords = NULL;
	
	galeon_dialog_construct (GALEON_DIALOG(dialog),
                                 properties,
                                 "galeon.glade",
                                 "pdm_dialog");

	gul_state_monitor_window 
		(galeon_dialog_get_control (GALEON_DIALOG(dialog), PROP_DIALOG),
		 "PDM", -1, -1);

	dialog->priv->notebook = 
		galeon_dialog_get_control (GALEON_DIALOG(dialog),
				           PROP_NOTEBOOK);

	group_button_allocations (GALEON_DIALOG (dialog));

	cookies_tv = setup_cookies_treeview (dialog);
	passwords_tv = setup_passwords_treeview (dialog);
	cookie_sites_tv = setup_cookie_sites_treeview (dialog);
	image_sites_tv = setup_image_sites_treeview(dialog);
	password_sites_tv = setup_password_sites_treeview(dialog);
	popup_sites_tv = setup_popup_sites_treeview(dialog);

	cookies = g_new0 (PdmActionInfo, 1);
	cookies->list = galeon_embed_shell_list_cookies (shell);
	cookies->dialog = dialog;
	cookies->remove_id = PROP_COOKIES_REMOVE;
	cookies->add = pdm_dialog_cookie_add;
	cookies->remove = pdm_dialog_cookie_remove;
	cookies->free = pdm_dialog_cookies_free;
	cookies->treeview = cookies_tv;
	cookies->data_col = COL_COOKIES_DATA;
	setup_action (cookies);

	remove_block_button =
		galeon_dialog_get_control(GALEON_DIALOG(cookies->dialog),
					  PROP_COOKIES_REMOVE_BLOCK);
		 
	g_signal_connect(remove_block_button, "clicked",
			 G_CALLBACK(pdm_dialog_cookie_remove_block_button_clicked_cb),
			 cookies);

	passwords = g_new0 (PdmActionInfo, 1);
	passwords->list = galeon_embed_shell_list_passwords (shell, PASSWORD_PASSWORD);
	passwords->dialog = dialog;
	passwords->remove_id = PROP_PASSWORDS_REMOVE;
	passwords->add = pdm_dialog_password_add;
	passwords->remove = pdm_dialog_password_remove;
	passwords->free = pdm_dialog_passwords_free;
	passwords->treeview = passwords_tv;
	passwords->data_col = COL_PASSWORDS_DATA;
	setup_action (passwords);

	password_sites = g_new0(PdmActionInfo, 1);
	password_sites->list = galeon_embed_shell_list_passwords(shell, PASSWORD_REJECT);
	password_sites->dialog = dialog;
	password_sites->remove_id = PROP_PASSWORD_SITES_REMOVE;
	password_sites->add = pdm_dialog_password_site_add;
	password_sites->remove = pdm_dialog_password_site_remove;
	password_sites->free = pdm_dialog_passwords_free;
	password_sites->treeview = password_sites_tv;
	password_sites->data_col = COL_PASSWORD_SITES_DATA;
	setup_action(password_sites);

	cookie_sites = g_new0 (PdmActionInfo, 1);
	cookie_sites->list = galeon_embed_shell_list_permissions (shell, COOKIES_PERMISSION);
	cookie_sites->dialog	= dialog;
	cookie_sites->remove_id = PROP_COOKIE_SITES_REMOVE;
	cookie_sites->add	= pdm_dialog_cookie_site_add;
	cookie_sites->remove	= pdm_dialog_cookie_site_remove;
	cookie_sites->free	= pdm_dialog_site_permissions_free;
	cookie_sites->treeview	= cookie_sites_tv;
	cookie_sites->data_col	= COL_COOKIE_SITES_DATA;
	setup_action (cookie_sites);

	/* 
	 * Must be attached after the callback that actually blocks the cookie
	 * site, otherwise it won't reload the updated list
	 */
	g_signal_connect(remove_block_button, "clicked",
			 G_CALLBACK(pdm_dialog_cookie_sites_reload_cb),
			 cookie_sites);

	image_sites = g_new0(PdmActionInfo, 1);
	image_sites->list = galeon_embed_shell_list_permissions(shell, IMAGES_PERMISSION);
	image_sites->dialog	= dialog;
	image_sites->remove_id	= PROP_IMAGE_SITES_REMOVE;
	image_sites->add	= pdm_dialog_image_site_add;
	image_sites->remove	= pdm_dialog_image_site_remove;
	image_sites->free	= pdm_dialog_site_permissions_free;
	image_sites->treeview	= image_sites_tv;
	image_sites->data_col	= COL_IMAGE_SITES_DATA;
	setup_action(image_sites);

	popup_sites = g_new0(PdmActionInfo, 1);
	popup_sites->list = galeon_embed_shell_list_permissions(shell, POPUPS_PERMISSION);
	popup_sites->dialog	= dialog;
	popup_sites->remove_id	= PROP_POPUP_SITES_REMOVE;
	popup_sites->add	= pdm_dialog_popup_site_add;
	popup_sites->remove	= pdm_dialog_popup_site_remove;
	popup_sites->free	= pdm_dialog_site_permissions_free;
	popup_sites->treeview	= popup_sites_tv;
	popup_sites->data_col	= COL_POPUP_SITES_DATA;
	setup_action(popup_sites);

	dialog->priv->cookies = cookies;
	dialog->priv->passwords = passwords;
	dialog->priv->password_sites = password_sites;
	dialog->priv->cookie_sites = cookie_sites;
	dialog->priv->image_sites = image_sites;
	dialog->priv->popup_sites = popup_sites;

	/* Sort by host/domain name.  Setting it here, after the treeview has
	 * been filled, is noticeably faster than setting it in
	 * setup_*_treeview and adding the items in sorted liststores.
	 */

#define set_sort_column(treeview, column) \
	gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE( \
		gtk_tree_view_get_model(GTK_TREE_VIEW(treeview))), \
					     column, GTK_SORT_ASCENDING)

	set_sort_column (cookies_tv,        COL_COOKIES_HOST);
	set_sort_column (cookie_sites_tv,   COL_COOKIE_SITES_DOMAIN);
	set_sort_column (image_sites_tv,    COL_IMAGE_SITES_DOMAIN);
	set_sort_column (passwords_tv,      COL_PASSWORDS_HOST);
	set_sort_column (password_sites_tv, COL_PASSWORD_SITES_HOST);
	set_sort_column (popup_sites_tv,    COL_POPUP_SITES_DOMAIN);

#undef set_sort_column
}