Skip to content

Commit

Permalink
codenav: Don't mix declarations and code
Browse files Browse the repository at this point in the history
  • Loading branch information
b4n committed Jun 4, 2012
1 parent aa4b778 commit f21d8f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions codenav/src/codenavigation.c
Expand Up @@ -85,10 +85,10 @@ void plugin_init(GeanyData *data)
*/
GtkWidget *plugin_configure(GtkDialog *dialog)
{
log_func();

GtkWidget *vbox;

log_func();

vbox = gtk_vbox_new(FALSE, 6);

/* Switch header/implementation widget */
Expand Down
9 changes: 6 additions & 3 deletions codenav/src/goto_file.c
Expand Up @@ -47,9 +47,11 @@ menu_item_activate(guint key_id);
void
goto_file_init()
{
GtkWidget* edit_menu;

log_func();

GtkWidget* edit_menu = ui_lookup_widget(geany->main_widgets->window, "edit1_menu");
edit_menu = ui_lookup_widget(geany->main_widgets->window, "edit1_menu");

/* Add the menu item, sensitive only when a document is opened */
menu_item = gtk_menu_item_new_with_mnemonic(_("Goto file"));
Expand Down Expand Up @@ -89,11 +91,12 @@ goto_file_cleanup()
static void
menu_item_activate(guint key_id)
{
GtkWidget *dialog;

log_func();

/* TODO */

GtkWidget *dialog = gtk_message_dialog_new(
dialog = gtk_message_dialog_new(
GTK_WINDOW(geany->main_widgets->window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
Expand Down
8 changes: 6 additions & 2 deletions codenav/src/switch_head_impl.c
Expand Up @@ -75,9 +75,11 @@ on_configure_cell_edited(GtkCellRendererText* text, gchar* arg1, gchar* arg2, gp
void
switch_head_impl_init()
{
GtkWidget* edit_menu;

log_func();

GtkWidget* edit_menu = ui_lookup_widget(geany->main_widgets->window, "edit1_menu");
edit_menu = ui_lookup_widget(geany->main_widgets->window, "edit1_menu");

/* Add the menu item and make it sensitive only when a document is opened */
menu_item = gtk_menu_item_new_with_mnemonic(_("Switch header/implementation"));
Expand Down Expand Up @@ -356,9 +358,11 @@ menu_item_activate(guint key_id)

/* Third : if not found, ask the user if he wants to create it or not. */
{
GtkWidget* dialog;

p_str = g_strdup_printf("%s.%s", basename_no_extension, (const gchar*)(p_extensions_to_test->data));

GtkWidget* dialog = gtk_message_dialog_new( GTK_WINDOW(geany_data->main_widgets->window),
dialog = gtk_message_dialog_new( GTK_WINDOW(geany_data->main_widgets->window),
GTK_DIALOG_MODAL,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_OK_CANCEL,
Expand Down

0 comments on commit f21d8f1

Please sign in to comment.