Commit c585bd8a authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

added the export commands to the headerbar, removed the toolbar

parent b99b6b82
......@@ -714,6 +714,8 @@ extensions/exiv2_tools/Makefile
extensions/exiv2_tools/data/Makefile
extensions/exiv2_tools/data/ui/Makefile
extensions/export_tools/Makefile
extensions/export_tools/data/Makefile
extensions/export_tools/data/ui/Makefile
extensions/facebook/Makefile
extensions/facebook/data/Makefile
extensions/facebook/data/ui/Makefile
......
......@@ -89,9 +89,6 @@
<key name="sort-inverse" type="b">
<default>false</default>
</key>
<key name="toolbar-style" enum="org.gnome.gthumb.GthToolbarStyle">
<default>'system'</default>
</key>
<key name="window-width" type="i">
<default>0</default>
</key>
......@@ -104,9 +101,6 @@
<key name="image-pane-visible" type="b">
<default>true</default>
</key>
<key name="toolbar-visible" type="b">
<default>true</default>
</key>
<key name="statusbar-visible" type="b">
<default>true</default>
</key>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.0 on Tue Oct 22 16:12:56 2013 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkListStore" id="file_properties_position_liststore">
......@@ -36,7 +37,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
......@@ -53,7 +53,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
......@@ -105,22 +104,6 @@
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="toolbar_style_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Toolbar style:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">toolbar_style_combobox</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
......@@ -131,25 +114,6 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="toolbar_style_combobox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<items>
<item translatable="yes">System settings</item>
<item translatable="yes">Text below icons</item>
<item translatable="yes">Text beside icons</item>
<item translatable="yes">Icons only</item>
<item translatable="yes">Text only</item>
</items>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
......@@ -166,7 +130,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
......@@ -182,7 +146,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
......@@ -201,20 +165,11 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -269,7 +224,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
......@@ -293,7 +247,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
......@@ -337,7 +290,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
</object>
<packing>
......@@ -361,7 +313,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
......@@ -419,7 +370,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
......@@ -437,7 +387,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
......@@ -455,7 +404,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
......@@ -633,7 +581,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
......
......@@ -24,7 +24,6 @@
#include <glib/gi18n.h>
#include <gthumb.h>
#include <extensions/flicker_utils/dlg-export-to-flickr.h>
#include <extensions/flicker_utils/dlg-import-from-flickr.h>
#include <extensions/flicker_utils/flickr-types.h>
......@@ -49,11 +48,13 @@ static FlickrServer www_23hq_com = {
void
gth_browser_activate_action_export_23 (GtkAction *action,
GthBrowser *browser)
gth_browser_activate_export_23 (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GList *items;
GList *file_list;
GthBrowser *browser = GTH_BROWSER (user_data);
GList *items;
GList *file_list;
items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
file_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
......@@ -65,10 +66,3 @@ gth_browser_activate_action_export_23 (GtkAction *action,
_gtk_tree_path_list_free (items);
}
void
gth_browser_activate_action_import_23 (GtkAction *action,
GthBrowser *browser)
{
dlg_import_from_flickr (&www_23hq_com, browser);
}
......@@ -22,11 +22,8 @@
#ifndef ACTIONS_H
#define ACTIONS_H
#include <gtk/gtk.h>
#include <gthumb.h>
#define DEFINE_ACTION(x) void x (GtkAction *action, gpointer data);
DEFINE_ACTION(gth_browser_activate_action_export_23)
DEFINE_ACTION(gth_browser_activate_action_import_23)
DEF_ACTION_CALLBACK (gth_browser_activate_export_23)
#endif /* ACTIONS_H */
......@@ -24,90 +24,30 @@
#include <glib/gi18n.h>
#include <glib-object.h>
#include <gthumb.h>
#include <extensions/export_tools/export-tools.h>
#include "actions.h"
#define BROWSER_DATA_KEY "23hq-browser-data"
static const char *ui_info =
"<ui>"
" <menubar name='MenuBar'>"
" <menu name='File' action='FileMenu'>"
/*
" <menu name='Import' action='ImportMenu'>"
" <placeholder name='Web_Services'>"
" <menuitem action='File_Import_23'/>"
" </placeholder>"
" </menu>"
*/
" <menu name='Export' action='ExportMenu'>"
" <placeholder name='Web_Services'>"
" <menuitem action='File_Export_23'/>"
" </placeholder>"
" </menu>"
" </menu>"
" </menubar>"
" <popup name='ExportPopup'>"
" <placeholder name='Web_Services'>"
" <menuitem action='File_Export_23'/>"
" </placeholder>"
" </popup>"
"</ui>";
static GthActionEntryExt action_entries[] = {
/*
{ "File_Import_23", "site-twentythree",
N_("_23..."), NULL,
N_("Download photos from 23"),
GTH_ACTION_FLAG_ALWAYS_SHOW_IMAGE,
G_CALLBACK (gth_browser_activate_action_import_23) },
*/
{ "File_Export_23", "site-twentythree",
N_("_23..."), NULL,
N_("Upload photos to 23"),
GTH_ACTION_FLAG_ALWAYS_SHOW_IMAGE,
G_CALLBACK (gth_browser_activate_action_export_23) },
static const GActionEntry actions[] = {
{ "export-23", gth_browser_activate_export_23 }
};
typedef struct {
GtkActionGroup *action_group;
} BrowserData;
static void
browser_data_free (BrowserData *data)
{
g_free (data);
}
static const GthMenuEntry action_entries[] = {
{ "23…", "win.export-23", NULL, "site-twentythree" }
};
void
tt__gth_browser_construct_cb (GthBrowser *browser)
{
BrowserData *data;
GError *error = NULL;
guint merge_id;
g_return_if_fail (GTH_IS_BROWSER (browser));
data = g_new0 (BrowserData, 1);
data->action_group = gtk_action_group_new ("23HQ Actions");
gtk_action_group_set_translation_domain (data->action_group, NULL);
_gtk_action_group_add_actions_with_flags (data->action_group,
action_entries,
G_N_ELEMENTS (action_entries),
browser);
gtk_ui_manager_insert_action_group (gth_browser_get_ui_manager (browser), data->action_group, 0);
merge_id = gtk_ui_manager_add_ui_from_string (gth_browser_get_ui_manager (browser), ui_info, -1, &error);
if (merge_id == 0) {
g_warning ("building ui failed: %s", error->message);
g_clear_error (&error);
}
g_object_set_data_full (G_OBJECT (browser), BROWSER_DATA_KEY, data, (GDestroyNotify) browser_data_free);
g_action_map_add_action_entries (G_ACTION_MAP (browser),
actions,
G_N_ELEMENTS (actions),
browser);
gth_menu_manager_append_entries (gth_browser_get_menu_manager (browser, GTH_BROWSER_MENU_MANAGER_WEB_EXPORTERS),
action_entries,
G_N_ELEMENTS (action_entries));
}
......@@ -61,8 +61,8 @@ SUBDIRS = \
search \
selections \
slideshow \
$(EXPORTERS) \
$(IMPORTERS) \
$(EXPORTERS) \
$(OTHER_TOOLS) \
$(NULL)
......
......@@ -27,13 +27,15 @@
void
gth_browser_activate_action_burn_disc (GtkAction *action,
GthBrowser *browser)
gth_browser_activate_burn_disc (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GList *items;
GList *file_list;
GList *files;
GthTask *task;
GthBrowser *browser = GTH_BROWSER (user_data);
GList *items;
GList *file_list;
GList *files;
GthTask *task;
items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
file_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
......
......@@ -22,10 +22,8 @@
#ifndef ACTIONS_H
#define ACTIONS_H
#include <gtk/gtk.h>
#include <gthumb.h>
#define DEFINE_ACTION(x) void x (GtkAction *action, gpointer data);
DEFINE_ACTION(gth_browser_activate_action_burn_disc)
DEF_ACTION_CALLBACK (gth_browser_activate_burn_disc)
#endif /* ACTIONS_H */
......@@ -24,76 +24,28 @@
#include <glib/gi18n.h>
#include <glib-object.h>
#include <gthumb.h>
#include <extensions/export_tools/export-tools.h>
#include "actions.h"
#include "callbacks.h"
#define BROWSER_DATA_KEY "burn-disc-browser-data"
static const char *ui_info =
"<ui>"
" <menubar name='MenuBar'>"
" <menu name='File' action='FileMenu'>"
" <menu name='Export' action='ExportMenu'>"
" <placeholder name='Misc_Actions'>"
" <menuitem action='File_Export_BurnDisc'/>"
" </placeholder>"
" </menu>"
" </menu>"
" </menubar>"
" <popup name='ExportPopup'>"
" <placeholder name='Misc_Actions'>"
" <menuitem action='File_Export_BurnDisc'/>"
" </placeholder>"
" </popup>"
"</ui>";
static GtkActionEntry action_entries[] = {
{ "File_Export_BurnDisc", GTK_STOCK_CDROM,
N_("_Optical Disc..."), NULL,
N_("Write files to an optical disc"),
G_CALLBACK (gth_browser_activate_action_burn_disc) }
static const GActionEntry actions[] = {
{ "burn-disc", gth_browser_activate_burn_disc }
};
typedef struct {
GtkActionGroup *action_group;
guint actions_merge_id;
} BrowserData;
static void
browser_data_free (BrowserData *data)
{
g_free (data);
}
void
bd__gth_browser_construct_cb (GthBrowser *browser)
{
BrowserData *data;
GError *error = NULL;
g_return_if_fail (GTH_IS_BROWSER (browser));
data = g_new0 (BrowserData, 1);
data->action_group = gtk_action_group_new ("Burn Disc Action");
gtk_action_group_set_translation_domain (data->action_group, NULL);
gtk_action_group_add_actions (data->action_group,
action_entries,
G_N_ELEMENTS (action_entries),
browser);
gtk_ui_manager_insert_action_group (gth_browser_get_ui_manager (browser), data->action_group, 0);
data->actions_merge_id = gtk_ui_manager_add_ui_from_string (gth_browser_get_ui_manager (browser), ui_info, -1, &error);
if (data->actions_merge_id == 0) {
g_warning ("building menus failed: %s", error->message);
g_error_free (error);
}
g_object_set_data_full (G_OBJECT (browser), BROWSER_DATA_KEY, data, (GDestroyNotify) browser_data_free);
g_action_map_add_action_entries (G_ACTION_MAP (browser),
actions,
G_N_ELEMENTS (actions),
browser);
gth_menu_manager_append_entry (gth_browser_get_menu_manager (browser, GTH_BROWSER_MENU_MANAGER_OTHER_EXPORTERS),
GTH_MENU_MANAGER_NEW_MERGE_ID,
_("_Optical Disc..."),
"win.burn-disc",
NULL,
NULL);
}
......@@ -27,8 +27,6 @@
#include <extensions/list_tools/list-tools.h>
#include "actions.h"
#define BROWSER_DATA_KEY "change-date-browser-data"
static const GActionEntry actions[] = {
{ "change-date", gth_browser_activate_change_date }
......
......@@ -28,12 +28,14 @@
void
gth_browser_activate_action_create_contact_sheet (GtkAction *action,
GthBrowser *browser)
gth_browser_activate_create_contact_sheet (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GList *items;
GList *file_data_list;
GList *file_list;
GthBrowser *browser = GTH_BROWSER (user_data);
GList *items;
GList *file_data_list;
GList *file_list;
items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
file_data_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
......@@ -50,12 +52,14 @@ gth_browser_activate_action_create_contact_sheet (GtkAction *action,
void
gth_browser_activate_action_create_image_wall (GtkAction *action,
GthBrowser *browser)
gth_browser_activate_create_image_wall (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GList *items;
GList *file_data_list;
GList *file_list;
GthBrowser *browser = GTH_BROWSER (user_data);
GList *items;
GList *file_data_list;
GList *file_list;
items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
file_data_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
......
......@@ -22,11 +22,9 @@
#ifndef ACTIONS_H
#define ACTIONS_H
#include <gtk/gtk.h>
#include <gthumb.h>
#define DEFINE_ACTION(x) void x (GtkAction *action, gpointer data);
DEFINE_ACTION(gth_browser_activate_action_create_contact_sheet)
DEFINE_ACTION(gth_browser_activate_action_create_image_wall)
DEF_ACTION_CALLBACK (gth_browser_activate_create_contact_sheet)
DEF_ACTION_CALLBACK (gth_browser_activate_create_image_wall)
#endif /* ACTIONS_H */
......@@ -24,86 +24,31 @@
#include <glib/gi18n.h>
#include <glib-object.h>
#include <gthumb.h>
#include <extensions/export_tools/export-tools.h>
#include "actions.h"
#define BROWSER_DATA_KEY "contact-sheet-browser-data"
static const char *ui_info =
"<ui>"
" <menubar name='MenuBar'>"
" <menu name='File' action='FileMenu'>"
" <menu name='Export' action='ExportMenu'>"
" <placeholder name='Misc_Actions'>"
" <menu name='ContactSheet' action='ContactSheetMenu'>"
" <menuitem action='Tool_CreateContactSheet'/>"
" <menuitem action='Tool_CreateImageWall'/>"
" </menu>"
" </placeholder>"
" </menu>"
" </menu>"
" </menubar>"
" <popup name='ExportPopup'>"
" <placeholder name='Misc_Actions'>"
" <menu name='ContactSheet' action='ContactSheetMenu'>"
" <menuitem action='Tool_CreateContactSheet'/>"
" <menuitem action='Tool_CreateImageWall'/>"
" </menu>"
" </placeholder>"
" </popup>"
"</ui>";
static GtkActionEntry action_entries[] = {
{ "ContactSheetMenu", NULL, N_("Contact _Sheet") },
{ "Tool_CreateContactSheet", "contact-sheet",
N_("Contact _Sheet..."), NULL,
N_("Create a contact sheet"),
G_CALLBACK (gth_browser_activate_action_create_contact_sheet) },
{ "Tool_CreateImageWall", "image-wall",
N_("Image _Wall..."), NULL,
N_("Create an image-wall"),
G_CALLBACK (gth_browser_activate_action_create_image_wall) },
static const GActionEntry actions[] = {
{ "create-contact-sheet", gth_browser_activate_create_contact_sheet },
{ "create-image-wall", gth_browser_activate_create_image_wall }
};
typedef struct {
GtkActionGroup *action_group;
} BrowserData;
static void