summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-09-11 16:22:12 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-09-11 16:22:12 +0000
commitb04162cc32df0d27397d2b0320f984ec98267b54 (patch)
tree9b3a720a94d4b35d0b5ec615406652691b35126f
parentfccdb76b5140f0764a5e6ad035e67519b5ee6f6a (diff)
for view menu check items, set their active in an expose event so they're synced with preferences. add move up/down queue buttons (only in torrent menu for now).
-rw-r--r--configure.ac2
-rw-r--r--redhat/transmission-remote-gtk.spec9
-rw-r--r--src/protocol-constants.h2
-rw-r--r--src/requests.c10
-rw-r--r--src/requests.h3
-rw-r--r--src/trg-client.c7
-rw-r--r--src/trg-main-window.c25
-rw-r--r--src/trg-menu-bar.c39
8 files changed, 85 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 8cc214b..625803e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ(2.63)
-AC_INIT(transmission-remote-gtk, 0.5.2, alan@eth0.org.uk)
+AC_INIT(transmission-remote-gtk, 0.6, alan@eth0.org.uk)
AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_INIT_AUTOMAKE([foreign])
diff --git a/redhat/transmission-remote-gtk.spec b/redhat/transmission-remote-gtk.spec
index 65494bf..5358c4a 100644
--- a/redhat/transmission-remote-gtk.spec
+++ b/redhat/transmission-remote-gtk.spec
@@ -1,5 +1,5 @@
Name: transmission-remote-gtk
-Version: 0.5.2
+Version: 0.6
Release: 1%{?dist:%{dist}}
Summary: Remote control client for Transmission BitTorrent
@@ -70,11 +70,16 @@ update-desktop-database %{_datadir}/applications >/dev/null 2>&1
%{_datadir}/locale/uk/LC_MESSAGES/%{name}.mo
%changelog
-* Sat Aug 27 2011 Alan Fitton <alan@eth0.org.uk> 0.5.2
+* Sat Aug 27 2011 Alan Fitton <alan@eth0.org.uk> 0.6
- Profiles support.
- New JSON based configuration backend.
- Populate destination combo in move dialog.
- Ukranian translation from ROR191.
+- Lots of new columns and info.
+- Supports for queues.
+- Improved status bar and add a free space indicator.
+- Persist/restore filter selection, + notebook/selector visibility.
+- Many other fixes.
* Fri May 6 2011 Alan Fitton <alan@eth0.org.uk> - 0.5.1
- Use libproxy pkg-config CFLAGS in build, for older versions.
diff --git a/src/protocol-constants.h b/src/protocol-constants.h
index 33ceaa0..4a0d6ed 100644
--- a/src/protocol-constants.h
+++ b/src/protocol-constants.h
@@ -118,6 +118,8 @@
#define METHOD_PORT_TEST "port-test"
#define METHOD_BLOCKLIST_UPDATE "blocklist-update"
#define METHOD_SESSION_STATS "session-stats"
+#define METHOD_QUEUE_MOVE_UP "queue-move-up"
+#define METHOD_QUEUE_MOVE_DOWN "queue-move-down"
#define PARAM_IDS "ids"
#define PARAM_DELETE_LOCAL_DATA "delete-local-data"
diff --git a/src/requests.c b/src/requests.c
index 9f40bc2..e6b7639 100644
--- a/src/requests.c
+++ b/src/requests.c
@@ -92,6 +92,16 @@ JsonNode *torrent_verify(JsonArray * array)
return generic_request(METHOD_TORRENT_VERIFY, array);
}
+JsonNode *torrent_move_up_queue(JsonArray * array)
+{
+ return generic_request(METHOD_QUEUE_MOVE_UP, array);
+}
+
+JsonNode *torrent_move_down_queue(JsonArray * array)
+{
+ return generic_request(METHOD_QUEUE_MOVE_DOWN, array);
+}
+
JsonNode *session_set(void)
{
return generic_request(METHOD_SESSION_SET, NULL);
diff --git a/src/requests.h b/src/requests.h
index b8a7cc5..352e3ca 100644
--- a/src/requests.h
+++ b/src/requests.h
@@ -41,6 +41,9 @@ JsonNode *torrent_set_location(JsonArray * array, gchar * location,
JsonNode *blocklist_update(void);
JsonNode *port_test(void);
JsonNode *session_stats(void);
+JsonNode *torrent_move_down_queue(JsonArray * array);
+JsonNode *torrent_move_up_queue(JsonArray * array);
+
void request_set_tag(JsonNode * req, gint64 tag);
void request_set_tag_from_ids(JsonNode * req, JsonArray * ids);
diff --git a/src/trg-client.c b/src/trg-client.c
index 6810278..3256bf5 100644
--- a/src/trg-client.c
+++ b/src/trg-client.c
@@ -548,8 +548,11 @@ static trg_http_response *trg_http_perform_inner(TrgClient * tc,
tls->response->size = 0;
tls->response->status = -1;
- g_free(tls->response->data);
- tls->response->data = NULL;
+
+ if (tls->response->data) {
+ g_free(tls->response->data);
+ tls->response->data = NULL;
+ }
curl_easy_setopt(tls->curl, CURLOPT_POSTFIELDS, req);
tls->response->status = curl_easy_perform(tls->curl);
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index 0fee170..2aa4be0 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -535,6 +535,22 @@ static void verify_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data) {
on_generic_interactive_action, data);
}
+static void up_queue_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data) {
+ TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
+
+ dispatch_async(priv->client,
+ torrent_move_up_queue(build_json_id_array(priv->torrentTreeView)),
+ on_generic_interactive_action, data);
+}
+
+static void down_queue_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data) {
+ TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
+
+ dispatch_async(priv->client,
+ torrent_move_down_queue(build_json_id_array(priv->torrentTreeView)),
+ on_generic_interactive_action, data);
+}
+
static gint confirm_action_dialog(GtkWindow * win,
GtkTreeSelection * selection, gchar * question_single,
gchar * question_multi, gchar * action_stock) {
@@ -1167,7 +1183,8 @@ static TrgMenuBar *trg_main_window_menu_bar_new(TrgMainWindow * win) {
*b_remove, *b_delete, *b_props, *b_local_prefs, *b_remote_prefs,
*b_about, *b_view_states, *b_view_notebook, *b_view_stats,
*b_add_url, *b_quit, *b_move, *b_reannounce, *b_pause_all,
- *b_resume_all, *b_dir_filters, *b_tracker_filters, *b_show_graph;
+ *b_resume_all, *b_dir_filters, *b_tracker_filters, *b_show_graph, *b_up_queue, *b_down_queue;
+
TrgMenuBar *menuBar;
menuBar = trg_menu_bar_new(trg_client_get_prefs(priv->client));
@@ -1183,8 +1200,8 @@ static TrgMenuBar *trg_main_window_menu_bar_new(TrgMainWindow * win) {
"view-states-button", &b_view_states, "view-stats-button",
&b_view_stats, "about-button", &b_about, "quit-button", &b_quit,
"dir-filters", &b_dir_filters, "tracker-filters", &b_tracker_filters,
- "show-graph", &b_show_graph,
- NULL);
+ "show-graph", &b_show_graph, "up-queue", &b_up_queue, "down-queue",
+ &b_down_queue, NULL);
g_signal_connect(b_connect, "activate", G_CALLBACK(connect_cb), win);
g_signal_connect(b_disconnect, "activate",
@@ -1202,6 +1219,8 @@ static TrgMenuBar *trg_main_window_menu_bar_new(TrgMainWindow * win) {
win);
g_signal_connect(b_delete, "activate", G_CALLBACK(delete_cb), win);
g_signal_connect(b_remove, "activate", G_CALLBACK(remove_cb), win);
+ g_signal_connect(b_up_queue, "activate", G_CALLBACK(up_queue_cb), win);
+ g_signal_connect(b_down_queue, "activate", G_CALLBACK(down_queue_cb), win);
g_signal_connect(b_move, "activate", G_CALLBACK(move_cb), win);
g_signal_connect(b_about, "activate", G_CALLBACK(open_about_cb), win);
g_signal_connect(b_local_prefs, "activate",
diff --git a/src/trg-menu-bar.c b/src/trg-menu-bar.c
index dc3523b..f8f3f1d 100644
--- a/src/trg-menu-bar.c
+++ b/src/trg-menu-bar.c
@@ -49,7 +49,9 @@ enum {
PROP_PREFS,
PROP_DIR_FILTERS,
PROP_TRACKER_FILTERS,
- PROP_VIEW_SHOW_GRAPH
+ PROP_VIEW_SHOW_GRAPH,
+ PROP_MOVE_DOWN_QUEUE,
+ PROP_MOVE_UP_QUEUE
};
G_DEFINE_TYPE(TrgMenuBar, trg_menu_bar, GTK_TYPE_MENU_BAR)
@@ -82,6 +84,8 @@ struct _TrgMenuBarPrivate {
GtkWidget *mb_directory_filters;
GtkWidget *mb_tracker_filters;
GtkWidget *mb_view_graph;
+ GtkWidget *mb_down_queue;
+ GtkWidget *mb_up_queue;
TrgPrefs *prefs;
};
@@ -112,6 +116,8 @@ void trg_menu_bar_torrent_actions_sensitive(TrgMenuBar * mb,
gtk_widget_set_sensitive(priv->mb_verify, sensitive);
gtk_widget_set_sensitive(priv->mb_reannounce, sensitive);
gtk_widget_set_sensitive(priv->mb_move, sensitive);
+ gtk_widget_set_sensitive(priv->mb_up_queue, sensitive);
+ gtk_widget_set_sensitive(priv->mb_down_queue, sensitive);
}
static void trg_menu_bar_set_property(GObject * object,
@@ -149,6 +155,12 @@ trg_menu_bar_get_property(GObject * object, guint property_id,
case PROP_DELETE_BUTTON:
g_value_set_object(value, priv->mb_delete);
break;
+ case PROP_MOVE_UP_QUEUE:
+ g_value_set_object(value, priv->mb_up_queue);
+ break;
+ case PROP_MOVE_DOWN_QUEUE:
+ g_value_set_object(value, priv->mb_down_queue);
+ break;
case PROP_MOVE_BUTTON:
g_value_set_object(value, priv->mb_move);
break;
@@ -259,12 +271,18 @@ static void view_menu_bar_toggled_dependency_cb(GtkCheckMenuItem *w, gpointer da
gtk_widget_set_sensitive(GTK_WIDGET(data), gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w)));
}
+static void trg_menu_bar_view_item_exposed(GtkWidget *w, GdkEvent *event G_GNUC_UNUSED, gpointer data)
+{
+ TrgPrefs *prefs = TRG_PREFS(data);
+ gchar *key = (gchar*)g_object_get_data(G_OBJECT(w), "conf-key");
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
+ (w), trg_prefs_get_bool(prefs, key, TRG_PREFS_GLOBAL));
+}
+
static GtkWidget *trg_menu_bar_view_item_new(TrgPrefs *prefs, gchar *key,
gchar *label, GtkWidget *dependency)
{
GtkWidget *w = gtk_check_menu_item_new_with_label(label);
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
- (w), trg_prefs_get_bool(prefs, key, TRG_PREFS_GLOBAL));
g_object_set_data_full(G_OBJECT(w), "conf-key", g_strdup(key),
g_free);
@@ -276,6 +294,8 @@ static GtkWidget *trg_menu_bar_view_item_new(TrgPrefs *prefs, gchar *key,
g_signal_connect(w, "toggled",
G_CALLBACK(view_menu_item_toggled_cb), prefs);
+ g_signal_connect(w, "expose-event",
+ G_CALLBACK(trg_menu_bar_view_item_exposed), prefs);
return w;
}
@@ -396,6 +416,14 @@ GtkWidget *trg_menu_bar_torrent_menu_new(TrgMenuBarPrivate * priv)
_("Remove and Delete"), GTK_STOCK_DELETE,
FALSE);
+ priv->mb_up_queue = trg_menu_bar_item_new(GTK_MENU_SHELL(torrentMenu),
+ _("Move Up Queue"), GTK_STOCK_GO_UP,
+ FALSE);
+
+ priv->mb_down_queue = trg_menu_bar_item_new(GTK_MENU_SHELL(torrentMenu),
+ _("Move Down Queue"), GTK_STOCK_GO_DOWN,
+ FALSE);
+
gtk_menu_shell_append(GTK_MENU_SHELL(torrentMenu),
gtk_separator_menu_item_new());
@@ -517,9 +545,12 @@ static void trg_menu_bar_class_init(TrgMenuBarClass * klass)
"dir-filters", "Dir Filters");
trg_menu_bar_install_widget_prop(object_class, PROP_TRACKER_FILTERS,
"tracker-filters", "Tracker Filters");
-
trg_menu_bar_install_widget_prop(object_class, PROP_VIEW_SHOW_GRAPH,
"show-graph", "Show Graph");
+ trg_menu_bar_install_widget_prop(object_class, PROP_MOVE_DOWN_QUEUE,
+ "down-queue", "Down Queue");
+ trg_menu_bar_install_widget_prop(object_class, PROP_MOVE_UP_QUEUE,
+ "up-queue", "Up Queue");
g_object_class_install_property(object_class,