Skip to content

Commit

Permalink
Merge pull request #591 from andersonku/master
Browse files Browse the repository at this point in the history
Converting from Glade to GTK Builder to remove dependency

Updates issue #413
  • Loading branch information
shawnlaffan committed Apr 28, 2016
2 parents ae22f8a + 5b21ebf commit eb3e17e
Show file tree
Hide file tree
Showing 51 changed files with 25,879 additions and 24,651 deletions.
25 changes: 18 additions & 7 deletions bin/BiodiverseGUI.pl
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ BEGIN
# load Gtk
use Gtk2 qw/-init/;

use Gtk2::GladeXML;
use Biodiverse::GUI::Callbacks;

# Load filename specified in the arguments
Expand Down Expand Up @@ -77,22 +76,34 @@ BEGIN
};
#croak $EVAL_ERROR if $EVAL_ERROR;

sub get_main_window
{
my $gui = shift;
my $dlgxml = Gtk2::Builder->new();
$dlgxml->add_from_file($gui->get_gtk_ui_file('wndMain.ui'));
return $dlgxml;

}

###########################
# Create the UI

my $gui = Biodiverse::GUI::GUIManager->instance;
# TODO: Only support development path at the moment
# Should also support when app is packaged
$gui->set_gtk_ui_path(Path::Class::file($Bin, 'ui')->stringify());

my $gladefile = get_gladefile();
my $gladexml = eval {
Gtk2::GladeXML->new( $gladefile, 'wndMain' );
};
my $builder = eval { get_main_window($gui); };
croak $EVAL_ERROR if $EVAL_ERROR;
$gladexml->signal_autoconnect_from_package('Biodiverse::GUI::Callbacks');

my $user_data;
$builder->connect_signals($user_data, 'Biodiverse::GUI::Callbacks');

# Initialise the GUI Manager object
my $gui = Biodiverse::GUI::GUIManager->instance;
$gui->set_glade_xml($gladexml);
$gui->set_glade_xml($builder);
$gui->set_glade_file($gladefile);

$gui->init();

if ( defined $filename ) {
Expand Down
9,699 changes: 1,042 additions & 8,657 deletions bin/glade/biodiverse.glade

Large diffs are not rendered by default.

143 changes: 143 additions & 0 deletions bin/ui/OpenWithName.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
<?xml version="1.0"?>
<interface>
<object class="GtkDialog" id="dlgOpenWithName">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Import Matrix</property>
<property name="modal">True</property>
<property name="destroy_with_parent">True</property>
<property name="icon_name">gtk-add</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkVBox" id="vbox13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="hbuttonbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button19">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button20">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox14">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkHBox" id="hbox9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label75">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="txtName">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">3</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label76">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="ypad">7</property>
<property name="label" translatable="yes">Input File:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFileChooserWidget" id="filechooser">
<property name="width_request">550</property>
<property name="height_request">240</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-6">button19</action-widget>
<action-widget response="-5">button20</action-widget>
</action-widgets>
</object>
</interface>
Loading

0 comments on commit eb3e17e

Please sign in to comment.