Changeset 13477


Ignore:
Timestamp:
Sep 7, 2012, 5:18:17 PM (9 years ago)
Author:
jordan
Message:

load the UI from a resource file rather than a string. Patch by fmuellner

Location:
trunk/gtk
Files:
2 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/Makefile.am

    r13199 r13477  
    4848    stats.h \
    4949    torrent-cell-renderer.h \
     50    transmission-resources.h \
    5051    tr-core.h \
    5152    tr-icon.h \
    5253    tr-prefs.h \
    5354    tr-window.h \
    54     ui.h \
    5555    util.h
    5656
     
    7575    stats.c \
    7676    torrent-cell-renderer.c \
     77    transmission-resources.c \
    7778    tr-core.c \
    7879    tr-icon.c \
     
    107108icondir = $(datadir)/pixmaps
    108109
     110UI_FILES = transmission-ui.xml
     111
     112transmission-resources.c: transmission.gresource.xml $(UI_FILES)
     113        glib-compile-resources --target=$@ --sourcedir=$(srcdir) \
     114          --generate-source --c-name transmission $<
     115
     116transmission-resources.h: transmission.gresource.xml
     117        glib-compile-resources --target=$@ --sourcedir=$(srcdir) \
     118          --generate-header --c-name transmission $<
     119
    109120EXTRA_DIST = \
    110121    $(DESKTOP_IN_FILES) \
     
    120131
    121132BUILT_SOURCES = \
    122         setransmission.res
     133        setransmission.res \
     134        transmission-resources.c \
     135        transmission-resources.h
    123136
    124137CLEANFILES = \
    125         transmission.res
     138        setransmission.res \
     139        transmission-resources.c \
     140        transmission-resources.h
    126141
    127142transmission_gtk_LDADD += \
  • trunk/gtk/main.c

    r13474 r13477  
    5656#include "tr-window.h"
    5757#include "util.h"
    58 #include "ui.h"
    5958
    6059#define MY_CONFIG_NAME "transmission"
    6160#define MY_READABLE_NAME "transmission-gtk"
     61
     62#define TR_RESOURCE_PATH "/com/transmissionbt/transmission/"
    6263
    6364#define SHOW_LICENSE
     
    482483on_startup( GApplication * application, gpointer user_data )
    483484{
     485    GError * error;
    484486    const char * str;
    485487    GtkWindow * win;
     
    507509
    508510    /* init the ui manager */
     511    error = NULL;
    509512    ui_manager = gtk_ui_manager_new ( );
    510513    gtr_actions_init ( ui_manager, cbdata );
    511     gtk_ui_manager_add_ui_from_string ( ui_manager, fallback_ui_file, -1, NULL );
     514    gtk_ui_manager_add_ui_from_resource ( ui_manager, TR_RESOURCE_PATH "transmission-ui.xml", &error );
     515    g_assert_no_error (error);
    512516    gtk_ui_manager_ensure_update ( ui_manager );
    513517
Note: See TracChangeset for help on using the changeset viewer.