[latexila] MainWindow: continue to split the constructor
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] MainWindow: continue to split the constructor
- Date: Wed, 1 Aug 2012 23:31:21 +0000 (UTC)
commit a5e63c1494ff96f9ebac759e5859d35aecfe3c72
Author: SÃbastien Wilmet <swilmet src gnome org>
Date: Thu Aug 2 01:20:59 2012 +0200
MainWindow: continue to split the constructor
src/main_window.vala | 78 +++++++++++++++++++++++++++----------------------
1 files changed, 43 insertions(+), 35 deletions(-)
---
diff --git a/src/main_window.vala b/src/main_window.vala
index b82bb15..cc23811 100644
--- a/src/main_window.vala
+++ b/src/main_window.vala
@@ -218,6 +218,8 @@ public class MainWindow : Window
/* signal handlers */
connect_documents_panel ();
+ hide_completion_calltip_when_needed ();
+ support_drag_and_drop ();
delete_event.connect (() =>
{
@@ -227,43 +229,8 @@ public class MainWindow : Window
return true;
});
- // hide completion calltip
- notify["active-tab"].connect (() =>
- {
- CompletionProvider provider = CompletionProvider.get_default ();
- provider.hide_calltip_window ();
- });
-
- // hide completion calltip
- focus_out_event.connect (() =>
- {
- CompletionProvider provider = CompletionProvider.get_default ();
- provider.hide_calltip_window ();
-
- // propagate the event further
- return false;
- });
-
set_file_actions_sensitivity (false);
- // drag-n-drop support of files
- Gtk.drag_dest_set (this, DestDefaults.ALL, {}, Gdk.DragAction.COPY);
- Gtk.drag_dest_add_uri_targets (this);
- drag_data_received.connect ((dc, x, y, selection_data, info, time) =>
- {
- Latexila app = Latexila.get_instance ();
-
- File[] files = {};
- foreach (string uri in selection_data.get_uris ())
- {
- if (0 < uri.length)
- files += File.new_for_uri (uri);
- }
-
- app.open_documents (files);
- Gtk.drag_finish (dc, true, true, time);
- });
-
/* packing widgets */
Grid main_vgrid = new Grid ();
main_vgrid.orientation = Orientation.VERTICAL;
@@ -397,6 +364,47 @@ public class MainWindow : Window
});
}
+ private void hide_completion_calltip_when_needed ()
+ {
+ // hide completion calltip
+ notify["active-tab"].connect (() =>
+ {
+ CompletionProvider provider = CompletionProvider.get_default ();
+ provider.hide_calltip_window ();
+ });
+
+ // hide completion calltip
+ focus_out_event.connect (() =>
+ {
+ CompletionProvider provider = CompletionProvider.get_default ();
+ provider.hide_calltip_window ();
+
+ // propagate the event further
+ return false;
+ });
+ }
+
+ // Drag and drop of a list of files.
+ private void support_drag_and_drop ()
+ {
+ Gtk.drag_dest_set (this, DestDefaults.ALL, {}, Gdk.DragAction.COPY);
+ Gtk.drag_dest_add_uri_targets (this);
+ drag_data_received.connect ((dc, x, y, selection_data, info, time) =>
+ {
+ Latexila app = Latexila.get_instance ();
+
+ File[] files = {};
+ foreach (string uri in selection_data.get_uris ())
+ {
+ if (0 < uri.length)
+ files += File.new_for_uri (uri);
+ }
+
+ app.open_documents (files);
+ Gtk.drag_finish (dc, true, true, time);
+ });
+ }
+
public Gee.List<Document> get_documents ()
{
Gee.List<Document> all_documents = new Gee.LinkedList<Document> ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]