Don't show an error when transmission is run twice

Instead, present the main window. This commit also auto-generates
the dbus bindings.
This commit is contained in:
Mukund Sivaraman
2008-08-17 12:39:26 +00:00
parent e56a34000b
commit 317281f87c
15 changed files with 99 additions and 145 deletions

View File

@@ -71,9 +71,9 @@ cf_init(const char *dir, char **errstr)
/* errstr may be NULL, this might be called before GTK is initialized */
static gboolean
lockfile(const char * filename, char **errstr)
lockfile(const char * filename, tr_lockfile_state_t *tr_state, char **errstr)
{
const int state = tr_lockfile( filename );
const tr_lockfile_state_t state = tr_lockfile( filename );
const gboolean success = state == TR_LOCKFILE_SUCCESS;
if( errstr ) switch( state ) {
@@ -90,6 +90,9 @@ lockfile(const char * filename, char **errstr)
break;
}
if( tr_state != NULL)
*tr_state = state;
return success;
}
@@ -111,10 +114,10 @@ cf_removelocks( void )
/* errstr may be NULL, this might be called before GTK is initialized */
gboolean
cf_lock( char ** errstr )
cf_lock( tr_lockfile_state_t *tr_state, char ** errstr )
{
char * path = getLockFilename( );
const gboolean didLock = lockfile( path, errstr );
const gboolean didLock = lockfile( path, tr_state, errstr );
if( didLock )
gl_lockpath = g_strdup( path );
g_atexit( cf_removelocks );