[anjuta] project-wizard: Fixed GtkApplication wizard



commit 395e5b0878a77a3bd98de775bf30b26ed51f39cf
Author: Johannes Schmid <jhs gnome org>
Date:   Fri Dec 3 22:42:16 2010 +0100

    project-wizard: Fixed GtkApplication wizard

 .../project-wizard/templates/gtkapplication.wiz.in |    2 +-
 .../templates/gtkapplication/src/application.c     |   17 +++++++++--------
 .../templates/gtkapplication/src/main.c            |    6 +-----
 .../templates/gtkapplication/src/project.ui        |    1 -
 4 files changed, 11 insertions(+), 15 deletions(-)
---
diff --git a/plugins/project-wizard/templates/gtkapplication.wiz.in b/plugins/project-wizard/templates/gtkapplication.wiz.in
index 788200c..d647643 100644
--- a/plugins/project-wizard/templates/gtkapplication.wiz.in
+++ b/plugins/project-wizard/templates/gtkapplication.wiz.in
@@ -30,7 +30,7 @@
 		<property type="hidden" name="NameCUpper" default='[+(string->c-name! (string-substitute (string-upcase (get "Name")) " " "_"))+]'/>
 		<property type="hidden" name="NameCLower" default='[+(string->c-name! (string-substitute (string-downcase (get "Name")) " " "_"))+]'/>
 		<property type="hidden" name="NameHLower" default='[+(string-substitute (string->c-name! (string-downcase (get "Name"))) " " "-")+]'/>
-		<property type="hidden" name="NameCClass" default='[+(string->camelcase (get "Name"))+]'/>
+		<property type="hidden" name="NameCClass" default='[+(string-capitalize! (string-substitute (get "Name") "-" ""))+]'/>
 		<property type="hidden" name="HavePackage" default="1"/>
 		<property type="hidden" name="PackageModule1" default="gtk+-3.0 >= 2.90.3"/>
 		<property type="boolean" name="HaveLangCPP" _label="Add C++ support:" _description="Adds C++ support to the project so that C++ source files can be built" default="0"/>
diff --git a/plugins/project-wizard/templates/gtkapplication/src/application.c b/plugins/project-wizard/templates/gtkapplication/src/application.c
index 6449126..720ad32 100644
--- a/plugins/project-wizard/templates/gtkapplication/src/application.c
+++ b/plugins/project-wizard/templates/gtkapplication/src/application.c
@@ -14,7 +14,9 @@
 #include <glib/gi18n.h>
 [+ENDIF+]
 
-
+/* For testing propose use the local (not installed) ui file */
+/* #define UI_FILE PACKAGE_DATA_DIR"/[+NameHLower+]/ui/[+NameHLower+].ui" */
+#define UI_FILE "src/[+NameHLower+].ui"
 
 G_DEFINE_TYPE ([+NameCClass+], [+NameCLower+], GTK_TYPE_APPLICATION);
 
@@ -56,7 +58,7 @@ static void
 static void
 [+NameCLower+]_activate (GApplication *application)
 {
-  new_window (application, NULL);
+  [+NameCLower+]_new_window (application, NULL);
 }
 
 static void
@@ -68,7 +70,7 @@ static void
   gint i;
 
   for (i = 0; i < n_files; i++)
-    new_window (application, files[i]);
+    [+NameCLower+]_new_window (application, files[i]);
 }
 
 static void
@@ -81,17 +83,16 @@ static void
 [+NameCLower+]_finalize (GObject *object)
 {
 
-	G_OBJECT_CLASS (application_parent_class)->finalize (object);
+	G_OBJECT_CLASS ([+NameCLower+]_parent_class)->finalize (object);
 }
 
 static void
 [+NameCLower+]_class_init ([+NameCClass+]Class *klass)
 {
-	GObjectClass* object_class = G_OBJECT_CLASS (klass);
-	GApplicationClass* parent_class = G_APPLICATION_CLASS (klass);
-
 	G_APPLICATION_CLASS (klass)->activate = [+NameCLower+]_activate;
 	G_APPLICATION_CLASS (klass)->open = [+NameCLower+]_open;
+
+	G_OBJECT_CLASS (klass)->finalize = [+NameCLower+]_finalize;
 }
 
 [+NameCClass+] *
@@ -99,7 +100,7 @@ static void
 {
 	g_type_init ();
 
-	return g_object_new (bloat_pad_get_type (),
+	return g_object_new ([+NameCLower+]_get_type (),
 	                     "application-id", "org.gnome.[+NameCLower+]",
 	                     "flags", G_APPLICATION_HANDLES_OPEN,
 	                     NULL);
diff --git a/plugins/project-wizard/templates/gtkapplication/src/main.c b/plugins/project-wizard/templates/gtkapplication/src/main.c
index 6b1283f..de4d96a 100644
--- a/plugins/project-wizard/templates/gtkapplication/src/main.c
+++ b/plugins/project-wizard/templates/gtkapplication/src/main.c
@@ -18,10 +18,6 @@
 #include <glib/gi18n.h>
 [+ENDIF+]
 
-/* For testing propose use the local (not installed) ui file */
-/* #define UI_FILE PACKAGE_DATA_DIR"/[+NameHLower+]/ui/[+NameHLower+].ui" */
-#define UI_FILE "src/[+NameHLower+].ui"
-
 int
 main (int argc, char *argv[])
 {
@@ -36,7 +32,7 @@ main (int argc, char *argv[])
 #endif
 [+ENDIF+]
 	
-  app = [+NameCLower+]_pad_new ();
+  app = [+NameCLower+]_new ();
   status = g_application_run (G_APPLICATION (app), argc, argv);
   g_object_unref (app);
 
diff --git a/plugins/project-wizard/templates/gtkapplication/src/project.ui b/plugins/project-wizard/templates/gtkapplication/src/project.ui
index a21329c..550851a 100644
--- a/plugins/project-wizard/templates/gtkapplication/src/project.ui
+++ b/plugins/project-wizard/templates/gtkapplication/src/project.ui
@@ -7,7 +7,6 @@
     <property name="title" translatable="yes">window</property>
     <property name="default_width">500</property>
     <property name="default_height">400</property>
-    <signal name="destroy" handler="destroy"/>
     <child>
       <placeholder/>
     </child>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]