mirror of https://github.com/GNOME/gimp.git
moved some common code back to main.c
svn path=/trunk/; revision=26118
This commit is contained in:
parent
30cc37c5fe
commit
0cf63ba421
17
app/main.c
17
app/main.c
|
@ -41,6 +41,10 @@
|
|||
#include <io.h> /* get_osfhandle */
|
||||
#endif
|
||||
|
||||
#ifndef GIMP_CONSOLE_COMPILATION
|
||||
#include <gdk/gdk.h>
|
||||
#endif
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
|
||||
#include "core/core-types.h"
|
||||
|
@ -370,11 +374,18 @@ main (int argc,
|
|||
if (no_interface)
|
||||
new_instance = TRUE;
|
||||
|
||||
if (! new_instance)
|
||||
#ifndef GIMP_CONSOLE_COMPILATION
|
||||
if (! new_instance && gimp_unique_open (filenames, as_new))
|
||||
{
|
||||
if (gimp_unique_open (filenames, as_new, be_verbose))
|
||||
return EXIT_SUCCESS;
|
||||
if (be_verbose)
|
||||
g_print ("%s\n",
|
||||
_("Another GIMP instance is already running."));
|
||||
|
||||
gdk_notify_startup_complete ();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
abort_message = sanity_check ();
|
||||
if (abort_message)
|
||||
|
|
31
app/unique.c
31
app/unique.c
|
@ -28,40 +28,31 @@
|
|||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef GIMP_CONSOLE_COMPILATION
|
||||
#include <gdk/gdk.h>
|
||||
#endif
|
||||
|
||||
#include "core/core-types.h"
|
||||
|
||||
#include "file/file-utils.h"
|
||||
|
||||
#include "unique.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
#if HAVE_DBUS_GLIB
|
||||
static gboolean gimp_unique_dbus_open (const gchar **filenames,
|
||||
gboolean as_new,
|
||||
gboolean be_verbose);
|
||||
gboolean as_new);
|
||||
#endif
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
static gboolean gimp_unique_win32_open (const gchar **filenames,
|
||||
gboolean as_new,
|
||||
gboolean be_verbose);
|
||||
gboolean as_new);
|
||||
#endif
|
||||
|
||||
gboolean
|
||||
gimp_unique_open (const gchar **filenames,
|
||||
gboolean as_new,
|
||||
gboolean be_verbose)
|
||||
gboolean as_new)
|
||||
{
|
||||
#ifdef G_OS_WIN32
|
||||
return gimp_unique_win32_open (filenames, as_new, be_verbose);
|
||||
return gimp_unique_win32_open (filenames, as_new);
|
||||
#elif HAVE_DBUS_GLIB
|
||||
return gimp_unique_dbus_open (filenames, as_new, be_verbose);
|
||||
return gimp_unique_dbus_open (filenames, as_new);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
|
@ -72,8 +63,7 @@ gimp_unique_open (const gchar **filenames,
|
|||
|
||||
static gboolean
|
||||
gimp_unique_dbus_open (const gchar **filenames,
|
||||
gboolean as_new,
|
||||
gboolean be_verbose)
|
||||
gboolean as_new)
|
||||
{
|
||||
#ifndef GIMP_CONSOLE_COMPILATION
|
||||
|
||||
|
@ -160,12 +150,6 @@ gimp_unique_dbus_open (const gchar **filenames,
|
|||
|
||||
if (success)
|
||||
{
|
||||
if (be_verbose)
|
||||
g_print ("%s\n",
|
||||
_("Another GIMP instance is already running."));
|
||||
|
||||
gdk_notify_startup_complete ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else if (! (error->domain == DBUS_GERROR &&
|
||||
|
@ -188,8 +172,7 @@ gimp_unique_dbus_open (const gchar **filenames,
|
|||
|
||||
static gboolean
|
||||
gimp_unique_win32_open (const gchar **filenames,
|
||||
gboolean as_new,
|
||||
gboolean be_verbose)
|
||||
gboolean as_new)
|
||||
{
|
||||
#ifndef GIMP_CONSOLE_COMPILATION
|
||||
|
||||
|
|
|
@ -21,8 +21,7 @@
|
|||
|
||||
|
||||
gboolean gimp_unique_open (const gchar **filenames,
|
||||
gboolean as_new,
|
||||
gboolean be_verbose);
|
||||
gboolean as_new);
|
||||
|
||||
|
||||
#endif /* __UNIQUE_H__ */
|
||||
|
|
|
@ -8,7 +8,6 @@ app/app.c
|
|||
app/batch.c
|
||||
app/main.c
|
||||
app/sanity.c
|
||||
app/unique.c
|
||||
app/version.c
|
||||
|
||||
app/actions/actions.c
|
||||
|
|
Loading…
Reference in New Issue