[anjuta/system-db-refactor: 6/12] language-support-cpp-java: Initial pkg-config preferences
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta/system-db-refactor: 6/12] language-support-cpp-java: Initial pkg-config preferences
- Date: Wed, 26 Jan 2011 23:21:51 +0000 (UTC)
commit eb71ebd1484e9f8caf8bbbcbda30e7f8530d11a1
Author: Johannes Schmid <jhs gnome org>
Date: Tue Jan 25 16:12:17 2011 +0100
language-support-cpp-java: Initial pkg-config preferences
.../anjuta-language-cpp-java.ui | 198 ++++++++++++-------
plugins/language-support-cpp-java/plugin.c | 21 ++
2 files changed, 146 insertions(+), 73 deletions(-)
---
diff --git a/plugins/language-support-cpp-java/anjuta-language-cpp-java.ui b/plugins/language-support-cpp-java/anjuta-language-cpp-java.ui
index 9dd9b1e..a7a3eae 100644
--- a/plugins/language-support-cpp-java/anjuta-language-cpp-java.ui
+++ b/plugins/language-support-cpp-java/anjuta-language-cpp-java.ui
@@ -2,7 +2,23 @@
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-requires anjuta 0.0 -->
- <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="upper">100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment2">
+ <property name="upper">100</property>
+ <property name="value">4</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment3">
+ <property name="upper">50</property>
+ <property name="value">10</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkAdjustment" id="adjustment4">
<property name="upper">100</property>
<property name="step_increment">1</property>
@@ -10,6 +26,7 @@
</object>
<object class="GtkListStore" id="liststore1"/>
<object class="GtkWindow" id="preferences_dialog">
+ <property name="can_focus">False</property>
<property name="title" translatable="yes">window1</property>
<child>
<object class="GtkNotebook" id="preferences">
@@ -18,18 +35,21 @@
<child>
<object class="GtkFrame" id="page2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkVBox" id="vbox1111">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkTable" id="table15">
<property name="visible">True</property>
- <property name="n_rows">3</property>
+ <property name="can_focus">False</property>
<property name="border_width">10</property>
+ <property name="n_rows">3</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
@@ -38,31 +58,32 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
- <property name="position">0</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
- <child>
+ <child>
<object class="GtkCheckButton" id="preferences_toggle:bool:1:1:cpp-multiline-leading-asterisk">
<property name="label" translatable="yes">Leading asterisk in multi-line comment</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
</packing>
</child>
<child>
@@ -93,18 +114,22 @@
<child>
<object class="GtkFrame" id="frame48">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment5">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkTable" id="table18">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
@@ -146,6 +171,7 @@
<child>
<object class="GtkLabel" id="label12353">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Brace indentation size in spaces:</property>
</object>
@@ -159,6 +185,7 @@
<child>
<object class="GtkLabel" id="label123">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Statement indentation size in spaces:</property>
</object>
@@ -169,6 +196,8 @@
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
@@ -179,6 +208,7 @@
<child type="label">
<object class="GtkLabel" id="label12355">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Indentation parameters</property>
<attributes>
<attribute name="weight" value="bold"/>
@@ -188,22 +218,26 @@
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
@@ -214,6 +248,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">preferences_toggle:bool:0:0:cpp-indent-paranthese-indent</property>
@@ -229,6 +264,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -268,6 +304,7 @@
<child type="label">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Parenthesis indentation</property>
<attributes>
<attribute name="weight" value="bold"/>
@@ -286,6 +323,7 @@
<child type="label">
<object class="GtkLabel" id="label12321">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Smart Indentation</property>
<attributes>
<attribute name="weight" value="bold"/>
@@ -297,6 +335,7 @@
<child type="tab">
<object class="GtkLabel" id="label12351">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Smart Indentation</property>
</object>
<packing>
@@ -306,18 +345,19 @@
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<object class="GtkFrame" id="frame45">
<property name="visible">True</property>
- <property name="border_width">0</property>
+ <property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkVBox" id="vbox1118">
<property name="visible">True</property>
- <property name="spacing">0</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="preferences_toggle:bool:1:1:cpp-completion-enable">
<property name="label" translatable="yes">Enable code completion</property>
@@ -325,6 +365,7 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="border_width">5</property>
+ <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -337,15 +378,18 @@
<child>
<object class="GtkFrame" id="frame3">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="preferences_toggle:bool:1:1:cpp-completion-space-after-func">
<property name="label" translatable="yes">Add a space after function call autocompletion</property>
@@ -354,9 +398,12 @@
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property>
+ <property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
@@ -368,9 +415,12 @@
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property>
+ <property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -383,6 +433,8 @@
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -394,9 +446,12 @@
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property>
+ <property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
@@ -405,6 +460,7 @@
<child type="label">
<object class="GtkLabel" id="label12334">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">Autocompletion</property>
@@ -423,6 +479,7 @@
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property>
<property name="label_xalign">0</property>
@@ -431,10 +488,12 @@
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<object class="GtkCheckButton" id="preferences_toggle:bool:1:1:cpp-calltip-enable">
@@ -444,6 +503,7 @@
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property>
+ <property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -459,6 +519,7 @@
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Calltips</property>
<attributes>
@@ -473,94 +534,85 @@
<property name="position">1</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Auto-complete</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">5</property>
<child>
- <object class="GtkFrame" id="frame5">
+ <object class="GtkCheckButton" id="preferences_toggle:bool:1:1:cpp-load-project-packages">
+ <property name="label" translatable="yes">Automatically load required libraries of the project</property>
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
<child>
- <object class="GtkAlignment" id="alignment6">
+ <object class="AnjutaPkgConfigChooser" id="pkg_config_chooser1">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <object class="AnjutaPkgConfigChooser" id="pkg_config_chooser1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="headers_clickable">False</property>
- <property name="search_column">0</property>
- </object>
- </child>
- </object>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="headers_clickable">False</property>
+ <property name="search_column">0</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection"/>
</child>
</object>
</child>
- <child type="label">
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="xpad">6</property>
- <property name="label" translatable="yes">Available API tags</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
</object>
<packing>
- <property name="fill">False</property>
- <property name="expand">False</property>
- <property name="position">2</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
- <property name="fill">False</property>
- <property name="expand">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child type="tab">
- <object class="GtkLabel" id="label4">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label" translatable="yes">Auto-complete</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">API Tags (C/C++)</property>
</object>
<packing>
- <property name="position">1</property>
+ <property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
</child>
</object>
- <object class="GtkAdjustment" id="adjustment3">
- <property name="upper">50</property>
- <property name="value">10</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
- <object class="GtkAdjustment" id="adjustment2">
- <property name="upper">100</property>
- <property name="value">4</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
- <object class="GtkAdjustment" id="adjustment1">
- <property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
</interface>
diff --git a/plugins/language-support-cpp-java/plugin.c b/plugins/language-support-cpp-java/plugin.c
index fbb2a8e..cd01287 100644
--- a/plugins/language-support-cpp-java/plugin.c
+++ b/plugins/language-support-cpp-java/plugin.c
@@ -62,6 +62,7 @@
#define PREF_SCHEMA "org.gnome.anjuta.cpp"
#define PREF_INDENT_AUTOMATIC "cpp-indent-automatic"
#define PREF_INDENT_MODELINE "cpp-indent-modeline"
+#define PREF_PROJECT_PACKAGES "cpp-load-project-packages"
static gpointer parent_class;
@@ -1104,6 +1105,7 @@ cpp_java_plugin_class_init (GObjectClass *klass)
#define PREF_WIDGET_SPACE "preferences_toggle:bool:1:1:cpp-completion-space-after-func"
#define PREF_WIDGET_BRACE "preferences_toggle:bool:1:1:cpp-completion-brace-after-func"
#define PREF_WIDGET_AUTO "preferences_toggle:bool:1:1:cpp-completion-enable"
+#define PREF_WIDGET_PACKAGES "preferences_toggle:bool:1:1:cpp-load-project-packages"
#define PREF_WIDGET_PKG_CONFIG "pkg_config_chooser1"
static void
@@ -1120,6 +1122,19 @@ on_autocompletion_toggled (GtkToggleButton* button,
}
static void
+on_project_packages_toggled (GtkToggleButton* button,
+ GtkBuilder* bxml)
+{
+ GtkWidget* pkg_config;
+ gboolean sensitive = !gtk_toggle_button_get_active (button);
+ pkg_config = GTK_WIDGET (gtk_builder_get_object (bxml, PREF_WIDGET_PKG_CONFIG));
+
+ gtk_widget_set_sensitive (pkg_config, sensitive);
+ anjuta_pkg_config_chooser_show_active_only (ANJUTA_PKG_CONFIG_CHOOSER (pkg_config),
+ !sensitive);
+}
+
+static void
on_package_activated (AnjutaPkgConfigChooser *self, const gchar* package,
gpointer data)
{
@@ -1185,6 +1200,12 @@ ipreferences_merge (IAnjutaPreferences* ipref, AnjutaPreferences* prefs,
plugin->bxml);
on_autocompletion_toggled (GTK_TOGGLE_BUTTON (toggle), plugin->bxml);
+ toggle = GTK_WIDGET (gtk_builder_get_object (plugin->bxml, PREF_WIDGET_PACKAGES));
+ g_signal_connect (toggle, "toggled", G_CALLBACK (on_project_packages_toggled),
+ plugin->bxml);
+ on_autocompletion_toggled (GTK_TOGGLE_BUTTON (toggle), plugin->bxml);
+ on_project_packages_toggled (GTK_TOGGLE_BUTTON (toggle), plugin->bxml);
+
pkg_config = GTK_WIDGET (gtk_builder_get_object (plugin->bxml, PREF_WIDGET_PKG_CONFIG));
anjuta_pkg_config_chooser_show_active_column (ANJUTA_PKG_CONFIG_CHOOSER (pkg_config),
TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]