Commit 488a02f8 authored by Nick Schermer's avatar Nick Schermer
Browse files

* Backport trunk

(Old svn revision: 25304)
parent e9926f63
2007-03-27 16:31 nick
* Backport trunk
2007-03-18 15:46 nick
* libxfce4panel/xfce-hvbox.c: Mmm thought orientation was a property... Fix that.
......
......@@ -5,6 +5,6 @@ MoveFirst=false
_Name=Command Prompt
_Comment=X terminal emulator
Icon=utilities-terminal
Exec=Terminal
Exec=exo-open --launch TerminalEmulator
Terminal=false
StartupNotify=true
......@@ -3,7 +3,7 @@
<panels>
<panel>
<properties>
<property name="size" value="26"/>
<property name="size" value="30"/>
<property name="monitor" value="0"/>
<property name="screen-position" value="1"/>
<property name="fullwidth" value="1"/>
......
......@@ -1004,7 +1004,7 @@ panel_init_position (Panel *panel)
x = xmon->geometry.x;
y = xmon->geometry.y;
if (priv->xoffset > 0 && priv->yoffset > 0)
if (priv->xoffset > 0 || priv->yoffset > 0)
{
x += priv->xoffset;
y += priv->yoffset;
......
......@@ -5,7 +5,7 @@
* Copyright © 2005 Jasper Huijsmans <jasper@xfce.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
* it under the terms of the GNU Library General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
......@@ -45,15 +45,19 @@ typedef struct
{
XfcePanelPlugin *plugin;
GtkTooltips *tips;
ActionType type;
GtkWidget *button1;
GtkWidget *image1;
GtkWidget *button2;
GtkWidget *image2;
GtkWidget *box;
int screen_id;
int style_id;
GtkOrientation orientation;
}
Action;
......@@ -73,13 +77,13 @@ XFCE_PANEL_PLUGIN_REGISTER_INTERNAL (actions_construct);
/* Interface Implementation */
static void
actions_orientation_changed (XfcePanelPlugin *plugin,
actions_orientation_changed (XfcePanelPlugin *plugin,
GtkOrientation orientation,
Action *action)
{
if (action->type == ACTION_QUIT_LOCK)
{
xfce_hvbox_set_orientation (XFCE_HVBOX (GTK_BIN (plugin)->child),
xfce_hvbox_set_orientation (XFCE_HVBOX (GTK_BIN (plugin)->child),
(orientation == GTK_ORIENTATION_HORIZONTAL) ?
GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL);
}
......@@ -94,10 +98,10 @@ static GdkPixbuf *
actions_load_icon (ActionType type, int size)
{
GdkPixbuf *pb = NULL;
/* first try name from icon nameing spec... */
pb = xfce_themed_icon_load (action_icon_names[type][1], size);
/* ...then try xfce name, if necessary */
if (!pb)
{
......@@ -107,46 +111,50 @@ actions_load_icon (ActionType type, int size)
return pb;
}
static gboolean
static gboolean
actions_set_size (XfcePanelPlugin *plugin, int size, Action *action)
{
int width;
gint width;
GdkPixbuf *pb = NULL;
int border;
if (xfce_panel_plugin_get_orientation (plugin) ==
GTK_ORIENTATION_HORIZONTAL)
{
border = 2 + 2 * GTK_WIDGET(plugin)->style->ythickness;
}
else
{
border = 2 + 2 * GTK_WIDGET(plugin)->style->xthickness;
}
width = size - 2 - 2 * MAX (action->button1->style->xthickness,
action->button1->style->ythickness);
switch (action->type)
{
case ACTION_QUIT_LOCK:
width = size / 2 - 2 * border;
if (xfce_panel_plugin_get_orientation (plugin) != action->orientation)
{
width = (size / 2) - 4 - 4 * MAX (action->button1->style->xthickness,
action->button1->style->ythickness);
width = MAX (width, 5);
}
else
{
gtk_widget_set_size_request (GTK_WIDGET (action->button1), size, size);
gtk_widget_set_size_request (GTK_WIDGET (action->button2), size, size);
}
gtk_widget_set_size_request (GTK_WIDGET (plugin), -1, -1);
pb = actions_load_icon (ACTION_LOCK, width);
gtk_image_set_from_pixbuf (GTK_IMAGE (action->image1), pb);
g_object_unref (G_OBJECT (pb));
pb = actions_load_icon (ACTION_QUIT, width);
gtk_image_set_from_pixbuf (GTK_IMAGE (action->image2), pb);
g_object_unref (G_OBJECT (pb));
g_object_unref (G_OBJECT (pb));
break;
case ACTION_QUIT:
case ACTION_LOCK:
width = MIN(size - border, MAX(16, size/2 - border));
pb = actions_load_icon (action->type, width);
gtk_image_set_from_pixbuf (GTK_IMAGE (action->image1), pb);
g_object_unref (G_OBJECT (pb));
gtk_widget_set_size_request (GTK_WIDGET (plugin), size, size);
break;
}
return TRUE;
}
......@@ -155,8 +163,9 @@ actions_read_rc_file (XfcePanelPlugin *plugin, Action *action)
{
char *file;
XfceRc *rc;
GtkOrientation orientation = GTK_ORIENTATION_VERTICAL;
int type = ACTION_QUIT;
if ((file = xfce_panel_plugin_lookup_rc_file (plugin)) != NULL)
{
rc = xfce_rc_simple_open (file, TRUE);
......@@ -165,12 +174,14 @@ actions_read_rc_file (XfcePanelPlugin *plugin, Action *action)
if (rc != NULL)
{
type = xfce_rc_read_int_entry (rc, "type", ACTION_QUIT);
orientation = (xfce_rc_read_int_entry (rc, "orientation", 1) == 0 ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL);
xfce_rc_close (rc);
}
}
action->type = type;
action->orientation = orientation;
}
static void
......@@ -178,7 +189,7 @@ actions_write_rc_file (XfcePanelPlugin *plugin, Action *action)
{
char *file;
XfceRc *rc;
if (!(file = xfce_panel_plugin_save_location (plugin, TRUE)))
return;
......@@ -187,8 +198,9 @@ actions_write_rc_file (XfcePanelPlugin *plugin, Action *action)
if (!rc)
return;
xfce_rc_write_int_entry (rc, "type", action->type);
xfce_rc_write_int_entry (rc, "orientation", action->orientation == GTK_ORIENTATION_HORIZONTAL ? 0 : 1);
xfce_rc_close (rc);
}
......@@ -200,10 +212,10 @@ actions_free_data (XfcePanelPlugin *plugin, Action *action)
if (action->screen_id)
g_signal_handler_disconnect (plugin, action->screen_id);
if (action->style_id)
g_signal_handler_disconnect (plugin, action->style_id);
action->screen_id = action->style_id = 0;
dlg = g_object_get_data (G_OBJECT (plugin), "dialog");
......@@ -233,19 +245,13 @@ static void
actions_create_widgets (XfcePanelPlugin *plugin, Action *action)
{
GtkWidget *widget, *box, *button, *img;
GtkOrientation orientation;
widget = GTK_WIDGET (plugin);
switch (action->type)
{
case ACTION_QUIT_LOCK:
orientation = (xfce_panel_plugin_get_orientation (plugin) ==
GTK_ORIENTATION_HORIZONTAL) ?
GTK_ORIENTATION_VERTICAL :
GTK_ORIENTATION_HORIZONTAL;
box = xfce_hvbox_new (orientation, TRUE, 0);
box = xfce_hvbox_new (action->orientation, TRUE, 0);
gtk_widget_show (box);
gtk_container_add (GTK_CONTAINER (plugin), box);
......@@ -254,29 +260,29 @@ actions_create_widgets (XfcePanelPlugin *plugin, Action *action)
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
xfce_panel_plugin_add_action_widget (plugin, button);
g_signal_connect (button, "clicked",
g_signal_connect (button, "clicked",
G_CALLBACK (actions_do_lock), plugin);
gtk_tooltips_set_tip (action->tips, action->button1, _("Lock screen"), NULL);
img = action->image1 = gtk_image_new ();
gtk_widget_show (img);
gtk_container_add (GTK_CONTAINER (button), img);
action->button2 = button = xfce_create_panel_button ();
gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
xfce_panel_plugin_add_action_widget (plugin, button);
g_signal_connect (button, "clicked",
g_signal_connect (button, "clicked",
G_CALLBACK (actions_do_quit), plugin);
img = action->image2 = gtk_image_new ();
gtk_widget_show (img);
gtk_container_add (GTK_CONTAINER (button), img);
gtk_tooltips_set_tip (action->tips, action->button2, _("Quit"), NULL);
break;
......@@ -284,16 +290,16 @@ actions_create_widgets (XfcePanelPlugin *plugin, Action *action)
action->button1 = button = xfce_create_panel_button ();
gtk_widget_show (button);
gtk_container_add (GTK_CONTAINER (plugin), button);
xfce_panel_plugin_add_action_widget (plugin, button);
g_signal_connect (button, "clicked",
g_signal_connect (button, "clicked",
G_CALLBACK (actions_do_lock), plugin);
img = action->image1 = gtk_image_new ();
gtk_widget_show (img);
gtk_container_add (GTK_CONTAINER (button), img);
gtk_tooltips_set_tip (action->tips, action->button1, _("Lock screen"), NULL);
break;
......@@ -301,12 +307,12 @@ actions_create_widgets (XfcePanelPlugin *plugin, Action *action)
action->button1 = button = xfce_create_panel_button ();
gtk_widget_show (button);
gtk_container_add (GTK_CONTAINER (plugin), button);
xfce_panel_plugin_add_action_widget (plugin, button);
g_signal_connect (button, "clicked",
g_signal_connect (button, "clicked",
G_CALLBACK (actions_do_quit), plugin);
img = action->image1 = gtk_image_new ();
gtk_widget_show (img);
gtk_container_add (GTK_CONTAINER (button), img);
......@@ -322,7 +328,7 @@ actions_icontheme_changed (XfcePanelPlugin *plugin, gpointer ignored,
actions_set_size (plugin, xfce_panel_plugin_get_size (plugin), action);
}
static void
static void
actions_construct (XfcePanelPlugin *plugin)
{
Action *action = panel_slice_new0 (Action);
......@@ -330,33 +336,33 @@ actions_construct (XfcePanelPlugin *plugin)
action->plugin = plugin;
action->tips = gtk_tooltips_new();
g_signal_connect (plugin, "orientation-changed",
g_signal_connect (plugin, "orientation-changed",
G_CALLBACK (actions_orientation_changed), action);
g_signal_connect (plugin, "size-changed",
g_signal_connect (plugin, "size-changed",
G_CALLBACK (actions_set_size), action);
g_signal_connect (plugin, "save",
g_signal_connect (plugin, "save",
G_CALLBACK (actions_write_rc_file), action);
g_signal_connect (plugin, "free-data",
g_signal_connect (plugin, "free-data",
G_CALLBACK (actions_free_data), action);
xfce_panel_plugin_menu_show_configure (plugin);
g_signal_connect (plugin, "configure-plugin",
g_signal_connect (plugin, "configure-plugin",
G_CALLBACK (actions_properties_dialog), action);
actions_read_rc_file (plugin, action);
actions_create_widgets (plugin, action);
action->style_id =
g_signal_connect (plugin, "style-set",
g_signal_connect (plugin, "style-set",
G_CALLBACK (actions_icontheme_changed), action);
action->screen_id =
g_signal_connect (plugin, "screen-changed",
g_signal_connect (plugin, "screen-changed",
G_CALLBACK (actions_icontheme_changed), action);
}
......@@ -368,11 +374,27 @@ static void
action_type_changed (GtkComboBox *box, Action *action)
{
action->type = gtk_combo_box_get_active (box);
/* orientation only sensitive when 2 buttons are shown */
gtk_widget_set_sensitive (action->box, action->type == 2 ? TRUE : FALSE);
gtk_widget_destroy (GTK_BIN (action->plugin)->child);
actions_create_widgets (action->plugin, action);
actions_set_size (action->plugin,
xfce_panel_plugin_get_size (action->plugin), action);
}
static void
orientation_changed (GtkComboBox *box, Action *action)
{
action->orientation = (gtk_combo_box_get_active (box) == 0 ?
GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL);
gtk_widget_destroy (GTK_BIN (action->plugin)->child);
actions_create_widgets (action->plugin, action);
actions_set_size (action->plugin,
actions_set_size (action->plugin,
xfce_panel_plugin_get_size (action->plugin), action);
}
......@@ -389,28 +411,31 @@ actions_dialog_response (GtkWidget *dlg, int reponse, Action *action)
static void
actions_properties_dialog (XfcePanelPlugin *plugin, Action *action)
{
GtkWidget *dlg, *vbox, *hbox, *label, *box;
GtkWidget *dlg, *vbox, *hbox, *label, *box, *box2;
GtkSizeGroup *sg;
xfce_panel_plugin_block_menu (plugin);
dlg = xfce_titled_dialog_new_with_buttons (_("Panel Actions"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
NULL);
gtk_window_set_screen (GTK_WINDOW (dlg),
gtk_window_set_screen (GTK_WINDOW (dlg),
gtk_widget_get_screen (GTK_WIDGET (plugin)));
g_object_set_data (G_OBJECT (plugin), "dialog", dlg);
gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
gtk_window_set_icon_name (GTK_WINDOW (dlg), "xfce4-settings");
g_signal_connect (dlg, "response", G_CALLBACK (actions_dialog_response),
action);
gtk_container_set_border_width (GTK_CONTAINER (dlg), 2);
sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_widget_show (vbox);
......@@ -423,21 +448,50 @@ actions_properties_dialog (XfcePanelPlugin *plugin, Action *action)
label = gtk_label_new (_("Select action type:"));
gtk_widget_show (label);
gtk_size_group_add_widget (sg, label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
box = gtk_combo_box_new_text ();
gtk_widget_show (box);
gtk_box_pack_start (GTK_BOX (hbox), box, TRUE, TRUE, 0);
gtk_combo_box_append_text (GTK_COMBO_BOX (box), _("Quit"));
gtk_combo_box_append_text (GTK_COMBO_BOX (box), _("Lock screen"));
gtk_combo_box_append_text (GTK_COMBO_BOX (box), _("Quit + Lock screen"));
gtk_combo_box_set_active (GTK_COMBO_BOX (box), action->type);
g_signal_connect (box, "changed", G_CALLBACK (action_type_changed),
g_signal_connect (box, "changed", G_CALLBACK (action_type_changed),
action);
hbox = gtk_hbox_new (FALSE, 8);
gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new (_("Orientation:"));
gtk_widget_show (label);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_size_group_add_widget (sg, label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
box2 = action->box = gtk_combo_box_new_text ();
gtk_widget_show (box2);
gtk_box_pack_start (GTK_BOX (hbox), box2, TRUE, TRUE, 0);
/* only sensitive when 2 buttons are shown */
gtk_widget_set_sensitive (action->box, action->type == 2 ? TRUE : FALSE);
gtk_combo_box_append_text (GTK_COMBO_BOX (box2), _("Horizontal"));
gtk_combo_box_append_text (GTK_COMBO_BOX (box2), _("Vertical"));
gtk_combo_box_set_active (GTK_COMBO_BOX (box2),
action->orientation == GTK_ORIENTATION_HORIZONTAL ? 0 : 1);
g_signal_connect (box2, "changed", G_CALLBACK (orientation_changed),
action);
g_object_unref (G_OBJECT (sg));
gtk_widget_show (dlg);
}
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xfce4-panel\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-03-03 20:30+0100\n"
"POT-Creation-Date: 2007-03-27 16:30+0200\n"
"PO-Revision-Date: 2007-02-02 10:45+0200\n"
"Last-Translator: Mohamed Magdy <alnokta@yahoo.com>\n"
"Language-Team: Arabeyes Translation & Documentation <admin@arabeyes.org>\n"
......@@ -50,288 +50,323 @@ msgid "Web Browser"
msgstr "متصفح الويب"
#. dialogs are annoying, just spit out a warning
#: ../libxfce4panel/xfce-panel-external-item.c:171
#: ../libxfce4panel/xfce-panel-external-item.c:169
#, c-format
msgid "An item was unexpectedly removed: \"%s\"."
msgstr "لقد ازيل عنصر بصورة غير متوقعة: \"%s\"."
#: ../libxfce4panel/xfce-panel-plugin-iface.c:609
#: ../libxfce4panel/xfce-panel-plugin-iface.c:594
#, c-format
msgid "Remove \"%s\"?"
msgstr "ازل \"%s\"?"
#: ../libxfce4panel/xfce-panel-plugin-iface.c:623
#: ../libxfce4panel/xfce-panel-plugin-iface.c:608
msgid ""
"The item will be removed from the panel and its configuration will be lost."
msgstr ""
#. configure, hide by default
#: ../libxfce4panel/xfce-panel-plugin-iface.c:837
#: ../libxfce4panel/xfce-panel-plugin-iface.c:823
msgid "Properties"
msgstr "خصائص"
#. about item, hide by default
#: ../libxfce4panel/xfce-panel-plugin-iface.c:854
#: ../libxfce4panel/xfce-panel-plugin-iface.c:840
msgid "About"
msgstr "حول"
#: ../libxfce4panel/xfce-panel-plugin-iface.c:868
#. move
#: ../libxfce4panel/xfce-panel-plugin-iface.c:852
msgid "Move"
msgstr "انقل"
#: ../libxfce4panel/xfce-panel-plugin-iface.c:887
#: ../libxfce4panel/xfce-panel-plugin-iface.c:871
msgid "Remove"
msgstr "ازل"
#: ../libxfce4panel/xfce-panel-plugin-iface.c:904
#: ../libxfce4panel/xfce-panel-plugin-iface.c:888
msgid "Add New Item"
msgstr "أضف شيء جديد"
#: ../libxfce4panel/xfce-panel-plugin-iface.c:915 ../panel/panel.c:697
#: ../libxfce4panel/xfce-panel-plugin-iface.c:899 ../panel/panel.c:696
#: ../mcs-plugin/xfce4-panel-manager.desktop.in.h:1
msgid "Customize Panel"
msgstr "خصص الشريط"
#: ../panel/panel.c:708
#: ../panel/panel.c:707
msgid "Add Items"
msgstr "أضف أشياء"
#: ../panel/panel.c:724 ../plugins/actions/actions.c:280
#: ../plugins/actions/actions.c:314 ../plugins/actions/actions.c:432
#: ../panel/panel.c:723 ../plugins/actions/actions.c:286
#: ../plugins/actions/actions.c:320 ../plugins/actions/actions.c:458
msgid "Quit"
msgstr "خروج"
#: ../panel/panel.c:734
#: ../panel/panel.c:733
msgid "Restart"
msgstr "أعد البدأ"
#: ../panel/panel.c:748
#: ../panel/panel.c:747
msgid "About the Xfce Panel"
msgstr "حول شريط اكسفس"
#: ../panel/panel-app.c:238 ../panel/panel-app.c:876
#: ../panel/panel-app.c:255 ../panel/panel-app.c:896
msgid "Exit Xfce Panel?"
msgstr "اخرج من شريط اكسفس؟"
#: ../panel/panel-app.c:874 ../panel/panel-app.c:906 ../panel/panel-app.c:940
#: ../panel/panel-app.c:894 ../panel/panel-app.c:926 ../panel/panel-app.c:959
msgid "Xfce Panel"
msgstr "شريط Xfce"
#: ../panel/panel-app.c:877
#: ../panel/panel-app.c:897
msgid "You can't remove the last panel. Would you like to exit the program?"
msgstr ""
#: ../panel/panel-app.c:904
#: ../panel/panel-app.c:924
#, c-format
msgid "Remove Panel \"%d\"?"
msgstr "ازل الشريط \"%d\"?"
#: ../panel/panel-app.c:908
#: ../panel/panel-app.c:928
msgid "The selected panel and all its items will be removed."
msgstr ""
#: ../panel/panel-app.c:947 ../panel/panel-app.c:950
#: ../panel/panel-app.c:965 ../panel/panel-app.c:966
msgid "Developer"
msgstr "مطوّر"
#: ../panel/main.c:46