From 8c518f5f755d0ee1361481f8c00f84c48f78e9ac Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Mon, 4 Apr 2016 02:29:39 +0300 Subject: [PATCH] In progress... --- src/AppDirs.vala | 2 +- src/ObjectDialog.vala | 28 +++++++++++++++------------- src/main.vala | 14 ++++---------- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/AppDirs.vala b/src/AppDirs.vala index 93c4307..4a89670 100644 --- a/src/AppDirs.vala +++ b/src/AppDirs.vala @@ -2,7 +2,7 @@ extern static char SO_PATH[256]; namespace LAview.Core.Plugins { - class AppDirs { + class AppDirs : Object { public static File so_path; public static File exec_dir; diff --git a/src/ObjectDialog.vala b/src/ObjectDialog.vala index e75d82a..c5c8578 100644 --- a/src/ObjectDialog.vala +++ b/src/ObjectDialog.vala @@ -1,21 +1,23 @@ namespace LAview.Core.Plugins { using Gtk, LAview; - class ObjectExampleDialog1 { - //Dialog dialog; + class ObjectExampleDialog : Object { + Dialog dialog; - ObjectExampleDialog1 (Window parent) throws Error { - // var builder = new Builder (); - // builder.add_from_file (AppDirs.ui_dir + "/laview-plugin-object-example.glade"); - // builder.connect_signals (this); -// -// dialog = builder.get_object ("object_example_dialog") as Dialog; -// if (parent != null) dialog.transient_for = parent; -// dialog.modal = true; + public ObjectExampleDialog (Window parent) throws Error { + var builder = new Builder (); + builder.add_from_file (AppDirs.ui_dir + "/laview-plugin-object-example.glade"); + builder.connect_signals (this); + + dialog = builder.get_object ("object_example_dialog") as Dialog; + if (parent != null) { + dialog.transient_for = parent; + dialog.modal = true; + } } -// public void show_all () { -// dialog.show_all (); -// } + public void show_all () { + dialog.show_all (); + } } } diff --git a/src/main.vala b/src/main.vala index fad8a6b..24efe13 100644 --- a/src/main.vala +++ b/src/main.vala @@ -8,7 +8,7 @@ namespace LAview.Core.Plugins { */ public class PluginObjectExample : PluginObject { - //ObjectExampleDialog1 object_dialog = null; + ObjectExampleDialog object_dialog = null; /** * Constructs a new ``PluginObjectExample``. @@ -47,9 +47,9 @@ namespace LAview.Core.Plugins { * Compose the object. */ public override bool compose (Gee.HashMap answers) throws Error { - //if (object_dialog == null) object_dialog = new ObjectExampleDialog1 (null); + if (object_dialog == null) object_dialog = new ObjectExampleDialog (null); - //object_dialog.show_all (); + object_dialog.show_all (); PluginDataExample data_obj_ex = (host as IHostCore).get_data_object ("DataExample") as PluginDataExample; stdout.puts ("Compose() called\n"); @@ -62,16 +62,10 @@ namespace LAview.Core.Plugins { } } - -public class MyNameIsVasya { - public MyNameIsVasya () { - stdout.puts ("My name is Vasya\n"); - } } -} - [ModuleInit] Type plugin_init (GLib.TypeModule type_module) { + stdout.puts ("---ModuleInit called()---\n"); return typeof (PluginObjectExample); }