[Goodies-commits] r7315 - in xfce4-screenshooter/trunk: . lib
Jerome Guelfucci
jeromeg at xfce.org
Tue May 5 10:22:37 CEST 2009
Author: jeromeg
Date: 2009-05-05 08:22:37 +0000 (Tue, 05 May 2009)
New Revision: 7315
Modified:
xfce4-screenshooter/trunk/ChangeLog
xfce4-screenshooter/trunk/TODO
xfce4-screenshooter/trunk/lib/screenshooter-zimagez.c
Log:
* lib/screenshooter-zimagez.c: make the dialog unresizable and destroy
it when we are done. Remove useless blank spaces.
Modified: xfce4-screenshooter/trunk/ChangeLog
===================================================================
--- xfce4-screenshooter/trunk/ChangeLog 2009-05-04 22:26:27 UTC (rev 7314)
+++ xfce4-screenshooter/trunk/ChangeLog 2009-05-05 08:22:37 UTC (rev 7315)
@@ -1,3 +1,8 @@
+2009-05-05 jeromeg
+
+ * lib/screenshooter-zimagez.c: make the dialog unresizable and destroy
+ it when we are done. Remove useless blank spaces.
+
2009-05-04 jeromeg
* lib/sexy-url-label.{c,h}: add the sexy_url_label taken from
Modified: xfce4-screenshooter/trunk/TODO
===================================================================
--- xfce4-screenshooter/trunk/TODO 2009-05-04 22:26:27 UTC (rev 7314)
+++ xfce4-screenshooter/trunk/TODO 2009-05-05 08:22:37 UTC (rev 7315)
@@ -4,8 +4,6 @@
* Use Xshape to have a transparent background in the generated screenshots.
* Remove every call to xfce_err with a gtk_message_dialog.
* the Zimagez code needs a lot of error checking.
-* The login dialog is uggly.
-* the upload adress is only passed in the debug statements at the moment.
Low priority:
* Try to get borders captured with compiz.
Modified: xfce4-screenshooter/trunk/lib/screenshooter-zimagez.c
===================================================================
--- xfce4-screenshooter/trunk/lib/screenshooter-zimagez.c 2009-05-04 22:26:27 UTC (rev 7314)
+++ xfce4-screenshooter/trunk/lib/screenshooter-zimagez.c 2009-05-05 08:22:37 UTC (rev 7315)
@@ -103,8 +103,8 @@
{
open_url_hook (NULL, "http://www.zimagez.com", NULL);
}
-
+
/* Public */
@@ -123,7 +123,7 @@
* the image on Zimagez.com (see the API at the beginning of this file for more
* details).
**/
-
+
gchar *screenshooter_upload_to_zimagez (const gchar *image_path)
{
xmlrpc_env env;
@@ -170,6 +170,7 @@
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG(dialog)->vbox), 12);
gtk_window_set_icon_name (GTK_WINDOW (dialog), "gtk-info");
+ gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
@@ -179,11 +180,11 @@
gtk_alignment_set_padding (GTK_ALIGNMENT (main_alignment), 6, 0, 12, 12);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), main_alignment, TRUE, TRUE, 0);
-
+
/* Create the main box for the dialog */
-
+
vbox = gtk_vbox_new (FALSE, 10);
-
+
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_container_add (GTK_CONTAINER (main_alignment), vbox);
@@ -231,8 +232,8 @@
gtk_widget_set_tooltip_text (user_entry,
_("Your Zimagez user name, if you do not have one yet"
"please create one on the Web page linked above"));
-
+
gtk_table_attach_defaults (GTK_TABLE (table), user_entry, 1, 2, 0, 1);
/* Create the password label */
@@ -327,7 +328,7 @@
return NULL;
}
-
+
user = g_strdup (gtk_entry_get_text (GTK_ENTRY (user_entry)));
password = g_strdup (gtk_entry_get_text (GTK_ENTRY (password_entry)));
title = g_strdup (gtk_entry_get_text (GTK_ENTRY (title_entry)));
@@ -357,20 +358,20 @@
TRACE ("All fields were filed");
gtk_widget_hide (dialog);
}
-
+
while (gtk_events_pending ())
gtk_main_iteration_do (FALSE);
-
+
encoded_password = g_strdup (g_strreverse (rot13 (password)));
-
+
TRACE ("User: %s", user);
/* Start the user session */
TRACE ("Call the login method");
-
+
resultP = xmlrpc_client_call (&env, serverurl, method_login,
"(ss)", user, encoded_password);
-
+
if (warn_if_fault_occurred (&env))
{
xmlrpc_env_clean (&env);
@@ -381,17 +382,17 @@
g_free (title);
g_free (comment);
g_free (encoded_password);
-
+
return NULL;
}
TRACE ("Read the login response");
-
+
/* If the response is a boolean, there was an error */
if (xmlrpc_value_type (resultP) == XMLRPC_TYPE_BOOL)
{
xmlrpc_read_bool (&env, resultP, &response);
-
+
if (warn_if_fault_occurred (&env))
{
xmlrpc_env_clean (&env);
@@ -402,17 +403,17 @@
g_free (title);
g_free (comment);
g_free (encoded_password);
-
+
return NULL;
}
-
+
}
/* Else we read the string response to get the session ID */
else
{
TRACE ("Read the session ID");
xmlrpc_read_string (&env, resultP, (const gchar ** const)&login_response);
-
+
if (warn_if_fault_occurred (&env))
{
xmlrpc_env_clean (&env);
@@ -423,7 +424,7 @@
g_free (title);
g_free (comment);
g_free (encoded_password);
-
+
return NULL;
}
@@ -440,9 +441,11 @@
xmlrpc_DECREF (resultP);
+ gtk_widget_destroy (dialog);
+
g_free (password);
g_free (encoded_password);
-
+
/* Get the contents of the image file and encode it to base64 */
g_file_get_contents (image_path, &data, &data_length, NULL);
@@ -564,7 +567,7 @@
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
/* Create the image link */
-
+
image_link =
gtk_link_button_new_with_label (image_url, _("Link to the full-size screenshot"));
@@ -606,4 +609,4 @@
g_free (small_thumbnail_url);
}
-
+
More information about the Goodies-commits
mailing list