Commit d13e876a authored by Jeroen Arnoldus's avatar Jeroen Arnoldus Committed by Lucas Beeler

Adds support for Tumblr publishing to the Shotwell Extras plugin pack. Closes #5431.

parent 49d065ea
......@@ -7,6 +7,7 @@ Patrick Tierney <patrick@yorba.org>
Mihhail Afanasjev <mihhail.afanasjev@gmail.com>
Joeny Ang <ang.joeny@gmail.com>
Jeroen Arnoldus <b.j.arnoldus@bja-electronics.nl>
Michael Axiak <mike@axiak.net>
Eser Aygün <eser.aygun@gmail.com>
Philip Beam <psbeam@gmail.com>
......
......@@ -58,5 +58,31 @@
</key>
</schema>
<schema id="org.yorba.shotwell.sharing.org-yorba-shotwell-publishing-tumblr" path="/apps/shotwell/sharing/org-yorba-shotwell-publishing-tumblr/">
<key name="token" type="s">
<default>""</default>
<summary>Token</summary>
<description>The token to access tumblr</description>
</key>
<key name="token-secret" type="s">
<default>""</default>
<summary>Secret token</summary>
<description>The secret token to sign oauth requests</description>
</key>
<key name="default-size" type="i">
<default>2</default>
<summary>default size</summary>
<description>A numeric code representing the default size for photos uploaded to Tumblr</description>
</key>
<key name="default-blog" type="i">
<default>0</default>
<summary>default blog</summary>
<description>The name of the default blog of the user, if any</description>
</key>
</schema>
</schemalist>
......@@ -525,6 +525,12 @@
<summary>enable yandex publishing plugin</summary>
<description>True if the Yandex.Fotki publishing plugin is enabled, false otherwise</description>
</key>
<key name="publishing-tumblr" type="b">
<default>false</default>
<summary>enable tumblr publishing plugin</summary>
<description>True if the Tumblr publishing plugin is enabled, false otherwise</description>
</key>
<key name="dataimports-fspot" type="b">
<default>true</default>
......
......@@ -355,10 +355,10 @@ public class Transaction {
}
public class UploadTransaction : Transaction {
private GLib.HashTable<string, string> binary_disposition_table = null;
private Spit.Publishing.Publishable publishable = null;
private string mime_type;
private Gee.HashMap<string, string> message_headers = null;
protected GLib.HashTable<string, string> binary_disposition_table = null;
protected Spit.Publishing.Publishable publishable = null;
protected string mime_type;
protected Gee.HashMap<string, string> message_headers = null;
public UploadTransaction(Session session, Spit.Publishing.Publishable publishable) {
base (session);
......
......@@ -6,15 +6,22 @@ PLUGIN_PKGS := \
libsoup-2.4 \
libxml-2.0 \
webkitgtk-3.0 \
gee-1.0
gee-1.0 \
rest-0.7 \
json-glib-1.0
SRC_FILES := \
shotwell-publishing-extras.vala \
YandexPublishing.vala \
TumblrPublishing.vala \
../../src/util/string.vala \
../common/RESTSupport.vala
RC_FILES := \
yandex_publish_model.glade
yandex_publish_model.glade \
tumblr.png \
tumblr_authentication_pane.glade \
tumblr_publishing_options_pane.glade
include ../Makefile.plugin.mk
This diff is collapsed.
......@@ -92,6 +92,7 @@ private class ShotwellPublishingExtraServices : Object, Spit.Module {
public ShotwellPublishingExtraServices(GLib.File module_file) {
pluggables += new YandexService();
pluggables += new TumblrService(module_file.get_parent());
}
public unowned string get_module_name() {
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="authentication_pane">
<property name="can_focus">False</property>
<child>
<object class="GtkAlignment" id="alignment">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xscale">0.5</property>
<property name="yscale">0.5</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">30</property>
<property name="margin_right">30</property>
<property name="hexpand">True</property>
<property name="spacing">8</property>
<child>
<object class="GtkLabel" id="message_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">label</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkTable" id="field_table">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">8</property>
<property name="row_spacing">2</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Email address</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">username_entry</property>
</object>
</child>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Password</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">password_entry</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="username_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="password_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkButton" id="login_button">
<property name="label" translatable="yes">Login</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkBox" id="tumblr_pane">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">16</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkBox" id="inner_wrapper">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">40</property>
<child>
<object class="GtkLabel" id="upload_info_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">You are logged into Tumblr as (name).
(this label's string is populated and set inside the code,
so changes made here will not display)</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">16</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="visibility_and_size_grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="row_spacing">8</property>
<property name="column_spacing">24</property>
<child>
<object class="GtkLabel" id="blog_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Blogs:</property>
<property name="use_underline">True</property>
<property name="justify">right</property>
<property name="mnemonic_widget">blog_combo</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="size_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Photo _size:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">size_combo</property>
</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="blog_combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="size_combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">18</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="spacing">48</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkButton" id="logout_button">
<property name="label" translatable="yes">_Logout</property>
<property name="use_action_appearance">False</property>
<property name="width_request">96</property>
<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>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">24</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="publish_button">
<property name="label" translatable="yes">_Publish</property>
<property name="use_action_appearance">False</property>
<property name="width_request">96</property>
<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>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">24</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">1</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">8</property>
<property name="position">0</property>
</packing>
</child>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment