diff options
| -rw-r--r-- | Makefile.am | 2 | ||||
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | desktop/.gitignore | 1 | ||||
| -rw-r--r-- | desktop/Makefile.am | 15 | ||||
| -rw-r--r-- | desktop/viewtorrents.desktop.in | 11 | ||||
| -rw-r--r-- | desktop/viewtorrents.png | bin | 0 -> 8987 bytes | |||
| -rw-r--r-- | gui/viewtorrents.glade | 57 | ||||
| -rw-r--r-- | src/main.c | 6 |
8 files changed, 63 insertions, 31 deletions
diff --git a/Makefile.am b/Makefile.am index 18f84ae..7c7029f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,4 +4,4 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ config.sub configure depcomp install-sh ltmain.sh \ missing config.rpath mkinstalldirs -SUBDIRS = gui test src +SUBDIRS = gui desktop test src diff --git a/configure.ac b/configure.ac index cf80acf..aa41f75 100644 --- a/configure.ac +++ b/configure.ac @@ -51,4 +51,4 @@ AS_IF([test -x "$XMLRPC_C_CONFIG"], # End AM_CONFIG_HEADER([config.h]) -AC_OUTPUT([Makefile gui/Makefile test/Makefile src/Makefile]) +AC_OUTPUT([Makefile gui/Makefile desktop/Makefile test/Makefile src/Makefile]) diff --git a/desktop/.gitignore b/desktop/.gitignore new file mode 100644 index 0000000..dfd5cd8 --- /dev/null +++ b/desktop/.gitignore @@ -0,0 +1 @@ +/viewtorrents.desktop diff --git a/desktop/Makefile.am b/desktop/Makefile.am new file mode 100644 index 0000000..0ac91e2 --- /dev/null +++ b/desktop/Makefile.am @@ -0,0 +1,15 @@ +MAINTAINERCLEANFILES = Makefile.in + +Applicationdir = $(datadir)/applications +Applicationicondir = $(datadir)/icons/hicolor/128x128/apps + +Application_predata = viewtorrents.desktop.in +dist_Application_DATA = $(Application_predata:.desktop.in=.desktop) +dist_Applicationicon_DATA = viewtorrents.png + +EXTRA_DIST = $(Application_predata) + +%.desktop: %.desktop.in + cp $< $@ + +CONFIG_CLEAN_FILES = viewtorrents.desktop diff --git a/desktop/viewtorrents.desktop.in b/desktop/viewtorrents.desktop.in new file mode 100644 index 0000000..a532843 --- /dev/null +++ b/desktop/viewtorrents.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=viewtorrents +GenericName=GUI for rTorrent +Comment=View your list of torrents +Exec=viewtorrents +Terminal=false +Type=Application +Icon=viewtorrents +Categories=Utility +StartupNotify=true diff --git a/desktop/viewtorrents.png b/desktop/viewtorrents.png Binary files differnew file mode 100644 index 0000000..c83d662 --- /dev/null +++ b/desktop/viewtorrents.png diff --git a/gui/viewtorrents.glade b/gui/viewtorrents.glade index dee4204..cee5b9a 100644 --- a/gui/viewtorrents.glade +++ b/gui/viewtorrents.glade @@ -5,20 +5,18 @@ <object class="GtkAccelGroup" id="accelgroup1"/> <object class="GtkActionGroup" id="actiongroup"> <child> - <object class="GtkAction" id="rehashaction"> - <property name="label" translatable="yes">Rehash</property> - <property name="tooltip" translatable="yes">Rehash selected torrent</property> - <property name="stock_id">gtk-refresh</property> + <object class="GtkAction" id="connectaction"> + <property name="label" translatable="yes">Connect</property> + <property name="tooltip" translatable="yes">Connect to rTorrent</property> + <property name="stock_id">gtk-connect</property> </object> - <accelerator key="r" modifiers="GDK_CONTROL_MASK"/> </child> <child> - <object class="GtkAction" id="stopaction"> - <property name="label" translatable="yes">Stop</property> - <property name="tooltip" translatable="yes">Stop selected torrent</property> - <property name="stock_id">gtk-media-stop</property> + <object class="GtkAction" id="disconnectaction"> + <property name="label" translatable="yes">Disconnect</property> + <property name="tooltip" translatable="yes">Disconnect from rTorrent</property> + <property name="stock_id">gtk-disconnect</property> </object> - <accelerator key="d" modifiers="GDK_CONTROL_MASK"/> </child> <child> <object class="GtkAction" id="startaction"> @@ -29,18 +27,20 @@ <accelerator key="s" modifiers="GDK_CONTROL_MASK"/> </child> <child> - <object class="GtkAction" id="disconnectaction"> - <property name="label" translatable="yes">Disconnect</property> - <property name="tooltip" translatable="yes">Disconnect from rTorrent</property> - <property name="stock_id">gtk-disconnect</property> + <object class="GtkAction" id="stopaction"> + <property name="label" translatable="yes">Stop</property> + <property name="tooltip" translatable="yes">Stop selected torrent</property> + <property name="stock_id">gtk-media-stop</property> </object> + <accelerator key="d" modifiers="GDK_CONTROL_MASK"/> </child> <child> - <object class="GtkAction" id="connectaction"> - <property name="label" translatable="yes">Connect</property> - <property name="tooltip" translatable="yes">Connect to rTorrent</property> - <property name="stock_id">gtk-connect</property> + <object class="GtkAction" id="rehashaction"> + <property name="label" translatable="yes">Rehash</property> + <property name="tooltip" translatable="yes">Rehash selected torrent</property> + <property name="stock_id">gtk-refresh</property> </object> + <accelerator key="r" modifiers="GDK_CONTROL_MASK"/> </child> </object> <object class="GtkDialog" id="connectdlg"> @@ -65,10 +65,10 @@ <child> <object class="GtkButton" id="button4"> <property name="label">gtk-cancel</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> <property name="use_stock">True</property> </object> <packing> @@ -80,11 +80,11 @@ <child> <object class="GtkButton" id="button3"> <property name="label">gtk-connect</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="can_default">True</property> <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> <property name="use_stock">True</property> </object> <packing> @@ -243,6 +243,8 @@ If authentication is needed, enter username and password as well.</property> <property name="title" translatable="yes">Viewtorrents</property> <property name="default_width">600</property> <property name="default_height">400</property> + <property name="icon_name">viewtorrents</property> + <property name="startup_id">viewtorrents</property> <accel-groups> <group name="accelgroup1"/> </accel-groups> @@ -256,9 +258,9 @@ If authentication is needed, enter username and password as well.</property> <property name="can_focus">False</property> <child> <object class="GtkMenuItem" id="menuitem1"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="use_action_appearance">False</property> <property name="label" translatable="yes">_File</property> <property name="use_underline">True</property> <child type="submenu"> @@ -270,6 +272,7 @@ If authentication is needed, enter username and password as well.</property> <property name="related_action">connectaction</property> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="use_underline">True</property> <property name="use_stock">True</property> <property name="accel_group">accelgroup1</property> </object> @@ -286,17 +289,17 @@ If authentication is needed, enter username and password as well.</property> </child> <child> <object class="GtkSeparatorMenuItem" id="separatormenuitem1"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="use_action_appearance">False</property> </object> </child> <child> <object class="GtkImageMenuItem" id="quitmenuitem"> <property name="label">gtk-quit</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <property name="accel_group">accelgroup1</property> @@ -353,9 +356,9 @@ If authentication is needed, enter username and password as well.</property> </child> <child> <object class="GtkMenuItem" id="menuitem4"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="use_action_appearance">False</property> <property name="label" translatable="yes">_Help</property> <property name="use_underline">True</property> <child type="submenu"> @@ -365,9 +368,9 @@ If authentication is needed, enter username and password as well.</property> <child> <object class="GtkImageMenuItem" id="aboutmenuitem"> <property name="label">gtk-about</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <property name="accel_group">accelgroup1</property> @@ -600,10 +603,10 @@ If authentication is needed, enter username and password as well.</property> <child> <object class="GtkButton" id="button2"> <property name="label">gtk-cancel</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> <property name="use_stock">True</property> </object> <packing> @@ -615,11 +618,11 @@ If authentication is needed, enter username and password as well.</property> <child> <object class="GtkButton" id="button1"> <property name="label">gtk-connect</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="can_default">True</property> <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> <property name="use_stock">True</property> </object> <packing> @@ -280,7 +280,7 @@ static gint liststore_default_compare_func(GtkTreeModel* model, int main(int argc, char** argv) { - const gchar* gladefile; + gchar* gladefile; GtkBuilder* builder; GError* error = NULL; guint ret; @@ -309,7 +309,7 @@ int main(int argc, char** argv) } builder = gtk_builder_new(); - gladefile = DATAROOTDIR "viewtorrents/viewtorrents.glade"; + gladefile = g_build_filename(DATAROOTDIR, "viewtorrents.glade", NULL); ret = gtk_builder_add_from_file(builder, gladefile, &error); #ifdef DEBUG if (ret == 0) @@ -322,9 +322,11 @@ int main(int argc, char** argv) if (ret == 0) { fprintf(stderr, "Unable to load %s: %s\n", gladefile, error->message); + g_free(gladefile); g_clear_error(&error); return EXIT_FAILURE; } + g_free(gladefile); master.torrents = g_hash_table_new_full(g_direct_hash, g_direct_equal, noop_destroy, torrent_destroy); |
