Revision: 398 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=398&view=rev Author: frlan Date: 2009-01-22 23:31:18 +0000 (Thu, 22 Jan 2009)
Log Message: ----------- GeanyLipsum: Make usage of Geany plugin API v128
Modified Paths: -------------- trunk/geanylipsum/ChangeLog trunk/geanylipsum/po/de.po trunk/geanylipsum/po/geanylipsum.pot trunk/geanylipsum/src/geanylipsum.c
Modified: trunk/geanylipsum/ChangeLog =================================================================== --- trunk/geanylipsum/ChangeLog 2009-01-21 22:25:45 UTC (rev 397) +++ trunk/geanylipsum/ChangeLog 2009-01-22 23:31:18 UTC (rev 398) @@ -0,0 +1,5 @@ +2009-01-23 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + + * Update to plugin API v128 + +
Modified: trunk/geanylipsum/po/de.po =================================================================== --- trunk/geanylipsum/po/de.po 2009-01-21 22:25:45 UTC (rev 397) +++ trunk/geanylipsum/po/de.po 2009-01-22 23:31:18 UTC (rev 398) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: geanylipsum 0.1dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-12-22 23:17+0100\n" +"POT-Creation-Date: 2009-01-23 00:30+0100\n" "PO-Revision-Date: \n" "Last-Translator: Frank Lanitz frank@frank.uvena.de\n" "Language-Team: geany-118n geany-118n@uvena.de\n" @@ -13,38 +13,34 @@ "X-Poedit-Country: GERMANY\n" "X-Poedit-SourceCharset: utf-8\n"
-#: src/geanylipsum.c:74 +#: src/geanylipsum.c:63 msgid "Lipsum" msgstr "Lipsum"
-#: src/geanylipsum.c:74 +#: src/geanylipsum.c:63 msgid "Creating dummy text with Geany" msgstr "Platzhaltertexte erstellen mit Geany"
-#: src/geanylipsum.c:74 +#: src/geanylipsum.c:63 msgid "Frank Lanitz frank@frank.uvena.de" msgstr "Frank Lanitz frank@frank.uvena.de"
-#: src/geanylipsum.c:117 -msgid "Lipsum-generator" +#: src/geanylipsum.c:105 +msgid "Lipsum-Generator" msgstr "Lorem ipsum Generator"
-#: src/geanylipsum.c:126 -msgid "HTML" -msgstr "HTML" +#: src/geanylipsum.c:106 +msgid "Enter the length of Lipsum text here" +msgstr "Bitte die Länge des Platzhaltertextes eingeben"
-#: src/geanylipsum.c:136 -msgid "LaTeX" -msgstr "LaTeX" - -#: src/geanylipsum.c:146 -msgid "Plain" -msgstr "Unformatiert" - -#: src/geanylipsum.c:196 +#: src/geanylipsum.c:174 msgid "_Lipsum" msgstr "_Lipsum"
-#: src/geanylipsum.c:198 +#: src/geanylipsum.c:176 msgid "Include Pseudotext to your code" msgstr "Fügt Platzhaltertexte in das Dokument ein" + +#: src/geanylipsum.c:184 +msgid "Insert Lipsum text" +msgstr "Fügt Platzhaltertexte ein"
Modified: trunk/geanylipsum/po/geanylipsum.pot =================================================================== --- trunk/geanylipsum/po/geanylipsum.pot 2009-01-21 22:25:45 UTC (rev 397) +++ trunk/geanylipsum/po/geanylipsum.pot 2009-01-22 23:31:18 UTC (rev 398) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-12-22 23:17+0100\n" +"POT-Creation-Date: 2009-01-23 00:30+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME EMAIL@ADDRESS\n" "Language-Team: LANGUAGE LL@li.org\n" @@ -16,38 +16,34 @@ "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n"
-#: src/geanylipsum.c:74 +#: src/geanylipsum.c:63 msgid "Lipsum" msgstr ""
-#: src/geanylipsum.c:74 +#: src/geanylipsum.c:63 msgid "Creating dummy text with Geany" msgstr ""
-#: src/geanylipsum.c:74 +#: src/geanylipsum.c:63 msgid "Frank Lanitz frank@frank.uvena.de" msgstr ""
-#: src/geanylipsum.c:117 -msgid "Lipsum-generator" +#: src/geanylipsum.c:105 +msgid "Lipsum-Generator" msgstr ""
-#: src/geanylipsum.c:126 -msgid "HTML" +#: src/geanylipsum.c:106 +msgid "Enter the length of Lipsum text here" msgstr ""
-#: src/geanylipsum.c:136 -msgid "LaTeX" -msgstr "" - -#: src/geanylipsum.c:146 -msgid "Plain" -msgstr "" - -#: src/geanylipsum.c:196 +#: src/geanylipsum.c:174 msgid "_Lipsum" msgstr ""
-#: src/geanylipsum.c:198 +#: src/geanylipsum.c:176 msgid "Include Pseudotext to your code" msgstr "" + +#: src/geanylipsum.c:184 +msgid "Insert Lipsum text" +msgstr ""
Modified: trunk/geanylipsum/src/geanylipsum.c =================================================================== --- trunk/geanylipsum/src/geanylipsum.c 2009-01-21 22:25:45 UTC (rev 397) +++ trunk/geanylipsum/src/geanylipsum.c 2009-01-22 23:31:18 UTC (rev 398) @@ -59,7 +59,7 @@ GeanyData *geany_data; GeanyFunctions *geany_functions;
-PLUGIN_VERSION_CHECK(115) +PLUGIN_VERSION_CHECK(128) PLUGIN_SET_INFO(_("Lipsum"), _("Creating dummy text with Geany"), VERSION, _("Frank Lanitz frank@frank.uvena.de"));
static GtkWidget *main_menu_item = NULL; @@ -96,41 +96,14 @@ void lipsum_activated(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer gdata) { - GtkWidget *dialog = NULL; - GtkWidget *vbox = NULL; - GtkWidget *label = NULL; - GtkWidget *hbox = NULL; - GtkWidget *spin = NULL; - GtkTooltips *tooltip = NULL; GeanyDocument *doc = NULL; + /* Setting default length to 1500 characters */ + gdouble value = 1500;
- int length = 0; - - tooltip = gtk_tooltips_new(); - doc = document_get_current();
- dialog = gtk_dialog_new_with_buttons(_("Lipsum-generator"), - GTK_WINDOW(geany->main_widgets->window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); - vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog)); - gtk_widget_set_name(dialog, "GeanyDialog"); - gtk_box_set_spacing(GTK_BOX(vbox), 10); - - label = gtk_label_new(_("characters")); - spin = gtk_spin_button_new_with_range(1, 5000, 1); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin), 1500); - - hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(GTK_BOX(hbox), spin, TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); - - gtk_widget_show_all(vbox); - - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + if (dialogs_show_input_numeric(_("Lipsum-Generator"), + _("Enter the length of Lipsum text here"), &value, 1, 5000, 1)) {
int tmp = 0; @@ -138,27 +111,23 @@ int i = 0; int missing = 0;
- /* Checking for length of string that should be inserted */ - length = gtk_spin_button_get_value_as_int( - GTK_SPIN_BUTTON(spin)); - /* Checking what we have */
tmp = strlen(lipsum);
- if (tmp > length) + if (tmp > value) { x = 0; - missing = length - (x * tmp); + missing = value - (x * tmp); } - else if (tmp == length) + else if (tmp == (int)value) { x = 1; } else if (tmp > 0) { - x = length / tmp; - missing = length - (x * tmp); + x = value / tmp; + missing = value - (x * tmp); }
for (i = 0; i < x; i++) @@ -167,7 +136,6 @@ if (missing > 0) insert_string(g_strndup(lipsum, missing));
- gtk_widget_destroy(dialog); } }
@@ -213,7 +181,7 @@
/* init keybindins */ keybindings_set_item(plugin_key_group, LIPSUM_KB_INSERT, kblipsum_insert, - 0, 0, "inster_lipsum", _("Insert Lipsum tex"), menu_lipsum); + 0, 0, "inster_lipsum", _("Insert Lipsum text"), menu_lipsum);
main_menu_item = menu_lipsum;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org