mirror of
https://github.com/transmission/transmission
synced 2025-01-31 03:12:44 +00:00
(trunk, gtk) use GtkApplication and GtkApplicationWindow
This commit is contained in:
parent
dfbfdbc81b
commit
6a3c7f34ec
3 changed files with 7 additions and 7 deletions
|
@ -512,7 +512,7 @@ on_startup( GApplication * application, gpointer user_data )
|
|||
gtk_ui_manager_ensure_update ( ui_manager );
|
||||
|
||||
/* create main window now to be a parent to any error dialogs */
|
||||
win = GTK_WINDOW( gtr_window_new( ui_manager, cbdata->core ) );
|
||||
win = GTK_WINDOW( gtr_window_new( GTK_APPLICATION( application ), ui_manager, cbdata->core ) );
|
||||
g_signal_connect( win, "size-allocate", G_CALLBACK( on_main_window_size_allocated ), cbdata );
|
||||
g_application_hold( application );
|
||||
g_object_weak_ref( G_OBJECT( win ), (GWeakNotify)g_application_release, application );
|
||||
|
@ -587,7 +587,7 @@ main( int argc, char ** argv )
|
|||
int ret;
|
||||
struct stat sb;
|
||||
char * application_id;
|
||||
GApplication * app;
|
||||
GtkApplication * app;
|
||||
GOptionContext * option_context;
|
||||
bool show_version = false;
|
||||
GError * error = NULL;
|
||||
|
@ -650,11 +650,11 @@ main( int argc, char ** argv )
|
|||
/* init the application for the specified config dir */
|
||||
stat( cbdata.config_dir, &sb );
|
||||
application_id = g_strdup_printf( "com.transmissionbt.transmission_%lu_%lu", (unsigned long)sb.st_dev, (unsigned long)sb.st_ino );
|
||||
app = g_application_new( application_id, G_APPLICATION_HANDLES_OPEN );
|
||||
app = gtk_application_new( application_id, G_APPLICATION_HANDLES_OPEN );
|
||||
g_signal_connect( app, "open", G_CALLBACK(on_open), &cbdata );
|
||||
g_signal_connect( app, "startup", G_CALLBACK(on_startup), &cbdata );
|
||||
g_signal_connect( app, "activate", G_CALLBACK(on_activate), &cbdata );
|
||||
ret = g_application_run (app, argc, argv);
|
||||
ret = g_application_run( G_APPLICATION( app ), argc, argv);
|
||||
g_object_unref( app );
|
||||
g_free( application_id );
|
||||
return ret;
|
||||
|
|
|
@ -580,7 +580,7 @@ onOptionsClicked( GtkButton * button UNUSED, gpointer vp )
|
|||
***/
|
||||
|
||||
GtkWidget *
|
||||
gtr_window_new( GtkUIManager * ui_mgr, TrCore * core )
|
||||
gtr_window_new( GtkApplication * app, GtkUIManager * ui_mgr, TrCore * core )
|
||||
{
|
||||
int i, n;
|
||||
const char * pch;
|
||||
|
@ -593,7 +593,7 @@ gtr_window_new( GtkUIManager * ui_mgr, TrCore * core )
|
|||
p = g_new0( PrivateData, 1 );
|
||||
|
||||
/* make the window */
|
||||
self = gtk_window_new ( GTK_WINDOW_TOPLEVEL );
|
||||
self = gtk_application_window_new ( app );
|
||||
g_object_set_qdata_full( G_OBJECT(self), get_private_data_key( ), p, privateFree );
|
||||
win = GTK_WINDOW( self );
|
||||
gtk_window_set_title( win, g_get_application_name( ) );
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <gtk/gtk.h>
|
||||
#include "tr-core.h"
|
||||
|
||||
GtkWidget * gtr_window_new( GtkUIManager * uim, TrCore * core );
|
||||
GtkWidget * gtr_window_new( GtkApplication * app, GtkUIManager * uim, TrCore * core );
|
||||
GtkTreeSelection * gtr_window_get_selection( GtkWindow * );
|
||||
void gtr_window_set_busy( GtkWindow *, gboolean isBusy );
|
||||
void gtr_window_refresh( GtkWindow * );
|
||||
|
|
Loading…
Reference in a new issue