~ubuntu-branches/debian/sid/xiphos/sid

« back to all changes in this revision

Viewing changes to src/gnome2/main_menu.c

  • Committer: Package Import Robot
  • Author(s): Dimitri John Ledkov
  • Date: 2014-07-12 17:08:46 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20140712170846-ja9jzhgt51d3fkrd
Tags: 3.2.2+dfsg1-1
* New upstream release.
* Bump standards version.
* Switch uscan to sf.net redirector.
* Unpack waf in get-orig-source target.
* Bump to debhelper 9.
* Add uuid-dev build-dep.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Xiphos Bible Study Tool
3
3
 * main_menu.c - creation of and call backs for xiphos main menu
4
4
 *
5
 
 * Copyright (C) 2000-2011 Xiphos Developer Team
 
5
 * Copyright (C) 2000-2014 Xiphos Developer Team
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify
8
8
 * it under the terms of the GNU General Public License as published by
30
30
  #include <glade/glade-xml.h>
31
31
#endif
32
32
 
 
33
#ifdef USE_WEBKIT_EDITOR        
 
34
#include "editor/webkit_editor.h"
 
35
#include "editor/editor.h"
 
36
#else
33
37
#include "editor/slib-editor.h"
 
38
#endif
 
39
 
34
40
 
35
41
#include "gui/about_xiphos.h"
36
42
#include "gui/about_sword.h"
154
160
on_live_chat_activate(GtkMenuItem * menuitem, gpointer user_data)
155
161
{
156
162
        gchar *user = g_strdup_printf("%s", g_get_user_name()), *s, *url;
 
163
        gchar version[] = VERSION;
 
164
        int i;
 
165
        gchar platform =
 
166
#ifdef WIN32
 
167
            'W'
 
168
#else
 
169
            'L'
 
170
#endif
 
171
            ;
 
172
 
 
173
        /* no periods in irc nicks. */
 
174
        for (i = 0; version[i]; ++i)
 
175
                if (version[i] == '.')
 
176
                        version[i] = '-';
 
177
 
 
178
        /* mibbit nick length limit = 16 chars. */
 
179
        /* cut name off at 8, leaving 8 for "|platform+version". */
 
180
        if (strlen(user) > 8)
 
181
                user[8] = '\0';
 
182
 
 
183
        /* no blanks in irc nicks. */
157
184
        for (s = strchr(user, ' '); s; s = strchr(s, ' '))
158
185
                *s = '_';
 
186
 
159
187
        url = g_strdup_printf(
160
 
            "http://webchat.freenode.net/?nick=%s|xiphos&channels=xiphos&prompt=1",
161
 
            user);
 
188
            "http://webchat.freenode.net/?nick=%s|%c%s&channels=xiphos&prompt=1",
 
189
            user, platform, version);
162
190
        xiphos_open_default(url);
163
191
        g_free(url);
164
192
        g_free(user);
481
509
G_MODULE_EXPORT void
482
510
on_quit_activate(GtkMenuItem * menuitem, gpointer user_data)
483
511
{
 
512
#if defined(WIN32) && defined(HAVE_DBUS)
 
513
        /* we started dbus-daemon ourselves, so we must kill it, too. */
 
514
        extern GPid dbus_pid;
 
515
 
 
516
        g_spawn_close_pid(dbus_pid);
 
517
#endif
 
518
 
 
519
        /* offer to save all editors remaining open */
 
520
        editor_maybe_save_all();
 
521
 
484
522
        shutdown_frontend();
485
523
        /* shutdown the sword stuff */
486
524
        main_shutdown_backend();
487
525
        gtk_main_quit();
 
526
#if 0
 
527
        /* this causes trouble when paratab is active.
 
528
           and frankly, why do we care?  we're about to exit.  just leave. */
488
529
        gtk_widget_destroy(widgets.app);
 
530
#endif
489
531
        exit(0);
490
532
}
491
533
 
549
591
        dialog = gtk_file_chooser_dialog_new ("Save Session",
550
592
                                      NULL,
551
593
                                      GTK_FILE_CHOOSER_ACTION_SAVE,
 
594
#ifdef HAVE_GTK_310
 
595
                                       "_Cancel", GTK_RESPONSE_CANCEL,
 
596
                                       "_Save", GTK_RESPONSE_ACCEPT,
 
597
#else                        
552
598
                                      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
553
 
                                      GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
 
599
                                      GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, 
 
600
#endif                                                
554
601
                                      NULL);
 
602
        
555
603
        gtk_file_chooser_set_current_folder((GtkFileChooser*)dialog, tabs_dir);
556
604
        if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
557
605
        {
654
702
 
655
703
        dialog = gtk_file_chooser_dialog_new ("Open Session",
656
704
                                      NULL,
657
 
                                      GTK_FILE_CHOOSER_ACTION_OPEN,
 
705
                                      GTK_FILE_CHOOSER_ACTION_OPEN,                                   
 
706
#ifdef HAVE_GTK_310
 
707
                                       "_Cancel", GTK_RESPONSE_CANCEL,
 
708
                                       "_Open", GTK_RESPONSE_ACCEPT,
 
709
#else                        
658
710
                                      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
659
 
                                      GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
 
711
                                      GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, 
 
712
#endif                                  
660
713
                                      NULL);
 
714
        
661
715
        gtk_file_chooser_set_current_folder((GtkFileChooser*)dialog, tabs_dir);
662
716
        if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
663
717
        {
793
847
on_open_studypad_activate(GtkMenuItem * menuitem, gpointer user_data)
794
848
{
795
849
        editor_create_new(settings.studypadfilename, NULL, FALSE);
 
850
        //create_window ();
796
851
}
797
852
 
798
853